ciris-agent 1.7.7__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- ciris_adapters/README.md +113 -0
- ciris_adapters/__init__.py +30 -0
- ciris_adapters/ciris_covenant_metrics/README.md +144 -0
- ciris_adapters/ciris_covenant_metrics/__init__.py +36 -0
- ciris_adapters/ciris_covenant_metrics/adapter.py +249 -0
- ciris_adapters/ciris_covenant_metrics/manifest.json +152 -0
- ciris_adapters/ciris_covenant_metrics/services.py +403 -0
- ciris_adapters/ciris_hosted_tools/__init__.py +24 -0
- ciris_adapters/ciris_hosted_tools/adapter.py +169 -0
- ciris_adapters/ciris_hosted_tools/manifest.json +94 -0
- ciris_adapters/ciris_hosted_tools/services.py +744 -0
- ciris_adapters/external_data_sql/README.md +559 -0
- ciris_adapters/external_data_sql/__init__.py +43 -0
- ciris_adapters/external_data_sql/adapter.py +144 -0
- ciris_adapters/external_data_sql/configurable.py +315 -0
- ciris_adapters/external_data_sql/dialects/__init__.py +37 -0
- ciris_adapters/external_data_sql/dialects/base.py +133 -0
- ciris_adapters/external_data_sql/dialects/mysql.py +63 -0
- ciris_adapters/external_data_sql/dialects/postgresql.py +59 -0
- ciris_adapters/external_data_sql/dialects/sqlite.py +62 -0
- ciris_adapters/external_data_sql/example_config.json +88 -0
- ciris_adapters/external_data_sql/example_privacy_schema.yaml +127 -0
- ciris_adapters/external_data_sql/manifest.json +195 -0
- ciris_adapters/external_data_sql/privacy_schema_loader.py +189 -0
- ciris_adapters/external_data_sql/protocol.py +101 -0
- ciris_adapters/external_data_sql/schemas.py +146 -0
- ciris_adapters/external_data_sql/service.py +1547 -0
- ciris_adapters/external_data_sql/service_old.py +492 -0
- ciris_adapters/home_assistant/__init__.py +63 -0
- ciris_adapters/home_assistant/adapter.py +201 -0
- ciris_adapters/home_assistant/communication_service.py +347 -0
- ciris_adapters/home_assistant/configurable.py +667 -0
- ciris_adapters/home_assistant/manifest.json +203 -0
- ciris_adapters/home_assistant/schemas.py +129 -0
- ciris_adapters/home_assistant/service.py +751 -0
- ciris_adapters/home_assistant/tool_service.py +441 -0
- ciris_adapters/mcp_client/__init__.py +82 -0
- ciris_adapters/mcp_client/adapter.py +847 -0
- ciris_adapters/mcp_client/config.py +280 -0
- ciris_adapters/mcp_client/configurable.py +422 -0
- ciris_adapters/mcp_client/manifest.json +185 -0
- ciris_adapters/mcp_client/mcp_communication_service.py +393 -0
- ciris_adapters/mcp_client/mcp_tool_service.py +463 -0
- ciris_adapters/mcp_client/mcp_wise_service.py +394 -0
- ciris_adapters/mcp_client/schemas.py +149 -0
- ciris_adapters/mcp_client/security.py +592 -0
- ciris_adapters/mcp_common/__init__.py +44 -0
- ciris_adapters/mcp_common/manifest.json +25 -0
- ciris_adapters/mcp_common/protocol.py +315 -0
- ciris_adapters/mcp_common/schemas.py +225 -0
- ciris_adapters/mcp_server/__init__.py +47 -0
- ciris_adapters/mcp_server/adapter.py +581 -0
- ciris_adapters/mcp_server/config.py +260 -0
- ciris_adapters/mcp_server/configurable.py +393 -0
- ciris_adapters/mcp_server/handlers.py +663 -0
- ciris_adapters/mcp_server/manifest.json +211 -0
- ciris_adapters/mcp_server/security.py +500 -0
- ciris_adapters/mock_llm/README.md +117 -0
- ciris_adapters/mock_llm/__init__.py +21 -0
- ciris_adapters/mock_llm/adapter.py +131 -0
- ciris_adapters/mock_llm/configurable.py +237 -0
- ciris_adapters/mock_llm/manifest.json +106 -0
- ciris_adapters/mock_llm/protocol.py +37 -0
- ciris_adapters/mock_llm/responses.py +520 -0
- ciris_adapters/mock_llm/responses_action_selection.py +1041 -0
- ciris_adapters/mock_llm/responses_epistemic.py +17 -0
- ciris_adapters/mock_llm/responses_feedback.py +27 -0
- ciris_adapters/mock_llm/schemas.py +35 -0
- ciris_adapters/mock_llm/service.py +294 -0
- ciris_adapters/navigation/__init__.py +21 -0
- ciris_adapters/navigation/adapter.py +129 -0
- ciris_adapters/navigation/configurable.py +239 -0
- ciris_adapters/navigation/manifest.json +104 -0
- ciris_adapters/navigation/service.py +487 -0
- ciris_adapters/reddit/README.md +132 -0
- ciris_adapters/reddit/REDDIT_ADAPTER_ANALYSIS.md +715 -0
- ciris_adapters/reddit/REDDIT_ADAPTER_SUMMARY.txt +278 -0
- ciris_adapters/reddit/REDDIT_ANALYSIS_INDEX.md +307 -0
- ciris_adapters/reddit/REDDIT_PRODUCTION_READINESS_PLAN.md +518 -0
- ciris_adapters/reddit/__init__.py +15 -0
- ciris_adapters/reddit/adapter.py +189 -0
- ciris_adapters/reddit/configurable.py +274 -0
- ciris_adapters/reddit/error_handler.py +307 -0
- ciris_adapters/reddit/manifest.json +218 -0
- ciris_adapters/reddit/observer.py +532 -0
- ciris_adapters/reddit/protocol.py +34 -0
- ciris_adapters/reddit/schemas.py +433 -0
- ciris_adapters/reddit/service.py +1471 -0
- ciris_adapters/sample_adapter/README.md +474 -0
- ciris_adapters/sample_adapter/__init__.py +45 -0
- ciris_adapters/sample_adapter/adapter.py +208 -0
- ciris_adapters/sample_adapter/configurable.py +469 -0
- ciris_adapters/sample_adapter/manifest.json +247 -0
- ciris_adapters/sample_adapter/services.py +486 -0
- ciris_adapters/weather/__init__.py +16 -0
- ciris_adapters/weather/adapter.py +130 -0
- ciris_adapters/weather/configurable.py +240 -0
- ciris_adapters/weather/manifest.json +156 -0
- ciris_adapters/weather/service.py +600 -0
- ciris_agent-1.7.7.dist-info/METADATA +284 -0
- ciris_agent-1.7.7.dist-info/RECORD +986 -0
- ciris_agent-1.7.7.dist-info/WHEEL +5 -0
- ciris_agent-1.7.7.dist-info/entry_points.txt +15 -0
- ciris_agent-1.7.7.dist-info/licenses/LICENSE +205 -0
- ciris_agent-1.7.7.dist-info/licenses/NOTICE +82 -0
- ciris_agent-1.7.7.dist-info/top_level.txt +4 -0
- ciris_engine/__init__.py +15 -0
- ciris_engine/ciris_templates/ally.yaml +632 -0
- ciris_engine/ciris_templates/default.yaml +411 -0
- ciris_engine/ciris_templates/echo-core.yaml +629 -0
- ciris_engine/ciris_templates/echo-speculative.yaml +764 -0
- ciris_engine/ciris_templates/echo.yaml +647 -0
- ciris_engine/ciris_templates/sage.yaml +332 -0
- ciris_engine/ciris_templates/scout.yaml +338 -0
- ciris_engine/ciris_templates/test.yaml +168 -0
- ciris_engine/cli.py +42 -0
- ciris_engine/config/CIRIS_SERVICES.json +19 -0
- ciris_engine/config/MODEL_CAPABILITIES.json +419 -0
- ciris_engine/config/PRICING_DATA.json +179 -0
- ciris_engine/config/__init__.py +50 -0
- ciris_engine/config/ciris_services.py +113 -0
- ciris_engine/config/model_capabilities.py +388 -0
- ciris_engine/config/pricing_models.py +276 -0
- ciris_engine/constants.py +35 -0
- ciris_engine/data/__init__.py +1 -0
- ciris_engine/data/covenant_1.0b.txt +978 -0
- ciris_engine/gui_static/11steps.svg +107 -0
- ciris_engine/gui_static/2x-schematics.png +0 -0
- ciris_engine/gui_static/404/index.html +1 -0
- ciris_engine/gui_static/404.html +1 -0
- ciris_engine/gui_static/_next/static/0edhkwDxd5UccTsCmtaBi/_buildManifest.js +1 -0
- ciris_engine/gui_static/_next/static/0edhkwDxd5UccTsCmtaBi/_ssgManifest.js +1 -0
- ciris_engine/gui_static/_next/static/U-3xTQao7hc2wnAi-Uekm/_buildManifest.js +1 -0
- ciris_engine/gui_static/_next/static/U-3xTQao7hc2wnAi-Uekm/_ssgManifest.js +1 -0
- ciris_engine/gui_static/_next/static/chunks/3297-60e86ba0f8a7b040.js +1 -0
- ciris_engine/gui_static/_next/static/chunks/3835-2aad4b7f5f8e4643.js +1 -0
- ciris_engine/gui_static/_next/static/chunks/4499-99a0bc47de0b8975.js +1 -0
- ciris_engine/gui_static/_next/static/chunks/4534-af88cd4ba6e99bff.js +1 -0
- ciris_engine/gui_static/_next/static/chunks/4541-84b455f9e0dc4cfe.js +1 -0
- ciris_engine/gui_static/_next/static/chunks/4789-61412711484754bb.js +1 -0
- ciris_engine/gui_static/_next/static/chunks/6539-c6398bc9d7018430.js +1 -0
- ciris_engine/gui_static/_next/static/chunks/704-8e827b26cc8c2d32.js +1 -0
- ciris_engine/gui_static/_next/static/chunks/704-fb45d630f3192c6f.js +1 -0
- ciris_engine/gui_static/_next/static/chunks/8072-de4952a2e6d2b33f.js +1 -0
- ciris_engine/gui_static/_next/static/chunks/8315-b91d03a3949db0af.js +1 -0
- ciris_engine/gui_static/_next/static/chunks/8386-f93a83ccbd789bd9.js +1 -0
- ciris_engine/gui_static/_next/static/chunks/87c73c54-781a7f35148d5433.js +1 -0
- ciris_engine/gui_static/_next/static/chunks/8903-fefea3339a02d41b.js +1 -0
- ciris_engine/gui_static/_next/static/chunks/9090-e66485adf8d9d990.js +1 -0
- ciris_engine/gui_static/_next/static/chunks/app/_not-found/page-a67d9808462c23b1.js +1 -0
- ciris_engine/gui_static/_next/static/chunks/app/account/api-keys/page-2d7ee1583bbbd02e.js +1 -0
- ciris_engine/gui_static/_next/static/chunks/app/account/api-keys/page-6a3c2bae6fe92b7b.js +1 -0
- ciris_engine/gui_static/_next/static/chunks/app/account/consent/page-2ed3a035136bc4e8.js +1 -0
- ciris_engine/gui_static/_next/static/chunks/app/account/consent/page-b2f5c91844a32422.js +1 -0
- ciris_engine/gui_static/_next/static/chunks/app/account/page-25b90f89af3ea58c.js +1 -0
- ciris_engine/gui_static/_next/static/chunks/app/account/page-b65d16c94ecaf69c.js +1 -0
- ciris_engine/gui_static/_next/static/chunks/app/account/privacy/page-675b6d05c8f9184f.js +1 -0
- ciris_engine/gui_static/_next/static/chunks/app/account/privacy/page-cbee2e1c8ab52145.js +1 -0
- ciris_engine/gui_static/_next/static/chunks/app/account/settings/page-0f44da06697cf9f0.js +1 -0
- ciris_engine/gui_static/_next/static/chunks/app/account/settings/page-563420253577edbf.js +1 -0
- ciris_engine/gui_static/_next/static/chunks/app/adapters/page-1854631018bc32be.js +1 -0
- ciris_engine/gui_static/_next/static/chunks/app/agents/page-8353752c176a7c70.js +1 -0
- ciris_engine/gui_static/_next/static/chunks/app/agents/page-f61a529f110a6040.js +1 -0
- ciris_engine/gui_static/_next/static/chunks/app/api-demo/page-7f19b9d20d39be28.js +1 -0
- ciris_engine/gui_static/_next/static/chunks/app/api-demo/page-d1063938f249b8bd.js +1 -0
- ciris_engine/gui_static/_next/static/chunks/app/audit/page-321b6728b8fff0bb.js +1 -0
- ciris_engine/gui_static/_next/static/chunks/app/audit/page-ebac35ca961a1277.js +1 -0
- ciris_engine/gui_static/_next/static/chunks/app/billing/page-6f3dc3bd02924f8e.js +1 -0
- ciris_engine/gui_static/_next/static/chunks/app/billing/page-fa4a469f814c821a.js +1 -0
- ciris_engine/gui_static/_next/static/chunks/app/comms/page-0d4f734269addd8f.js +1 -0
- ciris_engine/gui_static/_next/static/chunks/app/comms/page-79227d426050089c.js +1 -0
- ciris_engine/gui_static/_next/static/chunks/app/config/page-018d21d683b6e5bc.js +1 -0
- ciris_engine/gui_static/_next/static/chunks/app/config/page-2aa5a5363ca2a371.js +1 -0
- ciris_engine/gui_static/_next/static/chunks/app/consent/page-198373205fd316e2.js +1 -0
- ciris_engine/gui_static/_next/static/chunks/app/consent/page-f2ca39e7713b13f8.js +1 -0
- ciris_engine/gui_static/_next/static/chunks/app/dashboard/page-1dd5a196f643c60d.js +1 -0
- ciris_engine/gui_static/_next/static/chunks/app/dashboard/page-530a04d3abbb8cda.js +1 -0
- ciris_engine/gui_static/_next/static/chunks/app/docs/page-3193b06d094ab654.js +1 -0
- ciris_engine/gui_static/_next/static/chunks/app/docs/page-330e996dedb87aba.js +1 -0
- ciris_engine/gui_static/_next/static/chunks/app/layout-0a70f5fc460298b1.js +1 -0
- ciris_engine/gui_static/_next/static/chunks/app/layout-21f2f99dd5b336e9.js +1 -0
- ciris_engine/gui_static/_next/static/chunks/app/login/page-33240e6c6034a49d.js +1 -0
- ciris_engine/gui_static/_next/static/chunks/app/login/page-68ffab6d54a7fdcd.js +1 -0
- ciris_engine/gui_static/_next/static/chunks/app/logs/page-8a6167aecc4a475c.js +1 -0
- ciris_engine/gui_static/_next/static/chunks/app/memory/page-9ca8c5d0056de3ff.js +1 -0
- ciris_engine/gui_static/_next/static/chunks/app/memory/page-e961226941c18f81.js +1 -0
- ciris_engine/gui_static/_next/static/chunks/app/page-6fdb065a787a4974.js +1 -0
- ciris_engine/gui_static/_next/static/chunks/app/page-89f87d431be6064a.js +1 -0
- ciris_engine/gui_static/_next/static/chunks/app/runtime/page-2e728b9c43aa164d.js +1 -0
- ciris_engine/gui_static/_next/static/chunks/app/runtime/page-c7dd033dc40a72f0.js +1 -0
- ciris_engine/gui_static/_next/static/chunks/app/services/page-ae9f0bdf11d01a95.js +1 -0
- ciris_engine/gui_static/_next/static/chunks/app/services/page-b10feb79ca5d75e5.js +1 -0
- ciris_engine/gui_static/_next/static/chunks/app/sessions/page-13ebe7ef1c16ae11.js +1 -0
- ciris_engine/gui_static/_next/static/chunks/app/sessions/page-e6c82b16d617f785.js +1 -0
- ciris_engine/gui_static/_next/static/chunks/app/setup/page-0beb5f5b5a5c20fc.js +1 -0
- ciris_engine/gui_static/_next/static/chunks/app/setup/page-2595e729eae30c0e.js +1 -0
- ciris_engine/gui_static/_next/static/chunks/app/status-dashboard/page-1037c987aecc3653.js +1 -0
- ciris_engine/gui_static/_next/static/chunks/app/status-dashboard/page-2ffd147f6d3162ff.js +1 -0
- ciris_engine/gui_static/_next/static/chunks/app/system/page-2c5798d58cafcd91.js +1 -0
- ciris_engine/gui_static/_next/static/chunks/app/system/page-505b1ba4eceb01c3.js +1 -0
- ciris_engine/gui_static/_next/static/chunks/app/test-auth/page-b0cad31d5cb1b2fa.js +1 -0
- ciris_engine/gui_static/_next/static/chunks/app/test-auth/page-f3ecd7a8012df230.js +1 -0
- ciris_engine/gui_static/_next/static/chunks/app/test-login/page-f35117fdc4105801.js +1 -0
- ciris_engine/gui_static/_next/static/chunks/app/test-login/page-fb583a7924114906.js +1 -0
- ciris_engine/gui_static/_next/static/chunks/app/test-sdk/page-50f116fd76935563.js +1 -0
- ciris_engine/gui_static/_next/static/chunks/app/test-sdk/page-c37d8aa5ba623a44.js +1 -0
- ciris_engine/gui_static/_next/static/chunks/app/tools/page-429aec7a707777ef.js +1 -0
- ciris_engine/gui_static/_next/static/chunks/app/tools/page-5f705aad60e0c04e.js +1 -0
- ciris_engine/gui_static/_next/static/chunks/app/users/page-13476b8b0f3808cc.js +1 -0
- ciris_engine/gui_static/_next/static/chunks/app/users/page-7e500d154ed5bba4.js +1 -0
- ciris_engine/gui_static/_next/static/chunks/app/wa/page-cc4a9d8a5cb44d08.js +1 -0
- ciris_engine/gui_static/_next/static/chunks/app/wa/page-ec3e429efbc79230.js +1 -0
- ciris_engine/gui_static/_next/static/chunks/framework-9d29490f5ba089ba.js +1 -0
- ciris_engine/gui_static/_next/static/chunks/main-1f554952e47a82c4.js +1 -0
- ciris_engine/gui_static/_next/static/chunks/main-app-26fa8aed029082e5.js +1 -0
- ciris_engine/gui_static/_next/static/chunks/main-app-97b0486ef6bcef25.js +1 -0
- ciris_engine/gui_static/_next/static/chunks/pages/_app-6ce685456e616eb2.js +1 -0
- ciris_engine/gui_static/_next/static/chunks/pages/_error-d4bce98d93fe21e7.js +1 -0
- ciris_engine/gui_static/_next/static/chunks/polyfills-42372ed130431b0a.js +1 -0
- ciris_engine/gui_static/_next/static/chunks/webpack-fcebd240b7f8477d.js +1 -0
- ciris_engine/gui_static/_next/static/css/16b94b1fe0cc6e37.css +3 -0
- ciris_engine/gui_static/_next/static/css/77a24ceaae86deff.css +3 -0
- ciris_engine/gui_static/_next/static/media/4cf2300e9c8272f7-s.p.woff2 +0 -0
- ciris_engine/gui_static/_next/static/media/747892c23ea88013-s.woff2 +0 -0
- ciris_engine/gui_static/_next/static/media/8d697b304b401681-s.woff2 +0 -0
- ciris_engine/gui_static/_next/static/media/93f479601ee12b01-s.p.woff2 +0 -0
- ciris_engine/gui_static/_next/static/media/9610d9e46709d722-s.woff2 +0 -0
- ciris_engine/gui_static/_next/static/media/ba015fad6dcf6784-s.woff2 +0 -0
- ciris_engine/gui_static/_next/static/media/d8298875641ec7d4-s.p.woff2 +0 -0
- ciris_engine/gui_static/account/api-keys/index.html +1 -0
- ciris_engine/gui_static/account/api-keys/index.txt +27 -0
- ciris_engine/gui_static/account/consent/index.html +1 -0
- ciris_engine/gui_static/account/consent/index.txt +27 -0
- ciris_engine/gui_static/account/index.html +1 -0
- ciris_engine/gui_static/account/index.txt +27 -0
- ciris_engine/gui_static/account/privacy/index.html +1 -0
- ciris_engine/gui_static/account/privacy/index.txt +27 -0
- ciris_engine/gui_static/account/settings/index.html +1 -0
- ciris_engine/gui_static/account/settings/index.txt +27 -0
- ciris_engine/gui_static/adapters/index.html +1 -0
- ciris_engine/gui_static/adapters/index.txt +27 -0
- ciris_engine/gui_static/agents/index.html +1 -0
- ciris_engine/gui_static/agents/index.txt +27 -0
- ciris_engine/gui_static/andrew-roberts-euBRXcx57T4-unsplash.jpg +0 -0
- ciris_engine/gui_static/api-demo/index.html +1 -0
- ciris_engine/gui_static/api-demo/index.txt +27 -0
- ciris_engine/gui_static/audit/index.html +1 -0
- ciris_engine/gui_static/audit/index.txt +27 -0
- ciris_engine/gui_static/billing/index.html +1 -0
- ciris_engine/gui_static/billing/index.txt +27 -0
- ciris_engine/gui_static/blurryinfo.png +0 -0
- ciris_engine/gui_static/chip-vincent-PkQDwfl9Flc-unsplash.jpg +0 -0
- ciris_engine/gui_static/ciris-architecture.svg +338 -0
- ciris_engine/gui_static/comms/index.html +1 -0
- ciris_engine/gui_static/comms/index.txt +27 -0
- ciris_engine/gui_static/config/index.html +1 -0
- ciris_engine/gui_static/config/index.txt +27 -0
- ciris_engine/gui_static/consent/index.html +1 -0
- ciris_engine/gui_static/consent/index.txt +27 -0
- ciris_engine/gui_static/dashboard/index.html +1 -0
- ciris_engine/gui_static/dashboard/index.txt +27 -0
- ciris_engine/gui_static/docs/index.html +1 -0
- ciris_engine/gui_static/docs/index.txt +27 -0
- ciris_engine/gui_static/eric.png +0 -0
- ciris_engine/gui_static/file.svg +1 -0
- ciris_engine/gui_static/globe.svg +1 -0
- ciris_engine/gui_static/index.html +1 -0
- ciris_engine/gui_static/index.txt +27 -0
- ciris_engine/gui_static/infogfx-1@2x.png +0 -0
- ciris_engine/gui_static/infogfx-2.png +0 -0
- ciris_engine/gui_static/infogfx-dark-1.png +0 -0
- ciris_engine/gui_static/kelly-vohs-soSTXmIxTDU-unsplash.jpg +0 -0
- ciris_engine/gui_static/login/index.html +1 -0
- ciris_engine/gui_static/login/index.txt +27 -0
- ciris_engine/gui_static/logs/index.html +1 -0
- ciris_engine/gui_static/logs/index.txt +27 -0
- ciris_engine/gui_static/memory/index.html +1 -0
- ciris_engine/gui_static/memory/index.txt +27 -0
- ciris_engine/gui_static/nathan-farrish-ArcTfEoBgzs-unsplash.jpg +0 -0
- ciris_engine/gui_static/next.svg +1 -0
- ciris_engine/gui_static/overview.svg +512 -0
- ciris_engine/gui_static/overview1.svg +407 -0
- ciris_engine/gui_static/overview2.svg +370 -0
- ciris_engine/gui_static/pipeline-visualization.svg +278 -0
- ciris_engine/gui_static/privacy-policy.html +160 -0
- ciris_engine/gui_static/runtime/index.html +8 -0
- ciris_engine/gui_static/runtime/index.txt +27 -0
- ciris_engine/gui_static/services/index.html +1 -0
- ciris_engine/gui_static/services/index.txt +27 -0
- ciris_engine/gui_static/sessions/index.html +1 -0
- ciris_engine/gui_static/sessions/index.txt +27 -0
- ciris_engine/gui_static/setup/index.html +1 -0
- ciris_engine/gui_static/setup/index.txt +27 -0
- ciris_engine/gui_static/status-dashboard/index.html +1 -0
- ciris_engine/gui_static/status-dashboard/index.txt +27 -0
- ciris_engine/gui_static/system/index.html +1 -0
- ciris_engine/gui_static/system/index.txt +27 -0
- ciris_engine/gui_static/terms-of-service.html +174 -0
- ciris_engine/gui_static/test-auth/index.html +1 -0
- ciris_engine/gui_static/test-auth/index.txt +27 -0
- ciris_engine/gui_static/test-login/index.html +1 -0
- ciris_engine/gui_static/test-login/index.txt +27 -0
- ciris_engine/gui_static/test-sdk/index.html +1 -0
- ciris_engine/gui_static/test-sdk/index.txt +27 -0
- ciris_engine/gui_static/tools/index.html +1 -0
- ciris_engine/gui_static/tools/index.txt +27 -0
- ciris_engine/gui_static/users/index.html +1 -0
- ciris_engine/gui_static/users/index.txt +27 -0
- ciris_engine/gui_static/vercel.svg +1 -0
- ciris_engine/gui_static/videos/video1.mp4 +0 -0
- ciris_engine/gui_static/videos/video3.mp4 +0 -0
- ciris_engine/gui_static/wa/index.html +1 -0
- ciris_engine/gui_static/wa/index.txt +27 -0
- ciris_engine/gui_static/window.svg +1 -0
- ciris_engine/logic/__init__.py +8 -0
- ciris_engine/logic/adapters/__init__.py +74 -0
- ciris_engine/logic/adapters/api/__init__.py +5 -0
- ciris_engine/logic/adapters/api/adapter.py +1037 -0
- ciris_engine/logic/adapters/api/api_communication.py +370 -0
- ciris_engine/logic/adapters/api/api_document.py +330 -0
- ciris_engine/logic/adapters/api/api_observer.py +24 -0
- ciris_engine/logic/adapters/api/api_runtime_control.py +388 -0
- ciris_engine/logic/adapters/api/api_tools.py +299 -0
- ciris_engine/logic/adapters/api/api_vision.py +215 -0
- ciris_engine/logic/adapters/api/app.py +272 -0
- ciris_engine/logic/adapters/api/auth.py +159 -0
- ciris_engine/logic/adapters/api/config.py +101 -0
- ciris_engine/logic/adapters/api/constants.py +55 -0
- ciris_engine/logic/adapters/api/dependencies/__init__.py +1 -0
- ciris_engine/logic/adapters/api/dependencies/auth.py +260 -0
- ciris_engine/logic/adapters/api/endpoints/__init__.py +1 -0
- ciris_engine/logic/adapters/api/endpoints/emergency.py +86 -0
- ciris_engine/logic/adapters/api/middleware/__init__.py +1 -0
- ciris_engine/logic/adapters/api/middleware/rate_limiter.py +302 -0
- ciris_engine/logic/adapters/api/models.py +29 -0
- ciris_engine/logic/adapters/api/routes/__init__.py +52 -0
- ciris_engine/logic/adapters/api/routes/agent.py +1762 -0
- ciris_engine/logic/adapters/api/routes/audit.py +707 -0
- ciris_engine/logic/adapters/api/routes/auth.py +1745 -0
- ciris_engine/logic/adapters/api/routes/billing.py +895 -0
- ciris_engine/logic/adapters/api/routes/config.py +329 -0
- ciris_engine/logic/adapters/api/routes/connectors.py +534 -0
- ciris_engine/logic/adapters/api/routes/consent.py +637 -0
- ciris_engine/logic/adapters/api/routes/dsar.py +637 -0
- ciris_engine/logic/adapters/api/routes/dsar_multi_source.py +484 -0
- ciris_engine/logic/adapters/api/routes/emergency.py +302 -0
- ciris_engine/logic/adapters/api/routes/memory.py +733 -0
- ciris_engine/logic/adapters/api/routes/memory_filters.py +230 -0
- ciris_engine/logic/adapters/api/routes/memory_models.py +112 -0
- ciris_engine/logic/adapters/api/routes/memory_queries.py +236 -0
- ciris_engine/logic/adapters/api/routes/memory_query_helpers.py +394 -0
- ciris_engine/logic/adapters/api/routes/memory_visualization.py +359 -0
- ciris_engine/logic/adapters/api/routes/memory_visualization_helpers.py +110 -0
- ciris_engine/logic/adapters/api/routes/partnership.py +541 -0
- ciris_engine/logic/adapters/api/routes/setup.py +1374 -0
- ciris_engine/logic/adapters/api/routes/system.py +3049 -0
- ciris_engine/logic/adapters/api/routes/system_extensions.py +952 -0
- ciris_engine/logic/adapters/api/routes/telemetry.py +1987 -0
- ciris_engine/logic/adapters/api/routes/telemetry_converters.py +141 -0
- ciris_engine/logic/adapters/api/routes/telemetry_helpers.py +111 -0
- ciris_engine/logic/adapters/api/routes/telemetry_logs_reader.py +280 -0
- ciris_engine/logic/adapters/api/routes/telemetry_metrics.py +131 -0
- ciris_engine/logic/adapters/api/routes/telemetry_models.py +190 -0
- ciris_engine/logic/adapters/api/routes/telemetry_otlp.py +878 -0
- ciris_engine/logic/adapters/api/routes/telemetry_resource_helpers.py +191 -0
- ciris_engine/logic/adapters/api/routes/tickets.py +541 -0
- ciris_engine/logic/adapters/api/routes/tools.py +556 -0
- ciris_engine/logic/adapters/api/routes/transparency.py +281 -0
- ciris_engine/logic/adapters/api/routes/users.py +981 -0
- ciris_engine/logic/adapters/api/routes/verification.py +373 -0
- ciris_engine/logic/adapters/api/routes/wa.py +369 -0
- ciris_engine/logic/adapters/api/service_configuration.py +177 -0
- ciris_engine/logic/adapters/api/services/__init__.py +1 -0
- ciris_engine/logic/adapters/api/services/auth_service.py +1417 -0
- ciris_engine/logic/adapters/api/services/oauth_security.py +68 -0
- ciris_engine/logic/adapters/base.py +141 -0
- ciris_engine/logic/adapters/base_adapter.py +73 -0
- ciris_engine/logic/adapters/base_observer.py +1141 -0
- ciris_engine/logic/adapters/base_vision.py +312 -0
- ciris_engine/logic/adapters/cirisnode_client.py +307 -0
- ciris_engine/logic/adapters/cli/__init__.py +3 -0
- ciris_engine/logic/adapters/cli/adapter.py +207 -0
- ciris_engine/logic/adapters/cli/cli_adapter.py +902 -0
- ciris_engine/logic/adapters/cli/cli_observer.py +268 -0
- ciris_engine/logic/adapters/cli/cli_tools.py +427 -0
- ciris_engine/logic/adapters/cli/cli_wa_service.py +134 -0
- ciris_engine/logic/adapters/cli/config.py +73 -0
- ciris_engine/logic/adapters/discord/__init__.py +3 -0
- ciris_engine/logic/adapters/discord/adapter.py +783 -0
- ciris_engine/logic/adapters/discord/ciris_discord_client.py +159 -0
- ciris_engine/logic/adapters/discord/config.py +177 -0
- ciris_engine/logic/adapters/discord/constants.py +185 -0
- ciris_engine/logic/adapters/discord/discord-stubs.pyi +50 -0
- ciris_engine/logic/adapters/discord/discord_adapter.py +1584 -0
- ciris_engine/logic/adapters/discord/discord_audit.py +150 -0
- ciris_engine/logic/adapters/discord/discord_channel_manager.py +351 -0
- ciris_engine/logic/adapters/discord/discord_connection_manager.py +313 -0
- ciris_engine/logic/adapters/discord/discord_embed_formatter.py +369 -0
- ciris_engine/logic/adapters/discord/discord_error_classifier.py +302 -0
- ciris_engine/logic/adapters/discord/discord_error_handler.py +316 -0
- ciris_engine/logic/adapters/discord/discord_guidance_handler.py +460 -0
- ciris_engine/logic/adapters/discord/discord_message_handler.py +207 -0
- ciris_engine/logic/adapters/discord/discord_observer.py +670 -0
- ciris_engine/logic/adapters/discord/discord_rate_limiter.py +249 -0
- ciris_engine/logic/adapters/discord/discord_reaction_handler.py +278 -0
- ciris_engine/logic/adapters/discord/discord_tool_handler.py +465 -0
- ciris_engine/logic/adapters/discord/discord_tool_service.py +790 -0
- ciris_engine/logic/adapters/discord/discord_tools.py +90 -0
- ciris_engine/logic/adapters/discord/discord_vision_helper.py +148 -0
- ciris_engine/logic/adapters/discord/py.typed +0 -0
- ciris_engine/logic/adapters/document_parser.py +320 -0
- ciris_engine/logic/audit/__init__.py +10 -0
- ciris_engine/logic/audit/hash_chain.py +313 -0
- ciris_engine/logic/audit/signature_manager.py +352 -0
- ciris_engine/logic/audit/verifier.py +408 -0
- ciris_engine/logic/buses/__init__.py +21 -0
- ciris_engine/logic/buses/base_bus.py +178 -0
- ciris_engine/logic/buses/bus_manager.py +121 -0
- ciris_engine/logic/buses/communication_bus.py +387 -0
- ciris_engine/logic/buses/llm_bus.py +722 -0
- ciris_engine/logic/buses/memory_bus.py +577 -0
- ciris_engine/logic/buses/prohibitions.py +502 -0
- ciris_engine/logic/buses/runtime_control_bus.py +539 -0
- ciris_engine/logic/buses/tool_bus.py +482 -0
- ciris_engine/logic/buses/wise_bus.py +684 -0
- ciris_engine/logic/config/__init__.py +25 -0
- ciris_engine/logic/config/bootstrap.py +255 -0
- ciris_engine/logic/config/config_accessor.py +202 -0
- ciris_engine/logic/config/db_paths.py +194 -0
- ciris_engine/logic/config/env_utils.py +39 -0
- ciris_engine/logic/conscience/__init__.py +16 -0
- ciris_engine/logic/conscience/build_deferral_package.py +0 -0
- ciris_engine/logic/conscience/core.py +688 -0
- ciris_engine/logic/conscience/interface.py +33 -0
- ciris_engine/logic/conscience/registry.py +76 -0
- ciris_engine/logic/conscience/thought_depth_guardrail.py +231 -0
- ciris_engine/logic/conscience/updated_status_conscience.py +156 -0
- ciris_engine/logic/context/__init__.py +10 -0
- ciris_engine/logic/context/batch_context.py +550 -0
- ciris_engine/logic/context/builder.py +149 -0
- ciris_engine/logic/context/channel_resolution.py +136 -0
- ciris_engine/logic/context/secrets_snapshot.py +52 -0
- ciris_engine/logic/context/system_snapshot.py +116 -0
- ciris_engine/logic/context/system_snapshot_helpers.py +1651 -0
- ciris_engine/logic/covenant/__init__.py +33 -0
- ciris_engine/logic/covenant/executor.py +303 -0
- ciris_engine/logic/covenant/extractor.py +382 -0
- ciris_engine/logic/covenant/handler.py +241 -0
- ciris_engine/logic/covenant/verifier.py +383 -0
- ciris_engine/logic/dma/__init__.py +15 -0
- ciris_engine/logic/dma/action_selection/__init__.py +11 -0
- ciris_engine/logic/dma/action_selection/action_instruction_generator.py +444 -0
- ciris_engine/logic/dma/action_selection/context_builder.py +508 -0
- ciris_engine/logic/dma/action_selection/faculty_integration.py +193 -0
- ciris_engine/logic/dma/action_selection/special_cases.py +132 -0
- ciris_engine/logic/dma/action_selection_pdma.py +365 -0
- ciris_engine/logic/dma/base_dma.py +335 -0
- ciris_engine/logic/dma/csdma.py +239 -0
- ciris_engine/logic/dma/dma_executor.py +575 -0
- ciris_engine/logic/dma/dsdma_base.py +410 -0
- ciris_engine/logic/dma/exceptions.py +4 -0
- ciris_engine/logic/dma/factory.py +150 -0
- ciris_engine/logic/dma/pdma.py +120 -0
- ciris_engine/logic/dma/prompt_loader.py +189 -0
- ciris_engine/logic/dma/prompts/action_selection_pdma.yml +58 -0
- ciris_engine/logic/dma/prompts/csdma_common_sense.yml +28 -0
- ciris_engine/logic/dma/prompts/dsdma_base.yml +17 -0
- ciris_engine/logic/dma/prompts/pdma_ethical.yml +42 -0
- ciris_engine/logic/formatters/__init__.py +26 -0
- ciris_engine/logic/formatters/crisis_resources.py +80 -0
- ciris_engine/logic/formatters/escalation.py +21 -0
- ciris_engine/logic/formatters/identity.py +224 -0
- ciris_engine/logic/formatters/prompt_blocks.py +64 -0
- ciris_engine/logic/formatters/system_snapshot.py +193 -0
- ciris_engine/logic/formatters/user_profiles.py +108 -0
- ciris_engine/logic/handlers/__init__.py +1 -0
- ciris_engine/logic/handlers/control/__init__.py +1 -0
- ciris_engine/logic/handlers/control/defer_handler.py +195 -0
- ciris_engine/logic/handlers/control/ponder_handler.py +154 -0
- ciris_engine/logic/handlers/control/reject_handler.py +81 -0
- ciris_engine/logic/handlers/external/__init__.py +1 -0
- ciris_engine/logic/handlers/external/observe_handler.py +154 -0
- ciris_engine/logic/handlers/external/speak_handler.py +250 -0
- ciris_engine/logic/handlers/external/tool_handler.py +148 -0
- ciris_engine/logic/handlers/memory/__init__.py +1 -0
- ciris_engine/logic/handlers/memory/forget_handler.py +107 -0
- ciris_engine/logic/handlers/memory/memorize_handler.py +391 -0
- ciris_engine/logic/handlers/memory/recall_handler.py +213 -0
- ciris_engine/logic/handlers/terminal/__init__.py +1 -0
- ciris_engine/logic/handlers/terminal/task_complete_handler.py +299 -0
- ciris_engine/logic/infrastructure/__init__.py +1 -0
- ciris_engine/logic/infrastructure/handlers/__init__.py +8 -0
- ciris_engine/logic/infrastructure/handlers/action_dispatcher.py +382 -0
- ciris_engine/logic/infrastructure/handlers/base_handler.py +450 -0
- ciris_engine/logic/infrastructure/handlers/exceptions.py +2 -0
- ciris_engine/logic/infrastructure/handlers/handler_registry.py +59 -0
- ciris_engine/logic/infrastructure/handlers/helpers.py +55 -0
- ciris_engine/logic/infrastructure/step_streaming.py +149 -0
- ciris_engine/logic/infrastructure/sub_services/__init__.py +1 -0
- ciris_engine/logic/infrastructure/sub_services/identity_variance_monitor.py +1035 -0
- ciris_engine/logic/infrastructure/sub_services/pattern_analysis_loop.py +758 -0
- ciris_engine/logic/infrastructure/sub_services/wa_cli_bootstrap.py +229 -0
- ciris_engine/logic/infrastructure/sub_services/wa_cli_display.py +176 -0
- ciris_engine/logic/infrastructure/sub_services/wa_cli_oauth.py +404 -0
- ciris_engine/logic/infrastructure/sub_services/wa_cli_wizard.py +181 -0
- ciris_engine/logic/persistence/__init__.py +130 -0
- ciris_engine/logic/persistence/analytics.py +97 -0
- ciris_engine/logic/persistence/db/__init__.py +28 -0
- ciris_engine/logic/persistence/db/core.py +520 -0
- ciris_engine/logic/persistence/db/dialect.py +380 -0
- ciris_engine/logic/persistence/db/execution_helpers.py +216 -0
- ciris_engine/logic/persistence/db/migration_runner.py +191 -0
- ciris_engine/logic/persistence/db/operations.py +313 -0
- ciris_engine/logic/persistence/db/query_builder.py +232 -0
- ciris_engine/logic/persistence/db/retry.py +154 -0
- ciris_engine/logic/persistence/db/setup.py +18 -0
- ciris_engine/logic/persistence/migrations/postgres/001_initial_schema.sql +4 -0
- ciris_engine/logic/persistence/migrations/postgres/002_add_retry_status.sql +3 -0
- ciris_engine/logic/persistence/migrations/postgres/003_add_task_update_tracking.sql +8 -0
- ciris_engine/logic/persistence/migrations/postgres/004_add_occurrence_id.sql +54 -0
- ciris_engine/logic/persistence/migrations/postgres/005_add_consolidation_locks.sql +22 -0
- ciris_engine/logic/persistence/migrations/postgres/006_add_correlation_id_unique_index.sql +16 -0
- ciris_engine/logic/persistence/migrations/postgres/007_add_dsar_tickets.sql +39 -0
- ciris_engine/logic/persistence/migrations/postgres/008_rename_to_tickets_add_sop.sql +123 -0
- ciris_engine/logic/persistence/migrations/postgres/009_add_ticket_status_columns.sql +39 -0
- ciris_engine/logic/persistence/migrations/postgres/010_add_images_to_tasks.sql +5 -0
- ciris_engine/logic/persistence/migrations/sqlite/001_initial_schema.sql +357 -0
- ciris_engine/logic/persistence/migrations/sqlite/002_add_retry_status.sql +3 -0
- ciris_engine/logic/persistence/migrations/sqlite/003_add_task_update_tracking.sql +8 -0
- ciris_engine/logic/persistence/migrations/sqlite/004_add_occurrence_id.sql +45 -0
- ciris_engine/logic/persistence/migrations/sqlite/005_add_consolidation_locks.sql +22 -0
- ciris_engine/logic/persistence/migrations/sqlite/006_add_correlation_id_unique_index.sql +16 -0
- ciris_engine/logic/persistence/migrations/sqlite/007_add_dsar_tickets.sql +39 -0
- ciris_engine/logic/persistence/migrations/sqlite/008_rename_to_tickets_add_sop.sql +120 -0
- ciris_engine/logic/persistence/migrations/sqlite/009_add_ticket_status_columns.sql +129 -0
- ciris_engine/logic/persistence/migrations/sqlite/010_add_images_to_tasks.sql +17 -0
- ciris_engine/logic/persistence/models/__init__.py +141 -0
- ciris_engine/logic/persistence/models/correlations.py +881 -0
- ciris_engine/logic/persistence/models/deferral.py +68 -0
- ciris_engine/logic/persistence/models/dsar.py +286 -0
- ciris_engine/logic/persistence/models/graph.py +362 -0
- ciris_engine/logic/persistence/models/identity.py +264 -0
- ciris_engine/logic/persistence/models/queue_status.py +139 -0
- ciris_engine/logic/persistence/models/tasks.py +1043 -0
- ciris_engine/logic/persistence/models/thoughts.py +400 -0
- ciris_engine/logic/persistence/models/tickets.py +518 -0
- ciris_engine/logic/persistence/stores/__init__.py +13 -0
- ciris_engine/logic/persistence/stores/auth_helpers.py +117 -0
- ciris_engine/logic/persistence/stores/authentication_store.py +414 -0
- ciris_engine/logic/persistence/utils.py +212 -0
- ciris_engine/logic/processors/__init__.py +30 -0
- ciris_engine/logic/processors/core/__init__.py +1 -0
- ciris_engine/logic/processors/core/base_processor.py +280 -0
- ciris_engine/logic/processors/core/main_processor.py +1777 -0
- ciris_engine/logic/processors/core/step_decorators.py +1583 -0
- ciris_engine/logic/processors/core/thought_processor/__init__.py +20 -0
- ciris_engine/logic/processors/core/thought_processor/action_execution.py +49 -0
- ciris_engine/logic/processors/core/thought_processor/conscience_execution.py +382 -0
- ciris_engine/logic/processors/core/thought_processor/finalize_action.py +66 -0
- ciris_engine/logic/processors/core/thought_processor/gather_context.py +120 -0
- ciris_engine/logic/processors/core/thought_processor/main.py +920 -0
- ciris_engine/logic/processors/core/thought_processor/perform_aspdma.py +86 -0
- ciris_engine/logic/processors/core/thought_processor/perform_dmas.py +106 -0
- ciris_engine/logic/processors/core/thought_processor/recursive_processing.py +237 -0
- ciris_engine/logic/processors/core/thought_processor/round_complete.py +52 -0
- ciris_engine/logic/processors/core/thought_processor/start_round.py +64 -0
- ciris_engine/logic/processors/exceptions.py +59 -0
- ciris_engine/logic/processors/states/__init__.py +1 -0
- ciris_engine/logic/processors/states/dream_processor.py +1381 -0
- ciris_engine/logic/processors/states/play_processor.py +141 -0
- ciris_engine/logic/processors/states/shutdown_processor.py +623 -0
- ciris_engine/logic/processors/states/solitude_processor.py +305 -0
- ciris_engine/logic/processors/states/wakeup_processor.py +802 -0
- ciris_engine/logic/processors/states/work_processor.py +742 -0
- ciris_engine/logic/processors/support/__init__.py +1 -0
- ciris_engine/logic/processors/support/dma_orchestrator.py +336 -0
- ciris_engine/logic/processors/support/processing_queue.py +133 -0
- ciris_engine/logic/processors/support/shutdown_condition_evaluator.py +294 -0
- ciris_engine/logic/processors/support/state_manager.py +358 -0
- ciris_engine/logic/processors/support/task_manager.py +303 -0
- ciris_engine/logic/processors/support/thought_escalation.py +116 -0
- ciris_engine/logic/processors/support/thought_manager.py +328 -0
- ciris_engine/logic/processors/support/thought_manager_enhanced.py +105 -0
- ciris_engine/logic/registries/__init__.py +34 -0
- ciris_engine/logic/registries/base.py +653 -0
- ciris_engine/logic/registries/circuit_breaker.py +275 -0
- ciris_engine/logic/registries/typed_registries.py +184 -0
- ciris_engine/logic/runtime/__init__.py +7 -0
- ciris_engine/logic/runtime/adapter_loader.py +261 -0
- ciris_engine/logic/runtime/adapter_manager.py +1053 -0
- ciris_engine/logic/runtime/ciris_runtime.py +2342 -0
- ciris_engine/logic/runtime/ciris_runtime_helpers.py +923 -0
- ciris_engine/logic/runtime/component_builder.py +361 -0
- ciris_engine/logic/runtime/identity_manager.py +219 -0
- ciris_engine/logic/runtime/module_loader.py +207 -0
- ciris_engine/logic/runtime/prevent_sideeffects.py +30 -0
- ciris_engine/logic/runtime/runtime_interface.py +23 -0
- ciris_engine/logic/runtime/service_initializer.py +1623 -0
- ciris_engine/logic/secrets/__init__.py +30 -0
- ciris_engine/logic/secrets/encryption.py +175 -0
- ciris_engine/logic/secrets/filter.py +295 -0
- ciris_engine/logic/secrets/service.py +652 -0
- ciris_engine/logic/secrets/store.py +669 -0
- ciris_engine/logic/services/__init__.py +1 -0
- ciris_engine/logic/services/adaptation/__init__.py +3 -0
- ciris_engine/logic/services/base_graph_service.py +142 -0
- ciris_engine/logic/services/base_infrastructure_service.py +69 -0
- ciris_engine/logic/services/base_scheduled_service.py +136 -0
- ciris_engine/logic/services/base_service.py +247 -0
- ciris_engine/logic/services/governance/__init__.py +3 -0
- ciris_engine/logic/services/governance/adaptive_filter/__init__.py +14 -0
- ciris_engine/logic/services/governance/adaptive_filter/service.py +818 -0
- ciris_engine/logic/services/governance/consent/__init__.py +53 -0
- ciris_engine/logic/services/governance/consent/air.py +403 -0
- ciris_engine/logic/services/governance/consent/decay.py +324 -0
- ciris_engine/logic/services/governance/consent/dsar_automation.py +589 -0
- ciris_engine/logic/services/governance/consent/exceptions.py +106 -0
- ciris_engine/logic/services/governance/consent/metrics.py +270 -0
- ciris_engine/logic/services/governance/consent/partnership.py +533 -0
- ciris_engine/logic/services/governance/consent/service.py +1256 -0
- ciris_engine/logic/services/governance/dsar/__init__.py +29 -0
- ciris_engine/logic/services/governance/dsar/orchestrator.py +977 -0
- ciris_engine/logic/services/governance/dsar/schemas.py +141 -0
- ciris_engine/logic/services/governance/dsar/signature_service.py +283 -0
- ciris_engine/logic/services/governance/self_observation/__init__.py +20 -0
- ciris_engine/logic/services/governance/self_observation/service.py +1153 -0
- ciris_engine/logic/services/governance/visibility/__init__.py +17 -0
- ciris_engine/logic/services/governance/visibility/service.py +512 -0
- ciris_engine/logic/services/governance/wise_authority/__init__.py +15 -0
- ciris_engine/logic/services/governance/wise_authority/service.py +827 -0
- ciris_engine/logic/services/graph/__init__.py +5 -0
- ciris_engine/logic/services/graph/audit_service/__init__.py +5 -0
- ciris_engine/logic/services/graph/audit_service/service.py +1675 -0
- ciris_engine/logic/services/graph/base.py +208 -0
- ciris_engine/logic/services/graph/config_service/__init__.py +5 -0
- ciris_engine/logic/services/graph/config_service/service.py +372 -0
- ciris_engine/logic/services/graph/incident_service/__init__.py +5 -0
- ciris_engine/logic/services/graph/incident_service/service.py +803 -0
- ciris_engine/logic/services/graph/memory_service.py +1120 -0
- ciris_engine/logic/services/graph/telemetry_service/__init__.py +5 -0
- ciris_engine/logic/services/graph/telemetry_service/exceptions.py +104 -0
- ciris_engine/logic/services/graph/telemetry_service/helpers.py +1337 -0
- ciris_engine/logic/services/graph/telemetry_service/service.py +2429 -0
- ciris_engine/logic/services/graph/tsdb_consolidation/__init__.py +17 -0
- ciris_engine/logic/services/graph/tsdb_consolidation/aggregation_helpers.py +355 -0
- ciris_engine/logic/services/graph/tsdb_consolidation/cleanup_helpers.py +438 -0
- ciris_engine/logic/services/graph/tsdb_consolidation/compressor.py +260 -0
- ciris_engine/logic/services/graph/tsdb_consolidation/consolidators/__init__.py +27 -0
- ciris_engine/logic/services/graph/tsdb_consolidation/consolidators/audit.py +326 -0
- ciris_engine/logic/services/graph/tsdb_consolidation/consolidators/conversation.py +291 -0
- ciris_engine/logic/services/graph/tsdb_consolidation/consolidators/memory.py +197 -0
- ciris_engine/logic/services/graph/tsdb_consolidation/consolidators/metrics.py +251 -0
- ciris_engine/logic/services/graph/tsdb_consolidation/consolidators/task.py +257 -0
- ciris_engine/logic/services/graph/tsdb_consolidation/consolidators/trace.py +363 -0
- ciris_engine/logic/services/graph/tsdb_consolidation/data_converter.py +545 -0
- ciris_engine/logic/services/graph/tsdb_consolidation/date_calculation_helpers.py +193 -0
- ciris_engine/logic/services/graph/tsdb_consolidation/db_query_helpers.py +296 -0
- ciris_engine/logic/services/graph/tsdb_consolidation/edge_helpers.py +92 -0
- ciris_engine/logic/services/graph/tsdb_consolidation/edge_manager.py +896 -0
- ciris_engine/logic/services/graph/tsdb_consolidation/extensive_helpers.py +322 -0
- ciris_engine/logic/services/graph/tsdb_consolidation/period_manager.py +152 -0
- ciris_engine/logic/services/graph/tsdb_consolidation/profound_helpers.py +277 -0
- ciris_engine/logic/services/graph/tsdb_consolidation/query_manager.py +812 -0
- ciris_engine/logic/services/graph/tsdb_consolidation/service.py +1692 -0
- ciris_engine/logic/services/graph/tsdb_consolidation/sql_builders.py +363 -0
- ciris_engine/logic/services/infrastructure/__init__.py +1 -0
- ciris_engine/logic/services/infrastructure/authentication/__init__.py +5 -0
- ciris_engine/logic/services/infrastructure/authentication/service.py +1634 -0
- ciris_engine/logic/services/infrastructure/database_maintenance/__init__.py +15 -0
- ciris_engine/logic/services/infrastructure/database_maintenance/service.py +764 -0
- ciris_engine/logic/services/infrastructure/resource_monitor/__init__.py +7 -0
- ciris_engine/logic/services/infrastructure/resource_monitor/ciris_billing_provider.py +755 -0
- ciris_engine/logic/services/infrastructure/resource_monitor/service.py +409 -0
- ciris_engine/logic/services/infrastructure/resource_monitor/simple_credit_provider.py +129 -0
- ciris_engine/logic/services/lifecycle/__init__.py +3 -0
- ciris_engine/logic/services/lifecycle/initialization/__init__.py +10 -0
- ciris_engine/logic/services/lifecycle/initialization/service.py +312 -0
- ciris_engine/logic/services/lifecycle/scheduler/__init__.py +5 -0
- ciris_engine/logic/services/lifecycle/scheduler/service.py +607 -0
- ciris_engine/logic/services/lifecycle/shutdown/__init__.py +9 -0
- ciris_engine/logic/services/lifecycle/shutdown/service.py +378 -0
- ciris_engine/logic/services/lifecycle/time/__init__.py +15 -0
- ciris_engine/logic/services/lifecycle/time/service.py +259 -0
- ciris_engine/logic/services/memory_service/__init__.py +8 -0
- ciris_engine/logic/services/mixins/__init__.py +13 -0
- ciris_engine/logic/services/mixins/example_usage.py +200 -0
- ciris_engine/logic/services/mixins/request_metrics.py +179 -0
- ciris_engine/logic/services/runtime/__init__.py +3 -0
- ciris_engine/logic/services/runtime/adapter_configuration/__init__.py +16 -0
- ciris_engine/logic/services/runtime/adapter_configuration/service.py +674 -0
- ciris_engine/logic/services/runtime/adapter_configuration/session.py +67 -0
- ciris_engine/logic/services/runtime/control_service/__init__.py +5 -0
- ciris_engine/logic/services/runtime/control_service/service.py +2269 -0
- ciris_engine/logic/services/runtime/llm_service/__init__.py +14 -0
- ciris_engine/logic/services/runtime/llm_service/pricing_calculator.py +279 -0
- ciris_engine/logic/services/runtime/llm_service/service.py +930 -0
- ciris_engine/logic/services/tools/__init__.py +5 -0
- ciris_engine/logic/services/tools/core_tool_service/__init__.py +8 -0
- ciris_engine/logic/services/tools/core_tool_service/service.py +852 -0
- ciris_engine/logic/setup/__init__.py +1 -0
- ciris_engine/logic/setup/first_run.py +250 -0
- ciris_engine/logic/setup/wizard.py +327 -0
- ciris_engine/logic/telemetry/__init__.py +46 -0
- ciris_engine/logic/telemetry/core.py +239 -0
- ciris_engine/logic/telemetry/hot_cold_config.py +133 -0
- ciris_engine/logic/telemetry/log_collector.py +190 -0
- ciris_engine/logic/telemetry/resource_monitor.py +7 -0
- ciris_engine/logic/telemetry/security.py +79 -0
- ciris_engine/logic/utils/__init__.py +18 -0
- ciris_engine/logic/utils/channel_utils.py +75 -0
- ciris_engine/logic/utils/consent/__init__.py +1 -0
- ciris_engine/logic/utils/consent/partnership_utils.py +172 -0
- ciris_engine/logic/utils/constants.py +92 -0
- ciris_engine/logic/utils/context_utils.py +145 -0
- ciris_engine/logic/utils/directory_setup.py +533 -0
- ciris_engine/logic/utils/graphql_context_provider.py +152 -0
- ciris_engine/logic/utils/identity_resolution.py +843 -0
- ciris_engine/logic/utils/incident_capture_handler.py +303 -0
- ciris_engine/logic/utils/initialization_manager.py +74 -0
- ciris_engine/logic/utils/jsondict_helpers.py +290 -0
- ciris_engine/logic/utils/log_sanitizer.py +97 -0
- ciris_engine/logic/utils/logging_config.py +151 -0
- ciris_engine/logic/utils/observability_decorators.py +544 -0
- ciris_engine/logic/utils/occurrence_utils.py +155 -0
- ciris_engine/logic/utils/path_resolution.py +281 -0
- ciris_engine/logic/utils/platform_detection.py +286 -0
- ciris_engine/logic/utils/privacy.py +266 -0
- ciris_engine/logic/utils/profile_loader.py +124 -0
- ciris_engine/logic/utils/profile_manager.py +16 -0
- ciris_engine/logic/utils/runtime_utils.py +69 -0
- ciris_engine/logic/utils/shutdown_manager.py +107 -0
- ciris_engine/logic/utils/task_formatters.py +60 -0
- ciris_engine/logic/utils/task_thought_factory.py +404 -0
- ciris_engine/logic/utils/thought_utils.py +54 -0
- ciris_engine/logic/utils/user_utils.py +70 -0
- ciris_engine/protocols/__init__.py +0 -0
- ciris_engine/protocols/adapters/__init__.py +35 -0
- ciris_engine/protocols/adapters/base.py +149 -0
- ciris_engine/protocols/adapters/configurable.py +265 -0
- ciris_engine/protocols/adapters/message.py +90 -0
- ciris_engine/protocols/audit/__init__.py +1 -0
- ciris_engine/protocols/buses/__init__.py +1 -0
- ciris_engine/protocols/config/__init__.py +1 -0
- ciris_engine/protocols/conscience/__init__.py +1 -0
- ciris_engine/protocols/consent.py +88 -0
- ciris_engine/protocols/context/__init__.py +1 -0
- ciris_engine/protocols/data/__init__.py +1 -0
- ciris_engine/protocols/dma/__init__.py +1 -0
- ciris_engine/protocols/dma/base.py +107 -0
- ciris_engine/protocols/faculties.py +34 -0
- ciris_engine/protocols/formatters/__init__.py +1 -0
- ciris_engine/protocols/handlers/__init__.py +1 -0
- ciris_engine/protocols/infrastructure/__init__.py +25 -0
- ciris_engine/protocols/infrastructure/base.py +377 -0
- ciris_engine/protocols/persistence/__init__.py +1 -0
- ciris_engine/protocols/pipeline_control.py +609 -0
- ciris_engine/protocols/processors/__init__.py +19 -0
- ciris_engine/protocols/processors/agent.py +299 -0
- ciris_engine/protocols/processors/base.py +130 -0
- ciris_engine/protocols/processors/orchestration.py +62 -0
- ciris_engine/protocols/registries/__init__.py +1 -0
- ciris_engine/protocols/runtime/__init__.py +1 -0
- ciris_engine/protocols/runtime/base.py +163 -0
- ciris_engine/protocols/secrets/__init__.py +1 -0
- ciris_engine/protocols/services/__init__.py +80 -0
- ciris_engine/protocols/services/adaptation/__init__.py +7 -0
- ciris_engine/protocols/services/adaptation/self_observation.py +265 -0
- ciris_engine/protocols/services/governance/__init__.py +20 -0
- ciris_engine/protocols/services/governance/communication.py +58 -0
- ciris_engine/protocols/services/governance/filter.py +56 -0
- ciris_engine/protocols/services/governance/visibility.py +32 -0
- ciris_engine/protocols/services/governance/wa_auth.py +192 -0
- ciris_engine/protocols/services/governance/wise_authority.py +75 -0
- ciris_engine/protocols/services/graph/__init__.py +19 -0
- ciris_engine/protocols/services/graph/audit.py +92 -0
- ciris_engine/protocols/services/graph/config.py +54 -0
- ciris_engine/protocols/services/graph/incident_management.py +103 -0
- ciris_engine/protocols/services/graph/memory.py +110 -0
- ciris_engine/protocols/services/graph/telemetry.py +51 -0
- ciris_engine/protocols/services/graph/tsdb_consolidation.py +87 -0
- ciris_engine/protocols/services/infrastructure/__init__.py +11 -0
- ciris_engine/protocols/services/infrastructure/authentication.py +159 -0
- ciris_engine/protocols/services/infrastructure/credit_gate.py +46 -0
- ciris_engine/protocols/services/infrastructure/database_maintenance.py +25 -0
- ciris_engine/protocols/services/infrastructure/resource_monitor.py +83 -0
- ciris_engine/protocols/services/lifecycle/__init__.py +13 -0
- ciris_engine/protocols/services/lifecycle/initialization.py +41 -0
- ciris_engine/protocols/services/lifecycle/scheduler.py +42 -0
- ciris_engine/protocols/services/lifecycle/shutdown.py +50 -0
- ciris_engine/protocols/services/lifecycle/time.py +31 -0
- ciris_engine/protocols/services/runtime/__init__.py +13 -0
- ciris_engine/protocols/services/runtime/llm.py +50 -0
- ciris_engine/protocols/services/runtime/runtime_control.py +193 -0
- ciris_engine/protocols/services/runtime/secrets.py +100 -0
- ciris_engine/protocols/services/runtime/tool.py +123 -0
- ciris_engine/protocols/telemetry/__init__.py +1 -0
- ciris_engine/protocols/utils/__init__.py +1 -0
- ciris_engine/schemas/__init__.py +112 -0
- ciris_engine/schemas/actions/__init__.py +37 -0
- ciris_engine/schemas/actions/parameters.py +137 -0
- ciris_engine/schemas/adapters/__init__.py +13 -0
- ciris_engine/schemas/adapters/cirisnode.py +135 -0
- ciris_engine/schemas/adapters/cli.py +97 -0
- ciris_engine/schemas/adapters/cli_tools.py +98 -0
- ciris_engine/schemas/adapters/discord.py +125 -0
- ciris_engine/schemas/adapters/graphql_core.py +144 -0
- ciris_engine/schemas/adapters/registration.py +47 -0
- ciris_engine/schemas/adapters/runtime_context.py +48 -0
- ciris_engine/schemas/adapters/tool_execution.py +45 -0
- ciris_engine/schemas/adapters/tools.py +96 -0
- ciris_engine/schemas/api/__init__.py +1 -0
- ciris_engine/schemas/api/agent.py +50 -0
- ciris_engine/schemas/api/audit.py +38 -0
- ciris_engine/schemas/api/auth.py +351 -0
- ciris_engine/schemas/api/config_security.py +242 -0
- ciris_engine/schemas/api/emergency.py +111 -0
- ciris_engine/schemas/api/responses.py +72 -0
- ciris_engine/schemas/api/runtime.py +26 -0
- ciris_engine/schemas/api/telemetry.py +109 -0
- ciris_engine/schemas/api/wa.py +90 -0
- ciris_engine/schemas/audit/__init__.py +13 -0
- ciris_engine/schemas/audit/core.py +139 -0
- ciris_engine/schemas/audit/hash_chain.py +58 -0
- ciris_engine/schemas/audit/verification.py +131 -0
- ciris_engine/schemas/buses/__init__.py +1 -0
- ciris_engine/schemas/config/__init__.py +41 -0
- ciris_engine/schemas/config/agent.py +279 -0
- ciris_engine/schemas/config/cognitive_state_behaviors.py +194 -0
- ciris_engine/schemas/config/default_dsar_sops.py +178 -0
- ciris_engine/schemas/config/essential.py +195 -0
- ciris_engine/schemas/config/tickets.py +86 -0
- ciris_engine/schemas/conscience/__init__.py +25 -0
- ciris_engine/schemas/conscience/context.py +34 -0
- ciris_engine/schemas/conscience/core.py +145 -0
- ciris_engine/schemas/conscience/results.py +24 -0
- ciris_engine/schemas/consent/__init__.py +5 -0
- ciris_engine/schemas/consent/core.py +404 -0
- ciris_engine/schemas/context/__init__.py +1 -0
- ciris_engine/schemas/covenant.py +382 -0
- ciris_engine/schemas/data/__init__.py +1 -0
- ciris_engine/schemas/dma/__init__.py +16 -0
- ciris_engine/schemas/dma/core.py +199 -0
- ciris_engine/schemas/dma/faculty.py +192 -0
- ciris_engine/schemas/dma/prompts.py +172 -0
- ciris_engine/schemas/dma/results.py +103 -0
- ciris_engine/schemas/formatters/__init__.py +1 -0
- ciris_engine/schemas/handlers/__init__.py +10 -0
- ciris_engine/schemas/handlers/context.py +119 -0
- ciris_engine/schemas/handlers/contexts.py +100 -0
- ciris_engine/schemas/handlers/core.py +167 -0
- ciris_engine/schemas/handlers/memory_schemas.py +67 -0
- ciris_engine/schemas/handlers/schemas.py +95 -0
- ciris_engine/schemas/identity.py +149 -0
- ciris_engine/schemas/infrastructure/__init__.py +1 -0
- ciris_engine/schemas/infrastructure/base.py +256 -0
- ciris_engine/schemas/infrastructure/behavioral_patterns.py +129 -0
- ciris_engine/schemas/infrastructure/feedback_loop.py +57 -0
- ciris_engine/schemas/infrastructure/identity_variance.py +141 -0
- ciris_engine/schemas/infrastructure/oauth.py +175 -0
- ciris_engine/schemas/infrastructure/wa_cli_wizard.py +54 -0
- ciris_engine/schemas/persistence/__init__.py +34 -0
- ciris_engine/schemas/persistence/core.py +140 -0
- ciris_engine/schemas/persistence/correlations.py +73 -0
- ciris_engine/schemas/persistence/postgres/__init__.py +1 -0
- ciris_engine/schemas/persistence/postgres/tables.py +280 -0
- ciris_engine/schemas/persistence/sqlite/__init__.py +1 -0
- ciris_engine/schemas/persistence/sqlite/tables.py +281 -0
- ciris_engine/schemas/platform.py +149 -0
- ciris_engine/schemas/processors/__init__.py +26 -0
- ciris_engine/schemas/processors/base.py +130 -0
- ciris_engine/schemas/processors/cognitive.py +77 -0
- ciris_engine/schemas/processors/context.py +35 -0
- ciris_engine/schemas/processors/core.py +152 -0
- ciris_engine/schemas/processors/dma.py +105 -0
- ciris_engine/schemas/processors/error.py +122 -0
- ciris_engine/schemas/processors/main.py +109 -0
- ciris_engine/schemas/processors/phase_results.py +21 -0
- ciris_engine/schemas/processors/results.py +99 -0
- ciris_engine/schemas/processors/solitude.py +79 -0
- ciris_engine/schemas/processors/state.py +202 -0
- ciris_engine/schemas/processors/state_example.py +177 -0
- ciris_engine/schemas/processors/states.py +21 -0
- ciris_engine/schemas/processors/status.py +34 -0
- ciris_engine/schemas/registries/__init__.py +1 -0
- ciris_engine/schemas/registries/base.py +66 -0
- ciris_engine/schemas/resources/__init__.py +15 -0
- ciris_engine/schemas/resources/crisis.py +315 -0
- ciris_engine/schemas/runtime/__init__.py +42 -0
- ciris_engine/schemas/runtime/adapter_management.py +186 -0
- ciris_engine/schemas/runtime/api.py +58 -0
- ciris_engine/schemas/runtime/audit.py +50 -0
- ciris_engine/schemas/runtime/bootstrap.py +33 -0
- ciris_engine/schemas/runtime/contexts.py +61 -0
- ciris_engine/schemas/runtime/core.py +161 -0
- ciris_engine/schemas/runtime/enums.py +167 -0
- ciris_engine/schemas/runtime/extended.py +232 -0
- ciris_engine/schemas/runtime/manifest.py +311 -0
- ciris_engine/schemas/runtime/memory.py +60 -0
- ciris_engine/schemas/runtime/messages.py +108 -0
- ciris_engine/schemas/runtime/models.py +156 -0
- ciris_engine/schemas/runtime/processing_context.py +43 -0
- ciris_engine/schemas/runtime/protocols_core.py +96 -0
- ciris_engine/schemas/runtime/resources.py +33 -0
- ciris_engine/schemas/runtime/system_context.py +417 -0
- ciris_engine/schemas/secrets/__init__.py +1 -0
- ciris_engine/schemas/secrets/core.py +267 -0
- ciris_engine/schemas/secrets/service.py +95 -0
- ciris_engine/schemas/services/__init__.py +33 -0
- ciris_engine/schemas/services/audit_summary_node.py +172 -0
- ciris_engine/schemas/services/authority/__init__.py +39 -0
- ciris_engine/schemas/services/authority/jwt.py +158 -0
- ciris_engine/schemas/services/authority/wa_updates.py +138 -0
- ciris_engine/schemas/services/authority/wise_authority.py +163 -0
- ciris_engine/schemas/services/authority_core.py +370 -0
- ciris_engine/schemas/services/capabilities.py +72 -0
- ciris_engine/schemas/services/community_core.py +95 -0
- ciris_engine/schemas/services/context.py +111 -0
- ciris_engine/schemas/services/conversation_summary_node.py +189 -0
- ciris_engine/schemas/services/core/__init__.py +153 -0
- ciris_engine/schemas/services/core/runtime.py +262 -0
- ciris_engine/schemas/services/core/runtime_config.py +117 -0
- ciris_engine/schemas/services/core/secrets.py +65 -0
- ciris_engine/schemas/services/correlation_node.py +179 -0
- ciris_engine/schemas/services/credit_gate.py +92 -0
- ciris_engine/schemas/services/discord_nodes.py +299 -0
- ciris_engine/schemas/services/feedback_core.py +131 -0
- ciris_engine/schemas/services/filters_core.py +270 -0
- ciris_engine/schemas/services/governance.py +26 -0
- ciris_engine/schemas/services/graph/__init__.py +26 -0
- ciris_engine/schemas/services/graph/attributes.py +254 -0
- ciris_engine/schemas/services/graph/audit.py +98 -0
- ciris_engine/schemas/services/graph/consolidation.py +338 -0
- ciris_engine/schemas/services/graph/edge_types.py +43 -0
- ciris_engine/schemas/services/graph/edges.py +88 -0
- ciris_engine/schemas/services/graph/incident.py +312 -0
- ciris_engine/schemas/services/graph/memory.py +84 -0
- ciris_engine/schemas/services/graph/node_data.py +174 -0
- ciris_engine/schemas/services/graph/query_results.py +82 -0
- ciris_engine/schemas/services/graph/telemetry.py +250 -0
- ciris_engine/schemas/services/graph/tsdb_consolidation.py +27 -0
- ciris_engine/schemas/services/graph/tsdb_models.py +107 -0
- ciris_engine/schemas/services/graph_core.py +196 -0
- ciris_engine/schemas/services/graph_typed_nodes.py +194 -0
- ciris_engine/schemas/services/infrastructure/__init__.py +1 -0
- ciris_engine/schemas/services/infrastructure/resource_monitor.py +20 -0
- ciris_engine/schemas/services/lifecycle/__init__.py +9 -0
- ciris_engine/schemas/services/lifecycle/initialization.py +33 -0
- ciris_engine/schemas/services/lifecycle/time.py +50 -0
- ciris_engine/schemas/services/llm.py +187 -0
- ciris_engine/schemas/services/metadata.py +43 -0
- ciris_engine/schemas/services/nodes.py +704 -0
- ciris_engine/schemas/services/operations.py +126 -0
- ciris_engine/schemas/services/requests.py +128 -0
- ciris_engine/schemas/services/resources_core.py +182 -0
- ciris_engine/schemas/services/runtime_control.py +1010 -0
- ciris_engine/schemas/services/shutdown.py +88 -0
- ciris_engine/schemas/services/special/__init__.py +0 -0
- ciris_engine/schemas/services/special/self_observation.py +396 -0
- ciris_engine/schemas/services/trace_summary_node.py +199 -0
- ciris_engine/schemas/services/visibility.py +98 -0
- ciris_engine/schemas/streaming/__init__.py +10 -0
- ciris_engine/schemas/streaming/reasoning_stream.py +95 -0
- ciris_engine/schemas/telemetry/__init__.py +0 -0
- ciris_engine/schemas/telemetry/collector.py +67 -0
- ciris_engine/schemas/telemetry/core.py +252 -0
- ciris_engine/schemas/telemetry/unified.py +59 -0
- ciris_engine/schemas/tools.py +72 -0
- ciris_engine/schemas/types.py +47 -0
- ciris_engine/schemas/utils/__init__.py +1 -0
- ciris_engine/schemas/utils/config_validator.py +54 -0
- ciris_engine/utils/__init__.py +1 -0
- ciris_engine/utils/serialization.py +35 -0
- ciris_sdk/__init__.py +124 -0
- ciris_sdk/auth_store.py +261 -0
- ciris_sdk/client.py +261 -0
- ciris_sdk/exceptions.py +73 -0
- ciris_sdk/model_types.py +258 -0
- ciris_sdk/models.py +354 -0
- ciris_sdk/pagination.py +214 -0
- ciris_sdk/rate_limiter.py +188 -0
- ciris_sdk/setup.py +17 -0
- ciris_sdk/telemetry_models.py +257 -0
- ciris_sdk/telemetry_responses.py +199 -0
- ciris_sdk/transport.py +177 -0
- ciris_sdk/websocket.py +400 -0
- main.py +766 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8903],{494:(t,e,i)=>{i.d(e,{jG:()=>n});var s=t=>setTimeout(t,0),n=function(){let t=[],e=0,i=t=>{t()},n=t=>{t()},r=s,o=s=>{e?t.push(s):r(()=>{i(s)})},a=()=>{let e=t;t=[],e.length&&r(()=>{n(()=>{e.forEach(t=>{i(t)})})})};return{batch:t=>{let i;e++;try{i=t()}finally{--e||a()}return i},batchCalls:t=>(...e)=>{o(()=>{t(...e)})},schedule:o,setNotifyFunction:t=>{i=t},setBatchNotifyFunction:t=>{n=t},setScheduler:t=>{r=t}}}()},1116:(t,e,i)=>{i.d(e,{t:()=>r});var s=i(2327),n=i(7703),r=new class extends s.Q{#t=!0;#e;#i;constructor(){super(),this.#i=t=>{if(!n.S$&&window.addEventListener){let e=()=>t(!0),i=()=>t(!1);return window.addEventListener("online",e,!1),window.addEventListener("offline",i,!1),()=>{window.removeEventListener("online",e),window.removeEventListener("offline",i)}}}}onSubscribe(){this.#e||this.setEventListener(this.#i)}onUnsubscribe(){this.hasListeners()||(this.#e?.(),this.#e=void 0)}setEventListener(t){this.#i=t,this.#e?.(),this.#e=t(this.setOnline.bind(this))}setOnline(t){this.#t!==t&&(this.#t=t,this.listeners.forEach(e=>{e(t)}))}isOnline(){return this.#t}}},1229:(t,e,i)=>{i.d(e,{m:()=>r});var s=i(2327),n=i(7703),r=new class extends s.Q{#s;#e;#i;constructor(){super(),this.#i=t=>{if(!n.S$&&window.addEventListener){let e=()=>t();return window.addEventListener("visibilitychange",e,!1),()=>{window.removeEventListener("visibilitychange",e)}}}}onSubscribe(){this.#e||this.setEventListener(this.#i)}onUnsubscribe(){this.hasListeners()||(this.#e?.(),this.#e=void 0)}setEventListener(t){this.#i=t,this.#e?.(),this.#e=t(t=>{"boolean"==typeof t?this.setFocused(t):this.onFocus()})}setFocused(t){this.#s!==t&&(this.#s=t,this.onFocus())}onFocus(){let t=this.isFocused();this.listeners.forEach(e=>{e(t)})}isFocused(){return"boolean"==typeof this.#s?this.#s:globalThis.document?.visibilityState!=="hidden"}}},1279:(t,e,i)=>{i.d(e,{II:()=>l,v_:()=>u,wm:()=>h});var s=i(1229),n=i(1116),r=i(2153),o=i(7703);function a(t){return Math.min(1e3*2**t,3e4)}function u(t){return(t??"online")!=="online"||n.t.isOnline()}var c=class extends Error{constructor(t){super("CancelledError"),this.revert=t?.revert,this.silent=t?.silent}};function h(t){return t instanceof c}function l(t){let e,i=!1,h=0,l=!1,d=(0,r.T)(),f=()=>s.m.isFocused()&&("always"===t.networkMode||n.t.isOnline())&&t.canRun(),p=()=>u(t.networkMode)&&t.canRun(),y=i=>{l||(l=!0,t.onSuccess?.(i),e?.(),d.resolve(i))},v=i=>{l||(l=!0,t.onError?.(i),e?.(),d.reject(i))},b=()=>new Promise(i=>{e=t=>{(l||f())&&i(t)},t.onPause?.()}).then(()=>{e=void 0,l||t.onContinue?.()}),m=()=>{let e;if(l)return;let s=0===h?t.initialPromise:void 0;try{e=s??t.fn()}catch(t){e=Promise.reject(t)}Promise.resolve(e).then(y).catch(e=>{if(l)return;let s=t.retry??3*!o.S$,n=t.retryDelay??a,r="function"==typeof n?n(h,e):n,u=!0===s||"number"==typeof s&&h<s||"function"==typeof s&&s(h,e);if(i||!u)return void v(e);h++,t.onFail?.(h,e),(0,o.yy)(r).then(()=>f()?void 0:b()).then(()=>{i?v(e):m()})})};return{promise:d,cancel:e=>{l||(v(new c(e)),t.abort?.())},continue:()=>(e?.(),d),cancelRetry:()=>{i=!0},continueRetry:()=>{i=!1},canStart:p,start:()=>(p()?m():b().then(m),d)}}},2153:(t,e,i)=>{function s(){let t,e,i=new Promise((i,s)=>{t=i,e=s});function s(t){Object.assign(i,t),delete i.resolve,delete i.reject}return i.status="pending",i.catch(()=>{}),i.resolve=e=>{s({status:"fulfilled",value:e}),t(e)},i.reject=t=>{s({status:"rejected",reason:t}),e(t)},i}i.d(e,{T:()=>s})},2210:(t,e,i)=>{i.d(e,{X:()=>a,k:()=>u});var s=i(7703),n=i(494),r=i(1279),o=i(6759),a=class extends o.k{#n;#r;#o;#a;#u;#c;#h;constructor(t){super(),this.#h=!1,this.#c=t.defaultOptions,this.setOptions(t.options),this.observers=[],this.#a=t.client,this.#o=this.#a.getQueryCache(),this.queryKey=t.queryKey,this.queryHash=t.queryHash,this.#n=function(t){let e="function"==typeof t.initialData?t.initialData():t.initialData,i=void 0!==e,s=i?"function"==typeof t.initialDataUpdatedAt?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:i?s??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:i?"success":"pending",fetchStatus:"idle"}}(this.options),this.state=t.state??this.#n,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#u?.promise}setOptions(t){this.options={...this.#c,...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){this.observers.length||"idle"!==this.state.fetchStatus||this.#o.remove(this)}setData(t,e){let i=(0,s.pl)(this.state.data,t,this.options);return this.#l({data:i,type:"success",dataUpdatedAt:e?.updatedAt,manual:e?.manual}),i}setState(t,e){this.#l({type:"setState",state:t,setStateOptions:e})}cancel(t){let e=this.#u?.promise;return this.#u?.cancel(t),e?e.then(s.lQ).catch(s.lQ):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#n)}isActive(){return this.observers.some(t=>!1!==(0,s.Eh)(t.options.enabled,this))}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===s.hT||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0&&this.observers.some(t=>"static"===(0,s.d2)(t.options.staleTime,this))}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):void 0===this.state.data||this.state.isInvalidated}isStaleByTime(t=0){return void 0===this.state.data||"static"!==t&&(!!this.state.isInvalidated||!(0,s.j3)(this.state.dataUpdatedAt,t))}onFocus(){let t=this.observers.find(t=>t.shouldFetchOnWindowFocus());t?.refetch({cancelRefetch:!1}),this.#u?.continue()}onOnline(){let t=this.observers.find(t=>t.shouldFetchOnReconnect());t?.refetch({cancelRefetch:!1}),this.#u?.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),this.#o.notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(e=>e!==t),this.observers.length||(this.#u&&(this.#h?this.#u.cancel({revert:!0}):this.#u.cancelRetry()),this.scheduleGc()),this.#o.notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#l({type:"invalidate"})}fetch(t,e){if("idle"!==this.state.fetchStatus){if(void 0!==this.state.data&&e?.cancelRefetch)this.cancel({silent:!0});else if(this.#u)return this.#u.continueRetry(),this.#u.promise}if(t&&this.setOptions(t),!this.options.queryFn){let t=this.observers.find(t=>t.options.queryFn);t&&this.setOptions(t.options)}let i=new AbortController,n=t=>{Object.defineProperty(t,"signal",{enumerable:!0,get:()=>(this.#h=!0,i.signal)})},o=()=>{let t=(0,s.ZM)(this.options,e),i=(()=>{let t={client:this.#a,queryKey:this.queryKey,meta:this.meta};return n(t),t})();return(this.#h=!1,this.options.persister)?this.options.persister(t,i,this):t(i)},a=(()=>{let t={fetchOptions:e,options:this.options,queryKey:this.queryKey,client:this.#a,state:this.state,fetchFn:o};return n(t),t})();this.options.behavior?.onFetch(a,this),this.#r=this.state,("idle"===this.state.fetchStatus||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#l({type:"fetch",meta:a.fetchOptions?.meta});let u=t=>{(0,r.wm)(t)&&t.silent||this.#l({type:"error",error:t}),(0,r.wm)(t)||(this.#o.config.onError?.(t,this),this.#o.config.onSettled?.(this.state.data,t,this)),this.scheduleGc()};return this.#u=(0,r.II)({initialPromise:e?.initialPromise,fn:a.fetchFn,abort:i.abort.bind(i),onSuccess:t=>{if(void 0===t)return void u(Error(`${this.queryHash} data is undefined`));try{this.setData(t)}catch(t){u(t);return}this.#o.config.onSuccess?.(t,this),this.#o.config.onSettled?.(t,this.state.error,this),this.scheduleGc()},onError:u,onFail:(t,e)=>{this.#l({type:"failed",failureCount:t,error:e})},onPause:()=>{this.#l({type:"pause"})},onContinue:()=>{this.#l({type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0}),this.#u.start()}#l(t){this.state=(e=>{switch(t.type){case"failed":return{...e,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...e,fetchStatus:"paused"};case"continue":return{...e,fetchStatus:"fetching"};case"fetch":return{...e,...u(e.data,this.options),fetchMeta:t.meta??null};case"success":return this.#r=void 0,{...e,data:t.data,dataUpdateCount:e.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":let i=t.error;if((0,r.wm)(i)&&i.revert&&this.#r)return{...this.#r,fetchStatus:"idle"};return{...e,error:i,errorUpdateCount:e.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:e.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error"};case"invalidate":return{...e,isInvalidated:!0};case"setState":return{...e,...t.state}}})(this.state),n.jG.batch(()=>{this.observers.forEach(t=>{t.onQueryUpdate()}),this.#o.notify({query:this,type:"updated",action:t})})}};function u(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:(0,r.v_)(e.networkMode)?"fetching":"paused",...void 0===t&&{error:null,status:"pending"}}}},2327:(t,e,i)=>{i.d(e,{Q:()=>s});var s=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}}},6759:(t,e,i)=>{i.d(e,{k:()=>n});var s=i(7703),n=class{#d;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),(0,s.gn)(this.gcTime)&&(this.#d=setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(s.S$?1/0:3e5))}clearGcTimeout(){this.#d&&(clearTimeout(this.#d),this.#d=void 0)}}},7606:(t,e,i)=>{i.d(e,{Ht:()=>a,jE:()=>o});var s=i(7620),n=i(4568),r=s.createContext(void 0),o=t=>{let e=s.useContext(r);if(t)return t;if(!e)throw Error("No QueryClient set, use QueryClientProvider to set one");return e},a=t=>{let{client:e,children:i}=t;return s.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,n.jsx)(r.Provider,{value:e,children:i})}},7703:(t,e,i)=>{i.d(e,{Cp:()=>p,EN:()=>f,Eh:()=>c,F$:()=>d,GU:()=>E,MK:()=>h,S$:()=>s,ZM:()=>C,ZZ:()=>O,Zw:()=>r,d2:()=>u,f8:()=>y,gn:()=>o,hT:()=>F,j3:()=>a,lQ:()=>n,nJ:()=>l,pl:()=>S,y9:()=>w,yy:()=>g});var s="undefined"==typeof window||"Deno"in globalThis;function n(){}function r(t,e){return"function"==typeof t?t(e):t}function o(t){return"number"==typeof t&&t>=0&&t!==1/0}function a(t,e){return Math.max(t+(e||0)-Date.now(),0)}function u(t,e){return"function"==typeof t?t(e):t}function c(t,e){return"function"==typeof t?t(e):t}function h(t,e){let{type:i="all",exact:s,fetchStatus:n,predicate:r,queryKey:o,stale:a}=t;if(o){if(s){if(e.queryHash!==d(o,e.options))return!1}else if(!p(e.queryKey,o))return!1}if("all"!==i){let t=e.isActive();if("active"===i&&!t||"inactive"===i&&t)return!1}return("boolean"!=typeof a||e.isStale()===a)&&(!n||n===e.state.fetchStatus)&&(!r||!!r(e))}function l(t,e){let{exact:i,status:s,predicate:n,mutationKey:r}=t;if(r){if(!e.options.mutationKey)return!1;if(i){if(f(e.options.mutationKey)!==f(r))return!1}else if(!p(e.options.mutationKey,r))return!1}return(!s||e.state.status===s)&&(!n||!!n(e))}function d(t,e){return(e?.queryKeyHashFn||f)(t)}function f(t){return JSON.stringify(t,(t,e)=>b(e)?Object.keys(e).sort().reduce((t,i)=>(t[i]=e[i],t),{}):e)}function p(t,e){return t===e||typeof t==typeof e&&!!t&&!!e&&"object"==typeof t&&"object"==typeof e&&Object.keys(e).every(i=>p(t[i],e[i]))}function y(t,e){if(!e||Object.keys(t).length!==Object.keys(e).length)return!1;for(let i in t)if(t[i]!==e[i])return!1;return!0}function v(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function b(t){if(!m(t))return!1;let e=t.constructor;if(void 0===e)return!0;let i=e.prototype;return!!m(i)&&!!i.hasOwnProperty("isPrototypeOf")&&Object.getPrototypeOf(t)===Object.prototype}function m(t){return"[object Object]"===Object.prototype.toString.call(t)}function g(t){return new Promise(e=>{setTimeout(e,t)})}function S(t,e,i){return"function"==typeof i.structuralSharing?i.structuralSharing(t,e):!1!==i.structuralSharing?function t(e,i){if(e===i)return e;let s=v(e)&&v(i);if(s||b(e)&&b(i)){let n=s?e:Object.keys(e),r=n.length,o=s?i:Object.keys(i),a=o.length,u=s?[]:{},c=new Set(n),h=0;for(let n=0;n<a;n++){let r=s?n:o[n];(!s&&c.has(r)||s)&&void 0===e[r]&&void 0===i[r]?(u[r]=void 0,h++):(u[r]=t(e[r],i[r]),u[r]===e[r]&&void 0!==e[r]&&h++)}return r===a&&h===r?e:u}return i}(t,e):e}function w(t,e,i=0){let s=[...t,e];return i&&s.length>i?s.slice(1):s}function O(t,e,i=0){let s=[e,...t];return i&&s.length>i?s.slice(0,-1):s}var F=Symbol();function C(t,e){return!t.queryFn&&e?.initialPromise?()=>e.initialPromise:t.queryFn&&t.queryFn!==F?t.queryFn:()=>Promise.reject(Error(`Missing queryFn: '${t.queryHash}'`))}function E(t,e){return"function"==typeof t?t(...e):!!t}}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9090],{266:(t,e,r)=>{t.exports=r(9392)(r(1809),"Promise")},510:(t,e,r)=>{var n=r(7037),s=Array.prototype.splice;t.exports=function(t){var e=this.__data__,r=n(e,t);return!(r<0)&&(r==e.length-1?e.pop():s.call(e,r,1),--this.size,!0)}},567:t=>{t.exports=function(t){return function(e){return t(e)}}},589:(t,e,r)=>{"use strict";r.d(e,{$:()=>a,s:()=>o});var n=r(494),s=r(6759),i=r(1279),o=class extends s.k{#t;#e;#r;constructor(t){super(),this.mutationId=t.mutationId,this.#e=t.mutationCache,this.#t=[],this.state=t.state||a(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){this.#t.includes(t)||(this.#t.push(t),this.clearGcTimeout(),this.#e.notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){this.#t=this.#t.filter(e=>e!==t),this.scheduleGc(),this.#e.notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){this.#t.length||("pending"===this.state.status?this.scheduleGc():this.#e.remove(this))}continue(){return this.#r?.continue()??this.execute(this.state.variables)}async execute(t){let e=()=>{this.#n({type:"continue"})};this.#r=(0,i.II)({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(Error("No mutationFn found")),onFail:(t,e)=>{this.#n({type:"failed",failureCount:t,error:e})},onPause:()=>{this.#n({type:"pause"})},onContinue:e,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#e.canRun(this)});let r="pending"===this.state.status,n=!this.#r.canStart();try{if(r)e();else{this.#n({type:"pending",variables:t,isPaused:n}),await this.#e.config.onMutate?.(t,this);let e=await this.options.onMutate?.(t);e!==this.state.context&&this.#n({type:"pending",context:e,variables:t,isPaused:n})}let s=await this.#r.start();return await this.#e.config.onSuccess?.(s,t,this.state.context,this),await this.options.onSuccess?.(s,t,this.state.context),await this.#e.config.onSettled?.(s,null,this.state.variables,this.state.context,this),await this.options.onSettled?.(s,null,t,this.state.context),this.#n({type:"success",data:s}),s}catch(e){try{throw await this.#e.config.onError?.(e,t,this.state.context,this),await this.options.onError?.(e,t,this.state.context),await this.#e.config.onSettled?.(void 0,e,this.state.variables,this.state.context,this),await this.options.onSettled?.(void 0,e,t,this.state.context),e}finally{this.#n({type:"error",error:e})}}finally{this.#e.runNext(this)}}#n(t){this.state=(e=>{switch(t.type){case"failed":return{...e,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...e,isPaused:!0};case"continue":return{...e,isPaused:!1};case"pending":return{...e,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...e,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...e,data:void 0,error:t.error,failureCount:e.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}})(this.state),n.jG.batch(()=>{this.#t.forEach(e=>{e.onMutationUpdate(t)}),this.#e.notify({mutation:this,type:"updated",action:t})})}};function a(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}},623:(t,e,r)=>{var n=r(1182);t.exports=function(t,e){var r=this.__data__;return this.size+=+!this.has(t),r[t]=n&&void 0===e?"__lodash_hash_undefined__":e,this}},633:t=>{t.exports=function(t){var e=-1,r=Array(t.size);return t.forEach(function(t,n){r[++e]=[n,t]}),r}},655:(t,e,r)=>{t.exports=r(9392)(r(1809),"Set")},727:(t,e,r)=>{var n=r(3519);t.exports=function(t){return n(this,t).get(t)}},909:t=>{var e=Object.prototype;t.exports=function(t){var r=t&&t.constructor;return t===("function"==typeof r&&r.prototype||e)}},1039:(t,e,r)=>{var n=r(8302),s=r(1869);t.exports=function(t,e,r){var i=e(t);return s(t)?i:n(i,r(t))}},1119:(t,e,r)=>{var n=r(7037);t.exports=function(t){var e=this.__data__,r=n(e,t);return r<0?void 0:e[r][1]}},1173:(t,e,r)=>{var n=r(2822),s=r(1658),i=r(6075),o=r(2039),a=r(623);function u(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}u.prototype.clear=n,u.prototype.delete=s,u.prototype.get=i,u.prototype.has=o,u.prototype.set=a,t.exports=u},1182:(t,e,r)=>{t.exports=r(9392)(Object,"create")},1225:(t,e,r)=>{var n=r(4050),s=r(510),i=r(1119),o=r(6403),a=r(2971);function u(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}u.prototype.clear=n,u.prototype.delete=s,u.prototype.get=i,u.prototype.has=o,u.prototype.set=a,t.exports=u},1658:t=>{t.exports=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=!!e,e}},1728:t=>{t.exports=function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t}},1809:(t,e,r)=>{var n=r(7800),s="object"==typeof self&&self&&self.Object===Object&&self;t.exports=n||s||Function("return this")()},1854:(t,e,r)=>{t.exports=r(2845)(Object.keys,Object)},1869:t=>{t.exports=Array.isArray},2012:(t,e,r)=>{var n=r(9412);t.exports=function(t,e){return n(t,e)}},2039:(t,e,r)=>{var n=r(1182),s=Object.prototype.hasOwnProperty;t.exports=function(t){var e=this.__data__;return n?void 0!==e[t]:s.call(e,t)}},2072:(t,e,r)=>{var n=r(3745),s=function(){var t=/[^.]+$/.exec(n&&n.keys&&n.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();t.exports=function(t){return!!s&&s in t}},2190:(t,e,r)=>{var n=r(3299),s=r(6213),i=r(8666),o=r(4873),a=r(6101),u=r(1869),c=r(7550),h=r(8013),l="[object Arguments]",p="[object Array]",f="[object Object]",d=Object.prototype.hasOwnProperty;t.exports=function(t,e,r,v,y,_){var m=u(t),b=u(e),g=m?p:a(t),x=b?p:a(e);g=g==l?f:g,x=x==l?f:x;var S=g==f,j=x==f,w=g==x;if(w&&c(t)){if(!c(e))return!1;m=!0,S=!1}if(w&&!S)return _||(_=new n),m||h(t)?s(t,e,r,v,y,_):i(t,e,g,r,v,y,_);if(!(1&r)){var O=S&&d.call(t,"__wrapped__"),R=j&&d.call(e,"__wrapped__");if(O||R){var C=O?t.value():t,z=R?e.value():e;return _||(_=new n),y(C,z,r,v,_)}}return!!w&&(_||(_=new n),o(t,e,r,v,y,_))}},2232:(t,e,r)=>{t.exports=r(1809).Uint8Array},2256:(t,e,r)=>{var n=r(7032),s=r(5904),i=Object.prototype,o=i.hasOwnProperty,a=i.propertyIsEnumerable;t.exports=n(function(){return arguments}())?n:function(t){return s(t)&&o.call(t,"callee")&&!a.call(t,"callee")}},2293:(t,e,r)=>{t.exports=r(9392)(r(1809),"Map")},2349:t=>{var e=Function.prototype.toString;t.exports=function(t){if(null!=t){try{return e.call(t)}catch(t){}try{return t+""}catch(t){}}return""}},2594:t=>{t.exports=function(t,e){return t===e||t!=t&&e!=e}},2707:(t,e,r)=>{var n=r(3164),s=r(2072),i=r(6087),o=r(2349),a=/^\[object .+?Constructor\]$/,u=Object.prototype,c=Function.prototype.toString,h=u.hasOwnProperty,l=RegExp("^"+c.call(h).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");t.exports=function(t){return!(!i(t)||s(t))&&(n(t)?l:a).test(o(t))}},2796:(t,e,r)=>{t.exports=r(9392)(r(1809),"DataView")},2822:(t,e,r)=>{var n=r(1182);t.exports=function(){this.__data__=n?n(null):{},this.size=0}},2829:t=>{t.exports=function(t){return this.__data__.has(t)}},2845:t=>{t.exports=function(t,e){return function(r){return t(e(r))}}},2846:t=>{var e=Object.prototype.toString;t.exports=function(t){return e.call(t)}},2942:(t,e,r)=>{"use strict";var n=r(2418);r.o(n,"usePathname")&&r.d(e,{usePathname:function(){return n.usePathname}}),r.o(n,"useRouter")&&r.d(e,{useRouter:function(){return n.useRouter}}),r.o(n,"useSearchParams")&&r.d(e,{useSearchParams:function(){return n.useSearchParams}})},2971:(t,e,r)=>{var n=r(7037);t.exports=function(t,e){var r=this.__data__,s=n(r,t);return s<0?(++this.size,r.push([t,e])):r[s][1]=e,this}},3039:t=>{t.exports=function(){return!1}},3164:(t,e,r)=>{var n=r(8480),s=r(6087);t.exports=function(t){if(!s(t))return!1;var e=n(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e}},3232:(t,e,r)=>{var n=r(909),s=r(1854),i=Object.prototype.hasOwnProperty;t.exports=function(t){if(!n(t))return s(t);var e=[];for(var r in Object(t))i.call(t,r)&&"constructor"!=r&&e.push(r);return e}},3299:(t,e,r)=>{var n=r(1225),s=r(8936),i=r(9576),o=r(8273),a=r(2829),u=r(7277);function c(t){var e=this.__data__=new n(t);this.size=e.size}c.prototype.clear=s,c.prototype.delete=i,c.prototype.get=o,c.prototype.has=a,c.prototype.set=u,t.exports=c},3519:(t,e,r)=>{var n=r(1728);t.exports=function(t,e){var r=t.__data__;return n(e)?r["string"==typeof e?"string":"hash"]:r.map}},3522:()=>{},3590:t=>{t.exports=function(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}},3745:(t,e,r)=>{t.exports=r(1809)["__core-js_shared__"]},3876:t=>{t.exports=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=0x1fffffffffffff}},4004:(t,e,r)=>{var n=r(9344),s=r(9658),i=Object.prototype.propertyIsEnumerable,o=Object.getOwnPropertySymbols;t.exports=o?function(t){return null==t?[]:n(o(t=Object(t)),function(e){return i.call(t,e)})}:s},4050:t=>{t.exports=function(){this.__data__=[],this.size=0}},4059:t=>{t.exports=function(t,e){return t.has(e)}},4163:(t,e,r)=>{var n=r(3519);t.exports=function(t,e){var r=n(this,t),s=r.size;return r.set(t,e),this.size+=+(r.size!=s),this}},4275:(t,e,r)=>{"use strict";t.exports=r(8650).style},4584:(t,e,r)=>{var n=r(3519);t.exports=function(t){return n(this,t).has(t)}},4661:(t,e,r)=>{var n=r(3590),s=r(2256),i=r(1869),o=r(7550),a=r(9387),u=r(8013),c=Object.prototype.hasOwnProperty;t.exports=function(t,e){var r=i(t),h=!r&&s(t),l=!r&&!h&&o(t),p=!r&&!h&&!l&&u(t),f=r||h||l||p,d=f?n(t.length,String):[],v=d.length;for(var y in t)(e||c.call(t,y))&&!(f&&("length"==y||l&&("offset"==y||"parent"==y)||p&&("buffer"==y||"byteLength"==y||"byteOffset"==y)||a(y,v)))&&d.push(y);return d}},4665:(t,e,r)=>{t=r.nmd(t);var n=r(7800),s=e&&!e.nodeType&&e,i=s&&t&&!t.nodeType&&t,o=i&&i.exports===s&&n.process,a=function(){try{var t=i&&i.require&&i.require("util").types;if(t)return t;return o&&o.binding&&o.binding("util")}catch(t){}}();t.exports=a},4709:(t,e,r)=>{var n=r(8480),s=r(3876),i=r(5904),o={};o["[object Float32Array]"]=o["[object Float64Array]"]=o["[object Int8Array]"]=o["[object Int16Array]"]=o["[object Int32Array]"]=o["[object Uint8Array]"]=o["[object Uint8ClampedArray]"]=o["[object Uint16Array]"]=o["[object Uint32Array]"]=!0,o["[object Arguments]"]=o["[object Array]"]=o["[object ArrayBuffer]"]=o["[object Boolean]"]=o["[object DataView]"]=o["[object Date]"]=o["[object Error]"]=o["[object Function]"]=o["[object Map]"]=o["[object Number]"]=o["[object Object]"]=o["[object RegExp]"]=o["[object Set]"]=o["[object String]"]=o["[object WeakMap]"]=!1,t.exports=function(t){return i(t)&&s(t.length)&&!!o[n(t)]}},4721:t=>{t.exports=function(t){return this.__data__.has(t)}},4873:(t,e,r)=>{var n=r(5186),s=Object.prototype.hasOwnProperty;t.exports=function(t,e,r,i,o,a){var u=1&r,c=n(t),h=c.length;if(h!=n(e).length&&!u)return!1;for(var l=h;l--;){var p=c[l];if(!(u?p in e:s.call(e,p)))return!1}var f=a.get(t),d=a.get(e);if(f&&d)return f==e&&d==t;var v=!0;a.set(t,e),a.set(e,t);for(var y=u;++l<h;){var _=t[p=c[l]],m=e[p];if(i)var b=u?i(m,_,p,e,t,a):i(_,m,p,t,e,a);if(!(void 0===b?_===m||o(_,m,r,i,a):b)){v=!1;break}y||(y="constructor"==p)}if(v&&!y){var g=t.constructor,x=e.constructor;g!=x&&"constructor"in t&&"constructor"in e&&!("function"==typeof g&&g instanceof g&&"function"==typeof x&&x instanceof x)&&(v=!1)}return a.delete(t),a.delete(e),v}},4986:(t,e,r)=>{var n=r(1173),s=r(1225),i=r(2293);t.exports=function(){this.size=0,this.__data__={hash:new n,map:new(i||s),string:new n}}},5186:(t,e,r)=>{var n=r(1039),s=r(4004),i=r(7656);t.exports=function(t){return n(t,i,s)}},5464:t=>{t.exports=function(t){var e=-1,r=Array(t.size);return t.forEach(function(t){r[++e]=t}),r}},5695:(t,e,r)=>{var n=r(5761),s=r(7314),i=r(4721);function o(t){var e=-1,r=null==t?0:t.length;for(this.__data__=new n;++e<r;)this.add(t[e])}o.prototype.add=o.prototype.push=s,o.prototype.has=i,t.exports=o},5761:(t,e,r)=>{var n=r(4986),s=r(7350),i=r(727),o=r(4584),a=r(4163);function u(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}u.prototype.clear=n,u.prototype.delete=s,u.prototype.get=i,u.prototype.has=o,u.prototype.set=a,t.exports=u},5833:(t,e,r)=>{t.exports=r(9392)(r(1809),"WeakMap")},5904:t=>{t.exports=function(t){return null!=t&&"object"==typeof t}},6075:(t,e,r)=>{var n=r(1182),s=Object.prototype.hasOwnProperty;t.exports=function(t){var e=this.__data__;if(n){var r=e[t];return"__lodash_hash_undefined__"===r?void 0:r}return s.call(e,t)?e[t]:void 0}},6087:t=>{t.exports=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}},6101:(t,e,r)=>{var n=r(2796),s=r(2293),i=r(266),o=r(655),a=r(5833),u=r(8480),c=r(2349),h="[object Map]",l="[object Promise]",p="[object Set]",f="[object WeakMap]",d="[object DataView]",v=c(n),y=c(s),_=c(i),m=c(o),b=c(a),g=u;(n&&g(new n(new ArrayBuffer(1)))!=d||s&&g(new s)!=h||i&&g(i.resolve())!=l||o&&g(new o)!=p||a&&g(new a)!=f)&&(g=function(t){var e=u(t),r="[object Object]"==e?t.constructor:void 0,n=r?c(r):"";if(n)switch(n){case v:return d;case y:return h;case _:return l;case m:return p;case b:return f}return e}),t.exports=g},6213:(t,e,r)=>{var n=r(5695),s=r(7482),i=r(4059);t.exports=function(t,e,r,o,a,u){var c=1&r,h=t.length,l=e.length;if(h!=l&&!(c&&l>h))return!1;var p=u.get(t),f=u.get(e);if(p&&f)return p==e&&f==t;var d=-1,v=!0,y=2&r?new n:void 0;for(u.set(t,e),u.set(e,t);++d<h;){var _=t[d],m=e[d];if(o)var b=c?o(m,_,d,e,t,u):o(_,m,d,t,e,u);if(void 0!==b){if(b)continue;v=!1;break}if(y){if(!s(e,function(t,e){if(!i(y,e)&&(_===t||a(_,t,r,o,u)))return y.push(e)})){v=!1;break}}else if(!(_===m||a(_,m,r,o,u))){v=!1;break}}return u.delete(t),u.delete(e),v}},6258:(t,e,r)=>{"use strict";r.d(e,{n:()=>h});var n=r(7620),s=r(589),i=r(494),o=r(2327),a=r(7703),u=class extends o.Q{#s;#i=void 0;#o;#a;constructor(t,e){super(),this.#s=t,this.setOptions(e),this.bindMethods(),this.#u()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){let e=this.options;this.options=this.#s.defaultMutationOptions(t),(0,a.f8)(this.options,e)||this.#s.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#o,observer:this}),e?.mutationKey&&this.options.mutationKey&&(0,a.EN)(e.mutationKey)!==(0,a.EN)(this.options.mutationKey)?this.reset():this.#o?.state.status==="pending"&&this.#o.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#o?.removeObserver(this)}onMutationUpdate(t){this.#u(),this.#c(t)}getCurrentResult(){return this.#i}reset(){this.#o?.removeObserver(this),this.#o=void 0,this.#u(),this.#c()}mutate(t,e){return this.#a=e,this.#o?.removeObserver(this),this.#o=this.#s.getMutationCache().build(this.#s,this.options),this.#o.addObserver(this),this.#o.execute(t)}#u(){let t=this.#o?.state??(0,s.$)();this.#i={...t,isPending:"pending"===t.status,isSuccess:"success"===t.status,isError:"error"===t.status,isIdle:"idle"===t.status,mutate:this.mutate,reset:this.reset}}#c(t){i.jG.batch(()=>{if(this.#a&&this.hasListeners()){let e=this.#i.variables,r=this.#i.context;t?.type==="success"?(this.#a.onSuccess?.(t.data,e,r),this.#a.onSettled?.(t.data,null,e,r)):t?.type==="error"&&(this.#a.onError?.(t.error,e,r),this.#a.onSettled?.(void 0,t.error,e,r))}this.listeners.forEach(t=>{t(this.#i)})})}},c=r(7606);function h(t,e){let r=(0,c.jE)(e),[s]=n.useState(()=>new u(r,t));n.useEffect(()=>{s.setOptions(t)},[s,t]);let o=n.useSyncExternalStore(n.useCallback(t=>s.subscribe(i.jG.batchCalls(t)),[s]),()=>s.getCurrentResult(),()=>s.getCurrentResult()),h=n.useCallback((t,e)=>{s.mutate(t,e).catch(a.lQ)},[s]);if(o.error&&(0,a.GU)(s.options.throwOnError,[o.error]))throw o.error;return{...o,mutate:h,mutateAsync:o.mutate}}},6338:(t,e,r)=>{var n=r(3164),s=r(3876);t.exports=function(t){return null!=t&&s(t.length)&&!n(t)}},6403:(t,e,r)=>{var n=r(7037);t.exports=function(t){return n(this.__data__,t)>-1}},7032:(t,e,r)=>{var n=r(8480),s=r(5904);t.exports=function(t){return s(t)&&"[object Arguments]"==n(t)}},7037:(t,e,r)=>{var n=r(2594);t.exports=function(t,e){for(var r=t.length;r--;)if(n(t[r][0],e))return r;return -1}},7277:(t,e,r)=>{var n=r(1225),s=r(2293),i=r(5761);t.exports=function(t,e){var r=this.__data__;if(r instanceof n){var o=r.__data__;if(!s||o.length<199)return o.push([t,e]),this.size=++r.size,this;r=this.__data__=new i(o)}return r.set(t,e),this.size=r.size,this}},7314:t=>{t.exports=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this}},7350:(t,e,r)=>{var n=r(3519);t.exports=function(t){var e=n(this,t).delete(t);return this.size-=!!e,e}},7482:t=>{t.exports=function(t,e){for(var r=-1,n=null==t?0:t.length;++r<n;)if(e(t[r],r,t))return!0;return!1}},7550:(t,e,r)=>{t=r.nmd(t);var n=r(1809),s=r(3039),i=e&&!e.nodeType&&e,o=i&&t&&!t.nodeType&&t,a=o&&o.exports===i?n.Buffer:void 0,u=a?a.isBuffer:void 0;t.exports=u||s},7656:(t,e,r)=>{var n=r(4661),s=r(3232),i=r(6338);t.exports=function(t){return i(t)?n(t):s(t)}},7800:(t,e,r)=>{t.exports="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g},8013:(t,e,r)=>{var n=r(4709),s=r(567),i=r(4665),o=i&&i.isTypedArray;t.exports=o?s(o):n},8273:t=>{t.exports=function(t){return this.__data__.get(t)}},8302:t=>{t.exports=function(t,e){for(var r=-1,n=e.length,s=t.length;++r<n;)t[s+r]=e[r];return t}},8445:(t,e,r)=>{t.exports=r(1809).Symbol},8480:(t,e,r)=>{var n=r(8445),s=r(8769),i=r(2846),o=n?n.toStringTag:void 0;t.exports=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":o&&o in Object(t)?s(t):i(t)}},8488:t=>{t.exports=function(t,e){return null==t?void 0:t[e]}},8650:(t,e,r)=>{"use strict";var n=r(4338);r(3522);var s=r(7620),i=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(s),o=void 0!==n&&n.env&&!0,a=function(t){return"[object String]"===Object.prototype.toString.call(t)},u=function(){function t(t){var e=void 0===t?{}:t,r=e.name,n=void 0===r?"stylesheet":r,s=e.optimizeForSpeed,i=void 0===s?o:s;c(a(n),"`name` must be a string"),this._name=n,this._deletedRulePlaceholder="#"+n+"-deleted-rule____{}",c("boolean"==typeof i,"`optimizeForSpeed` must be a boolean"),this._optimizeForSpeed=i,this._serverSheet=void 0,this._tags=[],this._injected=!1,this._rulesCount=0;var u="undefined"!=typeof window&&document.querySelector('meta[property="csp-nonce"]');this._nonce=u?u.getAttribute("content"):null}var e,r=t.prototype;return r.setOptimizeForSpeed=function(t){c("boolean"==typeof t,"`setOptimizeForSpeed` accepts a boolean"),c(0===this._rulesCount,"optimizeForSpeed cannot be when rules have already been inserted"),this.flush(),this._optimizeForSpeed=t,this.inject()},r.isOptimizeForSpeed=function(){return this._optimizeForSpeed},r.inject=function(){var t=this;if(c(!this._injected,"sheet already injected"),this._injected=!0,"undefined"!=typeof window&&this._optimizeForSpeed){this._tags[0]=this.makeStyleTag(this._name),this._optimizeForSpeed="insertRule"in this.getSheet(),this._optimizeForSpeed||(o||console.warn("StyleSheet: optimizeForSpeed mode not supported falling back to standard mode."),this.flush(),this._injected=!0);return}this._serverSheet={cssRules:[],insertRule:function(e,r){return"number"==typeof r?t._serverSheet.cssRules[r]={cssText:e}:t._serverSheet.cssRules.push({cssText:e}),r},deleteRule:function(e){t._serverSheet.cssRules[e]=null}}},r.getSheetForTag=function(t){if(t.sheet)return t.sheet;for(var e=0;e<document.styleSheets.length;e++)if(document.styleSheets[e].ownerNode===t)return document.styleSheets[e]},r.getSheet=function(){return this.getSheetForTag(this._tags[this._tags.length-1])},r.insertRule=function(t,e){if(c(a(t),"`insertRule` accepts only strings"),"undefined"==typeof window)return"number"!=typeof e&&(e=this._serverSheet.cssRules.length),this._serverSheet.insertRule(t,e),this._rulesCount++;if(this._optimizeForSpeed){var r=this.getSheet();"number"!=typeof e&&(e=r.cssRules.length);try{r.insertRule(t,e)}catch(e){return o||console.warn("StyleSheet: illegal rule: \n\n"+t+"\n\nSee https://stackoverflow.com/q/20007992 for more info"),-1}}else{var n=this._tags[e];this._tags.push(this.makeStyleTag(this._name,t,n))}return this._rulesCount++},r.replaceRule=function(t,e){if(this._optimizeForSpeed||"undefined"==typeof window){var r="undefined"!=typeof window?this.getSheet():this._serverSheet;if(e.trim()||(e=this._deletedRulePlaceholder),!r.cssRules[t])return t;r.deleteRule(t);try{r.insertRule(e,t)}catch(n){o||console.warn("StyleSheet: illegal rule: \n\n"+e+"\n\nSee https://stackoverflow.com/q/20007992 for more info"),r.insertRule(this._deletedRulePlaceholder,t)}}else{var n=this._tags[t];c(n,"old rule at index `"+t+"` not found"),n.textContent=e}return t},r.deleteRule=function(t){if("undefined"==typeof window)return void this._serverSheet.deleteRule(t);if(this._optimizeForSpeed)this.replaceRule(t,"");else{var e=this._tags[t];c(e,"rule at index `"+t+"` not found"),e.parentNode.removeChild(e),this._tags[t]=null}},r.flush=function(){this._injected=!1,this._rulesCount=0,"undefined"!=typeof window?(this._tags.forEach(function(t){return t&&t.parentNode.removeChild(t)}),this._tags=[]):this._serverSheet.cssRules=[]},r.cssRules=function(){var t=this;return"undefined"==typeof window?this._serverSheet.cssRules:this._tags.reduce(function(e,r){return r?e=e.concat(Array.prototype.map.call(t.getSheetForTag(r).cssRules,function(e){return e.cssText===t._deletedRulePlaceholder?null:e})):e.push(null),e},[])},r.makeStyleTag=function(t,e,r){e&&c(a(e),"makeStyleTag accepts only strings as second parameter");var n=document.createElement("style");this._nonce&&n.setAttribute("nonce",this._nonce),n.type="text/css",n.setAttribute("data-"+t,""),e&&n.appendChild(document.createTextNode(e));var s=document.head||document.getElementsByTagName("head")[0];return r?s.insertBefore(n,r):s.appendChild(n),n},e=[{key:"length",get:function(){return this._rulesCount}}],function(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}(t.prototype,e),t}();function c(t,e){if(!t)throw Error("StyleSheet: "+e+".")}var h=function(t){for(var e=5381,r=t.length;r;)e=33*e^t.charCodeAt(--r);return e>>>0},l={};function p(t,e){if(!e)return"jsx-"+t;var r=String(e),n=t+r;return l[n]||(l[n]="jsx-"+h(t+"-"+r)),l[n]}function f(t,e){"undefined"==typeof window&&(e=e.replace(/\/style/gi,"\\/style"));var r=t+e;return l[r]||(l[r]=e.replace(/__jsx-style-dynamic-selector/g,t)),l[r]}var d=function(){function t(t){var e=void 0===t?{}:t,r=e.styleSheet,n=void 0===r?null:r,s=e.optimizeForSpeed,i=void 0!==s&&s;this._sheet=n||new u({name:"styled-jsx",optimizeForSpeed:i}),this._sheet.inject(),n&&"boolean"==typeof i&&(this._sheet.setOptimizeForSpeed(i),this._optimizeForSpeed=this._sheet.isOptimizeForSpeed()),this._fromServer=void 0,this._indices={},this._instancesCounts={}}var e=t.prototype;return e.add=function(t){var e=this;void 0===this._optimizeForSpeed&&(this._optimizeForSpeed=Array.isArray(t.children),this._sheet.setOptimizeForSpeed(this._optimizeForSpeed),this._optimizeForSpeed=this._sheet.isOptimizeForSpeed()),"undefined"==typeof window||this._fromServer||(this._fromServer=this.selectFromServer(),this._instancesCounts=Object.keys(this._fromServer).reduce(function(t,e){return t[e]=0,t},{}));var r=this.getIdAndRules(t),n=r.styleId,s=r.rules;if(n in this._instancesCounts){this._instancesCounts[n]+=1;return}var i=s.map(function(t){return e._sheet.insertRule(t)}).filter(function(t){return -1!==t});this._indices[n]=i,this._instancesCounts[n]=1},e.remove=function(t){var e=this,r=this.getIdAndRules(t).styleId;if(function(t,e){if(!t)throw Error("StyleSheetRegistry: "+e+".")}(r in this._instancesCounts,"styleId: `"+r+"` not found"),this._instancesCounts[r]-=1,this._instancesCounts[r]<1){var n=this._fromServer&&this._fromServer[r];n?(n.parentNode.removeChild(n),delete this._fromServer[r]):(this._indices[r].forEach(function(t){return e._sheet.deleteRule(t)}),delete this._indices[r]),delete this._instancesCounts[r]}},e.update=function(t,e){this.add(e),this.remove(t)},e.flush=function(){this._sheet.flush(),this._sheet.inject(),this._fromServer=void 0,this._indices={},this._instancesCounts={}},e.cssRules=function(){var t=this,e=this._fromServer?Object.keys(this._fromServer).map(function(e){return[e,t._fromServer[e]]}):[],r=this._sheet.cssRules();return e.concat(Object.keys(this._indices).map(function(e){return[e,t._indices[e].map(function(t){return r[t].cssText}).join(t._optimizeForSpeed?"":"\n")]}).filter(function(t){return!!t[1]}))},e.styles=function(t){var e,r;return e=this.cssRules(),void 0===(r=t)&&(r={}),e.map(function(t){var e=t[0],n=t[1];return i.default.createElement("style",{id:"__"+e,key:"__"+e,nonce:r.nonce?r.nonce:void 0,dangerouslySetInnerHTML:{__html:n}})})},e.getIdAndRules=function(t){var e=t.children,r=t.dynamic,n=t.id;if(r){var s=p(n,r);return{styleId:s,rules:Array.isArray(e)?e.map(function(t){return f(s,t)}):[f(s,e)]}}return{styleId:p(n),rules:Array.isArray(e)?e:[e]}},e.selectFromServer=function(){return Array.prototype.slice.call(document.querySelectorAll('[id^="__jsx-"]')).reduce(function(t,e){return t[e.id.slice(2)]=e,t},{})},t}(),v=s.createContext(null);v.displayName="StyleSheetContext";var y=i.default.useInsertionEffect||i.default.useLayoutEffect,_="undefined"!=typeof window?new d:void 0;function m(t){var e=_||s.useContext(v);return e&&("undefined"==typeof window?e.add(t):y(function(){return e.add(t),function(){e.remove(t)}},[t.id,String(t.dynamic)])),null}m.dynamic=function(t){return t.map(function(t){return p(t[0],t[1])}).join(" ")},e.style=m},8666:(t,e,r)=>{var n=r(8445),s=r(2232),i=r(2594),o=r(6213),a=r(633),u=r(5464),c=n?n.prototype:void 0,h=c?c.valueOf:void 0;t.exports=function(t,e,r,n,c,l,p){switch(r){case"[object DataView]":if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)break;t=t.buffer,e=e.buffer;case"[object ArrayBuffer]":if(t.byteLength!=e.byteLength||!l(new s(t),new s(e)))break;return!0;case"[object Boolean]":case"[object Date]":case"[object Number]":return i(+t,+e);case"[object Error]":return t.name==e.name&&t.message==e.message;case"[object RegExp]":case"[object String]":return t==e+"";case"[object Map]":var f=a;case"[object Set]":var d=1&n;if(f||(f=u),t.size!=e.size&&!d)break;var v=p.get(t);if(v)return v==e;n|=2,p.set(t,e);var y=o(f(t),f(e),n,c,l,p);return p.delete(t),y;case"[object Symbol]":if(h)return h.call(t)==h.call(e)}return!1}},8769:(t,e,r)=>{var n=r(8445),s=Object.prototype,i=s.hasOwnProperty,o=s.toString,a=n?n.toStringTag:void 0;t.exports=function(t){var e=i.call(t,a),r=t[a];try{t[a]=void 0;var n=!0}catch(t){}var s=o.call(t);return n&&(e?t[a]=r:delete t[a]),s}},8936:(t,e,r)=>{var n=r(1225);t.exports=function(){this.__data__=new n,this.size=0}},9344:t=>{t.exports=function(t,e){for(var r=-1,n=null==t?0:t.length,s=0,i=[];++r<n;){var o=t[r];e(o,r,t)&&(i[s++]=o)}return i}},9387:t=>{var e=/^(?:0|[1-9]\d*)$/;t.exports=function(t,r){var n=typeof t;return!!(r=null==r?0x1fffffffffffff:r)&&("number"==n||"symbol"!=n&&e.test(t))&&t>-1&&t%1==0&&t<r}},9392:(t,e,r)=>{var n=r(2707),s=r(8488);t.exports=function(t,e){var r=s(t,e);return n(r)?r:void 0}},9412:(t,e,r)=>{var n=r(2190),s=r(5904);t.exports=function t(e,r,i,o,a){return e===r||(null!=e&&null!=r&&(s(e)||s(r))?n(e,r,i,o,t,a):e!=e&&r!=r)}},9576:t=>{t.exports=function(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}},9658:t=>{t.exports=function(){return[]}}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9492],{2911:(e,t,r)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/_not-found/page",function(){return r(4823)}])},4823:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return o}});let l=r(4568),n=r(8904);function o(){return(0,l.jsx)(n.HTTPAccessErrorFallback,{status:404,message:"This page could not be found."})}("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)},8904:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"HTTPAccessErrorFallback",{enumerable:!0,get:function(){return o}}),r(6841);let l=r(4568);r(7620);let n={error:{fontFamily:'system-ui,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji"',height:"100vh",textAlign:"center",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},desc:{display:"inline-block"},h1:{display:"inline-block",margin:"0 20px 0 0",padding:"0 23px 0 0",fontSize:24,fontWeight:500,verticalAlign:"top",lineHeight:"49px"},h2:{fontSize:14,fontWeight:400,lineHeight:"49px",margin:0}};function o(e){let{status:t,message:r}=e;return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("title",{children:t+": "+r}),(0,l.jsx)("div",{style:n.error,children:(0,l.jsxs)("div",{children:[(0,l.jsx)("style",{dangerouslySetInnerHTML:{__html:"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}),(0,l.jsx)("h1",{className:"next-error-h1",style:n.h1,children:t}),(0,l.jsx)("div",{style:n.desc,children:(0,l.jsx)("h2",{style:n.h2,children:r})})]})})]})}("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)}},e=>{var t=t=>e(e.s=t);e.O(0,[587,8315,7358],()=>t(2911)),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8884],{891:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>i});var r=s(4568),a=s(7620),l=s(704);function i(){let[e,t]=(0,a.useState)([]),[s,i]=(0,a.useState)(!0),[n,d]=(0,a.useState)(!1),[c,o]=(0,a.useState)(!1),[x,m]=(0,a.useState)(null),[u,h]=(0,a.useState)(""),[p,y]=(0,a.useState)(1440),[b,g]=(0,a.useState)(null),f=async()=>{try{i(!0);let e=new l.CIRISClient,s=await e.auth.listAPIKeys();t(s.api_keys),g(null)}catch(e){console.error("Failed to load API keys:",e),g(e.message||"Failed to load API keys")}finally{i(!1)}};(0,a.useEffect)(()=>{f()},[]);let v=async()=>{if(!u.trim())return void g("Description is required");try{d(!0),g(null);let e=new l.CIRISClient,t=await e.auth.createAPIKey(u.trim(),p);m({api_key:t.api_key,description:t.description,expires_at:t.expires_at}),h(""),y(1440),o(!1),await f()}catch(e){console.error("Failed to create API key:",e),g(e.message||"Failed to create API key")}finally{d(!1)}},j=async e=>{if(confirm("Are you sure you want to revoke this API key? This action cannot be undone."))try{let t=new l.CIRISClient;await t.auth.deleteAPIKey(e),await f(),g(null)}catch(e){console.error("Failed to delete API key:",e),g(e.message||"Failed to delete API key")}},N=e=>{navigator.clipboard.writeText(e)},k=e=>new Date(e).toLocaleString(),w=e=>new Date(e)<new Date;return(0,r.jsxs)("div",{className:"max-w-6xl mx-auto px-4 py-8",children:[(0,r.jsxs)("div",{className:"mb-8",children:[(0,r.jsx)("h1",{className:"text-3xl font-bold text-gray-900",children:"API Keys"}),(0,r.jsx)("p",{className:"mt-2 text-sm text-gray-600",children:"Manage API keys for programmatic access to your CIRIS agent"})]}),b&&(0,r.jsx)("div",{className:"mb-6 p-4 bg-red-50 border border-red-200 rounded-lg",children:(0,r.jsx)("p",{className:"text-sm text-red-800",children:b})}),x&&(0,r.jsxs)("div",{className:"mb-6 p-6 bg-green-50 border-2 border-green-500 rounded-lg",children:[(0,r.jsxs)("div",{className:"flex items-start justify-between mb-4",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("h3",{className:"text-lg font-semibold text-green-900 flex items-center gap-2",children:"API Key Created Successfully"}),(0,r.jsx)("p",{className:"text-sm text-green-700 mt-1",children:"This is the only time you will see this key. Copy it now and store it securely."})]}),(0,r.jsx)("button",{onClick:()=>m(null),className:"text-green-700 hover:text-green-900",children:"✕"})]}),(0,r.jsxs)("div",{className:"space-y-3",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{className:"block text-xs font-medium text-green-900 mb-1",children:"Description"}),(0,r.jsx)("p",{className:"text-sm text-green-800",children:x.description})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{className:"block text-xs font-medium text-green-900 mb-1",children:"API Key"}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)("code",{className:"flex-1 px-3 py-2 bg-white border border-green-300 rounded text-sm font-mono text-gray-900 break-all",children:x.api_key}),(0,r.jsx)("button",{onClick:()=>N(x.api_key),className:"px-4 py-2 bg-green-600 text-white rounded hover:bg-green-700 text-sm font-medium whitespace-nowrap",children:"Copy"})]})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{className:"block text-xs font-medium text-green-900 mb-1",children:"Expires"}),(0,r.jsx)("p",{className:"text-sm text-green-800",children:k(x.expires_at)})]})]})]}),(0,r.jsx)("div",{className:"mb-8",children:c?(0,r.jsxs)("div",{className:"p-6 bg-white border border-gray-200 rounded-lg shadow-sm",children:[(0,r.jsxs)("div",{className:"flex items-start justify-between mb-4",children:[(0,r.jsx)("h3",{className:"text-lg font-semibold text-gray-900",children:"Create New API Key"}),(0,r.jsx)("button",{onClick:()=>{o(!1),h(""),g(null)},className:"text-gray-400 hover:text-gray-600",children:"✕"})]}),(0,r.jsxs)("div",{className:"space-y-4",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Description"}),(0,r.jsx)("input",{type:"text",value:u,onChange:e=>h(e.target.value),placeholder:"e.g., CI/CD pipeline, automation script",className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500"})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Expires In"}),(0,r.jsx)("select",{value:p,onChange:e=>y(Number(e.target.value)),className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500",children:[{value:30,label:"30 minutes"},{value:60,label:"1 hour"},{value:1440,label:"1 day"},{value:10080,label:"7 days"}].map(e=>(0,r.jsx)("option",{value:e.value,children:e.label},e.value))})]}),(0,r.jsxs)("div",{className:"flex gap-3",children:[(0,r.jsx)("button",{onClick:v,disabled:n||!u.trim(),className:"px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 disabled:bg-gray-400 disabled:cursor-not-allowed font-medium",children:n?"Creating...":"Create Key"}),(0,r.jsx)("button",{onClick:()=>{o(!1),h(""),g(null)},className:"px-4 py-2 bg-gray-100 text-gray-700 rounded-lg hover:bg-gray-200 font-medium",children:"Cancel"})]})]})]}):(0,r.jsx)("button",{onClick:()=>o(!0),className:"px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 font-medium",children:"Create New API Key"})}),(0,r.jsxs)("div",{className:"bg-white border border-gray-200 rounded-lg shadow-sm overflow-hidden",children:[(0,r.jsx)("div",{className:"px-6 py-4 bg-gray-50 border-b border-gray-200",children:(0,r.jsx)("h3",{className:"text-lg font-semibold text-gray-900",children:"Your API Keys"})}),s?(0,r.jsx)("div",{className:"px-6 py-12 text-center text-gray-500",children:"Loading API keys..."}):0===e.length?(0,r.jsx)("div",{className:"px-6 py-12 text-center text-gray-500",children:"No API keys yet. Create one to get started."}):(0,r.jsx)("div",{className:"divide-y divide-gray-200",children:e.map(e=>{let t=w(e.expires_at);return(0,r.jsx)("div",{className:"px-6 py-4",children:(0,r.jsxs)("div",{className:"flex items-start justify-between",children:[(0,r.jsxs)("div",{className:"flex-1",children:[(0,r.jsxs)("div",{className:"flex items-center gap-3 mb-2",children:[(0,r.jsx)("h4",{className:"font-medium text-gray-900",children:e.description}),(0,r.jsx)("span",{className:"px-2 py-1 rounded-full text-xs font-medium ".concat(t?"bg-red-100 text-red-800":e.is_active?"bg-green-100 text-green-800":"bg-gray-100 text-gray-800"),children:t?"Expired":e.is_active?"Active":"Inactive"}),(0,r.jsx)("span",{className:"px-2 py-1 rounded-full text-xs font-medium bg-blue-100 text-blue-800",children:e.role})]}),(0,r.jsxs)("div",{className:"space-y-1 text-sm text-gray-600",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("span",{className:"font-medium",children:"Key ID:"}),(0,r.jsx)("code",{className:"px-2 py-0.5 bg-gray-100 rounded font-mono text-xs",children:e.key_id})]}),(0,r.jsxs)("div",{className:"flex items-center gap-4",children:[(0,r.jsxs)("span",{children:[(0,r.jsx)("span",{className:"font-medium",children:"Created:"})," ",k(e.created_at)]}),(0,r.jsxs)("span",{children:[(0,r.jsx)("span",{className:"font-medium",children:"Expires:"})," ",k(e.expires_at)]}),e.last_used&&(0,r.jsxs)("span",{children:[(0,r.jsx)("span",{className:"font-medium",children:"Last used:"})," ",k(e.last_used)]})]})]})]}),(0,r.jsx)("button",{onClick:()=>j(e.key_id),className:"ml-4 px-3 py-1 text-sm text-red-600 hover:text-red-800 hover:bg-red-50 rounded font-medium",children:"Revoke"})]})},e.key_id)})})]}),(0,r.jsxs)("div",{className:"mt-6 p-4 bg-yellow-50 border border-yellow-200 rounded-lg",children:[(0,r.jsx)("h4",{className:"text-sm font-semibold text-yellow-900 mb-2",children:"Security Best Practices"}),(0,r.jsxs)("ul",{className:"text-sm text-yellow-800 space-y-1 list-disc list-inside",children:[(0,r.jsx)("li",{children:"Never share your API keys or commit them to version control"}),(0,r.jsx)("li",{children:"Use environment variables to store keys in your applications"}),(0,r.jsx)("li",{children:"Create separate keys for different applications or environments"}),(0,r.jsx)("li",{children:"Revoke keys immediately if they are compromised"}),(0,r.jsx)("li",{children:"Use the shortest expiry time that meets your needs"})]})]})]})}},7932:(e,t,s)=>{"use strict";function r(e){for(var t=1;t<arguments.length;t++){var s=arguments[t];for(var r in s)e[r]=s[r]}return e}s.d(t,{A:()=>a});var a=function e(t,s){function a(e,a,l){if("undefined"!=typeof document){"number"==typeof(l=r({},s,l)).expires&&(l.expires=new Date(Date.now()+864e5*l.expires)),l.expires&&(l.expires=l.expires.toUTCString()),e=encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var i="";for(var n in l)l[n]&&(i+="; "+n,!0!==l[n]&&(i+="="+l[n].split(";")[0]));return document.cookie=e+"="+t.write(a,e)+i}}return Object.create({set:a,get:function(e){if("undefined"!=typeof document&&(!arguments.length||e)){for(var s=document.cookie?document.cookie.split("; "):[],r={},a=0;a<s.length;a++){var l=s[a].split("="),i=l.slice(1).join("=");try{var n=decodeURIComponent(l[0]);if(r[n]=t.read(i,n),e===n)break}catch(e){}}return e?r[e]:r}},remove:function(e,t){a(e,"",r({},t,{expires:-1}))},withAttributes:function(t){return e(this.converter,r({},this.attributes,t))},withConverter:function(t){return e(r({},this.converter,t),this.attributes)}},{attributes:{value:Object.freeze(s)},converter:{value:Object.freeze(t)}})}({read:function(e){return'"'===e[0]&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}},{path:"/"})},8239:(e,t,s)=>{Promise.resolve().then(s.bind(s,891))}},e=>{var t=t=>e(e.s=t);e.O(0,[704,587,8315,7358],()=>t(8239)),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8884],{891:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>i});var r=s(4568),a=s(7620),l=s(704);function i(){let[e,t]=(0,a.useState)([]),[s,i]=(0,a.useState)(!0),[n,d]=(0,a.useState)(!1),[c,o]=(0,a.useState)(!1),[x,m]=(0,a.useState)(null),[u,h]=(0,a.useState)(""),[p,y]=(0,a.useState)(1440),[b,g]=(0,a.useState)(null),f=async()=>{try{i(!0);let e=new l.CIRISClient,s=await e.auth.listAPIKeys();t(s.api_keys),g(null)}catch(e){console.error("Failed to load API keys:",e),g(e.message||"Failed to load API keys")}finally{i(!1)}};(0,a.useEffect)(()=>{f()},[]);let v=async()=>{if(!u.trim())return void g("Description is required");try{d(!0),g(null);let e=new l.CIRISClient,t=await e.auth.createAPIKey(u.trim(),p);m({api_key:t.api_key,description:t.description,expires_at:t.expires_at}),h(""),y(1440),o(!1),await f()}catch(e){console.error("Failed to create API key:",e),g(e.message||"Failed to create API key")}finally{d(!1)}},j=async e=>{if(confirm("Are you sure you want to revoke this API key? This action cannot be undone."))try{let t=new l.CIRISClient;await t.auth.deleteAPIKey(e),await f(),g(null)}catch(e){console.error("Failed to delete API key:",e),g(e.message||"Failed to delete API key")}},N=e=>{navigator.clipboard.writeText(e)},k=e=>new Date(e).toLocaleString(),w=e=>new Date(e)<new Date;return(0,r.jsxs)("div",{className:"max-w-6xl mx-auto px-4 py-8",children:[(0,r.jsxs)("div",{className:"mb-8",children:[(0,r.jsx)("h1",{className:"text-3xl font-bold text-gray-900",children:"API Keys"}),(0,r.jsx)("p",{className:"mt-2 text-sm text-gray-600",children:"Manage API keys for programmatic access to your CIRIS agent"})]}),b&&(0,r.jsx)("div",{className:"mb-6 p-4 bg-red-50 border border-red-200 rounded-lg",children:(0,r.jsx)("p",{className:"text-sm text-red-800",children:b})}),x&&(0,r.jsxs)("div",{className:"mb-6 p-6 bg-green-50 border-2 border-green-500 rounded-lg",children:[(0,r.jsxs)("div",{className:"flex items-start justify-between mb-4",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("h3",{className:"text-lg font-semibold text-green-900 flex items-center gap-2",children:"API Key Created Successfully"}),(0,r.jsx)("p",{className:"text-sm text-green-700 mt-1",children:"This is the only time you will see this key. Copy it now and store it securely."})]}),(0,r.jsx)("button",{onClick:()=>m(null),className:"text-green-700 hover:text-green-900",children:"✕"})]}),(0,r.jsxs)("div",{className:"space-y-3",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{className:"block text-xs font-medium text-green-900 mb-1",children:"Description"}),(0,r.jsx)("p",{className:"text-sm text-green-800",children:x.description})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{className:"block text-xs font-medium text-green-900 mb-1",children:"API Key"}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)("code",{className:"flex-1 px-3 py-2 bg-white border border-green-300 rounded text-sm font-mono text-gray-900 break-all",children:x.api_key}),(0,r.jsx)("button",{onClick:()=>N(x.api_key),className:"px-4 py-2 bg-green-600 text-white rounded hover:bg-green-700 text-sm font-medium whitespace-nowrap",children:"Copy"})]})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{className:"block text-xs font-medium text-green-900 mb-1",children:"Expires"}),(0,r.jsx)("p",{className:"text-sm text-green-800",children:k(x.expires_at)})]})]})]}),(0,r.jsx)("div",{className:"mb-8",children:c?(0,r.jsxs)("div",{className:"p-6 bg-white border border-gray-200 rounded-lg shadow-sm",children:[(0,r.jsxs)("div",{className:"flex items-start justify-between mb-4",children:[(0,r.jsx)("h3",{className:"text-lg font-semibold text-gray-900",children:"Create New API Key"}),(0,r.jsx)("button",{onClick:()=>{o(!1),h(""),g(null)},className:"text-gray-400 hover:text-gray-600",children:"✕"})]}),(0,r.jsxs)("div",{className:"space-y-4",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Description"}),(0,r.jsx)("input",{type:"text",value:u,onChange:e=>h(e.target.value),placeholder:"e.g., CI/CD pipeline, automation script",className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500"})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Expires In"}),(0,r.jsx)("select",{value:p,onChange:e=>y(Number(e.target.value)),className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500",children:[{value:30,label:"30 minutes"},{value:60,label:"1 hour"},{value:1440,label:"1 day"},{value:10080,label:"7 days"}].map(e=>(0,r.jsx)("option",{value:e.value,children:e.label},e.value))})]}),(0,r.jsxs)("div",{className:"flex gap-3",children:[(0,r.jsx)("button",{onClick:v,disabled:n||!u.trim(),className:"px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 disabled:bg-gray-400 disabled:cursor-not-allowed font-medium",children:n?"Creating...":"Create Key"}),(0,r.jsx)("button",{onClick:()=>{o(!1),h(""),g(null)},className:"px-4 py-2 bg-gray-100 text-gray-700 rounded-lg hover:bg-gray-200 font-medium",children:"Cancel"})]})]})]}):(0,r.jsx)("button",{onClick:()=>o(!0),className:"px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 font-medium",children:"Create New API Key"})}),(0,r.jsxs)("div",{className:"bg-white border border-gray-200 rounded-lg shadow-sm overflow-hidden",children:[(0,r.jsx)("div",{className:"px-6 py-4 bg-gray-50 border-b border-gray-200",children:(0,r.jsx)("h3",{className:"text-lg font-semibold text-gray-900",children:"Your API Keys"})}),s?(0,r.jsx)("div",{className:"px-6 py-12 text-center text-gray-500",children:"Loading API keys..."}):0===e.length?(0,r.jsx)("div",{className:"px-6 py-12 text-center text-gray-500",children:"No API keys yet. Create one to get started."}):(0,r.jsx)("div",{className:"divide-y divide-gray-200",children:e.map(e=>{let t=w(e.expires_at);return(0,r.jsx)("div",{className:"px-6 py-4",children:(0,r.jsxs)("div",{className:"flex items-start justify-between",children:[(0,r.jsxs)("div",{className:"flex-1",children:[(0,r.jsxs)("div",{className:"flex items-center gap-3 mb-2",children:[(0,r.jsx)("h4",{className:"font-medium text-gray-900",children:e.description}),(0,r.jsx)("span",{className:"px-2 py-1 rounded-full text-xs font-medium ".concat(t?"bg-red-100 text-red-800":e.is_active?"bg-green-100 text-green-800":"bg-gray-100 text-gray-800"),children:t?"Expired":e.is_active?"Active":"Inactive"}),(0,r.jsx)("span",{className:"px-2 py-1 rounded-full text-xs font-medium bg-blue-100 text-blue-800",children:e.role})]}),(0,r.jsxs)("div",{className:"space-y-1 text-sm text-gray-600",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("span",{className:"font-medium",children:"Key ID:"}),(0,r.jsx)("code",{className:"px-2 py-0.5 bg-gray-100 rounded font-mono text-xs",children:e.key_id})]}),(0,r.jsxs)("div",{className:"flex items-center gap-4",children:[(0,r.jsxs)("span",{children:[(0,r.jsx)("span",{className:"font-medium",children:"Created:"})," ",k(e.created_at)]}),(0,r.jsxs)("span",{children:[(0,r.jsx)("span",{className:"font-medium",children:"Expires:"})," ",k(e.expires_at)]}),e.last_used&&(0,r.jsxs)("span",{children:[(0,r.jsx)("span",{className:"font-medium",children:"Last used:"})," ",k(e.last_used)]})]})]})]}),(0,r.jsx)("button",{onClick:()=>j(e.key_id),className:"ml-4 px-3 py-1 text-sm text-red-600 hover:text-red-800 hover:bg-red-50 rounded font-medium",children:"Revoke"})]})},e.key_id)})})]}),(0,r.jsxs)("div",{className:"mt-6 p-4 bg-yellow-50 border border-yellow-200 rounded-lg",children:[(0,r.jsx)("h4",{className:"text-sm font-semibold text-yellow-900 mb-2",children:"Security Best Practices"}),(0,r.jsxs)("ul",{className:"text-sm text-yellow-800 space-y-1 list-disc list-inside",children:[(0,r.jsx)("li",{children:"Never share your API keys or commit them to version control"}),(0,r.jsx)("li",{children:"Use environment variables to store keys in your applications"}),(0,r.jsx)("li",{children:"Create separate keys for different applications or environments"}),(0,r.jsx)("li",{children:"Revoke keys immediately if they are compromised"}),(0,r.jsx)("li",{children:"Use the shortest expiry time that meets your needs"})]})]})]})}},7932:(e,t,s)=>{"use strict";function r(e){for(var t=1;t<arguments.length;t++){var s=arguments[t];for(var r in s)e[r]=s[r]}return e}s.d(t,{A:()=>a});var a=function e(t,s){function a(e,a,l){if("undefined"!=typeof document){"number"==typeof(l=r({},s,l)).expires&&(l.expires=new Date(Date.now()+864e5*l.expires)),l.expires&&(l.expires=l.expires.toUTCString()),e=encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var i="";for(var n in l)l[n]&&(i+="; "+n,!0!==l[n]&&(i+="="+l[n].split(";")[0]));return document.cookie=e+"="+t.write(a,e)+i}}return Object.create({set:a,get:function(e){if("undefined"!=typeof document&&(!arguments.length||e)){for(var s=document.cookie?document.cookie.split("; "):[],r={},a=0;a<s.length;a++){var l=s[a].split("="),i=l.slice(1).join("=");try{var n=decodeURIComponent(l[0]);if(r[n]=t.read(i,n),e===n)break}catch(e){}}return e?r[e]:r}},remove:function(e,t){a(e,"",r({},t,{expires:-1}))},withAttributes:function(t){return e(this.converter,r({},this.attributes,t))},withConverter:function(t){return e(r({},this.converter,t),this.attributes)}},{attributes:{value:Object.freeze(s)},converter:{value:Object.freeze(t)}})}({read:function(e){return'"'===e[0]&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}},{path:"/"})},9973:(e,t,s)=>{Promise.resolve().then(s.bind(s,891))}},e=>{var t=t=>e(e.s=t);e.O(0,[704,587,8315,7358],()=>t(9973)),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3575],{3162:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>b});var a=s(4568),r=s(7620),n=s(9484),l=s(704),i=s(6264),c=s(5003),o=s(3457),d=s(1338),x=s(7192),u=s(7261),m=s.n(u);function p(){let{user:e}=(0,n.A)(),[t,s]=(0,r.useState)(null),[d,u]=(0,r.useState)({}),[p,b]=(0,r.useState)(!0),[j,v]=(0,r.useState)(null),[f,N]=(0,r.useState)(!1),[w,S]=(0,r.useState)(!1),[_,C]=(0,r.useState)("none"),[A,P]=(0,r.useState)(!0),[E,k]=(0,r.useState)([]);(0,r.useEffect)(()=>{(async()=>{try{try{let e=await l.AQ.consent.getStatus();P(!0),s(e)}catch(r){var e,t,a;if(console.log("[Consent] Error fetching status:",r),(null==r?void 0:r.status)===404||(null==r||null==(e=r.response)?void 0:e.status)===404||(null==r||null==(t=r.message)?void 0:t.toLowerCase().includes("not found"))||(null==r||null==(a=r.message)?void 0:a.toLowerCase().includes("404")))console.log("[Consent] No consent record found (404), this is normal for new users"),P(!1),s(null);else throw r}let r=await l.AQ.consent.getStreams();u(r.streams);let n=await l.AQ.consent.getPartnershipStatus();C(n.partnership_status),N("pending"===n.partnership_status),"deferred"===n.partnership_status&&k([{from:"agent",timestamp:new Date().toISOString(),message:n.message||"The agent would like to establish a partnership with you."}])}catch(t){console.error("❌ Failed to fetch consent data:",t);let e=(0,x.PE)(t);throw alert("Failed to load consent data: ".concat(e)),t}finally{b(!1)}})()},[]),(0,r.useEffect)(()=>{if(!f)return;let e=setInterval(async()=>{try{let e=await l.AQ.consent.getPartnershipStatus();if(C(e.partnership_status),"pending"!==e.partnership_status)if(N(!1),"accepted"===e.partnership_status){let e=await l.AQ.consent.getStatus();s(e),alert("Partnership approved! You now have PARTNERED consent.")}else"rejected"===e.partnership_status&&alert("Partnership request was declined by the agent.")}catch(s){console.error("❌ Failed to poll partnership status:",s);let t=(0,x.PE)(s);alert("Failed to check partnership status: ".concat(t)),N(!1),clearInterval(e)}},5e3);return()=>clearInterval(e)},[f]);let I=(0,r.useCallback)(async e=>{if(e!==(null==t?void 0:t.stream))if("partnered"===e)S(!0);else try{let t="anonymous"===e?"Switching to ANONYMOUS will create a proactive opt-out and anonymize your data. Continue?":"Switching to TEMPORARY will create a proactive opt-out with 14-day auto-forget. Continue?";if(!confirm(t))return;let a=await l.AQ.consent.grantConsent({stream:e,categories:[],reason:"User proactively opted for ".concat(e," consent (opt-out)")});s(a),alert("Successfully switched to ".concat(e.toUpperCase()," consent mode. This creates a proactive opt-out."))}catch(t){console.error("❌ Failed to change consent stream:",t);let e=(0,x.PE)(t);alert("Failed to change consent stream: ".concat(e)),console.error("Full error object:",{status:null==t?void 0:t.status,detail:null==t?void 0:t.detail,message:null==t?void 0:t.message,type:null==t?void 0:t.type,stack:null==t?void 0:t.stack})}},[t]),D=(0,r.useCallback)(()=>{N(!0),S(!1),alert("Partnership request submitted! The agent will review your request.")},[]);return p?(0,a.jsx)(i.O,{children:(0,a.jsx)("div",{className:"min-h-screen bg-gray-50 flex items-center justify-center",children:(0,a.jsxs)("div",{className:"text-center",children:[(0,a.jsx)("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-indigo-600 mx-auto"}),(0,a.jsx)("p",{className:"mt-4 text-gray-600",children:"Loading consent settings..."})]})})}):(0,a.jsxs)(i.O,{children:[(0,a.jsxs)("div",{className:"min-h-screen bg-gray-50",children:[(0,a.jsx)("div",{className:"bg-white shadow-sm border-b",children:(0,a.jsx)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-4",children:(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h1",{className:"text-2xl font-bold text-gray-900",children:"Account"}),(0,a.jsx)("p",{className:"mt-1 text-sm text-gray-600",children:"Manage your account settings and privacy preferences"})]}),t&&(0,a.jsx)("div",{className:"px-4 py-2 rounded-lg border ".concat((e=>{switch(e){case"temporary":return"bg-yellow-100 text-yellow-800 border-yellow-300";case"partnered":return"bg-green-100 text-green-800 border-green-300";case"anonymous":return"bg-blue-100 text-blue-800 border-blue-300";default:return"bg-gray-100 text-gray-800 border-gray-300"}})(t.stream)),children:(0,a.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,a.jsx)("span",{className:"text-2xl",children:(e=>{switch(e){case"temporary":return"\uD83D\uDEE1️";case"partnered":return"\uD83E\uDD1D";case"anonymous":return"\uD83D\uDC64";default:return"\uD83D\uDCCB"}})(t.stream)}),(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"font-semibold capitalize",children:[t.stream," Mode"]}),"temporary"===t.stream&&(0,a.jsxs)("div",{className:"text-xs",children:["Expires in: ",(()=>{if(!t||"temporary"!==t.stream||!t.expires_at)return null;let e=new Date(t.expires_at),s=new Date,a=e.getTime()-s.getTime();if(a<=0)return"Expired";let r=Math.floor(a/864e5),n=Math.floor(a%864e5/36e5);return"".concat(r," days, ").concat(n," hours")})()]}),f&&(0,a.jsx)("div",{className:"text-xs animate-pulse",children:"Partnership request pending..."})]})]})})]})})}),(0,a.jsx)("div",{className:"bg-white border-b",children:(0,a.jsx)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:(0,a.jsxs)("nav",{className:"flex space-x-8",children:[(0,a.jsx)(m(),{href:"/account",className:"border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300 whitespace-nowrap py-4 px-1 border-b-2 font-medium text-sm",children:"Details"}),(0,a.jsx)("span",{className:"border-indigo-500 text-indigo-600 whitespace-nowrap py-4 px-1 border-b-2 font-medium text-sm",children:"Consent"}),(0,a.jsx)(m(),{href:"/account/privacy",className:"border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300 whitespace-nowrap py-4 px-1 border-b-2 font-medium text-sm",children:"Privacy & Data"})]})})}),(0,a.jsxs)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8",children:[!A&&(0,a.jsxs)("div",{className:"mb-8 bg-yellow-50 border border-yellow-200 rounded-lg p-6",children:[(0,a.jsx)("h3",{className:"text-lg font-medium text-yellow-900 mb-2",children:"Consent Record Not Yet Created"}),(0,a.jsx)("p",{className:"text-yellow-700",children:"Your consent record will be automatically created 6-12 hours after your first Discord interaction with CIRIS. This ensures meaningful engagement before establishing a consent relationship."})]}),(0,a.jsx)(o.u,{partnershipRequests:E}),(0,a.jsx)("div",{className:"mb-8",children:(0,a.jsx)(o.k,{})}),(0,a.jsxs)("div",{className:"mb-8",children:[(0,a.jsx)("h2",{className:"text-lg font-semibold text-gray-900 mb-4",children:"Choose Your Consent Stream"}),(0,a.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:Object.entries(d).map(e=>{let[s,r]=e;return(0,a.jsx)(h,{streamKey:s,stream:r,isActive:(null==t?void 0:t.stream)===s,onSelect:()=>I(s)},s)})})]}),t&&["partnered","anonymous"].includes(t.stream)&&(0,a.jsx)(g,{consentStatus:t}),(0,a.jsx)(y,{}),(0,a.jsx)("div",{className:"mt-8 text-center text-xs text-gray-500",children:(0,a.jsxs)("p",{children:["You can only view and manage your own consent settings.",(null==e?void 0:e.role)==="ADMIN"&&" As an admin, you can view (but not modify) consent records for compliance purposes."]})})]})]}),(0,a.jsx)(c.A,{isOpen:w,onClose:()=>S(!1),onSuccess:D})]})}function h(e){let{streamKey:t,stream:s,isActive:r,onSelect:n}=e;return(0,a.jsxs)("div",{className:"border rounded-lg p-6 ".concat(r?"border-indigo-500 bg-indigo-50":"border-gray-200 bg-white"),children:[(0,a.jsxs)("div",{className:"text-center mb-4",children:[(0,a.jsx)("span",{className:"text-4xl",children:(()=>{switch(t){case"temporary":return"\uD83D\uDEE1️";case"partnered":return"\uD83E\uDD1D";case"anonymous":return"\uD83D\uDC64";default:return"\uD83D\uDCCB"}})()}),(0,a.jsx)("h3",{className:"mt-2 text-lg font-semibold capitalize",children:s.name})]}),(0,a.jsx)("p",{className:"text-sm text-gray-600 mb-4",children:s.description}),(0,a.jsx)("ul",{className:"space-y-1 mb-4",children:(()=>{switch(t){case"temporary":return["✓ No tracking","✓ Auto-forget in 14 days","✗ No learning"];case"partnered":return["✓ Mutual growth","✓ Personalized experience","✓ Full features"];case"anonymous":return["✓ Help others","✓ No identity stored","✓ Statistical contribution"];default:return[]}})().map((e,t)=>(0,a.jsx)("li",{className:"text-sm",children:e},t))}),s.duration_days&&(0,a.jsxs)("p",{className:"text-xs text-gray-500 mb-4",children:["Duration: ",s.duration_days," days"]}),s.requires_categories&&(0,a.jsx)("p",{className:"text-xs text-orange-600 mb-4",children:"⚠️ Requires agent approval"}),(0,a.jsx)("button",{onClick:n,disabled:r,className:"w-full py-2 px-4 rounded-md text-sm font-medium ".concat(r?"bg-gray-100 text-gray-400 cursor-not-allowed":"bg-indigo-600 text-white hover:bg-indigo-700"),children:r?"Current Stream":"partnered"===t?"Request Partnership":"Switch Stream"})]})}function g(e){let{consentStatus:t}=e,[s,n]=(0,r.useState)(null),[i,c]=(0,r.useState)(!0);return((0,r.useEffect)(()=>{(async()=>{try{let e=await l.AQ.consent.getImpactReport();n(e)}catch(e){console.error("❌ Failed to fetch impact data:",e),console.error("Impact error details:",{status:null==e?void 0:e.status,detail:null==e?void 0:e.detail,message:null==e?void 0:e.message})}finally{c(!1)}})()},[]),i)?(0,a.jsx)("div",{className:"animate-pulse h-32 bg-gray-200 rounded-lg"}):s?(0,a.jsxs)("div",{className:"mb-8 bg-white rounded-lg shadow p-6",children:[(0,a.jsx)("h2",{className:"text-lg font-semibold text-gray-900 mb-4",children:"Your Impact"}),(0,a.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-4",children:[(0,a.jsxs)("div",{className:"text-center",children:[(0,a.jsx)("div",{className:"text-3xl font-bold text-indigo-600",children:s.total_interactions}),(0,a.jsx)("div",{className:"text-sm text-gray-600",children:"Total Interactions"})]}),(0,a.jsxs)("div",{className:"text-center",children:[(0,a.jsx)("div",{className:"text-3xl font-bold text-green-600",children:s.patterns_contributed}),(0,a.jsx)("div",{className:"text-sm text-gray-600",children:"Patterns Contributed"})]}),(0,a.jsxs)("div",{className:"text-center",children:[(0,a.jsx)("div",{className:"text-3xl font-bold text-blue-600",children:s.users_helped}),(0,a.jsx)("div",{className:"text-sm text-gray-600",children:"Users Helped"})]}),(0,a.jsxs)("div",{className:"text-center",children:[(0,a.jsx)("div",{className:"text-3xl font-bold text-purple-600",children:s.impact_score.toFixed(1)}),(0,a.jsx)("div",{className:"text-sm text-gray-600",children:"Impact Score"})]})]})]}):null}function y(){let[e,t]=(0,r.useState)([]),[s,n]=(0,r.useState)(!0);return(0,r.useEffect)(()=>{(async()=>{try{let e=await l.AQ.consent.getAuditTrail(10);t(e)}catch(e){console.error("❌ Failed to fetch audit trail:",e),console.error("Audit error details:",{status:null==e?void 0:e.status,detail:null==e?void 0:e.detail,message:null==e?void 0:e.message})}finally{n(!1)}})()},[]),(0,a.jsxs)("div",{className:"bg-white rounded-lg shadow p-6",children:[(0,a.jsx)("h2",{className:"text-lg font-semibold text-gray-900 mb-4",children:"Consent History"}),s?(0,a.jsx)("div",{className:"animate-pulse space-y-2",children:[1,2,3].map(e=>(0,a.jsx)("div",{className:"h-12 bg-gray-200 rounded"},e))}):0===e.length?(0,a.jsx)("p",{className:"text-gray-500",children:"No consent changes recorded"}):(0,a.jsx)("div",{className:"overflow-x-auto",children:(0,a.jsxs)("table",{className:"min-w-full divide-y divide-gray-200",children:[(0,a.jsx)("thead",{children:(0,a.jsxs)("tr",{children:[(0,a.jsx)("th",{className:"px-4 py-2 text-left text-xs font-medium text-gray-500 uppercase",children:"Date"}),(0,a.jsx)("th",{className:"px-4 py-2 text-left text-xs font-medium text-gray-500 uppercase",children:"Previous"}),(0,a.jsx)("th",{className:"px-4 py-2 text-left text-xs font-medium text-gray-500 uppercase",children:"New"}),(0,a.jsx)("th",{className:"px-4 py-2 text-left text-xs font-medium text-gray-500 uppercase",children:"Initiated By"}),(0,a.jsx)("th",{className:"px-4 py-2 text-left text-xs font-medium text-gray-500 uppercase",children:"Reason"})]})}),(0,a.jsx)("tbody",{className:"divide-y divide-gray-200",children:e.map(e=>(0,a.jsxs)("tr",{children:[(0,a.jsx)("td",{className:"px-4 py-2 text-sm text-gray-900",children:new Date(e.timestamp).toLocaleDateString()}),(0,a.jsx)("td",{className:"px-4 py-2 text-sm capitalize",children:e.previous_stream}),(0,a.jsx)("td",{className:"px-4 py-2 text-sm capitalize",children:e.new_stream}),(0,a.jsx)("td",{className:"px-4 py-2 text-sm",children:e.initiated_by}),(0,a.jsx)("td",{className:"px-4 py-2 text-sm text-gray-600",children:e.reason||"-"})]},e.entry_id))})]})})]})}function b(){return(0,a.jsx)(d.L,{children:(0,a.jsx)(p,{})})}},9090:(e,t,s)=>{Promise.resolve().then(s.bind(s,3162))}},e=>{var t=t=>e(e.s=t);e.O(0,[4534,8072,704,4499,587,8315,7358],()=>t(9090)),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3575],{2660:(e,t,s)=>{Promise.resolve().then(s.bind(s,3162))},3162:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>b});var a=s(4568),r=s(7620),n=s(9484),l=s(704),i=s(6264),c=s(5003),o=s(3457),d=s(1338),x=s(7192),u=s(7261),m=s.n(u);function p(){let{user:e}=(0,n.A)(),[t,s]=(0,r.useState)(null),[d,u]=(0,r.useState)({}),[p,b]=(0,r.useState)(!0),[j,v]=(0,r.useState)(null),[f,N]=(0,r.useState)(!1),[w,S]=(0,r.useState)(!1),[_,C]=(0,r.useState)("none"),[A,P]=(0,r.useState)(!0),[E,k]=(0,r.useState)([]);(0,r.useEffect)(()=>{(async()=>{try{try{let e=await l.AQ.consent.getStatus();P(!0),s(e)}catch(r){var e,t,a;if(console.log("[Consent] Error fetching status:",r),(null==r?void 0:r.status)===404||(null==r||null==(e=r.response)?void 0:e.status)===404||(null==r||null==(t=r.message)?void 0:t.toLowerCase().includes("not found"))||(null==r||null==(a=r.message)?void 0:a.toLowerCase().includes("404")))console.log("[Consent] No consent record found (404), this is normal for new users"),P(!1),s(null);else throw r}let r=await l.AQ.consent.getStreams();u(r.streams);let n=await l.AQ.consent.getPartnershipStatus();C(n.partnership_status),N("pending"===n.partnership_status),"deferred"===n.partnership_status&&k([{from:"agent",timestamp:new Date().toISOString(),message:n.message||"The agent would like to establish a partnership with you."}])}catch(t){console.error("❌ Failed to fetch consent data:",t);let e=(0,x.PE)(t);throw alert("Failed to load consent data: ".concat(e)),t}finally{b(!1)}})()},[]),(0,r.useEffect)(()=>{if(!f)return;let e=setInterval(async()=>{try{let e=await l.AQ.consent.getPartnershipStatus();if(C(e.partnership_status),"pending"!==e.partnership_status)if(N(!1),"accepted"===e.partnership_status){let e=await l.AQ.consent.getStatus();s(e),alert("Partnership approved! You now have PARTNERED consent.")}else"rejected"===e.partnership_status&&alert("Partnership request was declined by the agent.")}catch(s){console.error("❌ Failed to poll partnership status:",s);let t=(0,x.PE)(s);alert("Failed to check partnership status: ".concat(t)),N(!1),clearInterval(e)}},5e3);return()=>clearInterval(e)},[f]);let I=(0,r.useCallback)(async e=>{if(e!==(null==t?void 0:t.stream))if("partnered"===e)S(!0);else try{let t="anonymous"===e?"Switching to ANONYMOUS will create a proactive opt-out and anonymize your data. Continue?":"Switching to TEMPORARY will create a proactive opt-out with 14-day auto-forget. Continue?";if(!confirm(t))return;let a=await l.AQ.consent.grantConsent({stream:e,categories:[],reason:"User proactively opted for ".concat(e," consent (opt-out)")});s(a),alert("Successfully switched to ".concat(e.toUpperCase()," consent mode. This creates a proactive opt-out."))}catch(t){console.error("❌ Failed to change consent stream:",t);let e=(0,x.PE)(t);alert("Failed to change consent stream: ".concat(e)),console.error("Full error object:",{status:null==t?void 0:t.status,detail:null==t?void 0:t.detail,message:null==t?void 0:t.message,type:null==t?void 0:t.type,stack:null==t?void 0:t.stack})}},[t]),D=(0,r.useCallback)(()=>{N(!0),S(!1),alert("Partnership request submitted! The agent will review your request.")},[]);return p?(0,a.jsx)(i.O,{children:(0,a.jsx)("div",{className:"min-h-screen bg-gray-50 flex items-center justify-center",children:(0,a.jsxs)("div",{className:"text-center",children:[(0,a.jsx)("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-indigo-600 mx-auto"}),(0,a.jsx)("p",{className:"mt-4 text-gray-600",children:"Loading consent settings..."})]})})}):(0,a.jsxs)(i.O,{children:[(0,a.jsxs)("div",{className:"min-h-screen bg-gray-50",children:[(0,a.jsx)("div",{className:"bg-white shadow-sm border-b",children:(0,a.jsx)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-4",children:(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h1",{className:"text-2xl font-bold text-gray-900",children:"Account"}),(0,a.jsx)("p",{className:"mt-1 text-sm text-gray-600",children:"Manage your account settings and privacy preferences"})]}),t&&(0,a.jsx)("div",{className:"px-4 py-2 rounded-lg border ".concat((e=>{switch(e){case"temporary":return"bg-yellow-100 text-yellow-800 border-yellow-300";case"partnered":return"bg-green-100 text-green-800 border-green-300";case"anonymous":return"bg-blue-100 text-blue-800 border-blue-300";default:return"bg-gray-100 text-gray-800 border-gray-300"}})(t.stream)),children:(0,a.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,a.jsx)("span",{className:"text-2xl",children:(e=>{switch(e){case"temporary":return"\uD83D\uDEE1️";case"partnered":return"\uD83E\uDD1D";case"anonymous":return"\uD83D\uDC64";default:return"\uD83D\uDCCB"}})(t.stream)}),(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"font-semibold capitalize",children:[t.stream," Mode"]}),"temporary"===t.stream&&(0,a.jsxs)("div",{className:"text-xs",children:["Expires in: ",(()=>{if(!t||"temporary"!==t.stream||!t.expires_at)return null;let e=new Date(t.expires_at),s=new Date,a=e.getTime()-s.getTime();if(a<=0)return"Expired";let r=Math.floor(a/864e5),n=Math.floor(a%864e5/36e5);return"".concat(r," days, ").concat(n," hours")})()]}),f&&(0,a.jsx)("div",{className:"text-xs animate-pulse",children:"Partnership request pending..."})]})]})})]})})}),(0,a.jsx)("div",{className:"bg-white border-b",children:(0,a.jsx)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:(0,a.jsxs)("nav",{className:"flex space-x-8",children:[(0,a.jsx)(m(),{href:"/account",className:"border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300 whitespace-nowrap py-4 px-1 border-b-2 font-medium text-sm",children:"Details"}),(0,a.jsx)("span",{className:"border-indigo-500 text-indigo-600 whitespace-nowrap py-4 px-1 border-b-2 font-medium text-sm",children:"Consent"}),(0,a.jsx)(m(),{href:"/account/privacy",className:"border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300 whitespace-nowrap py-4 px-1 border-b-2 font-medium text-sm",children:"Privacy & Data"})]})})}),(0,a.jsxs)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8",children:[!A&&(0,a.jsxs)("div",{className:"mb-8 bg-yellow-50 border border-yellow-200 rounded-lg p-6",children:[(0,a.jsx)("h3",{className:"text-lg font-medium text-yellow-900 mb-2",children:"Consent Record Not Yet Created"}),(0,a.jsx)("p",{className:"text-yellow-700",children:"Your consent record will be automatically created 6-12 hours after your first Discord interaction with CIRIS. This ensures meaningful engagement before establishing a consent relationship."})]}),(0,a.jsx)(o.u,{partnershipRequests:E}),(0,a.jsx)("div",{className:"mb-8",children:(0,a.jsx)(o.k,{})}),(0,a.jsxs)("div",{className:"mb-8",children:[(0,a.jsx)("h2",{className:"text-lg font-semibold text-gray-900 mb-4",children:"Choose Your Consent Stream"}),(0,a.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:Object.entries(d).map(e=>{let[s,r]=e;return(0,a.jsx)(h,{streamKey:s,stream:r,isActive:(null==t?void 0:t.stream)===s,onSelect:()=>I(s)},s)})})]}),t&&["partnered","anonymous"].includes(t.stream)&&(0,a.jsx)(g,{consentStatus:t}),(0,a.jsx)(y,{}),(0,a.jsx)("div",{className:"mt-8 text-center text-xs text-gray-500",children:(0,a.jsxs)("p",{children:["You can only view and manage your own consent settings.",(null==e?void 0:e.role)==="ADMIN"&&" As an admin, you can view (but not modify) consent records for compliance purposes."]})})]})]}),(0,a.jsx)(c.A,{isOpen:w,onClose:()=>S(!1),onSuccess:D})]})}function h(e){let{streamKey:t,stream:s,isActive:r,onSelect:n}=e;return(0,a.jsxs)("div",{className:"border rounded-lg p-6 ".concat(r?"border-indigo-500 bg-indigo-50":"border-gray-200 bg-white"),children:[(0,a.jsxs)("div",{className:"text-center mb-4",children:[(0,a.jsx)("span",{className:"text-4xl",children:(()=>{switch(t){case"temporary":return"\uD83D\uDEE1️";case"partnered":return"\uD83E\uDD1D";case"anonymous":return"\uD83D\uDC64";default:return"\uD83D\uDCCB"}})()}),(0,a.jsx)("h3",{className:"mt-2 text-lg font-semibold capitalize",children:s.name})]}),(0,a.jsx)("p",{className:"text-sm text-gray-600 mb-4",children:s.description}),(0,a.jsx)("ul",{className:"space-y-1 mb-4",children:(()=>{switch(t){case"temporary":return["✓ No tracking","✓ Auto-forget in 14 days","✗ No learning"];case"partnered":return["✓ Mutual growth","✓ Personalized experience","✓ Full features"];case"anonymous":return["✓ Help others","✓ No identity stored","✓ Statistical contribution"];default:return[]}})().map((e,t)=>(0,a.jsx)("li",{className:"text-sm",children:e},t))}),s.duration_days&&(0,a.jsxs)("p",{className:"text-xs text-gray-500 mb-4",children:["Duration: ",s.duration_days," days"]}),s.requires_categories&&(0,a.jsx)("p",{className:"text-xs text-orange-600 mb-4",children:"⚠️ Requires agent approval"}),(0,a.jsx)("button",{onClick:n,disabled:r,className:"w-full py-2 px-4 rounded-md text-sm font-medium ".concat(r?"bg-gray-100 text-gray-400 cursor-not-allowed":"bg-indigo-600 text-white hover:bg-indigo-700"),children:r?"Current Stream":"partnered"===t?"Request Partnership":"Switch Stream"})]})}function g(e){let{consentStatus:t}=e,[s,n]=(0,r.useState)(null),[i,c]=(0,r.useState)(!0);return((0,r.useEffect)(()=>{(async()=>{try{let e=await l.AQ.consent.getImpactReport();n(e)}catch(e){console.error("❌ Failed to fetch impact data:",e),console.error("Impact error details:",{status:null==e?void 0:e.status,detail:null==e?void 0:e.detail,message:null==e?void 0:e.message})}finally{c(!1)}})()},[]),i)?(0,a.jsx)("div",{className:"animate-pulse h-32 bg-gray-200 rounded-lg"}):s?(0,a.jsxs)("div",{className:"mb-8 bg-white rounded-lg shadow p-6",children:[(0,a.jsx)("h2",{className:"text-lg font-semibold text-gray-900 mb-4",children:"Your Impact"}),(0,a.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-4",children:[(0,a.jsxs)("div",{className:"text-center",children:[(0,a.jsx)("div",{className:"text-3xl font-bold text-indigo-600",children:s.total_interactions}),(0,a.jsx)("div",{className:"text-sm text-gray-600",children:"Total Interactions"})]}),(0,a.jsxs)("div",{className:"text-center",children:[(0,a.jsx)("div",{className:"text-3xl font-bold text-green-600",children:s.patterns_contributed}),(0,a.jsx)("div",{className:"text-sm text-gray-600",children:"Patterns Contributed"})]}),(0,a.jsxs)("div",{className:"text-center",children:[(0,a.jsx)("div",{className:"text-3xl font-bold text-blue-600",children:s.users_helped}),(0,a.jsx)("div",{className:"text-sm text-gray-600",children:"Users Helped"})]}),(0,a.jsxs)("div",{className:"text-center",children:[(0,a.jsx)("div",{className:"text-3xl font-bold text-purple-600",children:s.impact_score.toFixed(1)}),(0,a.jsx)("div",{className:"text-sm text-gray-600",children:"Impact Score"})]})]})]}):null}function y(){let[e,t]=(0,r.useState)([]),[s,n]=(0,r.useState)(!0);return(0,r.useEffect)(()=>{(async()=>{try{let e=await l.AQ.consent.getAuditTrail(10);t(e)}catch(e){console.error("❌ Failed to fetch audit trail:",e),console.error("Audit error details:",{status:null==e?void 0:e.status,detail:null==e?void 0:e.detail,message:null==e?void 0:e.message})}finally{n(!1)}})()},[]),(0,a.jsxs)("div",{className:"bg-white rounded-lg shadow p-6",children:[(0,a.jsx)("h2",{className:"text-lg font-semibold text-gray-900 mb-4",children:"Consent History"}),s?(0,a.jsx)("div",{className:"animate-pulse space-y-2",children:[1,2,3].map(e=>(0,a.jsx)("div",{className:"h-12 bg-gray-200 rounded"},e))}):0===e.length?(0,a.jsx)("p",{className:"text-gray-500",children:"No consent changes recorded"}):(0,a.jsx)("div",{className:"overflow-x-auto",children:(0,a.jsxs)("table",{className:"min-w-full divide-y divide-gray-200",children:[(0,a.jsx)("thead",{children:(0,a.jsxs)("tr",{children:[(0,a.jsx)("th",{className:"px-4 py-2 text-left text-xs font-medium text-gray-500 uppercase",children:"Date"}),(0,a.jsx)("th",{className:"px-4 py-2 text-left text-xs font-medium text-gray-500 uppercase",children:"Previous"}),(0,a.jsx)("th",{className:"px-4 py-2 text-left text-xs font-medium text-gray-500 uppercase",children:"New"}),(0,a.jsx)("th",{className:"px-4 py-2 text-left text-xs font-medium text-gray-500 uppercase",children:"Initiated By"}),(0,a.jsx)("th",{className:"px-4 py-2 text-left text-xs font-medium text-gray-500 uppercase",children:"Reason"})]})}),(0,a.jsx)("tbody",{className:"divide-y divide-gray-200",children:e.map(e=>(0,a.jsxs)("tr",{children:[(0,a.jsx)("td",{className:"px-4 py-2 text-sm text-gray-900",children:new Date(e.timestamp).toLocaleDateString()}),(0,a.jsx)("td",{className:"px-4 py-2 text-sm capitalize",children:e.previous_stream}),(0,a.jsx)("td",{className:"px-4 py-2 text-sm capitalize",children:e.new_stream}),(0,a.jsx)("td",{className:"px-4 py-2 text-sm",children:e.initiated_by}),(0,a.jsx)("td",{className:"px-4 py-2 text-sm text-gray-600",children:e.reason||"-"})]},e.entry_id))})]})})]})}function b(){return(0,a.jsx)(d.L,{children:(0,a.jsx)(p,{})})}}},e=>{var t=t=>e(e.s=t);e.O(0,[4534,8072,704,4499,587,8315,7358],()=>t(2660)),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1298],{589:(e,t,s)=>{"use strict";s.d(t,{$:()=>l,s:()=>n});var i=s(494),a=s(6759),r=s(1279),n=class extends a.k{#e;#t;#s;constructor(e){super(),this.mutationId=e.mutationId,this.#t=e.mutationCache,this.#e=[],this.state=e.state||l(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#e.includes(e)||(this.#e.push(e),this.clearGcTimeout(),this.#t.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#e=this.#e.filter(t=>t!==e),this.scheduleGc(),this.#t.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#e.length||("pending"===this.state.status?this.scheduleGc():this.#t.remove(this))}continue(){return this.#s?.continue()??this.execute(this.state.variables)}async execute(e){let t=()=>{this.#i({type:"continue"})};this.#s=(0,r.II)({fn:()=>this.options.mutationFn?this.options.mutationFn(e):Promise.reject(Error("No mutationFn found")),onFail:(e,t)=>{this.#i({type:"failed",failureCount:e,error:t})},onPause:()=>{this.#i({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#t.canRun(this)});let s="pending"===this.state.status,i=!this.#s.canStart();try{if(s)t();else{this.#i({type:"pending",variables:e,isPaused:i}),await this.#t.config.onMutate?.(e,this);let t=await this.options.onMutate?.(e);t!==this.state.context&&this.#i({type:"pending",context:t,variables:e,isPaused:i})}let a=await this.#s.start();return await this.#t.config.onSuccess?.(a,e,this.state.context,this),await this.options.onSuccess?.(a,e,this.state.context),await this.#t.config.onSettled?.(a,null,this.state.variables,this.state.context,this),await this.options.onSettled?.(a,null,e,this.state.context),this.#i({type:"success",data:a}),a}catch(t){try{throw await this.#t.config.onError?.(t,e,this.state.context,this),await this.options.onError?.(t,e,this.state.context),await this.#t.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this),await this.options.onSettled?.(void 0,t,e,this.state.context),t}finally{this.#i({type:"error",error:t})}}finally{this.#t.runNext(this)}}#i(e){this.state=(t=>{switch(e.type){case"failed":return{...t,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...t,isPaused:!0};case"continue":return{...t,isPaused:!1};case"pending":return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}})(this.state),i.jG.batch(()=>{this.#e.forEach(t=>{t.onMutationUpdate(e)}),this.#t.notify({mutation:this,type:"updated",action:e})})}};function l(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}},2639:(e,t,s)=>{Promise.resolve().then(s.bind(s,9667))},4893:(e,t,s)=>{"use strict";s.d(t,{DP:()=>v,HG:()=>u,Nl:()=>o,O4:()=>d,Pi:()=>n,RR:()=>x,RY:()=>m,Rv:()=>f,XR:()=>l,Zu:()=>y,bN:()=>g,c1:()=>N,fC:()=>w,fK:()=>j,lm:()=>p,md:()=>R,mo:()=>r,uc:()=>b,ui:()=>c,vK:()=>h,xZ:()=>M,xm:()=>C});var i=s(4568);s(7620);let a={xs:{width:12,height:12},sm:{width:16,height:16},md:{width:20,height:20},lg:{width:24,height:24}},r=e=>{let{className:t="",size:s="md"}=e,{width:r,height:n}=a[s];return(0,i.jsx)("svg",{className:t,width:r,height:n,viewBox:"0 0 20 20",fill:"currentColor",children:(0,i.jsx)("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z",clipRule:"evenodd"})})},n=e=>{let{className:t="",size:s="md"}=e,{width:r,height:n}=a[s];return(0,i.jsx)("svg",{className:t,width:r,height:n,viewBox:"0 0 20 20",fill:"currentColor",children:(0,i.jsx)("path",{fillRule:"evenodd",d:"M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z",clipRule:"evenodd"})})},l=e=>{let{className:t="",size:s="md"}=e,{width:r,height:n}=a[s];return(0,i.jsx)("svg",{className:t,width:r,height:n,viewBox:"0 0 20 20",fill:"currentColor",children:(0,i.jsx)("path",{d:"M11 17a1 1 0 001.447.894l4-2A1 1 0 0017 15V9.236a1 1 0 00-1.447-.894l-4 2a1 1 0 00-.553.894V17zM15.211 6.276a1 1 0 000-1.788l-4.764-2.382a1 1 0 00-.894 0L4.789 4.488a1 1 0 000 1.788l4.764 2.382a1 1 0 00.894 0l4.764-2.382zM4.447 8.342A1 1 0 003 9.236V15a1 1 0 00.553.894l4 2A1 1 0 009 17v-5.764a1 1 0 00-.553-.894l-4-2z"})})},o=e=>{let{className:t="",size:s="md"}=e,{width:r,height:n}=a[s];return(0,i.jsxs)("svg",{className:"animate-spin ".concat(t),width:r,height:n,xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[(0,i.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,i.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]})},c=e=>{let{className:t="",size:s="md"}=e,{width:r,height:n}=a[s];return(0,i.jsx)("svg",{className:t,width:r,height:n,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",children:(0,i.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,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"})})},d=e=>{let{className:t="",size:s="md"}=e,{width:r,height:n}=a[s];return(0,i.jsx)("svg",{className:t,width:r,height:n,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",children:(0,i.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"})})},u=e=>{let{className:t="",size:s="md"}=e,{width:r,height:n}=a[s];return(0,i.jsx)("svg",{className:t,width:r,height:n,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",children:(0,i.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 3v2m6-2v2M9 19v2m6-2v2M5 9H3m2 6H3m18-6h-2m2 6h-2M7 19h10a2 2 0 002-2V7a2 2 0 00-2-2H7a2 2 0 00-2 2v10a2 2 0 002 2zM9 9h6v6H9V9z"})})},h=e=>{let{className:t="",size:s="md"}=e,{width:r,height:n}=a[s];return(0,i.jsx)("svg",{className:t,width:r,height:n,viewBox:"0 0 20 20",fill:"currentColor",children:(0,i.jsx)("path",{fillRule:"evenodd",d:"M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z",clipRule:"evenodd"})})},m=e=>{let{className:t="",size:s="md"}=e,{width:r,height:n}=a[s];return(0,i.jsx)("svg",{className:t,width:r,height:n,viewBox:"0 0 20 20",fill:"currentColor",children:(0,i.jsx)("path",{fillRule:"evenodd",d:"M18 8a6 6 0 01-7.743 5.743L10 14l-1 1-1 1H6v2H2v-4l4.257-4.257A6 6 0 1118 8zm-6-4a1 1 0 100 2 2 2 0 012 2 1 1 0 102 0 4 4 0 00-4-4z",clipRule:"evenodd"})})},x=e=>{let{className:t="",size:s="md"}=e,{width:r,height:n}=a[s];return(0,i.jsx)("svg",{className:t,width:r,height:n,viewBox:"0 0 20 20",fill:"currentColor",children:(0,i.jsx)("path",{fillRule:"evenodd",d:"M2 5a2 2 0 012-2h12a2 2 0 012 2v2a2 2 0 01-2 2H4a2 2 0 01-2-2V5zm14 1a1 1 0 11-2 0 1 1 0 012 0zM2 13a2 2 0 012-2h12a2 2 0 012 2v2a2 2 0 01-2 2H4a2 2 0 01-2-2v-2zm14 1a1 1 0 11-2 0 1 1 0 012 0z",clipRule:"evenodd"})})},g=e=>{let{className:t="",size:s="md"}=e,{width:r,height:n}=a[s];return(0,i.jsxs)("svg",{className:t,width:r,height:n,viewBox:"0 0 20 20",fill:"currentColor",children:[(0,i.jsx)("path",{d:"M3 12v3c0 1.657 3.134 3 7 3s7-1.343 7-3v-3c0 1.657-3.134 3-7 3s-7-1.343-7-3z"}),(0,i.jsx)("path",{d:"M3 7v3c0 1.657 3.134 3 7 3s7-1.343 7-3V7c0 1.657-3.134 3-7 3S3 8.657 3 7z"}),(0,i.jsx)("path",{d:"M17 5c0 1.657-3.134 3-7 3S3 6.657 3 5s3.134-3 7-3 7 1.343 7 3z"})]})},p=e=>{let{className:t="",size:s="md"}=e,{width:r,height:n}=a[s];return(0,i.jsx)("svg",{className:t,width:r,height:n,viewBox:"0 0 20 20",fill:"currentColor",children:(0,i.jsx)("path",{fillRule:"evenodd",d:"M2.166 4.999A11.954 11.954 0 0010 1.944 11.954 11.954 0 0017.834 5c.11.65.166 1.32.166 2.001 0 5.225-3.34 9.67-8 11.317C5.34 16.67 2 12.225 2 7c0-.682.057-1.35.166-2.001zm11.541 3.708a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z",clipRule:"evenodd"})})},v=e=>{let{className:t="",size:s="md"}=e,{width:r,height:n}=a[s];return(0,i.jsx)("svg",{className:t,width:r,height:n,viewBox:"0 0 20 20",fill:"currentColor",children:(0,i.jsx)("path",{fillRule:"evenodd",d:"M11.49 3.17c-.38-1.56-2.6-1.56-2.98 0a1.532 1.532 0 01-2.286.948c-1.372-.836-2.942.734-2.106 2.106.54.886.061 2.042-.947 2.287-1.561.379-1.561 2.6 0 2.978a1.532 1.532 0 01.947 2.287c-.836 1.372.734 2.942 2.106 2.106a1.532 1.532 0 012.287.947c.379 1.561 2.6 1.561 2.978 0a1.533 1.533 0 012.287-.947c1.372.836 2.942-.734 2.106-2.106a1.533 1.533 0 01.947-2.287c1.561-.379 1.561-2.6 0-2.978a1.532 1.532 0 01-.947-2.287c.836-1.372-.734-2.942-2.106-2.106a1.532 1.532 0 01-2.287-.947zM10 13a3 3 0 100-6 3 3 0 000 6z",clipRule:"evenodd"})})},f=e=>{let{className:t="",size:s="md"}=e,{width:r,height:n}=a[s];return(0,i.jsx)("svg",{className:t,width:r,height:n,viewBox:"0 0 20 20",fill:"currentColor",children:(0,i.jsx)("path",{d:"M8 9a3 3 0 100-6 3 3 0 000 6zM8 11a6 6 0 016 6H2a6 6 0 016-6zM16 7a1 1 0 10-2 0v1h-1a1 1 0 100 2h1v1a1 1 0 102 0v-1h1a1 1 0 100-2h-1V7z"})})},j=e=>{let{className:t="",size:s="md"}=e,{width:r,height:n}=a[s];return(0,i.jsx)("svg",{className:t,width:r,height:n,viewBox:"0 0 20 20",fill:"currentColor",children:(0,i.jsx)("path",{fillRule:"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z",clipRule:"evenodd"})})},y=e=>{let{className:t="",size:s="md"}=e,{width:r,height:n}=a[s];return(0,i.jsx)("svg",{className:t,width:r,height:n,viewBox:"0 0 20 20",fill:"currentColor",children:(0,i.jsx)("path",{fillRule:"evenodd",d:"M2.166 4.999A11.954 11.954 0 0010 1.944 11.954 11.954 0 0017.834 5c.11.65.166 1.32.166 2.001 0 5.225-3.34 9.67-8 11.317C5.34 16.67 2 12.225 2 7c0-.682.057-1.35.166-2.001zm11.541 3.708a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z",clipRule:"evenodd"})})},b=e=>{let{className:t="",size:s="md"}=e,{width:r,height:n}=a[s];return(0,i.jsx)("svg",{className:t,width:r,height:n,viewBox:"0 0 20 20",fill:"currentColor",children:(0,i.jsx)("path",{fillRule:"evenodd",d:"M9 2a1 1 0 00-.894.553L7.382 4H4a1 1 0 000 2v10a2 2 0 002 2h8a2 2 0 002-2V6a1 1 0 100-2h-3.382l-.724-1.447A1 1 0 0011 2H9zM7 8a1 1 0 012 0v6a1 1 0 11-2 0V8zm5-1a1 1 0 00-1 1v6a1 1 0 102 0V8a1 1 0 00-1-1z",clipRule:"evenodd"})})},N=e=>{let{className:t="",size:s="md"}=e,{width:r,height:n}=a[s];return(0,i.jsx)("svg",{className:t,width:r,height:n,viewBox:"0 0 20 20",fill:"currentColor",children:(0,i.jsx)("path",{fillRule:"evenodd",d:"M10 3a1 1 0 011 1v5h5a1 1 0 110 2h-5v5a1 1 0 11-2 0v-5H4a1 1 0 110-2h5V4a1 1 0 011-1z",clipRule:"evenodd"})})},w=e=>{let{className:t="",size:s="md"}=e,{width:r,height:n}=a[s];return(0,i.jsx)("svg",{className:t,width:r,height:n,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",children:(0,i.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3.055 11H5a2 2 0 012 2v1a2 2 0 002 2 2 2 0 012 2v2.945M8 3.935V5.5A2.5 2.5 0 0010.5 8h.5a2 2 0 012 2 2 2 0 104 0 2 2 0 012-2h1.064M15 20.488V18a2 2 0 012-2h3.064M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})})},M=e=>{let{className:t="",size:s="md"}=e,{width:r,height:n}=a[s];return(0,i.jsx)("svg",{className:t,width:r,height:n,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",children:(0,i.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 10V3L4 14h7v7l9-11h-7z"})})},C=e=>{let{className:t="",size:s="md"}=e,{width:r,height:n}=a[s];return(0,i.jsx)("svg",{className:t,width:r,height:n,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",children:(0,i.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,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"})})},R=e=>{let{status:t,className:s=""}=e;return(0,i.jsx)("span",{className:"w-3 h-3 rounded-full ".concat({green:"bg-green-500",yellow:"bg-yellow-500",red:"bg-red-500",gray:"bg-gray-500"}[t]," ").concat(s)})}},6258:(e,t,s)=>{"use strict";s.d(t,{n:()=>d});var i=s(7620),a=s(589),r=s(494),n=s(2327),l=s(7703),o=class extends n.Q{#a;#r=void 0;#n;#l;constructor(e,t){super(),this.#a=e,this.setOptions(t),this.bindMethods(),this.#o()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#a.defaultMutationOptions(e),(0,l.f8)(this.options,t)||this.#a.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&(0,l.EN)(t.mutationKey)!==(0,l.EN)(this.options.mutationKey)?this.reset():this.#n?.state.status==="pending"&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#o(),this.#c(e)}getCurrentResult(){return this.#r}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#o(),this.#c()}mutate(e,t){return this.#l=t,this.#n?.removeObserver(this),this.#n=this.#a.getMutationCache().build(this.#a,this.options),this.#n.addObserver(this),this.#n.execute(e)}#o(){let e=this.#n?.state??(0,a.$)();this.#r={...e,isPending:"pending"===e.status,isSuccess:"success"===e.status,isError:"error"===e.status,isIdle:"idle"===e.status,mutate:this.mutate,reset:this.reset}}#c(e){r.jG.batch(()=>{if(this.#l&&this.hasListeners()){let t=this.#r.variables,s=this.#r.context;e?.type==="success"?(this.#l.onSuccess?.(e.data,t,s),this.#l.onSettled?.(e.data,null,t,s)):e?.type==="error"&&(this.#l.onError?.(e.error,t,s),this.#l.onSettled?.(void 0,e.error,t,s))}this.listeners.forEach(e=>{e(this.#r)})})}},c=s(7606);function d(e,t){let s=(0,c.jE)(t),[a]=i.useState(()=>new o(s,e));i.useEffect(()=>{a.setOptions(e)},[a,e]);let n=i.useSyncExternalStore(i.useCallback(e=>a.subscribe(r.jG.batchCalls(e)),[a]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),d=i.useCallback((e,t)=>{a.mutate(e,t).catch(l.lQ)},[a]);if(n.error&&(0,l.GU)(a.options.throwOnError,[n.error]))throw n.error;return{...n,mutate:d,mutateAsync:n.mutate}}},6264:(e,t,s)=>{"use strict";s.d(t,{O:()=>l});var i=s(4568),a=s(7620),r=s(2942),n=s(9484);function l(e){let{children:t,requiredRole:s,requiredPermission:l}=e,{user:o,loading:c,hasRole:d,hasPermission:u}=(0,n.A)(),h=(0,r.useRouter)();return((0,a.useEffect)(()=>{if(!c){if(!o)return void h.push("/login");if(s&&!d(s)||l&&!u(l))return void h.push("/unauthorized")}},[o,c,s,l,d,u,h]),c)?(0,i.jsx)("div",{className:"flex items-center justify-center min-h-screen",children:(0,i.jsx)("div",{className:"text-lg",children:"Loading..."})}):o&&(!s||d(s))&&(!l||u(l))?(0,i.jsx)(i.Fragment,{children:t}):null}},9667:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>y});var i=s(4568),a=s(7620),r=s(7606),n=s(3297),l=s(6258),o=s(2942),c=s(704),d=s(9484),u=s(3835),h=s(6264),m=s(4893),x=s(7261),g=s.n(x),p=s(3237),v=s(4338);function f(){let e=(0,o.useSearchParams)(),t=(0,r.jE)();return(0,a.useEffect)(()=>{let s=e.get("linked"),i=e.get("success"),a=e.get("error"),r=e.get("description");if(s&&"true"===i)p.Ay.success("Successfully linked your ".concat(s," account!")),t.invalidateQueries({queryKey:["user-details"]});else if(a){let t=e.get("provider");p.Ay.error("Failed to link ".concat(t||"OAuth"," account: ").concat(r||a))}},[e,t]),null}function j(){let{user:e,logout:t}=(0,d.A)(),{currentAgent:s}=(0,u.f)(),o=(0,r.jE)(),{data:h,isLoading:x}=(0,n.I)({queryKey:["user-info"],queryFn:()=>c.AQ.auth.getMe(),enabled:!!s}),{data:j}=(0,n.I)({queryKey:["user-details",null==h?void 0:h.user_id],queryFn:()=>c.AQ.users.get(h.user_id),enabled:!!(null==h?void 0:h.user_id)}),y=[{id:"google",name:"Google",icon:(0,i.jsxs)("svg",{className:"w-5 h-5",viewBox:"0 0 24 24",children:[(0,i.jsx)("path",{fill:"#4285F4",d:"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z"}),(0,i.jsx)("path",{fill:"#34A853",d:"M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z"}),(0,i.jsx)("path",{fill:"#FBBC05",d:"M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z"}),(0,i.jsx)("path",{fill:"#EA4335",d:"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z"})]}),color:"bg-white border-gray-300 hover:bg-gray-50"},{id:"discord",name:"Discord",icon:(0,i.jsx)("svg",{className:"w-5 h-5",viewBox:"0 0 24 24",fill:"#5865F2",children:(0,i.jsx)("path",{d:"M20.317 4.37a19.791 19.791 0 0 0-4.885-1.515a.074.074 0 0 0-.079.037c-.21.375-.444.864-.608 1.25a18.27 18.27 0 0 0-5.487 0a12.64 12.64 0 0 0-.617-1.25a.077.077 0 0 0-.079-.037A19.736 19.736 0 0 0 3.677 4.37a.07.07 0 0 0-.032.027C.533 9.046-.32 13.58.099 18.057a.082.082 0 0 0 .031.057a19.9 19.9 0 0 0 5.993 3.03a.078.078 0 0 0 .084-.028a14.09 14.09 0 0 0 1.226-1.994a.076.076 0 0 0-.041-.106a13.107 13.107 0 0 1-1.872-.892a.077.077 0 0 1-.008-.128a10.2 10.2 0 0 0 .372-.292a.074.074 0 0 1 .077-.01c3.928 1.793 8.18 1.793 12.062 0a.074.074 0 0 1 .078.01c.12.098.246.198.373.292a.077.077 0 0 1-.006.127a12.299 12.299 0 0 1-1.873.892a.077.077 0 0 0-.041.107c.36.698.772 1.362 1.225 1.993a.076.076 0 0 0 .084.028a19.839 19.839 0 0 0 6.002-3.03a.077.077 0 0 0 .032-.054c.5-5.177-.838-9.674-3.549-13.66a.061.061 0 0 0-.031-.03zM8.02 15.33c-1.183 0-2.157-1.085-2.157-2.419c0-1.333.956-2.419 2.157-2.419c1.21 0 2.176 1.096 2.157 2.42c0 1.333-.956 2.418-2.157 2.418zm7.975 0c-1.183 0-2.157-1.085-2.157-2.419c0-1.333.955-2.419 2.157-2.419c1.21 0 2.176 1.096 2.157 2.42c0 1.333-.946 2.418-2.157 2.418z"})}),color:"bg-indigo-600 hover:bg-indigo-700 text-white"}],b=()=>{var e;return(null==j||null==(e=j.linked_oauth_accounts)?void 0:e.map(e=>e.provider))||[]},N=async e=>{try{let i,a;if(localStorage.setItem("oauthIntention","link"),localStorage.setItem("oauthProvider",e),localStorage.setItem("oauthReturnUrl","/account"),s){var t;if(a=encodeURIComponent("".concat(window.location.origin,"/oauth/").concat(s.agent_id,"/").concat(e,"/callback")),window.location.hostname.includes("agents.ciris.ai")||(null==(t=s.api_endpoint)?void 0:t.includes("/api/")))i="".concat(window.location.origin,"/api/").concat(s.agent_id,"/v1/auth/oauth/").concat(e,"/login");else{let t=v.env.NEXT_PUBLIC_API_BASE_URL||window.location.origin;i="".concat(t,"/v1/auth/oauth/").concat(e,"/login")}window.location.href="".concat(i,"?redirect_uri=").concat(a)}else p.Ay.error("No agent selected")}catch(e){console.error("OAuth link error:",e),p.Ay.error("Failed to initiate OAuth linking")}},w=(0,l.n)({mutationFn:async e=>{if(!(null==h?void 0:h.user_id))throw Error("No user ID");return c.AQ.users.unlinkOAuthAccount(h.user_id,e.provider,e.external_id)},onSuccess:()=>{p.Ay.success("OAuth account unlinked successfully"),o.invalidateQueries({queryKey:["user-details"]})},onError:e=>{p.Ay.error(e.message||"Failed to unlink OAuth account")}}),M=async()=>{try{await t(),p.Ay.success("Logged out successfully")}catch(e){p.Ay.error("Logout failed")}};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(a.Suspense,{fallback:null,children:(0,i.jsx)(f,{})}),(0,i.jsxs)("div",{className:"max-w-4xl mx-auto px-4 sm:px-6 lg:px-8 py-8",children:[(0,i.jsxs)("div",{className:"mb-8",children:[(0,i.jsx)("h1",{className:"text-3xl font-bold text-gray-900",children:"Account"}),(0,i.jsx)("p",{className:"mt-2 text-lg text-gray-600",children:"Manage your account settings, privacy, and linked accounts"})]}),(0,i.jsx)("div",{className:"mb-8",children:(0,i.jsxs)("nav",{className:"flex space-x-8",children:[(0,i.jsx)("span",{className:"border-b-2 border-indigo-500 pb-2 px-1 text-sm font-medium text-indigo-600",children:"Details"}),(0,i.jsx)(g(),{href:"/account/consent",className:"border-b-2 border-transparent pb-2 px-1 text-sm font-medium text-gray-500 hover:text-gray-700 hover:border-gray-300",children:"Consent"}),(0,i.jsx)(g(),{href:"/account/privacy",className:"border-b-2 border-transparent pb-2 px-1 text-sm font-medium text-gray-500 hover:text-gray-700 hover:border-gray-300",children:"Privacy & Data"})]})}),(0,i.jsx)("div",{className:"bg-white shadow rounded-lg mb-6",children:(0,i.jsxs)("div",{className:"px-4 py-5 sm:p-6",children:[(0,i.jsxs)("div",{className:"flex items-center justify-between mb-6",children:[(0,i.jsx)("h2",{className:"text-lg font-medium text-gray-900",children:"Profile Information"}),(0,i.jsx)(m.md,{status:e?"green":"red",className:"h-3 w-3"})]}),x?(0,i.jsxs)("div",{className:"animate-pulse space-y-4",children:[(0,i.jsx)("div",{className:"h-4 bg-gray-200 rounded w-1/4"}),(0,i.jsx)("div",{className:"h-4 bg-gray-200 rounded w-1/3"}),(0,i.jsx)("div",{className:"h-4 bg-gray-200 rounded w-1/2"})]}):h?(0,i.jsxs)("dl",{className:"grid grid-cols-1 gap-x-4 gap-y-6 sm:grid-cols-2",children:[(0,i.jsxs)("div",{children:[(0,i.jsx)("dt",{className:"text-sm font-medium text-gray-500",children:"User ID"}),(0,i.jsx)("dd",{className:"mt-1 text-sm text-gray-900 font-mono",children:h.user_id})]}),(0,i.jsxs)("div",{children:[(0,i.jsx)("dt",{className:"text-sm font-medium text-gray-500",children:"Username"}),(0,i.jsx)("dd",{className:"mt-1 text-sm text-gray-900",children:h.username||"Not set"})]}),(0,i.jsxs)("div",{children:[(0,i.jsx)("dt",{className:"text-sm font-medium text-gray-500",children:"Role"}),(0,i.jsx)("dd",{className:"mt-1",children:(0,i.jsx)("span",{className:"inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium ".concat("SYSTEM_ADMIN"===h.role?"bg-red-100 text-red-800":"AUTHORITY"===h.role?"bg-purple-100 text-purple-800":"ADMIN"===h.role?"bg-blue-100 text-blue-800":"bg-gray-100 text-gray-800"),children:h.role})})]}),(0,i.jsxs)("div",{children:[(0,i.jsx)("dt",{className:"text-sm font-medium text-gray-500",children:"API Role"}),(0,i.jsx)("dd",{className:"mt-1",children:(0,i.jsx)("span",{className:"inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium ".concat("SYSTEM_ADMIN"===h.api_role?"bg-red-100 text-red-800":"AUTHORITY"===h.api_role?"bg-purple-100 text-purple-800":"ADMIN"===h.api_role?"bg-blue-100 text-blue-800":"bg-gray-100 text-gray-800"),children:h.api_role})})]}),h.wa_role&&(0,i.jsxs)("div",{children:[(0,i.jsx)("dt",{className:"text-sm font-medium text-gray-500",children:"WA Role"}),(0,i.jsx)("dd",{className:"mt-1",children:(0,i.jsx)("span",{className:"inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium ".concat("root"===h.wa_role?"bg-red-100 text-red-800":"authority"===h.wa_role?"bg-purple-100 text-purple-800":"admin"===h.wa_role?"bg-blue-100 text-blue-800":"bg-gray-100 text-gray-800"),children:h.wa_role})})]}),h.created_at&&(0,i.jsxs)("div",{children:[(0,i.jsx)("dt",{className:"text-sm font-medium text-gray-500",children:"Account Created"}),(0,i.jsx)("dd",{className:"mt-1 text-sm text-gray-900",children:new Date(h.created_at).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric",hour:"2-digit",minute:"2-digit"})})]}),h.last_login&&(0,i.jsxs)("div",{children:[(0,i.jsx)("dt",{className:"text-sm font-medium text-gray-500",children:"Last Login"}),(0,i.jsx)("dd",{className:"mt-1 text-sm text-gray-900",children:new Date(h.last_login).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric",hour:"2-digit",minute:"2-digit"})})]}),h.permissions&&h.permissions.length>0&&(0,i.jsxs)("div",{className:"sm:col-span-2",children:[(0,i.jsx)("dt",{className:"text-sm font-medium text-gray-500",children:"Permissions"}),(0,i.jsx)("dd",{className:"mt-1",children:(0,i.jsx)("div",{className:"flex flex-wrap gap-2",children:h.permissions.map(e=>(0,i.jsx)("span",{className:"inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-indigo-100 text-indigo-800",children:e},e))})})]})]}):(0,i.jsx)("div",{className:"text-center py-6",children:(0,i.jsx)("p",{className:"text-gray-500",children:"Unable to load user information"})})]})}),s&&(0,i.jsx)("div",{className:"bg-white shadow rounded-lg mb-6",children:(0,i.jsxs)("div",{className:"px-4 py-5 sm:p-6",children:[(0,i.jsx)("h2",{className:"text-lg font-medium text-gray-900 mb-4",children:"Current Agent"}),(0,i.jsxs)("dl",{className:"grid grid-cols-1 gap-x-4 gap-y-6 sm:grid-cols-2",children:[(0,i.jsxs)("div",{children:[(0,i.jsx)("dt",{className:"text-sm font-medium text-gray-500",children:"Agent Name"}),(0,i.jsx)("dd",{className:"mt-1 text-sm text-gray-900",children:s.agent_name})]}),(0,i.jsxs)("div",{children:[(0,i.jsx)("dt",{className:"text-sm font-medium text-gray-500",children:"Agent ID"}),(0,i.jsx)("dd",{className:"mt-1 text-sm text-gray-900 font-mono",children:s.agent_id})]}),(0,i.jsxs)("div",{children:[(0,i.jsx)("dt",{className:"text-sm font-medium text-gray-500",children:"Status"}),(0,i.jsx)("dd",{className:"mt-1",children:(0,i.jsx)("span",{className:"inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium ".concat("running"===s.status?"bg-green-100 text-green-800":"stopped"===s.status?"bg-red-100 text-red-800":"bg-yellow-100 text-yellow-800"),children:s.status})})]}),(0,i.jsxs)("div",{children:[(0,i.jsx)("dt",{className:"text-sm font-medium text-gray-500",children:"Health"}),(0,i.jsx)("dd",{className:"mt-1",children:(0,i.jsx)("span",{className:"inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium ".concat("healthy"===s.health?"bg-green-100 text-green-800":"unhealthy"===s.health?"bg-red-100 text-red-800":"bg-yellow-100 text-yellow-800"),children:s.health||"Unknown"})})]})]})]})}),(0,i.jsx)("div",{className:"bg-white shadow rounded-lg mb-6",children:(0,i.jsxs)("div",{className:"px-4 py-5 sm:p-6",children:[(0,i.jsx)("h2",{className:"text-lg font-medium text-gray-900 mb-6",children:"Connected Accounts"}),(0,i.jsx)("div",{className:"space-y-4 mb-6",children:y.map(e=>{var t;let s=b().includes(e.id),a=null==j||null==(t=j.linked_oauth_accounts)?void 0:t.find(t=>t.provider===e.id);return(0,i.jsxs)("div",{className:"flex items-center justify-between p-4 border border-gray-200 rounded-lg",children:[(0,i.jsxs)("div",{className:"flex items-center space-x-3",children:[(0,i.jsx)("div",{className:"flex-shrink-0",children:e.icon}),(0,i.jsxs)("div",{children:[(0,i.jsx)("p",{className:"text-sm font-medium text-gray-900",children:e.name}),s&&a?(0,i.jsxs)("div",{children:[(0,i.jsxs)("p",{className:"text-sm text-gray-500",children:["Connected as ",a.account_name||a.external_id]}),a.linked_at&&(0,i.jsxs)("p",{className:"text-xs text-gray-400",children:["Linked ",new Date(a.linked_at).toLocaleDateString()]})]}):(0,i.jsx)("p",{className:"text-sm text-gray-500",children:"Not connected"})]})]}),s&&a?(0,i.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,i.jsx)("span",{className:"inline-flex items-center px-2 py-1 rounded-full text-xs font-medium bg-green-100 text-green-800",children:"Connected"}),!a.is_primary&&(0,i.jsx)("button",{onClick:()=>w.mutate({provider:a.provider,external_id:a.external_id}),disabled:w.isPending,className:"text-sm text-red-600 hover:text-red-800 disabled:opacity-50",children:"Disconnect"})]}):(0,i.jsxs)("button",{onClick:()=>N(e.id),className:"inline-flex items-center px-4 py-2 border text-sm font-medium rounded-md focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 ".concat(e.color),children:["Connect ",e.name]})]},e.id)})}),(0,i.jsx)("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-4",children:(0,i.jsxs)("div",{className:"flex",children:[(0,i.jsx)("div",{className:"flex-shrink-0",children:(0,i.jsx)("svg",{className:"h-5 w-5 text-blue-400",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",children:(0,i.jsx)("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z",clipRule:"evenodd"})})}),(0,i.jsx)("div",{className:"ml-3",children:(0,i.jsxs)("p",{className:"text-sm text-blue-700",children:[(0,i.jsx)("strong",{children:"Connect your accounts"})," to use them for authentication and access control. You can safely connect multiple accounts and disconnect them at any time."]})})]})})]})}),(0,i.jsx)("div",{className:"bg-white shadow rounded-lg",children:(0,i.jsxs)("div",{className:"px-4 py-5 sm:p-6",children:[(0,i.jsx)("h2",{className:"text-lg font-medium text-gray-900 mb-4",children:"Account Actions"}),(0,i.jsx)("div",{className:"space-y-4",children:(0,i.jsxs)("div",{className:"flex items-center justify-between p-4 border border-gray-200 rounded-lg",children:[(0,i.jsxs)("div",{children:[(0,i.jsx)("h3",{className:"text-sm font-medium text-gray-900",children:"Sign Out"}),(0,i.jsx)("p",{className:"text-sm text-gray-500",children:"Sign out of your account and return to the login page"})]}),(0,i.jsx)("button",{onClick:M,className:"inline-flex items-center px-4 py-2 border border-transparent text-sm font-medium rounded-md text-white bg-red-600 hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500",children:"Sign Out"})]})})]})})]})]})}function y(){return(0,i.jsx)(h.O,{children:(0,i.jsx)(j,{})})}}},e=>{var t=t=>e(e.s=t);e.O(0,[4534,8903,3297,8072,704,3835,587,8315,7358],()=>t(2639)),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1298],{589:(e,t,s)=>{"use strict";s.d(t,{$:()=>l,s:()=>n});var i=s(494),a=s(6759),r=s(1279),n=class extends a.k{#e;#t;#s;constructor(e){super(),this.mutationId=e.mutationId,this.#t=e.mutationCache,this.#e=[],this.state=e.state||l(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#e.includes(e)||(this.#e.push(e),this.clearGcTimeout(),this.#t.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#e=this.#e.filter(t=>t!==e),this.scheduleGc(),this.#t.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#e.length||("pending"===this.state.status?this.scheduleGc():this.#t.remove(this))}continue(){return this.#s?.continue()??this.execute(this.state.variables)}async execute(e){let t=()=>{this.#i({type:"continue"})};this.#s=(0,r.II)({fn:()=>this.options.mutationFn?this.options.mutationFn(e):Promise.reject(Error("No mutationFn found")),onFail:(e,t)=>{this.#i({type:"failed",failureCount:e,error:t})},onPause:()=>{this.#i({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#t.canRun(this)});let s="pending"===this.state.status,i=!this.#s.canStart();try{if(s)t();else{this.#i({type:"pending",variables:e,isPaused:i}),await this.#t.config.onMutate?.(e,this);let t=await this.options.onMutate?.(e);t!==this.state.context&&this.#i({type:"pending",context:t,variables:e,isPaused:i})}let a=await this.#s.start();return await this.#t.config.onSuccess?.(a,e,this.state.context,this),await this.options.onSuccess?.(a,e,this.state.context),await this.#t.config.onSettled?.(a,null,this.state.variables,this.state.context,this),await this.options.onSettled?.(a,null,e,this.state.context),this.#i({type:"success",data:a}),a}catch(t){try{throw await this.#t.config.onError?.(t,e,this.state.context,this),await this.options.onError?.(t,e,this.state.context),await this.#t.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this),await this.options.onSettled?.(void 0,t,e,this.state.context),t}finally{this.#i({type:"error",error:t})}}finally{this.#t.runNext(this)}}#i(e){this.state=(t=>{switch(e.type){case"failed":return{...t,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...t,isPaused:!0};case"continue":return{...t,isPaused:!1};case"pending":return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}})(this.state),i.jG.batch(()=>{this.#e.forEach(t=>{t.onMutationUpdate(e)}),this.#t.notify({mutation:this,type:"updated",action:e})})}};function l(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}},1997:(e,t,s)=>{Promise.resolve().then(s.bind(s,9667))},4893:(e,t,s)=>{"use strict";s.d(t,{DP:()=>v,HG:()=>u,Nl:()=>o,O4:()=>d,Pi:()=>n,RR:()=>x,RY:()=>m,Rv:()=>f,XR:()=>l,Zu:()=>y,bN:()=>g,c1:()=>N,fC:()=>w,fK:()=>j,lm:()=>p,md:()=>R,mo:()=>r,uc:()=>b,ui:()=>c,vK:()=>h,xZ:()=>M,xm:()=>C});var i=s(4568);s(7620);let a={xs:{width:12,height:12},sm:{width:16,height:16},md:{width:20,height:20},lg:{width:24,height:24}},r=e=>{let{className:t="",size:s="md"}=e,{width:r,height:n}=a[s];return(0,i.jsx)("svg",{className:t,width:r,height:n,viewBox:"0 0 20 20",fill:"currentColor",children:(0,i.jsx)("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z",clipRule:"evenodd"})})},n=e=>{let{className:t="",size:s="md"}=e,{width:r,height:n}=a[s];return(0,i.jsx)("svg",{className:t,width:r,height:n,viewBox:"0 0 20 20",fill:"currentColor",children:(0,i.jsx)("path",{fillRule:"evenodd",d:"M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z",clipRule:"evenodd"})})},l=e=>{let{className:t="",size:s="md"}=e,{width:r,height:n}=a[s];return(0,i.jsx)("svg",{className:t,width:r,height:n,viewBox:"0 0 20 20",fill:"currentColor",children:(0,i.jsx)("path",{d:"M11 17a1 1 0 001.447.894l4-2A1 1 0 0017 15V9.236a1 1 0 00-1.447-.894l-4 2a1 1 0 00-.553.894V17zM15.211 6.276a1 1 0 000-1.788l-4.764-2.382a1 1 0 00-.894 0L4.789 4.488a1 1 0 000 1.788l4.764 2.382a1 1 0 00.894 0l4.764-2.382zM4.447 8.342A1 1 0 003 9.236V15a1 1 0 00.553.894l4 2A1 1 0 009 17v-5.764a1 1 0 00-.553-.894l-4-2z"})})},o=e=>{let{className:t="",size:s="md"}=e,{width:r,height:n}=a[s];return(0,i.jsxs)("svg",{className:"animate-spin ".concat(t),width:r,height:n,xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[(0,i.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,i.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]})},c=e=>{let{className:t="",size:s="md"}=e,{width:r,height:n}=a[s];return(0,i.jsx)("svg",{className:t,width:r,height:n,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",children:(0,i.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,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"})})},d=e=>{let{className:t="",size:s="md"}=e,{width:r,height:n}=a[s];return(0,i.jsx)("svg",{className:t,width:r,height:n,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",children:(0,i.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"})})},u=e=>{let{className:t="",size:s="md"}=e,{width:r,height:n}=a[s];return(0,i.jsx)("svg",{className:t,width:r,height:n,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",children:(0,i.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 3v2m6-2v2M9 19v2m6-2v2M5 9H3m2 6H3m18-6h-2m2 6h-2M7 19h10a2 2 0 002-2V7a2 2 0 00-2-2H7a2 2 0 00-2 2v10a2 2 0 002 2zM9 9h6v6H9V9z"})})},h=e=>{let{className:t="",size:s="md"}=e,{width:r,height:n}=a[s];return(0,i.jsx)("svg",{className:t,width:r,height:n,viewBox:"0 0 20 20",fill:"currentColor",children:(0,i.jsx)("path",{fillRule:"evenodd",d:"M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z",clipRule:"evenodd"})})},m=e=>{let{className:t="",size:s="md"}=e,{width:r,height:n}=a[s];return(0,i.jsx)("svg",{className:t,width:r,height:n,viewBox:"0 0 20 20",fill:"currentColor",children:(0,i.jsx)("path",{fillRule:"evenodd",d:"M18 8a6 6 0 01-7.743 5.743L10 14l-1 1-1 1H6v2H2v-4l4.257-4.257A6 6 0 1118 8zm-6-4a1 1 0 100 2 2 2 0 012 2 1 1 0 102 0 4 4 0 00-4-4z",clipRule:"evenodd"})})},x=e=>{let{className:t="",size:s="md"}=e,{width:r,height:n}=a[s];return(0,i.jsx)("svg",{className:t,width:r,height:n,viewBox:"0 0 20 20",fill:"currentColor",children:(0,i.jsx)("path",{fillRule:"evenodd",d:"M2 5a2 2 0 012-2h12a2 2 0 012 2v2a2 2 0 01-2 2H4a2 2 0 01-2-2V5zm14 1a1 1 0 11-2 0 1 1 0 012 0zM2 13a2 2 0 012-2h12a2 2 0 012 2v2a2 2 0 01-2 2H4a2 2 0 01-2-2v-2zm14 1a1 1 0 11-2 0 1 1 0 012 0z",clipRule:"evenodd"})})},g=e=>{let{className:t="",size:s="md"}=e,{width:r,height:n}=a[s];return(0,i.jsxs)("svg",{className:t,width:r,height:n,viewBox:"0 0 20 20",fill:"currentColor",children:[(0,i.jsx)("path",{d:"M3 12v3c0 1.657 3.134 3 7 3s7-1.343 7-3v-3c0 1.657-3.134 3-7 3s-7-1.343-7-3z"}),(0,i.jsx)("path",{d:"M3 7v3c0 1.657 3.134 3 7 3s7-1.343 7-3V7c0 1.657-3.134 3-7 3S3 8.657 3 7z"}),(0,i.jsx)("path",{d:"M17 5c0 1.657-3.134 3-7 3S3 6.657 3 5s3.134-3 7-3 7 1.343 7 3z"})]})},p=e=>{let{className:t="",size:s="md"}=e,{width:r,height:n}=a[s];return(0,i.jsx)("svg",{className:t,width:r,height:n,viewBox:"0 0 20 20",fill:"currentColor",children:(0,i.jsx)("path",{fillRule:"evenodd",d:"M2.166 4.999A11.954 11.954 0 0010 1.944 11.954 11.954 0 0017.834 5c.11.65.166 1.32.166 2.001 0 5.225-3.34 9.67-8 11.317C5.34 16.67 2 12.225 2 7c0-.682.057-1.35.166-2.001zm11.541 3.708a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z",clipRule:"evenodd"})})},v=e=>{let{className:t="",size:s="md"}=e,{width:r,height:n}=a[s];return(0,i.jsx)("svg",{className:t,width:r,height:n,viewBox:"0 0 20 20",fill:"currentColor",children:(0,i.jsx)("path",{fillRule:"evenodd",d:"M11.49 3.17c-.38-1.56-2.6-1.56-2.98 0a1.532 1.532 0 01-2.286.948c-1.372-.836-2.942.734-2.106 2.106.54.886.061 2.042-.947 2.287-1.561.379-1.561 2.6 0 2.978a1.532 1.532 0 01.947 2.287c-.836 1.372.734 2.942 2.106 2.106a1.532 1.532 0 012.287.947c.379 1.561 2.6 1.561 2.978 0a1.533 1.533 0 012.287-.947c1.372.836 2.942-.734 2.106-2.106a1.533 1.533 0 01.947-2.287c1.561-.379 1.561-2.6 0-2.978a1.532 1.532 0 01-.947-2.287c.836-1.372-.734-2.942-2.106-2.106a1.532 1.532 0 01-2.287-.947zM10 13a3 3 0 100-6 3 3 0 000 6z",clipRule:"evenodd"})})},f=e=>{let{className:t="",size:s="md"}=e,{width:r,height:n}=a[s];return(0,i.jsx)("svg",{className:t,width:r,height:n,viewBox:"0 0 20 20",fill:"currentColor",children:(0,i.jsx)("path",{d:"M8 9a3 3 0 100-6 3 3 0 000 6zM8 11a6 6 0 016 6H2a6 6 0 016-6zM16 7a1 1 0 10-2 0v1h-1a1 1 0 100 2h1v1a1 1 0 102 0v-1h1a1 1 0 100-2h-1V7z"})})},j=e=>{let{className:t="",size:s="md"}=e,{width:r,height:n}=a[s];return(0,i.jsx)("svg",{className:t,width:r,height:n,viewBox:"0 0 20 20",fill:"currentColor",children:(0,i.jsx)("path",{fillRule:"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z",clipRule:"evenodd"})})},y=e=>{let{className:t="",size:s="md"}=e,{width:r,height:n}=a[s];return(0,i.jsx)("svg",{className:t,width:r,height:n,viewBox:"0 0 20 20",fill:"currentColor",children:(0,i.jsx)("path",{fillRule:"evenodd",d:"M2.166 4.999A11.954 11.954 0 0010 1.944 11.954 11.954 0 0017.834 5c.11.65.166 1.32.166 2.001 0 5.225-3.34 9.67-8 11.317C5.34 16.67 2 12.225 2 7c0-.682.057-1.35.166-2.001zm11.541 3.708a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z",clipRule:"evenodd"})})},b=e=>{let{className:t="",size:s="md"}=e,{width:r,height:n}=a[s];return(0,i.jsx)("svg",{className:t,width:r,height:n,viewBox:"0 0 20 20",fill:"currentColor",children:(0,i.jsx)("path",{fillRule:"evenodd",d:"M9 2a1 1 0 00-.894.553L7.382 4H4a1 1 0 000 2v10a2 2 0 002 2h8a2 2 0 002-2V6a1 1 0 100-2h-3.382l-.724-1.447A1 1 0 0011 2H9zM7 8a1 1 0 012 0v6a1 1 0 11-2 0V8zm5-1a1 1 0 00-1 1v6a1 1 0 102 0V8a1 1 0 00-1-1z",clipRule:"evenodd"})})},N=e=>{let{className:t="",size:s="md"}=e,{width:r,height:n}=a[s];return(0,i.jsx)("svg",{className:t,width:r,height:n,viewBox:"0 0 20 20",fill:"currentColor",children:(0,i.jsx)("path",{fillRule:"evenodd",d:"M10 3a1 1 0 011 1v5h5a1 1 0 110 2h-5v5a1 1 0 11-2 0v-5H4a1 1 0 110-2h5V4a1 1 0 011-1z",clipRule:"evenodd"})})},w=e=>{let{className:t="",size:s="md"}=e,{width:r,height:n}=a[s];return(0,i.jsx)("svg",{className:t,width:r,height:n,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",children:(0,i.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3.055 11H5a2 2 0 012 2v1a2 2 0 002 2 2 2 0 012 2v2.945M8 3.935V5.5A2.5 2.5 0 0010.5 8h.5a2 2 0 012 2 2 2 0 104 0 2 2 0 012-2h1.064M15 20.488V18a2 2 0 012-2h3.064M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})})},M=e=>{let{className:t="",size:s="md"}=e,{width:r,height:n}=a[s];return(0,i.jsx)("svg",{className:t,width:r,height:n,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",children:(0,i.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 10V3L4 14h7v7l9-11h-7z"})})},C=e=>{let{className:t="",size:s="md"}=e,{width:r,height:n}=a[s];return(0,i.jsx)("svg",{className:t,width:r,height:n,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",children:(0,i.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,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"})})},R=e=>{let{status:t,className:s=""}=e;return(0,i.jsx)("span",{className:"w-3 h-3 rounded-full ".concat({green:"bg-green-500",yellow:"bg-yellow-500",red:"bg-red-500",gray:"bg-gray-500"}[t]," ").concat(s)})}},6258:(e,t,s)=>{"use strict";s.d(t,{n:()=>d});var i=s(7620),a=s(589),r=s(494),n=s(2327),l=s(7703),o=class extends n.Q{#a;#r=void 0;#n;#l;constructor(e,t){super(),this.#a=e,this.setOptions(t),this.bindMethods(),this.#o()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#a.defaultMutationOptions(e),(0,l.f8)(this.options,t)||this.#a.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&(0,l.EN)(t.mutationKey)!==(0,l.EN)(this.options.mutationKey)?this.reset():this.#n?.state.status==="pending"&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#o(),this.#c(e)}getCurrentResult(){return this.#r}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#o(),this.#c()}mutate(e,t){return this.#l=t,this.#n?.removeObserver(this),this.#n=this.#a.getMutationCache().build(this.#a,this.options),this.#n.addObserver(this),this.#n.execute(e)}#o(){let e=this.#n?.state??(0,a.$)();this.#r={...e,isPending:"pending"===e.status,isSuccess:"success"===e.status,isError:"error"===e.status,isIdle:"idle"===e.status,mutate:this.mutate,reset:this.reset}}#c(e){r.jG.batch(()=>{if(this.#l&&this.hasListeners()){let t=this.#r.variables,s=this.#r.context;e?.type==="success"?(this.#l.onSuccess?.(e.data,t,s),this.#l.onSettled?.(e.data,null,t,s)):e?.type==="error"&&(this.#l.onError?.(e.error,t,s),this.#l.onSettled?.(void 0,e.error,t,s))}this.listeners.forEach(e=>{e(this.#r)})})}},c=s(7606);function d(e,t){let s=(0,c.jE)(t),[a]=i.useState(()=>new o(s,e));i.useEffect(()=>{a.setOptions(e)},[a,e]);let n=i.useSyncExternalStore(i.useCallback(e=>a.subscribe(r.jG.batchCalls(e)),[a]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),d=i.useCallback((e,t)=>{a.mutate(e,t).catch(l.lQ)},[a]);if(n.error&&(0,l.GU)(a.options.throwOnError,[n.error]))throw n.error;return{...n,mutate:d,mutateAsync:n.mutate}}},6264:(e,t,s)=>{"use strict";s.d(t,{O:()=>l});var i=s(4568),a=s(7620),r=s(2942),n=s(9484);function l(e){let{children:t,requiredRole:s,requiredPermission:l}=e,{user:o,loading:c,hasRole:d,hasPermission:u}=(0,n.A)(),h=(0,r.useRouter)();return((0,a.useEffect)(()=>{if(!c){if(!o)return void h.push("/login");if(s&&!d(s)||l&&!u(l))return void h.push("/unauthorized")}},[o,c,s,l,d,u,h]),c)?(0,i.jsx)("div",{className:"flex items-center justify-center min-h-screen",children:(0,i.jsx)("div",{className:"text-lg",children:"Loading..."})}):o&&(!s||d(s))&&(!l||u(l))?(0,i.jsx)(i.Fragment,{children:t}):null}},9667:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>y});var i=s(4568),a=s(7620),r=s(7606),n=s(3297),l=s(6258),o=s(2942),c=s(704),d=s(9484),u=s(3835),h=s(6264),m=s(4893),x=s(7261),g=s.n(x),p=s(3237),v=s(4338);function f(){let e=(0,o.useSearchParams)(),t=(0,r.jE)();return(0,a.useEffect)(()=>{let s=e.get("linked"),i=e.get("success"),a=e.get("error"),r=e.get("description");if(s&&"true"===i)p.Ay.success("Successfully linked your ".concat(s," account!")),t.invalidateQueries({queryKey:["user-details"]});else if(a){let t=e.get("provider");p.Ay.error("Failed to link ".concat(t||"OAuth"," account: ").concat(r||a))}},[e,t]),null}function j(){let{user:e,logout:t}=(0,d.A)(),{currentAgent:s}=(0,u.f)(),o=(0,r.jE)(),{data:h,isLoading:x}=(0,n.I)({queryKey:["user-info"],queryFn:()=>c.AQ.auth.getMe(),enabled:!!s}),{data:j}=(0,n.I)({queryKey:["user-details",null==h?void 0:h.user_id],queryFn:()=>c.AQ.users.get(h.user_id),enabled:!!(null==h?void 0:h.user_id)}),y=[{id:"google",name:"Google",icon:(0,i.jsxs)("svg",{className:"w-5 h-5",viewBox:"0 0 24 24",children:[(0,i.jsx)("path",{fill:"#4285F4",d:"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z"}),(0,i.jsx)("path",{fill:"#34A853",d:"M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z"}),(0,i.jsx)("path",{fill:"#FBBC05",d:"M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z"}),(0,i.jsx)("path",{fill:"#EA4335",d:"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z"})]}),color:"bg-white border-gray-300 hover:bg-gray-50"},{id:"discord",name:"Discord",icon:(0,i.jsx)("svg",{className:"w-5 h-5",viewBox:"0 0 24 24",fill:"#5865F2",children:(0,i.jsx)("path",{d:"M20.317 4.37a19.791 19.791 0 0 0-4.885-1.515a.074.074 0 0 0-.079.037c-.21.375-.444.864-.608 1.25a18.27 18.27 0 0 0-5.487 0a12.64 12.64 0 0 0-.617-1.25a.077.077 0 0 0-.079-.037A19.736 19.736 0 0 0 3.677 4.37a.07.07 0 0 0-.032.027C.533 9.046-.32 13.58.099 18.057a.082.082 0 0 0 .031.057a19.9 19.9 0 0 0 5.993 3.03a.078.078 0 0 0 .084-.028a14.09 14.09 0 0 0 1.226-1.994a.076.076 0 0 0-.041-.106a13.107 13.107 0 0 1-1.872-.892a.077.077 0 0 1-.008-.128a10.2 10.2 0 0 0 .372-.292a.074.074 0 0 1 .077-.01c3.928 1.793 8.18 1.793 12.062 0a.074.074 0 0 1 .078.01c.12.098.246.198.373.292a.077.077 0 0 1-.006.127a12.299 12.299 0 0 1-1.873.892a.077.077 0 0 0-.041.107c.36.698.772 1.362 1.225 1.993a.076.076 0 0 0 .084.028a19.839 19.839 0 0 0 6.002-3.03a.077.077 0 0 0 .032-.054c.5-5.177-.838-9.674-3.549-13.66a.061.061 0 0 0-.031-.03zM8.02 15.33c-1.183 0-2.157-1.085-2.157-2.419c0-1.333.956-2.419 2.157-2.419c1.21 0 2.176 1.096 2.157 2.42c0 1.333-.956 2.418-2.157 2.418zm7.975 0c-1.183 0-2.157-1.085-2.157-2.419c0-1.333.955-2.419 2.157-2.419c1.21 0 2.176 1.096 2.157 2.42c0 1.333-.946 2.418-2.157 2.418z"})}),color:"bg-indigo-600 hover:bg-indigo-700 text-white"}],b=()=>{var e;return(null==j||null==(e=j.linked_oauth_accounts)?void 0:e.map(e=>e.provider))||[]},N=async e=>{try{let i,a;if(localStorage.setItem("oauthIntention","link"),localStorage.setItem("oauthProvider",e),localStorage.setItem("oauthReturnUrl","/account"),s){var t;if(a=encodeURIComponent("".concat(window.location.origin,"/oauth/").concat(s.agent_id,"/").concat(e,"/callback")),window.location.hostname.includes("agents.ciris.ai")||(null==(t=s.api_endpoint)?void 0:t.includes("/api/")))i="".concat(window.location.origin,"/api/").concat(s.agent_id,"/v1/auth/oauth/").concat(e,"/login");else{let t=v.env.NEXT_PUBLIC_API_BASE_URL||window.location.origin;i="".concat(t,"/v1/auth/oauth/").concat(e,"/login")}window.location.href="".concat(i,"?redirect_uri=").concat(a)}else p.Ay.error("No agent selected")}catch(e){console.error("OAuth link error:",e),p.Ay.error("Failed to initiate OAuth linking")}},w=(0,l.n)({mutationFn:async e=>{if(!(null==h?void 0:h.user_id))throw Error("No user ID");return c.AQ.users.unlinkOAuthAccount(h.user_id,e.provider,e.external_id)},onSuccess:()=>{p.Ay.success("OAuth account unlinked successfully"),o.invalidateQueries({queryKey:["user-details"]})},onError:e=>{p.Ay.error(e.message||"Failed to unlink OAuth account")}}),M=async()=>{try{await t(),p.Ay.success("Logged out successfully")}catch(e){p.Ay.error("Logout failed")}};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(a.Suspense,{fallback:null,children:(0,i.jsx)(f,{})}),(0,i.jsxs)("div",{className:"max-w-4xl mx-auto px-4 sm:px-6 lg:px-8 py-8",children:[(0,i.jsxs)("div",{className:"mb-8",children:[(0,i.jsx)("h1",{className:"text-3xl font-bold text-gray-900",children:"Account"}),(0,i.jsx)("p",{className:"mt-2 text-lg text-gray-600",children:"Manage your account settings, privacy, and linked accounts"})]}),(0,i.jsx)("div",{className:"mb-8",children:(0,i.jsxs)("nav",{className:"flex space-x-8",children:[(0,i.jsx)("span",{className:"border-b-2 border-indigo-500 pb-2 px-1 text-sm font-medium text-indigo-600",children:"Details"}),(0,i.jsx)(g(),{href:"/account/consent",className:"border-b-2 border-transparent pb-2 px-1 text-sm font-medium text-gray-500 hover:text-gray-700 hover:border-gray-300",children:"Consent"}),(0,i.jsx)(g(),{href:"/account/privacy",className:"border-b-2 border-transparent pb-2 px-1 text-sm font-medium text-gray-500 hover:text-gray-700 hover:border-gray-300",children:"Privacy & Data"})]})}),(0,i.jsx)("div",{className:"bg-white shadow rounded-lg mb-6",children:(0,i.jsxs)("div",{className:"px-4 py-5 sm:p-6",children:[(0,i.jsxs)("div",{className:"flex items-center justify-between mb-6",children:[(0,i.jsx)("h2",{className:"text-lg font-medium text-gray-900",children:"Profile Information"}),(0,i.jsx)(m.md,{status:e?"green":"red",className:"h-3 w-3"})]}),x?(0,i.jsxs)("div",{className:"animate-pulse space-y-4",children:[(0,i.jsx)("div",{className:"h-4 bg-gray-200 rounded w-1/4"}),(0,i.jsx)("div",{className:"h-4 bg-gray-200 rounded w-1/3"}),(0,i.jsx)("div",{className:"h-4 bg-gray-200 rounded w-1/2"})]}):h?(0,i.jsxs)("dl",{className:"grid grid-cols-1 gap-x-4 gap-y-6 sm:grid-cols-2",children:[(0,i.jsxs)("div",{children:[(0,i.jsx)("dt",{className:"text-sm font-medium text-gray-500",children:"User ID"}),(0,i.jsx)("dd",{className:"mt-1 text-sm text-gray-900 font-mono",children:h.user_id})]}),(0,i.jsxs)("div",{children:[(0,i.jsx)("dt",{className:"text-sm font-medium text-gray-500",children:"Username"}),(0,i.jsx)("dd",{className:"mt-1 text-sm text-gray-900",children:h.username||"Not set"})]}),(0,i.jsxs)("div",{children:[(0,i.jsx)("dt",{className:"text-sm font-medium text-gray-500",children:"Role"}),(0,i.jsx)("dd",{className:"mt-1",children:(0,i.jsx)("span",{className:"inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium ".concat("SYSTEM_ADMIN"===h.role?"bg-red-100 text-red-800":"AUTHORITY"===h.role?"bg-purple-100 text-purple-800":"ADMIN"===h.role?"bg-blue-100 text-blue-800":"bg-gray-100 text-gray-800"),children:h.role})})]}),(0,i.jsxs)("div",{children:[(0,i.jsx)("dt",{className:"text-sm font-medium text-gray-500",children:"API Role"}),(0,i.jsx)("dd",{className:"mt-1",children:(0,i.jsx)("span",{className:"inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium ".concat("SYSTEM_ADMIN"===h.api_role?"bg-red-100 text-red-800":"AUTHORITY"===h.api_role?"bg-purple-100 text-purple-800":"ADMIN"===h.api_role?"bg-blue-100 text-blue-800":"bg-gray-100 text-gray-800"),children:h.api_role})})]}),h.wa_role&&(0,i.jsxs)("div",{children:[(0,i.jsx)("dt",{className:"text-sm font-medium text-gray-500",children:"WA Role"}),(0,i.jsx)("dd",{className:"mt-1",children:(0,i.jsx)("span",{className:"inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium ".concat("root"===h.wa_role?"bg-red-100 text-red-800":"authority"===h.wa_role?"bg-purple-100 text-purple-800":"admin"===h.wa_role?"bg-blue-100 text-blue-800":"bg-gray-100 text-gray-800"),children:h.wa_role})})]}),h.created_at&&(0,i.jsxs)("div",{children:[(0,i.jsx)("dt",{className:"text-sm font-medium text-gray-500",children:"Account Created"}),(0,i.jsx)("dd",{className:"mt-1 text-sm text-gray-900",children:new Date(h.created_at).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric",hour:"2-digit",minute:"2-digit"})})]}),h.last_login&&(0,i.jsxs)("div",{children:[(0,i.jsx)("dt",{className:"text-sm font-medium text-gray-500",children:"Last Login"}),(0,i.jsx)("dd",{className:"mt-1 text-sm text-gray-900",children:new Date(h.last_login).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric",hour:"2-digit",minute:"2-digit"})})]}),h.permissions&&h.permissions.length>0&&(0,i.jsxs)("div",{className:"sm:col-span-2",children:[(0,i.jsx)("dt",{className:"text-sm font-medium text-gray-500",children:"Permissions"}),(0,i.jsx)("dd",{className:"mt-1",children:(0,i.jsx)("div",{className:"flex flex-wrap gap-2",children:h.permissions.map(e=>(0,i.jsx)("span",{className:"inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-indigo-100 text-indigo-800",children:e},e))})})]})]}):(0,i.jsx)("div",{className:"text-center py-6",children:(0,i.jsx)("p",{className:"text-gray-500",children:"Unable to load user information"})})]})}),s&&(0,i.jsx)("div",{className:"bg-white shadow rounded-lg mb-6",children:(0,i.jsxs)("div",{className:"px-4 py-5 sm:p-6",children:[(0,i.jsx)("h2",{className:"text-lg font-medium text-gray-900 mb-4",children:"Current Agent"}),(0,i.jsxs)("dl",{className:"grid grid-cols-1 gap-x-4 gap-y-6 sm:grid-cols-2",children:[(0,i.jsxs)("div",{children:[(0,i.jsx)("dt",{className:"text-sm font-medium text-gray-500",children:"Agent Name"}),(0,i.jsx)("dd",{className:"mt-1 text-sm text-gray-900",children:s.agent_name})]}),(0,i.jsxs)("div",{children:[(0,i.jsx)("dt",{className:"text-sm font-medium text-gray-500",children:"Agent ID"}),(0,i.jsx)("dd",{className:"mt-1 text-sm text-gray-900 font-mono",children:s.agent_id})]}),(0,i.jsxs)("div",{children:[(0,i.jsx)("dt",{className:"text-sm font-medium text-gray-500",children:"Status"}),(0,i.jsx)("dd",{className:"mt-1",children:(0,i.jsx)("span",{className:"inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium ".concat("running"===s.status?"bg-green-100 text-green-800":"stopped"===s.status?"bg-red-100 text-red-800":"bg-yellow-100 text-yellow-800"),children:s.status})})]}),(0,i.jsxs)("div",{children:[(0,i.jsx)("dt",{className:"text-sm font-medium text-gray-500",children:"Health"}),(0,i.jsx)("dd",{className:"mt-1",children:(0,i.jsx)("span",{className:"inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium ".concat("healthy"===s.health?"bg-green-100 text-green-800":"unhealthy"===s.health?"bg-red-100 text-red-800":"bg-yellow-100 text-yellow-800"),children:s.health||"Unknown"})})]})]})]})}),(0,i.jsx)("div",{className:"bg-white shadow rounded-lg mb-6",children:(0,i.jsxs)("div",{className:"px-4 py-5 sm:p-6",children:[(0,i.jsx)("h2",{className:"text-lg font-medium text-gray-900 mb-6",children:"Connected Accounts"}),(0,i.jsx)("div",{className:"space-y-4 mb-6",children:y.map(e=>{var t;let s=b().includes(e.id),a=null==j||null==(t=j.linked_oauth_accounts)?void 0:t.find(t=>t.provider===e.id);return(0,i.jsxs)("div",{className:"flex items-center justify-between p-4 border border-gray-200 rounded-lg",children:[(0,i.jsxs)("div",{className:"flex items-center space-x-3",children:[(0,i.jsx)("div",{className:"flex-shrink-0",children:e.icon}),(0,i.jsxs)("div",{children:[(0,i.jsx)("p",{className:"text-sm font-medium text-gray-900",children:e.name}),s&&a?(0,i.jsxs)("div",{children:[(0,i.jsxs)("p",{className:"text-sm text-gray-500",children:["Connected as ",a.account_name||a.external_id]}),a.linked_at&&(0,i.jsxs)("p",{className:"text-xs text-gray-400",children:["Linked ",new Date(a.linked_at).toLocaleDateString()]})]}):(0,i.jsx)("p",{className:"text-sm text-gray-500",children:"Not connected"})]})]}),s&&a?(0,i.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,i.jsx)("span",{className:"inline-flex items-center px-2 py-1 rounded-full text-xs font-medium bg-green-100 text-green-800",children:"Connected"}),!a.is_primary&&(0,i.jsx)("button",{onClick:()=>w.mutate({provider:a.provider,external_id:a.external_id}),disabled:w.isPending,className:"text-sm text-red-600 hover:text-red-800 disabled:opacity-50",children:"Disconnect"})]}):(0,i.jsxs)("button",{onClick:()=>N(e.id),className:"inline-flex items-center px-4 py-2 border text-sm font-medium rounded-md focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 ".concat(e.color),children:["Connect ",e.name]})]},e.id)})}),(0,i.jsx)("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-4",children:(0,i.jsxs)("div",{className:"flex",children:[(0,i.jsx)("div",{className:"flex-shrink-0",children:(0,i.jsx)("svg",{className:"h-5 w-5 text-blue-400",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",children:(0,i.jsx)("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z",clipRule:"evenodd"})})}),(0,i.jsx)("div",{className:"ml-3",children:(0,i.jsxs)("p",{className:"text-sm text-blue-700",children:[(0,i.jsx)("strong",{children:"Connect your accounts"})," to use them for authentication and access control. You can safely connect multiple accounts and disconnect them at any time."]})})]})})]})}),(0,i.jsx)("div",{className:"bg-white shadow rounded-lg",children:(0,i.jsxs)("div",{className:"px-4 py-5 sm:p-6",children:[(0,i.jsx)("h2",{className:"text-lg font-medium text-gray-900 mb-4",children:"Account Actions"}),(0,i.jsx)("div",{className:"space-y-4",children:(0,i.jsxs)("div",{className:"flex items-center justify-between p-4 border border-gray-200 rounded-lg",children:[(0,i.jsxs)("div",{children:[(0,i.jsx)("h3",{className:"text-sm font-medium text-gray-900",children:"Sign Out"}),(0,i.jsx)("p",{className:"text-sm text-gray-500",children:"Sign out of your account and return to the login page"})]}),(0,i.jsx)("button",{onClick:M,className:"inline-flex items-center px-4 py-2 border border-transparent text-sm font-medium rounded-md text-white bg-red-600 hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500",children:"Sign Out"})]})})]})})]})]})}function y(){return(0,i.jsx)(h.O,{children:(0,i.jsx)(j,{})})}}},e=>{var t=t=>e(e.s=t);e.O(0,[4534,8903,3297,8072,704,3835,587,8315,7358],()=>t(1997)),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5465],{2142:(e,t,s)=>{Promise.resolve().then(s.bind(s,4768))},3120:(e,t,s)=>{"use strict";s.d(t,{_:()=>l});var a=s(704);function r(){let e=window.location.hostname,t=window.location.pathname,s=t.startsWith("/agent/");if("agents.ciris.ai"!==e&&!s)return{mode:"standalone",agentId:"default",apiBase:"/v1"};{let e="default";e=s?t.split("/")[2]||"default":localStorage.getItem("selectedAgentId")||"default";let a="/api/".concat(e,"/v1");return{mode:"managed",agentId:e,apiBase:a}}}var n=s(5950);class i{configure(e,t){let s,{mode:a}=r();if("managed"===a)s="".concat(window.location.origin,"/api/").concat(e);else{let t=localStorage.getItem("agent_".concat(e,"_api_url"));s=t||window.location.origin}t||(t=n.a.getAccessToken()||void 0);let i={baseURL:s,authToken:t,agentId:e,mode:a};return this.hasConfigChanged(i)&&this.applyConfiguration(i),i}configureForOAuthCallback(e,t){let s,{mode:a}=r(),n={baseURL:"managed"===a?"".concat(window.location.origin,"/api/").concat(e):window.location.origin,authToken:t,agentId:e,mode:a};return this.applyConfiguration(n),this.storeConfiguration(n),n}getCurrentConfig(){return this.currentConfig}isConfiguredFor(e){return!!this.currentConfig&&this.currentConfig.agentId===e&&!!this.currentConfig.authToken}clear(){this.currentConfig=null,localStorage.removeItem("sdk_config"),this.log("SDK configuration cleared")}applyConfiguration(e){this.log("Applying SDK configuration:",e),a.AQ.setConfig({baseURL:e.baseURL,authToken:e.authToken}),this.currentConfig=e,this.log("SDK configured successfully")}hasConfigChanged(e){return!this.currentConfig||this.currentConfig.baseURL!==e.baseURL||this.currentConfig.authToken!==e.authToken||this.currentConfig.agentId!==e.agentId||this.currentConfig.mode!==e.mode}storeConfiguration(e){let t={baseURL:e.baseURL,agentId:e.agentId,mode:e.mode};localStorage.setItem("sdk_config",JSON.stringify(t)),"standalone"===e.mode&&e.baseURL!==window.location.origin&&localStorage.setItem("agent_".concat(e.agentId,"_api_url"),e.baseURL)}restoreConfiguration(){let e=localStorage.getItem("sdk_config");if(!e)return null;try{let t=JSON.parse(e),s=n.a.getAccessToken()||void 0;return{...t,authToken:s}}catch(e){return null}}log(){for(var e=arguments.length,t=Array(e),s=0;s<e;s++)t[s]=arguments[s];this.debugMode&&console.log("[SDKConfigManager]",...t)}constructor(){this.currentConfig=null,this.debugMode=!1}}let l=new i},4768:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>m});var a=s(4568),r=s(7620),n=s(9484),i=s(704),l=s(6264),o=s(7192),c=s(7261),d=s.n(c);function u(){let{user:e}=(0,n.A)(),[t,s]=(0,r.useState)([]),[c,u]=(0,r.useState)(!1),[m,x]=(0,r.useState)(!1),[g,h]=(0,r.useState)({request_type:"access",email:(null==e?void 0:e.username)||"",details:""}),[p,y]=(0,r.useState)(!1),[f,b]=(0,r.useState)("full"),[j,N]=(0,r.useState)(!1),[v,w]=(0,r.useState)(!1),[D,C]=(0,r.useState)(null),[A,S]=(0,r.useState)(!1),[k,_]=(0,r.useState)(!1),[R,I]=(0,r.useState)(null);(0,r.useEffect)(()=>{((null==e?void 0:e.role)==="ADMIN"||(null==e?void 0:e.role)==="SYSTEM_ADMIN")&&q()},[e]);let q=async()=>{u(!0);try{let e=await i.AQ.dsar.listRequests();s(e)}catch(e){console.error("Failed to fetch DSAR requests:",e)}finally{u(!1)}},T=async t=>{t.preventDefault(),y(!0);try{let t=await i.AQ.dsar.submitRequest(g);alert("DSAR request submitted successfully! Ticket ID: ".concat(t.ticket_id)),x(!1),h({request_type:"access",email:(null==e?void 0:e.username)||"",details:""}),((null==e?void 0:e.role)==="ADMIN"||(null==e?void 0:e.role)==="SYSTEM_ADMIN")&&q()}catch(t){console.error("Failed to submit DSAR request:",t);let e=(0,o.PE)(t);alert("Failed to submit request: ".concat(e))}finally{y(!1)}},E=async()=>{N(!0),w(!1);try{let e=await i.AQ.consent.downloadConsentData(f);C(e),w(!0),setTimeout(()=>w(!1),5e3)}catch(t){console.error("Failed to export consent data:",t);let e=(0,o.PE)(t);alert("Failed to export data: ".concat(e))}finally{N(!1)}},M=async()=>{_(!0);try{let e=await i.AQ.consent.revokeConsent("User requested data deletion via Privacy & Data page");I(e),S(!1),alert("Consent revoked successfully. Decay protocol initiated (90-day gradual anonymization).")}catch(t){console.error("Failed to revoke consent:",t);let e=(0,o.PE)(t);alert("Failed to revoke consent: ".concat(e))}finally{_(!1)}},U=e=>{switch(e){case"access":return{text:"Data Access",icon:"\uD83D\uDC41️",color:"blue"};case"delete":return{text:"Data Deletion",icon:"\uD83D\uDDD1️",color:"red"};case"export":return{text:"Data Export",icon:"\uD83D\uDCE6",color:"green"};case"correct":return{text:"Data Correction",icon:"✏️",color:"yellow"};default:return{text:e,icon:"\uD83D\uDCCB",color:"gray"}}},L=e=>{switch(e.toLowerCase()){case"pending":return"bg-yellow-100 text-yellow-800";case"in_progress":return"bg-blue-100 text-blue-800";case"completed":return"bg-green-100 text-green-800";case"rejected":return"bg-red-100 text-red-800";default:return"bg-gray-100 text-gray-800"}};return(0,a.jsx)(l.O,{children:(0,a.jsxs)("div",{className:"min-h-screen bg-gray-50",children:[(0,a.jsx)("div",{className:"bg-white shadow-sm border-b",children:(0,a.jsx)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-4",children:(0,a.jsx)("div",{className:"flex items-center justify-between",children:(0,a.jsxs)("div",{children:[(0,a.jsx)("h1",{className:"text-2xl font-bold text-gray-900",children:"Account"}),(0,a.jsx)("p",{className:"mt-1 text-sm text-gray-600",children:"Manage your account settings and privacy preferences"})]})})})}),(0,a.jsx)("div",{className:"bg-white border-b",children:(0,a.jsx)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:(0,a.jsxs)("nav",{className:"flex space-x-8",children:[(0,a.jsx)(d(),{href:"/account",className:"border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300 whitespace-nowrap py-4 px-1 border-b-2 font-medium text-sm",children:"Details"}),(0,a.jsx)(d(),{href:"/account/consent",className:"border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300 whitespace-nowrap py-4 px-1 border-b-2 font-medium text-sm",children:"Consent"}),(0,a.jsx)("span",{className:"border-indigo-500 text-indigo-600 whitespace-nowrap py-4 px-1 border-b-2 font-medium text-sm",children:"Privacy & Data"})]})})}),(0,a.jsxs)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8",children:[(0,a.jsxs)("div",{className:"mb-8 bg-white rounded-lg shadow p-6",children:[(0,a.jsx)("h2",{className:"text-lg font-semibold text-gray-900 mb-4",children:"Privacy & Data Rights"}),(0,a.jsx)("p",{className:"text-gray-600 mb-4",children:"Under GDPR and other privacy regulations, you have specific rights regarding your personal data. Use the Data Subject Access Request (DSAR) system to exercise these rights."}),(0,a.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4",children:[(0,a.jsxs)("div",{className:"p-4 border rounded-lg",children:[(0,a.jsx)("div",{className:"text-2xl mb-2",children:"\uD83D\uDC41️"}),(0,a.jsx)("h3",{className:"font-medium text-gray-900",children:"Access"}),(0,a.jsx)("p",{className:"text-sm text-gray-600",children:"Request a copy of your personal data"})]}),(0,a.jsxs)("div",{className:"p-4 border rounded-lg",children:[(0,a.jsx)("div",{className:"text-2xl mb-2",children:"\uD83D\uDDD1️"}),(0,a.jsx)("h3",{className:"font-medium text-gray-900",children:"Deletion"}),(0,a.jsx)("p",{className:"text-sm text-gray-600",children:"Request deletion of your personal data"})]}),(0,a.jsxs)("div",{className:"p-4 border rounded-lg",children:[(0,a.jsx)("div",{className:"text-2xl mb-2",children:"\uD83D\uDCE6"}),(0,a.jsx)("h3",{className:"font-medium text-gray-900",children:"Export"}),(0,a.jsx)("p",{className:"text-sm text-gray-600",children:"Export your data in a portable format"})]}),(0,a.jsxs)("div",{className:"p-4 border rounded-lg",children:[(0,a.jsx)("div",{className:"text-2xl mb-2",children:"✏️"}),(0,a.jsx)("h3",{className:"font-medium text-gray-900",children:"Correction"}),(0,a.jsx)("p",{className:"text-sm text-gray-600",children:"Request correction of inaccurate data"})]})]})]}),(0,a.jsxs)("div",{className:"mb-8 bg-white rounded-lg shadow p-6",children:[(0,a.jsx)("h2",{className:"text-lg font-semibold text-gray-900 mb-4",children:"\uD83D\uDCE5 Download Your Consent Data"}),(0,a.jsx)("p",{className:"text-gray-600 mb-6",children:"Instantly download your consent status, impact metrics, and consent history as a JSON file. This is the fastest way to get your consent-related data."}),(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Choose what to download:"}),(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsxs)("label",{className:"flex items-center p-3 border rounded-lg cursor-pointer hover:bg-gray-50",children:[(0,a.jsx)("input",{type:"radio",name:"exportType",value:"full",checked:"full"===f,onChange:e=>b(e.target.value),className:"h-4 w-4 text-indigo-600 focus:ring-indigo-500 border-gray-300"}),(0,a.jsxs)("div",{className:"ml-3",children:[(0,a.jsx)("div",{className:"text-sm font-medium text-gray-900",children:"Complete Data Export (Recommended)"}),(0,a.jsx)("div",{className:"text-xs text-gray-600",children:"All consent data, impact metrics, and complete audit history"})]})]}),(0,a.jsxs)("label",{className:"flex items-center p-3 border rounded-lg cursor-pointer hover:bg-gray-50",children:[(0,a.jsx)("input",{type:"radio",name:"exportType",value:"consent_only",checked:"consent_only"===f,onChange:e=>b(e.target.value),className:"h-4 w-4 text-indigo-600 focus:ring-indigo-500 border-gray-300"}),(0,a.jsxs)("div",{className:"ml-3",children:[(0,a.jsx)("div",{className:"text-sm font-medium text-gray-900",children:"Consent Data Only"}),(0,a.jsx)("div",{className:"text-xs text-gray-600",children:"Your current consent status and categories"})]})]}),(0,a.jsxs)("label",{className:"flex items-center p-3 border rounded-lg cursor-pointer hover:bg-gray-50",children:[(0,a.jsx)("input",{type:"radio",name:"exportType",value:"impact_only",checked:"impact_only"===f,onChange:e=>b(e.target.value),className:"h-4 w-4 text-indigo-600 focus:ring-indigo-500 border-gray-300"}),(0,a.jsxs)("div",{className:"ml-3",children:[(0,a.jsx)("div",{className:"text-sm font-medium text-gray-900",children:"Impact Metrics"}),(0,a.jsx)("div",{className:"text-xs text-gray-600",children:"Your contribution statistics"})]})]}),(0,a.jsxs)("label",{className:"flex items-center p-3 border rounded-lg cursor-pointer hover:bg-gray-50",children:[(0,a.jsx)("input",{type:"radio",name:"exportType",value:"audit_only",checked:"audit_only"===f,onChange:e=>b(e.target.value),className:"h-4 w-4 text-indigo-600 focus:ring-indigo-500 border-gray-300"}),(0,a.jsxs)("div",{className:"ml-3",children:[(0,a.jsx)("div",{className:"text-sm font-medium text-gray-900",children:"Audit Trail"}),(0,a.jsx)("div",{className:"text-xs text-gray-600",children:"Complete consent change history"})]})]})]})]}),(0,a.jsx)("button",{onClick:E,disabled:j,className:"w-full bg-indigo-600 text-white px-6 py-3 rounded-lg text-sm font-medium hover:bg-indigo-700 disabled:bg-gray-400 disabled:cursor-not-allowed flex items-center justify-center",children:j?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"animate-spin rounded-full h-4 w-4 border-b-2 border-white mr-2"}),"Exporting..."]}):"Download Data"}),v&&D&&(0,a.jsx)("div",{className:"mt-4 p-4 bg-green-50 border border-green-200 rounded-lg",children:(0,a.jsxs)("div",{className:"flex items-start",children:[(0,a.jsx)("div",{className:"text-2xl mr-3",children:"✅"}),(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsx)("h4",{className:"text-sm font-medium text-green-900 mb-1",children:"Data Export Complete!"}),(0,a.jsxs)("p",{className:"text-xs text-green-700 mb-2",children:["Request ID: ",D]}),(0,a.jsxs)("p",{className:"text-xs text-green-600",children:["Your data has been downloaded as"," ",(0,a.jsxs)("code",{className:"bg-green-100 px-1 py-0.5 rounded",children:["ciris-consent-export-",D,".json"]})]})]})]})})]})]}),(0,a.jsxs)("div",{className:"mb-8 bg-white rounded-lg shadow p-6",children:[(0,a.jsx)("h2",{className:"text-lg font-semibold text-gray-900 mb-4 flex items-center",children:"\uD83D\uDDD1️ Request Data Deletion"}),(0,a.jsx)("p",{className:"text-gray-600 mb-4",children:"You can request deletion of your consent data at any time. CIRIS uses a gradual 90-day decay protocol to ensure safe anonymization while retaining safety patterns."}),R?(0,a.jsxs)("div",{className:"bg-purple-50 border border-purple-200 rounded-lg p-6",children:[(0,a.jsx)("h4",{className:"text-lg font-medium text-purple-900 mb-3",children:"Decay Protocol Initiated"}),(0,a.jsxs)("div",{className:"space-y-3 text-sm text-purple-800",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between py-2 border-b border-purple-200",children:[(0,a.jsx)("span",{children:"Decay Started:"}),(0,a.jsx)("span",{className:"font-medium",children:new Date(R.decay_started).toLocaleDateString()})]}),(0,a.jsxs)("div",{className:"flex items-center justify-between py-2 border-b border-purple-200",children:[(0,a.jsx)("span",{children:"Identity Severed:"}),(0,a.jsx)("span",{className:"font-medium",children:R.identity_severed?"✓ Yes":"✗ No"})]}),(0,a.jsxs)("div",{className:"flex items-center justify-between py-2 border-b border-purple-200",children:[(0,a.jsx)("span",{children:"Patterns Anonymized:"}),(0,a.jsx)("span",{className:"font-medium",children:R.patterns_anonymized?"✓ Yes":"✗ No"})]}),(0,a.jsxs)("div",{className:"flex items-center justify-between py-2 border-b border-purple-200",children:[(0,a.jsx)("span",{children:"Complete By:"}),(0,a.jsx)("span",{className:"font-medium",children:new Date(R.decay_complete_at).toLocaleDateString()})]}),(0,a.jsxs)("div",{className:"flex items-center justify-between py-2",children:[(0,a.jsx)("span",{children:"Safety Patterns Retained:"}),(0,a.jsx)("span",{className:"font-medium",children:R.safety_patterns_retained})]})]}),(0,a.jsxs)("div",{className:"mt-4 text-xs text-purple-600",children:[(0,a.jsx)("p",{children:"The decay protocol will complete over 90 days:"}),(0,a.jsxs)("ul",{className:"mt-2 space-y-1 ml-4",children:[(0,a.jsx)("li",{children:"• Days 0-30: Relationship context retained"}),(0,a.jsx)("li",{children:"• Days 31-60: Behavioral data aggregated"}),(0,a.jsx)("li",{children:"• Days 61-90: Identity markers removed"}),(0,a.jsx)("li",{children:"• Day 90: Complete anonymization"})]})]})]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"bg-yellow-50 border border-yellow-200 rounded-lg p-4 mb-4",children:[(0,a.jsx)("h4",{className:"text-sm font-medium text-yellow-900 mb-2",children:"⚠️ Before You Delete"}),(0,a.jsxs)("ul",{className:"text-sm text-yellow-800 space-y-1 mb-3",children:[(0,a.jsx)("li",{children:"• Download your data first (using the section above)"}),(0,a.jsx)("li",{children:"• Deletion initiates a 90-day decay protocol"}),(0,a.jsx)("li",{children:"• Your identity is immediately severed"}),(0,a.jsx)("li",{children:"• Behavioral patterns are gradually anonymized"}),(0,a.jsx)("li",{children:"• Safety patterns may be retained (anonymized)"})]})]}),A?(0,a.jsx)("div",{className:"space-y-4",children:(0,a.jsxs)("div",{className:"bg-red-50 border-2 border-red-300 rounded-lg p-4",children:[(0,a.jsx)("h4",{className:"text-sm font-medium text-red-900 mb-2",children:"⚠️ Final Confirmation"}),(0,a.jsx)("p",{className:"text-sm text-red-800 mb-3",children:"This will revoke your consent and initiate the decay protocol. Are you absolutely sure?"}),(0,a.jsxs)("div",{className:"flex gap-3",children:[(0,a.jsx)("button",{onClick:M,disabled:k,className:"flex-1 bg-red-600 text-white px-4 py-2 rounded-lg text-sm font-medium hover:bg-red-700 disabled:bg-gray-400",children:k?"Processing...":"Yes, Delete My Data"}),(0,a.jsx)("button",{onClick:()=>S(!1),disabled:k,className:"flex-1 bg-gray-200 text-gray-700 px-4 py-2 rounded-lg text-sm font-medium hover:bg-gray-300",children:"Cancel"})]})]})}):(0,a.jsx)("button",{onClick:()=>S(!0),className:"w-full bg-red-600 text-white px-6 py-3 rounded-lg text-sm font-medium hover:bg-red-700",children:"Request Data Deletion"})]})]}),(0,a.jsxs)("div",{className:"mb-8 bg-white rounded-lg shadow p-6",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,a.jsx)("h2",{className:"text-lg font-semibold text-gray-900",children:"Submit Data Request"}),!m&&(0,a.jsx)("button",{onClick:()=>x(!0),className:"bg-indigo-600 text-white px-4 py-2 rounded-md text-sm font-medium hover:bg-indigo-700",children:"New Request"})]}),m&&(0,a.jsxs)("form",{onSubmit:T,className:"space-y-4",children:[(0,a.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Request Type"}),(0,a.jsxs)("select",{value:g.request_type,onChange:e=>h(t=>({...t,request_type:e.target.value})),className:"w-full border border-gray-300 rounded-md px-3 py-2 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500",required:!0,children:[(0,a.jsx)("option",{value:"access",children:"Data Access"}),(0,a.jsx)("option",{value:"delete",children:"Data Deletion"}),(0,a.jsx)("option",{value:"export",children:"Data Export"}),(0,a.jsx)("option",{value:"correct",children:"Data Correction"})]})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Email Address"}),(0,a.jsx)("input",{type:"email",value:g.email,onChange:e=>h(t=>({...t,email:e.target.value})),className:"w-full border border-gray-300 rounded-md px-3 py-2 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500",required:!0})]})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"User Identifier (Optional)"}),(0,a.jsx)("input",{type:"text",value:g.user_identifier||"",onChange:e=>h(t=>({...t,user_identifier:e.target.value})),className:"w-full border border-gray-300 rounded-md px-3 py-2 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500",placeholder:"Discord ID, username, etc."})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Request Details"}),(0,a.jsx)("textarea",{value:g.details||"",onChange:e=>h(t=>({...t,details:e.target.value})),rows:4,className:"w-full border border-gray-300 rounded-md px-3 py-2 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500",placeholder:"Please provide specific details about your request..."})]}),(0,a.jsxs)("div",{className:"flex items-center",children:[(0,a.jsx)("input",{type:"checkbox",checked:g.urgent||!1,onChange:e=>h(t=>({...t,urgent:e.target.checked})),className:"h-4 w-4 text-indigo-600 focus:ring-indigo-500 border-gray-300 rounded"}),(0,a.jsx)("label",{className:"ml-2 block text-sm text-gray-700",children:"Urgent request (requires justification in details)"})]}),(0,a.jsxs)("div",{className:"flex items-center space-x-4",children:[(0,a.jsx)("button",{type:"submit",disabled:p,className:"bg-indigo-600 text-white px-4 py-2 rounded-md text-sm font-medium hover:bg-indigo-700 disabled:bg-gray-400 disabled:cursor-not-allowed",children:p?"Submitting...":"Submit Request"}),(0,a.jsx)("button",{type:"button",onClick:()=>{x(!1),h({request_type:"access",email:(null==e?void 0:e.username)||"",details:""})},className:"text-gray-600 hover:text-gray-800",children:"Cancel"})]})]})]}),((null==e?void 0:e.role)==="ADMIN"||(null==e?void 0:e.role)==="SYSTEM_ADMIN")&&(0,a.jsxs)("div",{className:"bg-white rounded-lg shadow p-6",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,a.jsx)("h2",{className:"text-lg font-semibold text-gray-900",children:"All DSAR Requests (Admin View)"}),(0,a.jsx)("button",{onClick:q,disabled:c,className:"text-indigo-600 hover:text-indigo-800 text-sm font-medium",children:c?"Refreshing...":"Refresh"})]}),c?(0,a.jsx)("div",{className:"animate-pulse space-y-3",children:[1,2,3].map(e=>(0,a.jsx)("div",{className:"h-16 bg-gray-200 rounded"},e))}):0===t.length?(0,a.jsx)("p",{className:"text-gray-500 text-center py-8",children:"No DSAR requests found"}):(0,a.jsx)("div",{className:"overflow-x-auto",children:(0,a.jsxs)("table",{className:"min-w-full divide-y divide-gray-200",children:[(0,a.jsx)("thead",{children:(0,a.jsxs)("tr",{children:[(0,a.jsx)("th",{className:"px-4 py-2 text-left text-xs font-medium text-gray-500 uppercase",children:"Ticket ID"}),(0,a.jsx)("th",{className:"px-4 py-2 text-left text-xs font-medium text-gray-500 uppercase",children:"Type"}),(0,a.jsx)("th",{className:"px-4 py-2 text-left text-xs font-medium text-gray-500 uppercase",children:"Email"}),(0,a.jsx)("th",{className:"px-4 py-2 text-left text-xs font-medium text-gray-500 uppercase",children:"Status"}),(0,a.jsx)("th",{className:"px-4 py-2 text-left text-xs font-medium text-gray-500 uppercase",children:"Created"}),(0,a.jsx)("th",{className:"px-4 py-2 text-left text-xs font-medium text-gray-500 uppercase",children:"Urgent"})]})}),(0,a.jsx)("tbody",{className:"divide-y divide-gray-200",children:t.map(e=>{let t=U(e.request_type);return(0,a.jsxs)("tr",{className:"hover:bg-gray-50",children:[(0,a.jsx)("td",{className:"px-4 py-3 text-sm font-mono text-gray-900",children:e.ticket_id}),(0,a.jsx)("td",{className:"px-4 py-3 text-sm",children:(0,a.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,a.jsx)("span",{children:t.icon}),(0,a.jsx)("span",{children:t.text})]})}),(0,a.jsx)("td",{className:"px-4 py-3 text-sm text-gray-600",children:e.email}),(0,a.jsx)("td",{className:"px-4 py-3 text-sm",children:(0,a.jsx)("span",{className:"px-2 py-1 text-xs rounded-full ".concat(L(e.status)),children:e.status})}),(0,a.jsx)("td",{className:"px-4 py-3 text-sm text-gray-600",children:new Date(e.created_at).toLocaleDateString()}),(0,a.jsx)("td",{className:"px-4 py-3 text-sm",children:e.urgent&&(0,a.jsx)("span",{className:"text-red-600 font-medium",children:"⚠️ Urgent"})})]},e.ticket_id)})})]})})]}),(0,a.jsx)("div",{className:"mt-8 text-center text-xs text-gray-500",children:(0,a.jsx)("p",{children:"DSAR requests are processed according to applicable privacy regulations. Response times may vary based on request complexity and legal requirements."})})]})]})})}function m(){return(0,a.jsx)(u,{})}},6264:(e,t,s)=>{"use strict";s.d(t,{O:()=>l});var a=s(4568),r=s(7620),n=s(2942),i=s(9484);function l(e){let{children:t,requiredRole:s,requiredPermission:l}=e,{user:o,loading:c,hasRole:d,hasPermission:u}=(0,i.A)(),m=(0,n.useRouter)();return((0,r.useEffect)(()=>{if(!c){if(!o)return void m.push("/login");if(s&&!d(s)||l&&!u(l))return void m.push("/unauthorized")}},[o,c,s,l,d,u,m]),c)?(0,a.jsx)("div",{className:"flex items-center justify-center min-h-screen",children:(0,a.jsx)("div",{className:"text-lg",children:"Loading..."})}):o&&(!s||d(s))&&(!l||u(l))?(0,a.jsx)(a.Fragment,{children:t}):null}},7192:(e,t,s)=>{"use strict";function a(e){if(!e)return"Unknown error";if("string"==typeof e)return e;if(Array.isArray(e))return e.map(e=>"string"==typeof e?e:e.msg?e.msg:e.message?e.message:JSON.stringify(e)).join("; ");if(e.detail){if(Array.isArray(e.detail))return e.detail.map(e=>{let t=Array.isArray(e.loc)?e.loc.join("."):e.loc||"",s=e.msg||e.message||"Validation error";return t?"".concat(t,": ").concat(s):s}).join("; ");if("string"==typeof e.detail)return e.detail;if("object"==typeof e.detail)return JSON.stringify(e.detail)}if(e.message&&"string"==typeof e.message)return e.message;if(e.error&&"string"==typeof e.error)return e.error;if(e.statusText&&"string"==typeof e.statusText)return e.statusText;try{let t=JSON.stringify(e);if(t.length>200)return"Complex error object (see console for details)";return t}catch(e){return"Unknown error (see console for details)"}}s.d(t,{PE:()=>a})},9484:(e,t,s)=>{"use strict";s.d(t,{A:()=>u,O:()=>d});var a=s(4568),r=s(7620),n=s(2942),i=s(3237),l=s(704),o=s(3120);let c=(0,r.createContext)(void 0);function d(e){let{children:t}=e,[s,d]=(0,r.useState)(null),[u,m]=(0,r.useState)(!0),[x,g]=(0,r.useState)(null),h=(0,n.useRouter)();(0,r.useEffect)(()=>{let e=window.location.pathname;"/login"===e||e.startsWith("/manager")?m(!1):p();let t=localStorage.getItem("manager_token");t&&g(t)},[]);let p=async()=>{try{if(l.AQ.isAuthenticated()){let e=await l.AQ.auth.getMe();d(e)}}catch(e){console.error("Auth check failed:",e)}finally{m(!1)}},y=(0,r.useCallback)(async(e,t)=>{try{let s=localStorage.getItem("selectedAgentId");if(!s)throw Error("No agent selected");o._.configure(s);let a=await l.AQ.login(e,t),r=l.AQ.auth.getAccessToken();r&&o._.configure(s,r),d(a),i.Ay.success("Welcome, ".concat(a.username||a.user_id,"!")),h.push("/")}catch(e){throw i.Ay.error(e.message||"Login failed"),e}},[h]),f=(0,r.useCallback)(async()=>{try{await l.AQ.logout(),d(null),i.Ay.success("Logged out successfully"),h.push("/login")}catch(e){console.error("Logout failed:",e),i.Ay.error("Logout failed")}},[h]),b=(0,r.useCallback)(e=>!!s&&(s.permissions.includes(e)||"SYSTEM_ADMIN"===s.role),[s]),j=(0,r.useCallback)(e=>{if(!s)return!1;let t=["OBSERVER","ADMIN","AUTHORITY","SYSTEM_ADMIN"];return t.indexOf(s.role)>=t.indexOf(e)},[s]),N=(0,r.useCallback)(e=>{l.AQ.setConfig({authToken:e})},[]),v=(0,r.useCallback)(()=>!!x,[x]);return(0,a.jsx)(c.Provider,{value:{user:s,loading:u,login:y,logout:f,hasPermission:b,hasRole:j,setUser:d,setToken:N,managerToken:x,setManagerToken:g,isManagerAuthenticated:v},children:t})}function u(){let e=(0,r.useContext)(c);if(void 0===e)throw Error("useAuth must be used within an AuthProvider");return e}}},e=>{var t=t=>e(e.s=t);e.O(0,[4534,8072,704,587,8315,7358],()=>t(2142)),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5465],{3120:(e,t,s)=>{"use strict";s.d(t,{_:()=>l});var a=s(704);function r(){let e=window.location.hostname,t=window.location.pathname,s=t.startsWith("/agent/");if("agents.ciris.ai"!==e&&!s)return{mode:"standalone",agentId:"default",apiBase:"/v1"};{let e="default";e=s?t.split("/")[2]||"default":localStorage.getItem("selectedAgentId")||"default";let a="/api/".concat(e,"/v1");return{mode:"managed",agentId:e,apiBase:a}}}var n=s(5950);class i{configure(e,t){let s,{mode:a}=r();if("managed"===a)s="".concat(window.location.origin,"/api/").concat(e);else{let t=localStorage.getItem("agent_".concat(e,"_api_url"));s=t||window.location.origin}t||(t=n.a.getAccessToken()||void 0);let i={baseURL:s,authToken:t,agentId:e,mode:a};return this.hasConfigChanged(i)&&this.applyConfiguration(i),i}configureForOAuthCallback(e,t){let s,{mode:a}=r(),n={baseURL:"managed"===a?"".concat(window.location.origin,"/api/").concat(e):window.location.origin,authToken:t,agentId:e,mode:a};return this.applyConfiguration(n),this.storeConfiguration(n),n}getCurrentConfig(){return this.currentConfig}isConfiguredFor(e){return!!this.currentConfig&&this.currentConfig.agentId===e&&!!this.currentConfig.authToken}clear(){this.currentConfig=null,localStorage.removeItem("sdk_config"),this.log("SDK configuration cleared")}applyConfiguration(e){this.log("Applying SDK configuration:",e),a.AQ.setConfig({baseURL:e.baseURL,authToken:e.authToken}),this.currentConfig=e,this.log("SDK configured successfully")}hasConfigChanged(e){return!this.currentConfig||this.currentConfig.baseURL!==e.baseURL||this.currentConfig.authToken!==e.authToken||this.currentConfig.agentId!==e.agentId||this.currentConfig.mode!==e.mode}storeConfiguration(e){let t={baseURL:e.baseURL,agentId:e.agentId,mode:e.mode};localStorage.setItem("sdk_config",JSON.stringify(t)),"standalone"===e.mode&&e.baseURL!==window.location.origin&&localStorage.setItem("agent_".concat(e.agentId,"_api_url"),e.baseURL)}restoreConfiguration(){let e=localStorage.getItem("sdk_config");if(!e)return null;try{let t=JSON.parse(e),s=n.a.getAccessToken()||void 0;return{...t,authToken:s}}catch(e){return null}}log(){for(var e=arguments.length,t=Array(e),s=0;s<e;s++)t[s]=arguments[s];this.debugMode&&console.log("[SDKConfigManager]",...t)}constructor(){this.currentConfig=null,this.debugMode=!1}}let l=new i},4768:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>m});var a=s(4568),r=s(7620),n=s(9484),i=s(704),l=s(6264),o=s(7192),c=s(7261),d=s.n(c);function u(){let{user:e}=(0,n.A)(),[t,s]=(0,r.useState)([]),[c,u]=(0,r.useState)(!1),[m,x]=(0,r.useState)(!1),[g,h]=(0,r.useState)({request_type:"access",email:(null==e?void 0:e.username)||"",details:""}),[p,y]=(0,r.useState)(!1),[f,b]=(0,r.useState)("full"),[j,N]=(0,r.useState)(!1),[v,w]=(0,r.useState)(!1),[D,C]=(0,r.useState)(null),[A,S]=(0,r.useState)(!1),[k,_]=(0,r.useState)(!1),[R,I]=(0,r.useState)(null);(0,r.useEffect)(()=>{((null==e?void 0:e.role)==="ADMIN"||(null==e?void 0:e.role)==="SYSTEM_ADMIN")&&q()},[e]);let q=async()=>{u(!0);try{let e=await i.AQ.dsar.listRequests();s(e)}catch(e){console.error("Failed to fetch DSAR requests:",e)}finally{u(!1)}},T=async t=>{t.preventDefault(),y(!0);try{let t=await i.AQ.dsar.submitRequest(g);alert("DSAR request submitted successfully! Ticket ID: ".concat(t.ticket_id)),x(!1),h({request_type:"access",email:(null==e?void 0:e.username)||"",details:""}),((null==e?void 0:e.role)==="ADMIN"||(null==e?void 0:e.role)==="SYSTEM_ADMIN")&&q()}catch(t){console.error("Failed to submit DSAR request:",t);let e=(0,o.PE)(t);alert("Failed to submit request: ".concat(e))}finally{y(!1)}},E=async()=>{N(!0),w(!1);try{let e=await i.AQ.consent.downloadConsentData(f);C(e),w(!0),setTimeout(()=>w(!1),5e3)}catch(t){console.error("Failed to export consent data:",t);let e=(0,o.PE)(t);alert("Failed to export data: ".concat(e))}finally{N(!1)}},M=async()=>{_(!0);try{let e=await i.AQ.consent.revokeConsent("User requested data deletion via Privacy & Data page");I(e),S(!1),alert("Consent revoked successfully. Decay protocol initiated (90-day gradual anonymization).")}catch(t){console.error("Failed to revoke consent:",t);let e=(0,o.PE)(t);alert("Failed to revoke consent: ".concat(e))}finally{_(!1)}},U=e=>{switch(e){case"access":return{text:"Data Access",icon:"\uD83D\uDC41️",color:"blue"};case"delete":return{text:"Data Deletion",icon:"\uD83D\uDDD1️",color:"red"};case"export":return{text:"Data Export",icon:"\uD83D\uDCE6",color:"green"};case"correct":return{text:"Data Correction",icon:"✏️",color:"yellow"};default:return{text:e,icon:"\uD83D\uDCCB",color:"gray"}}},L=e=>{switch(e.toLowerCase()){case"pending":return"bg-yellow-100 text-yellow-800";case"in_progress":return"bg-blue-100 text-blue-800";case"completed":return"bg-green-100 text-green-800";case"rejected":return"bg-red-100 text-red-800";default:return"bg-gray-100 text-gray-800"}};return(0,a.jsx)(l.O,{children:(0,a.jsxs)("div",{className:"min-h-screen bg-gray-50",children:[(0,a.jsx)("div",{className:"bg-white shadow-sm border-b",children:(0,a.jsx)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-4",children:(0,a.jsx)("div",{className:"flex items-center justify-between",children:(0,a.jsxs)("div",{children:[(0,a.jsx)("h1",{className:"text-2xl font-bold text-gray-900",children:"Account"}),(0,a.jsx)("p",{className:"mt-1 text-sm text-gray-600",children:"Manage your account settings and privacy preferences"})]})})})}),(0,a.jsx)("div",{className:"bg-white border-b",children:(0,a.jsx)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:(0,a.jsxs)("nav",{className:"flex space-x-8",children:[(0,a.jsx)(d(),{href:"/account",className:"border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300 whitespace-nowrap py-4 px-1 border-b-2 font-medium text-sm",children:"Details"}),(0,a.jsx)(d(),{href:"/account/consent",className:"border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300 whitespace-nowrap py-4 px-1 border-b-2 font-medium text-sm",children:"Consent"}),(0,a.jsx)("span",{className:"border-indigo-500 text-indigo-600 whitespace-nowrap py-4 px-1 border-b-2 font-medium text-sm",children:"Privacy & Data"})]})})}),(0,a.jsxs)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8",children:[(0,a.jsxs)("div",{className:"mb-8 bg-white rounded-lg shadow p-6",children:[(0,a.jsx)("h2",{className:"text-lg font-semibold text-gray-900 mb-4",children:"Privacy & Data Rights"}),(0,a.jsx)("p",{className:"text-gray-600 mb-4",children:"Under GDPR and other privacy regulations, you have specific rights regarding your personal data. Use the Data Subject Access Request (DSAR) system to exercise these rights."}),(0,a.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4",children:[(0,a.jsxs)("div",{className:"p-4 border rounded-lg",children:[(0,a.jsx)("div",{className:"text-2xl mb-2",children:"\uD83D\uDC41️"}),(0,a.jsx)("h3",{className:"font-medium text-gray-900",children:"Access"}),(0,a.jsx)("p",{className:"text-sm text-gray-600",children:"Request a copy of your personal data"})]}),(0,a.jsxs)("div",{className:"p-4 border rounded-lg",children:[(0,a.jsx)("div",{className:"text-2xl mb-2",children:"\uD83D\uDDD1️"}),(0,a.jsx)("h3",{className:"font-medium text-gray-900",children:"Deletion"}),(0,a.jsx)("p",{className:"text-sm text-gray-600",children:"Request deletion of your personal data"})]}),(0,a.jsxs)("div",{className:"p-4 border rounded-lg",children:[(0,a.jsx)("div",{className:"text-2xl mb-2",children:"\uD83D\uDCE6"}),(0,a.jsx)("h3",{className:"font-medium text-gray-900",children:"Export"}),(0,a.jsx)("p",{className:"text-sm text-gray-600",children:"Export your data in a portable format"})]}),(0,a.jsxs)("div",{className:"p-4 border rounded-lg",children:[(0,a.jsx)("div",{className:"text-2xl mb-2",children:"✏️"}),(0,a.jsx)("h3",{className:"font-medium text-gray-900",children:"Correction"}),(0,a.jsx)("p",{className:"text-sm text-gray-600",children:"Request correction of inaccurate data"})]})]})]}),(0,a.jsxs)("div",{className:"mb-8 bg-white rounded-lg shadow p-6",children:[(0,a.jsx)("h2",{className:"text-lg font-semibold text-gray-900 mb-4",children:"\uD83D\uDCE5 Download Your Consent Data"}),(0,a.jsx)("p",{className:"text-gray-600 mb-6",children:"Instantly download your consent status, impact metrics, and consent history as a JSON file. This is the fastest way to get your consent-related data."}),(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Choose what to download:"}),(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsxs)("label",{className:"flex items-center p-3 border rounded-lg cursor-pointer hover:bg-gray-50",children:[(0,a.jsx)("input",{type:"radio",name:"exportType",value:"full",checked:"full"===f,onChange:e=>b(e.target.value),className:"h-4 w-4 text-indigo-600 focus:ring-indigo-500 border-gray-300"}),(0,a.jsxs)("div",{className:"ml-3",children:[(0,a.jsx)("div",{className:"text-sm font-medium text-gray-900",children:"Complete Data Export (Recommended)"}),(0,a.jsx)("div",{className:"text-xs text-gray-600",children:"All consent data, impact metrics, and complete audit history"})]})]}),(0,a.jsxs)("label",{className:"flex items-center p-3 border rounded-lg cursor-pointer hover:bg-gray-50",children:[(0,a.jsx)("input",{type:"radio",name:"exportType",value:"consent_only",checked:"consent_only"===f,onChange:e=>b(e.target.value),className:"h-4 w-4 text-indigo-600 focus:ring-indigo-500 border-gray-300"}),(0,a.jsxs)("div",{className:"ml-3",children:[(0,a.jsx)("div",{className:"text-sm font-medium text-gray-900",children:"Consent Data Only"}),(0,a.jsx)("div",{className:"text-xs text-gray-600",children:"Your current consent status and categories"})]})]}),(0,a.jsxs)("label",{className:"flex items-center p-3 border rounded-lg cursor-pointer hover:bg-gray-50",children:[(0,a.jsx)("input",{type:"radio",name:"exportType",value:"impact_only",checked:"impact_only"===f,onChange:e=>b(e.target.value),className:"h-4 w-4 text-indigo-600 focus:ring-indigo-500 border-gray-300"}),(0,a.jsxs)("div",{className:"ml-3",children:[(0,a.jsx)("div",{className:"text-sm font-medium text-gray-900",children:"Impact Metrics"}),(0,a.jsx)("div",{className:"text-xs text-gray-600",children:"Your contribution statistics"})]})]}),(0,a.jsxs)("label",{className:"flex items-center p-3 border rounded-lg cursor-pointer hover:bg-gray-50",children:[(0,a.jsx)("input",{type:"radio",name:"exportType",value:"audit_only",checked:"audit_only"===f,onChange:e=>b(e.target.value),className:"h-4 w-4 text-indigo-600 focus:ring-indigo-500 border-gray-300"}),(0,a.jsxs)("div",{className:"ml-3",children:[(0,a.jsx)("div",{className:"text-sm font-medium text-gray-900",children:"Audit Trail"}),(0,a.jsx)("div",{className:"text-xs text-gray-600",children:"Complete consent change history"})]})]})]})]}),(0,a.jsx)("button",{onClick:E,disabled:j,className:"w-full bg-indigo-600 text-white px-6 py-3 rounded-lg text-sm font-medium hover:bg-indigo-700 disabled:bg-gray-400 disabled:cursor-not-allowed flex items-center justify-center",children:j?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"animate-spin rounded-full h-4 w-4 border-b-2 border-white mr-2"}),"Exporting..."]}):"Download Data"}),v&&D&&(0,a.jsx)("div",{className:"mt-4 p-4 bg-green-50 border border-green-200 rounded-lg",children:(0,a.jsxs)("div",{className:"flex items-start",children:[(0,a.jsx)("div",{className:"text-2xl mr-3",children:"✅"}),(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsx)("h4",{className:"text-sm font-medium text-green-900 mb-1",children:"Data Export Complete!"}),(0,a.jsxs)("p",{className:"text-xs text-green-700 mb-2",children:["Request ID: ",D]}),(0,a.jsxs)("p",{className:"text-xs text-green-600",children:["Your data has been downloaded as"," ",(0,a.jsxs)("code",{className:"bg-green-100 px-1 py-0.5 rounded",children:["ciris-consent-export-",D,".json"]})]})]})]})})]})]}),(0,a.jsxs)("div",{className:"mb-8 bg-white rounded-lg shadow p-6",children:[(0,a.jsx)("h2",{className:"text-lg font-semibold text-gray-900 mb-4 flex items-center",children:"\uD83D\uDDD1️ Request Data Deletion"}),(0,a.jsx)("p",{className:"text-gray-600 mb-4",children:"You can request deletion of your consent data at any time. CIRIS uses a gradual 90-day decay protocol to ensure safe anonymization while retaining safety patterns."}),R?(0,a.jsxs)("div",{className:"bg-purple-50 border border-purple-200 rounded-lg p-6",children:[(0,a.jsx)("h4",{className:"text-lg font-medium text-purple-900 mb-3",children:"Decay Protocol Initiated"}),(0,a.jsxs)("div",{className:"space-y-3 text-sm text-purple-800",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between py-2 border-b border-purple-200",children:[(0,a.jsx)("span",{children:"Decay Started:"}),(0,a.jsx)("span",{className:"font-medium",children:new Date(R.decay_started).toLocaleDateString()})]}),(0,a.jsxs)("div",{className:"flex items-center justify-between py-2 border-b border-purple-200",children:[(0,a.jsx)("span",{children:"Identity Severed:"}),(0,a.jsx)("span",{className:"font-medium",children:R.identity_severed?"✓ Yes":"✗ No"})]}),(0,a.jsxs)("div",{className:"flex items-center justify-between py-2 border-b border-purple-200",children:[(0,a.jsx)("span",{children:"Patterns Anonymized:"}),(0,a.jsx)("span",{className:"font-medium",children:R.patterns_anonymized?"✓ Yes":"✗ No"})]}),(0,a.jsxs)("div",{className:"flex items-center justify-between py-2 border-b border-purple-200",children:[(0,a.jsx)("span",{children:"Complete By:"}),(0,a.jsx)("span",{className:"font-medium",children:new Date(R.decay_complete_at).toLocaleDateString()})]}),(0,a.jsxs)("div",{className:"flex items-center justify-between py-2",children:[(0,a.jsx)("span",{children:"Safety Patterns Retained:"}),(0,a.jsx)("span",{className:"font-medium",children:R.safety_patterns_retained})]})]}),(0,a.jsxs)("div",{className:"mt-4 text-xs text-purple-600",children:[(0,a.jsx)("p",{children:"The decay protocol will complete over 90 days:"}),(0,a.jsxs)("ul",{className:"mt-2 space-y-1 ml-4",children:[(0,a.jsx)("li",{children:"• Days 0-30: Relationship context retained"}),(0,a.jsx)("li",{children:"• Days 31-60: Behavioral data aggregated"}),(0,a.jsx)("li",{children:"• Days 61-90: Identity markers removed"}),(0,a.jsx)("li",{children:"• Day 90: Complete anonymization"})]})]})]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"bg-yellow-50 border border-yellow-200 rounded-lg p-4 mb-4",children:[(0,a.jsx)("h4",{className:"text-sm font-medium text-yellow-900 mb-2",children:"⚠️ Before You Delete"}),(0,a.jsxs)("ul",{className:"text-sm text-yellow-800 space-y-1 mb-3",children:[(0,a.jsx)("li",{children:"• Download your data first (using the section above)"}),(0,a.jsx)("li",{children:"• Deletion initiates a 90-day decay protocol"}),(0,a.jsx)("li",{children:"• Your identity is immediately severed"}),(0,a.jsx)("li",{children:"• Behavioral patterns are gradually anonymized"}),(0,a.jsx)("li",{children:"• Safety patterns may be retained (anonymized)"})]})]}),A?(0,a.jsx)("div",{className:"space-y-4",children:(0,a.jsxs)("div",{className:"bg-red-50 border-2 border-red-300 rounded-lg p-4",children:[(0,a.jsx)("h4",{className:"text-sm font-medium text-red-900 mb-2",children:"⚠️ Final Confirmation"}),(0,a.jsx)("p",{className:"text-sm text-red-800 mb-3",children:"This will revoke your consent and initiate the decay protocol. Are you absolutely sure?"}),(0,a.jsxs)("div",{className:"flex gap-3",children:[(0,a.jsx)("button",{onClick:M,disabled:k,className:"flex-1 bg-red-600 text-white px-4 py-2 rounded-lg text-sm font-medium hover:bg-red-700 disabled:bg-gray-400",children:k?"Processing...":"Yes, Delete My Data"}),(0,a.jsx)("button",{onClick:()=>S(!1),disabled:k,className:"flex-1 bg-gray-200 text-gray-700 px-4 py-2 rounded-lg text-sm font-medium hover:bg-gray-300",children:"Cancel"})]})]})}):(0,a.jsx)("button",{onClick:()=>S(!0),className:"w-full bg-red-600 text-white px-6 py-3 rounded-lg text-sm font-medium hover:bg-red-700",children:"Request Data Deletion"})]})]}),(0,a.jsxs)("div",{className:"mb-8 bg-white rounded-lg shadow p-6",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,a.jsx)("h2",{className:"text-lg font-semibold text-gray-900",children:"Submit Data Request"}),!m&&(0,a.jsx)("button",{onClick:()=>x(!0),className:"bg-indigo-600 text-white px-4 py-2 rounded-md text-sm font-medium hover:bg-indigo-700",children:"New Request"})]}),m&&(0,a.jsxs)("form",{onSubmit:T,className:"space-y-4",children:[(0,a.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Request Type"}),(0,a.jsxs)("select",{value:g.request_type,onChange:e=>h(t=>({...t,request_type:e.target.value})),className:"w-full border border-gray-300 rounded-md px-3 py-2 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500",required:!0,children:[(0,a.jsx)("option",{value:"access",children:"Data Access"}),(0,a.jsx)("option",{value:"delete",children:"Data Deletion"}),(0,a.jsx)("option",{value:"export",children:"Data Export"}),(0,a.jsx)("option",{value:"correct",children:"Data Correction"})]})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Email Address"}),(0,a.jsx)("input",{type:"email",value:g.email,onChange:e=>h(t=>({...t,email:e.target.value})),className:"w-full border border-gray-300 rounded-md px-3 py-2 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500",required:!0})]})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"User Identifier (Optional)"}),(0,a.jsx)("input",{type:"text",value:g.user_identifier||"",onChange:e=>h(t=>({...t,user_identifier:e.target.value})),className:"w-full border border-gray-300 rounded-md px-3 py-2 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500",placeholder:"Discord ID, username, etc."})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Request Details"}),(0,a.jsx)("textarea",{value:g.details||"",onChange:e=>h(t=>({...t,details:e.target.value})),rows:4,className:"w-full border border-gray-300 rounded-md px-3 py-2 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500",placeholder:"Please provide specific details about your request..."})]}),(0,a.jsxs)("div",{className:"flex items-center",children:[(0,a.jsx)("input",{type:"checkbox",checked:g.urgent||!1,onChange:e=>h(t=>({...t,urgent:e.target.checked})),className:"h-4 w-4 text-indigo-600 focus:ring-indigo-500 border-gray-300 rounded"}),(0,a.jsx)("label",{className:"ml-2 block text-sm text-gray-700",children:"Urgent request (requires justification in details)"})]}),(0,a.jsxs)("div",{className:"flex items-center space-x-4",children:[(0,a.jsx)("button",{type:"submit",disabled:p,className:"bg-indigo-600 text-white px-4 py-2 rounded-md text-sm font-medium hover:bg-indigo-700 disabled:bg-gray-400 disabled:cursor-not-allowed",children:p?"Submitting...":"Submit Request"}),(0,a.jsx)("button",{type:"button",onClick:()=>{x(!1),h({request_type:"access",email:(null==e?void 0:e.username)||"",details:""})},className:"text-gray-600 hover:text-gray-800",children:"Cancel"})]})]})]}),((null==e?void 0:e.role)==="ADMIN"||(null==e?void 0:e.role)==="SYSTEM_ADMIN")&&(0,a.jsxs)("div",{className:"bg-white rounded-lg shadow p-6",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,a.jsx)("h2",{className:"text-lg font-semibold text-gray-900",children:"All DSAR Requests (Admin View)"}),(0,a.jsx)("button",{onClick:q,disabled:c,className:"text-indigo-600 hover:text-indigo-800 text-sm font-medium",children:c?"Refreshing...":"Refresh"})]}),c?(0,a.jsx)("div",{className:"animate-pulse space-y-3",children:[1,2,3].map(e=>(0,a.jsx)("div",{className:"h-16 bg-gray-200 rounded"},e))}):0===t.length?(0,a.jsx)("p",{className:"text-gray-500 text-center py-8",children:"No DSAR requests found"}):(0,a.jsx)("div",{className:"overflow-x-auto",children:(0,a.jsxs)("table",{className:"min-w-full divide-y divide-gray-200",children:[(0,a.jsx)("thead",{children:(0,a.jsxs)("tr",{children:[(0,a.jsx)("th",{className:"px-4 py-2 text-left text-xs font-medium text-gray-500 uppercase",children:"Ticket ID"}),(0,a.jsx)("th",{className:"px-4 py-2 text-left text-xs font-medium text-gray-500 uppercase",children:"Type"}),(0,a.jsx)("th",{className:"px-4 py-2 text-left text-xs font-medium text-gray-500 uppercase",children:"Email"}),(0,a.jsx)("th",{className:"px-4 py-2 text-left text-xs font-medium text-gray-500 uppercase",children:"Status"}),(0,a.jsx)("th",{className:"px-4 py-2 text-left text-xs font-medium text-gray-500 uppercase",children:"Created"}),(0,a.jsx)("th",{className:"px-4 py-2 text-left text-xs font-medium text-gray-500 uppercase",children:"Urgent"})]})}),(0,a.jsx)("tbody",{className:"divide-y divide-gray-200",children:t.map(e=>{let t=U(e.request_type);return(0,a.jsxs)("tr",{className:"hover:bg-gray-50",children:[(0,a.jsx)("td",{className:"px-4 py-3 text-sm font-mono text-gray-900",children:e.ticket_id}),(0,a.jsx)("td",{className:"px-4 py-3 text-sm",children:(0,a.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,a.jsx)("span",{children:t.icon}),(0,a.jsx)("span",{children:t.text})]})}),(0,a.jsx)("td",{className:"px-4 py-3 text-sm text-gray-600",children:e.email}),(0,a.jsx)("td",{className:"px-4 py-3 text-sm",children:(0,a.jsx)("span",{className:"px-2 py-1 text-xs rounded-full ".concat(L(e.status)),children:e.status})}),(0,a.jsx)("td",{className:"px-4 py-3 text-sm text-gray-600",children:new Date(e.created_at).toLocaleDateString()}),(0,a.jsx)("td",{className:"px-4 py-3 text-sm",children:e.urgent&&(0,a.jsx)("span",{className:"text-red-600 font-medium",children:"⚠️ Urgent"})})]},e.ticket_id)})})]})})]}),(0,a.jsx)("div",{className:"mt-8 text-center text-xs text-gray-500",children:(0,a.jsx)("p",{children:"DSAR requests are processed according to applicable privacy regulations. Response times may vary based on request complexity and legal requirements."})})]})]})})}function m(){return(0,a.jsx)(u,{})}},6264:(e,t,s)=>{"use strict";s.d(t,{O:()=>l});var a=s(4568),r=s(7620),n=s(2942),i=s(9484);function l(e){let{children:t,requiredRole:s,requiredPermission:l}=e,{user:o,loading:c,hasRole:d,hasPermission:u}=(0,i.A)(),m=(0,n.useRouter)();return((0,r.useEffect)(()=>{if(!c){if(!o)return void m.push("/login");if(s&&!d(s)||l&&!u(l))return void m.push("/unauthorized")}},[o,c,s,l,d,u,m]),c)?(0,a.jsx)("div",{className:"flex items-center justify-center min-h-screen",children:(0,a.jsx)("div",{className:"text-lg",children:"Loading..."})}):o&&(!s||d(s))&&(!l||u(l))?(0,a.jsx)(a.Fragment,{children:t}):null}},6636:(e,t,s)=>{Promise.resolve().then(s.bind(s,4768))},7192:(e,t,s)=>{"use strict";function a(e){if(!e)return"Unknown error";if("string"==typeof e)return e;if(Array.isArray(e))return e.map(e=>"string"==typeof e?e:e.msg?e.msg:e.message?e.message:JSON.stringify(e)).join("; ");if(e.detail){if(Array.isArray(e.detail))return e.detail.map(e=>{let t=Array.isArray(e.loc)?e.loc.join("."):e.loc||"",s=e.msg||e.message||"Validation error";return t?"".concat(t,": ").concat(s):s}).join("; ");if("string"==typeof e.detail)return e.detail;if("object"==typeof e.detail)return JSON.stringify(e.detail)}if(e.message&&"string"==typeof e.message)return e.message;if(e.error&&"string"==typeof e.error)return e.error;if(e.statusText&&"string"==typeof e.statusText)return e.statusText;try{let t=JSON.stringify(e);if(t.length>200)return"Complex error object (see console for details)";return t}catch(e){return"Unknown error (see console for details)"}}s.d(t,{PE:()=>a})},9484:(e,t,s)=>{"use strict";s.d(t,{A:()=>u,O:()=>d});var a=s(4568),r=s(7620),n=s(2942),i=s(3237),l=s(704),o=s(3120);let c=(0,r.createContext)(void 0);function d(e){let{children:t}=e,[s,d]=(0,r.useState)(null),[u,m]=(0,r.useState)(!0),[x,g]=(0,r.useState)(null),h=(0,n.useRouter)();(0,r.useEffect)(()=>{let e=window.location.pathname;"/login"===e||e.startsWith("/manager")?m(!1):p();let t=localStorage.getItem("manager_token");t&&g(t)},[]);let p=async()=>{try{if(l.AQ.isAuthenticated()){let e=await l.AQ.auth.getMe();d(e)}}catch(e){console.error("Auth check failed:",e)}finally{m(!1)}},y=(0,r.useCallback)(async(e,t)=>{try{let s=localStorage.getItem("selectedAgentId");if(!s)throw Error("No agent selected");o._.configure(s);let a=await l.AQ.login(e,t),r=l.AQ.auth.getAccessToken();r&&o._.configure(s,r),d(a),i.Ay.success("Welcome, ".concat(a.username||a.user_id,"!")),h.push("/")}catch(e){throw i.Ay.error(e.message||"Login failed"),e}},[h]),f=(0,r.useCallback)(async()=>{try{await l.AQ.logout(),d(null),i.Ay.success("Logged out successfully"),h.push("/login")}catch(e){console.error("Logout failed:",e),i.Ay.error("Logout failed")}},[h]),b=(0,r.useCallback)(e=>!!s&&(s.permissions.includes(e)||"SYSTEM_ADMIN"===s.role),[s]),j=(0,r.useCallback)(e=>{if(!s)return!1;let t=["OBSERVER","ADMIN","AUTHORITY","SYSTEM_ADMIN"];return t.indexOf(s.role)>=t.indexOf(e)},[s]),N=(0,r.useCallback)(e=>{l.AQ.setConfig({authToken:e})},[]),v=(0,r.useCallback)(()=>!!x,[x]);return(0,a.jsx)(c.Provider,{value:{user:s,loading:u,login:y,logout:f,hasPermission:b,hasRole:j,setUser:d,setToken:N,managerToken:x,setManagerToken:g,isManagerAuthenticated:v},children:t})}function u(){let e=(0,r.useContext)(c);if(void 0===e)throw Error("useAuth must be used within an AuthProvider");return e}}},e=>{var t=t=>e(e.s=t);e.O(0,[4534,8072,704,587,8315,7358],()=>t(6636)),_N_E=e.O()}]);
|