@stigmer/server-slim 3.40.0 → 3.40.1
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.
- package/console/404.html +1 -1
- package/console/__next.__PAGE__.txt +2 -2
- package/console/__next._full.txt +14 -14
- package/console/__next._head.txt +4 -4
- package/console/__next._index.txt +9 -9
- package/console/__next._tree.txt +1 -1
- package/console/_next/static/chunks/01hep6fbspt.0.js +1 -0
- package/console/_next/static/chunks/05uzu4-_sp1yp.js +1 -0
- package/console/_next/static/chunks/{12i_a9yn.gms7.js → 072g980hrxnyl.js} +1 -1
- package/console/_next/static/chunks/0rh6tj~41xah0.js +34 -0
- package/console/_next/static/chunks/0s7rm5b3t2blp.js +1 -0
- package/console/_next/static/chunks/0xy23zns071f6.js +1 -0
- package/console/_next/static/chunks/161o._k~z2-bu.js +1 -0
- package/console/_not-found/__next._full.txt +14 -14
- package/console/_not-found/__next._head.txt +4 -4
- package/console/_not-found/__next._index.txt +9 -9
- package/console/_not-found/__next._not-found.__PAGE__.txt +3 -3
- package/console/_not-found/__next._not-found.txt +3 -3
- package/console/_not-found/__next._tree.txt +1 -1
- package/console/_not-found.html +1 -1
- package/console/_not-found.txt +14 -14
- package/console/auth/callback/__next._full.txt +16 -16
- package/console/auth/callback/__next._head.txt +4 -4
- package/console/auth/callback/__next._index.txt +9 -9
- package/console/auth/callback/__next._tree.txt +1 -1
- package/console/auth/callback/__next.auth.callback.__PAGE__.txt +4 -4
- package/console/auth/callback/__next.auth.callback.txt +3 -3
- package/console/auth/callback/__next.auth.txt +3 -3
- package/console/auth/callback.html +1 -1
- package/console/auth/callback.txt +16 -16
- package/console/auth/github/callback/__next._full.txt +16 -16
- package/console/auth/github/callback/__next._head.txt +4 -4
- package/console/auth/github/callback/__next._index.txt +9 -9
- package/console/auth/github/callback/__next._tree.txt +1 -1
- package/console/auth/github/callback/__next.auth.github.callback.__PAGE__.txt +4 -4
- package/console/auth/github/callback/__next.auth.github.callback.txt +3 -3
- package/console/auth/github/callback/__next.auth.github.txt +3 -3
- package/console/auth/github/callback/__next.auth.txt +3 -3
- package/console/auth/github/callback.html +1 -1
- package/console/auth/github/callback.txt +16 -16
- package/console/auth/oauth/callback/__next._full.txt +16 -16
- package/console/auth/oauth/callback/__next._head.txt +4 -4
- package/console/auth/oauth/callback/__next._index.txt +9 -9
- package/console/auth/oauth/callback/__next._tree.txt +1 -1
- package/console/auth/oauth/callback/__next.auth.oauth.callback.__PAGE__.txt +4 -4
- package/console/auth/oauth/callback/__next.auth.oauth.callback.txt +3 -3
- package/console/auth/oauth/callback/__next.auth.oauth.txt +3 -3
- package/console/auth/oauth/callback/__next.auth.txt +3 -3
- package/console/auth/oauth/callback.html +1 -1
- package/console/auth/oauth/callback.txt +16 -16
- package/console/chat/__placeholder__/__placeholder__/__next._full.txt +15 -15
- package/console/chat/__placeholder__/__placeholder__/__next._head.txt +4 -4
- package/console/chat/__placeholder__/__placeholder__/__next._index.txt +9 -9
- package/console/chat/__placeholder__/__placeholder__/__next._tree.txt +1 -1
- package/console/chat/__placeholder__/__placeholder__/__next.chat.$d$org.$d$slug.__PAGE__.txt +3 -3
- package/console/chat/__placeholder__/__placeholder__/__next.chat.$d$org.$d$slug.txt +3 -3
- package/console/chat/__placeholder__/__placeholder__/__next.chat.$d$org.txt +3 -3
- package/console/chat/__placeholder__/__placeholder__/__next.chat.txt +3 -3
- package/console/chat/__placeholder__/__placeholder__.html +1 -1
- package/console/chat/__placeholder__/__placeholder__.txt +15 -15
- package/console/conversations/__next._full.txt +15 -15
- package/console/conversations/__next._head.txt +4 -4
- package/console/conversations/__next._index.txt +9 -9
- package/console/conversations/__next._tree.txt +1 -1
- package/console/conversations/__next.conversations.__PAGE__.txt +3 -3
- package/console/conversations/__next.conversations.txt +3 -3
- package/console/conversations/__placeholder__/__placeholder__/__next._full.txt +15 -15
- package/console/conversations/__placeholder__/__placeholder__/__next._head.txt +4 -4
- package/console/conversations/__placeholder__/__placeholder__/__next._index.txt +9 -9
- package/console/conversations/__placeholder__/__placeholder__/__next._tree.txt +1 -1
- package/console/conversations/__placeholder__/__placeholder__/__next.conversations.$d$channelId.$d$key.__PAGE__.txt +3 -3
- package/console/conversations/__placeholder__/__placeholder__/__next.conversations.$d$channelId.$d$key.txt +3 -3
- package/console/conversations/__placeholder__/__placeholder__/__next.conversations.$d$channelId.txt +3 -3
- package/console/conversations/__placeholder__/__placeholder__/__next.conversations.txt +3 -3
- package/console/conversations/__placeholder__/__placeholder__.html +1 -1
- package/console/conversations/__placeholder__/__placeholder__.txt +15 -15
- package/console/conversations.html +1 -1
- package/console/conversations.txt +15 -15
- package/console/dashboard/__next._full.txt +15 -15
- package/console/dashboard/__next._head.txt +4 -4
- package/console/dashboard/__next._index.txt +9 -9
- package/console/dashboard/__next._tree.txt +1 -1
- package/console/dashboard/__next.dashboard.__PAGE__.txt +3 -3
- package/console/dashboard/__next.dashboard.txt +3 -3
- package/console/dashboard.html +1 -1
- package/console/dashboard.txt +15 -15
- package/console/desktop/billing/__next._full.txt +16 -16
- package/console/desktop/billing/__next._head.txt +4 -4
- package/console/desktop/billing/__next._index.txt +9 -9
- package/console/desktop/billing/__next._tree.txt +1 -1
- package/console/desktop/billing/__next.desktop.billing.__PAGE__.txt +4 -4
- package/console/desktop/billing/__next.desktop.billing.txt +3 -3
- package/console/desktop/billing/__next.desktop.txt +3 -3
- package/console/desktop/billing.html +1 -1
- package/console/desktop/billing.txt +16 -16
- package/console/executions/__placeholder__/__next._full.txt +14 -14
- package/console/executions/__placeholder__/__next._head.txt +4 -4
- package/console/executions/__placeholder__/__next._index.txt +9 -9
- package/console/executions/__placeholder__/__next._tree.txt +1 -1
- package/console/executions/__placeholder__/__next.executions.$d$id.__PAGE__.txt +2 -2
- package/console/executions/__placeholder__/__next.executions.$d$id.txt +3 -3
- package/console/executions/__placeholder__/__next.executions.txt +3 -3
- package/console/executions/__placeholder__.html +1 -1
- package/console/executions/__placeholder__.txt +14 -14
- package/console/index.html +1 -1
- package/console/index.txt +14 -14
- package/console/invite/__placeholder__/__next._full.txt +15 -15
- package/console/invite/__placeholder__/__next._head.txt +4 -4
- package/console/invite/__placeholder__/__next._index.txt +9 -9
- package/console/invite/__placeholder__/__next._tree.txt +1 -1
- package/console/invite/__placeholder__/__next.invite.$d$token.__PAGE__.txt +3 -3
- package/console/invite/__placeholder__/__next.invite.$d$token.txt +3 -3
- package/console/invite/__placeholder__/__next.invite.txt +3 -3
- package/console/invite/__placeholder__.html +1 -1
- package/console/invite/__placeholder__.txt +15 -15
- package/console/library/__next._full.txt +17 -17
- package/console/library/__next._head.txt +4 -4
- package/console/library/__next._index.txt +9 -9
- package/console/library/__next._tree.txt +1 -1
- package/console/library/__next.library.__PAGE__.txt +3 -3
- package/console/library/__next.library.txt +5 -5
- package/console/library/agents/__next._full.txt +17 -17
- package/console/library/agents/__next._head.txt +4 -4
- package/console/library/agents/__next._index.txt +9 -9
- package/console/library/agents/__next._tree.txt +1 -1
- package/console/library/agents/__next.library.agents.__PAGE__.txt +3 -3
- package/console/library/agents/__next.library.agents.txt +3 -3
- package/console/library/agents/__next.library.txt +5 -5
- package/console/library/agents/__placeholder__/__placeholder__/__next._full.txt +17 -17
- package/console/library/agents/__placeholder__/__placeholder__/__next._head.txt +4 -4
- package/console/library/agents/__placeholder__/__placeholder__/__next._index.txt +9 -9
- package/console/library/agents/__placeholder__/__placeholder__/__next._tree.txt +1 -1
- package/console/library/agents/__placeholder__/__placeholder__/__next.library.agents.$d$org.$d$slug.__PAGE__.txt +3 -3
- package/console/library/agents/__placeholder__/__placeholder__/__next.library.agents.$d$org.$d$slug.txt +3 -3
- package/console/library/agents/__placeholder__/__placeholder__/__next.library.agents.$d$org.txt +3 -3
- package/console/library/agents/__placeholder__/__placeholder__/__next.library.agents.txt +3 -3
- package/console/library/agents/__placeholder__/__placeholder__/__next.library.txt +5 -5
- package/console/library/agents/__placeholder__/__placeholder__.html +1 -1
- package/console/library/agents/__placeholder__/__placeholder__.txt +17 -17
- package/console/library/agents/new/__next._full.txt +18 -18
- package/console/library/agents/new/__next._head.txt +4 -4
- package/console/library/agents/new/__next._index.txt +9 -9
- package/console/library/agents/new/__next._tree.txt +1 -1
- package/console/library/agents/new/__next.library.agents.new.__PAGE__.txt +4 -4
- package/console/library/agents/new/__next.library.agents.new.txt +3 -3
- package/console/library/agents/new/__next.library.agents.txt +3 -3
- package/console/library/agents/new/__next.library.txt +5 -5
- package/console/library/agents/new.html +1 -1
- package/console/library/agents/new.txt +18 -18
- package/console/library/agents.html +1 -1
- package/console/library/agents.txt +17 -17
- package/console/library/mcp-servers/__next._full.txt +17 -17
- package/console/library/mcp-servers/__next._head.txt +4 -4
- package/console/library/mcp-servers/__next._index.txt +9 -9
- package/console/library/mcp-servers/__next._tree.txt +1 -1
- package/console/library/mcp-servers/__next.library.mcp-servers.__PAGE__.txt +3 -3
- package/console/library/mcp-servers/__next.library.mcp-servers.txt +3 -3
- package/console/library/mcp-servers/__next.library.txt +5 -5
- package/console/library/mcp-servers/__placeholder__/__placeholder__/__next._full.txt +17 -17
- package/console/library/mcp-servers/__placeholder__/__placeholder__/__next._head.txt +4 -4
- package/console/library/mcp-servers/__placeholder__/__placeholder__/__next._index.txt +9 -9
- package/console/library/mcp-servers/__placeholder__/__placeholder__/__next._tree.txt +1 -1
- package/console/library/mcp-servers/__placeholder__/__placeholder__/__next.library.mcp-servers.$d$org.$d$slug.__PAGE__.txt +3 -3
- package/console/library/mcp-servers/__placeholder__/__placeholder__/__next.library.mcp-servers.$d$org.$d$slug.txt +3 -3
- package/console/library/mcp-servers/__placeholder__/__placeholder__/__next.library.mcp-servers.$d$org.txt +3 -3
- package/console/library/mcp-servers/__placeholder__/__placeholder__/__next.library.mcp-servers.txt +3 -3
- package/console/library/mcp-servers/__placeholder__/__placeholder__/__next.library.txt +5 -5
- package/console/library/mcp-servers/__placeholder__/__placeholder__.html +1 -1
- package/console/library/mcp-servers/__placeholder__/__placeholder__.txt +17 -17
- package/console/library/mcp-servers/new/__next._full.txt +18 -18
- package/console/library/mcp-servers/new/__next._head.txt +4 -4
- package/console/library/mcp-servers/new/__next._index.txt +9 -9
- package/console/library/mcp-servers/new/__next._tree.txt +1 -1
- package/console/library/mcp-servers/new/__next.library.mcp-servers.new.__PAGE__.txt +4 -4
- package/console/library/mcp-servers/new/__next.library.mcp-servers.new.txt +3 -3
- package/console/library/mcp-servers/new/__next.library.mcp-servers.txt +3 -3
- package/console/library/mcp-servers/new/__next.library.txt +5 -5
- package/console/library/mcp-servers/new.html +1 -1
- package/console/library/mcp-servers/new.txt +18 -18
- package/console/library/mcp-servers.html +1 -1
- package/console/library/mcp-servers.txt +17 -17
- package/console/library/plugins/__next._full.txt +17 -17
- package/console/library/plugins/__next._head.txt +4 -4
- package/console/library/plugins/__next._index.txt +9 -9
- package/console/library/plugins/__next._tree.txt +1 -1
- package/console/library/plugins/__next.library.plugins.__PAGE__.txt +3 -3
- package/console/library/plugins/__next.library.plugins.txt +3 -3
- package/console/library/plugins/__next.library.txt +5 -5
- package/console/library/plugins/__placeholder__/__placeholder__/__next._full.txt +17 -17
- package/console/library/plugins/__placeholder__/__placeholder__/__next._head.txt +4 -4
- package/console/library/plugins/__placeholder__/__placeholder__/__next._index.txt +9 -9
- package/console/library/plugins/__placeholder__/__placeholder__/__next._tree.txt +1 -1
- package/console/library/plugins/__placeholder__/__placeholder__/__next.library.plugins.$d$org.$d$slug.__PAGE__.txt +3 -3
- package/console/library/plugins/__placeholder__/__placeholder__/__next.library.plugins.$d$org.$d$slug.txt +3 -3
- package/console/library/plugins/__placeholder__/__placeholder__/__next.library.plugins.$d$org.txt +3 -3
- package/console/library/plugins/__placeholder__/__placeholder__/__next.library.plugins.txt +3 -3
- package/console/library/plugins/__placeholder__/__placeholder__/__next.library.txt +5 -5
- package/console/library/plugins/__placeholder__/__placeholder__.html +1 -1
- package/console/library/plugins/__placeholder__/__placeholder__.txt +17 -17
- package/console/library/plugins/upload/__next._full.txt +18 -18
- package/console/library/plugins/upload/__next._head.txt +4 -4
- package/console/library/plugins/upload/__next._index.txt +9 -9
- package/console/library/plugins/upload/__next._tree.txt +1 -1
- package/console/library/plugins/upload/__next.library.plugins.txt +3 -3
- package/console/library/plugins/upload/__next.library.plugins.upload.__PAGE__.txt +4 -4
- package/console/library/plugins/upload/__next.library.plugins.upload.txt +3 -3
- package/console/library/plugins/upload/__next.library.txt +5 -5
- package/console/library/plugins/upload.html +1 -1
- package/console/library/plugins/upload.txt +18 -18
- package/console/library/plugins.html +1 -1
- package/console/library/plugins.txt +17 -17
- package/console/library/schedules/__next._full.txt +17 -17
- package/console/library/schedules/__next._head.txt +4 -4
- package/console/library/schedules/__next._index.txt +9 -9
- package/console/library/schedules/__next._tree.txt +1 -1
- package/console/library/schedules/__next.library.schedules.__PAGE__.txt +3 -3
- package/console/library/schedules/__next.library.schedules.txt +3 -3
- package/console/library/schedules/__next.library.txt +5 -5
- package/console/library/schedules/__placeholder__/__placeholder__/__next._full.txt +17 -17
- package/console/library/schedules/__placeholder__/__placeholder__/__next._head.txt +4 -4
- package/console/library/schedules/__placeholder__/__placeholder__/__next._index.txt +9 -9
- package/console/library/schedules/__placeholder__/__placeholder__/__next._tree.txt +1 -1
- package/console/library/schedules/__placeholder__/__placeholder__/__next.library.schedules.$d$org.$d$slug.__PAGE__.txt +3 -3
- package/console/library/schedules/__placeholder__/__placeholder__/__next.library.schedules.$d$org.$d$slug.txt +3 -3
- package/console/library/schedules/__placeholder__/__placeholder__/__next.library.schedules.$d$org.txt +3 -3
- package/console/library/schedules/__placeholder__/__placeholder__/__next.library.schedules.txt +3 -3
- package/console/library/schedules/__placeholder__/__placeholder__/__next.library.txt +5 -5
- package/console/library/schedules/__placeholder__/__placeholder__.html +1 -1
- package/console/library/schedules/__placeholder__/__placeholder__.txt +17 -17
- package/console/library/schedules/new/__next._full.txt +18 -18
- package/console/library/schedules/new/__next._head.txt +4 -4
- package/console/library/schedules/new/__next._index.txt +9 -9
- package/console/library/schedules/new/__next._tree.txt +1 -1
- package/console/library/schedules/new/__next.library.schedules.new.__PAGE__.txt +4 -4
- package/console/library/schedules/new/__next.library.schedules.new.txt +3 -3
- package/console/library/schedules/new/__next.library.schedules.txt +3 -3
- package/console/library/schedules/new/__next.library.txt +5 -5
- package/console/library/schedules/new.html +1 -1
- package/console/library/schedules/new.txt +18 -18
- package/console/library/schedules.html +1 -1
- package/console/library/schedules.txt +17 -17
- package/console/library/skills/__next._full.txt +17 -17
- package/console/library/skills/__next._head.txt +4 -4
- package/console/library/skills/__next._index.txt +9 -9
- package/console/library/skills/__next._tree.txt +1 -1
- package/console/library/skills/__next.library.skills.__PAGE__.txt +3 -3
- package/console/library/skills/__next.library.skills.txt +3 -3
- package/console/library/skills/__next.library.txt +5 -5
- package/console/library/skills/__placeholder__/__placeholder__/__next._full.txt +17 -17
- package/console/library/skills/__placeholder__/__placeholder__/__next._head.txt +4 -4
- package/console/library/skills/__placeholder__/__placeholder__/__next._index.txt +9 -9
- package/console/library/skills/__placeholder__/__placeholder__/__next._tree.txt +1 -1
- package/console/library/skills/__placeholder__/__placeholder__/__next.library.skills.$d$org.$d$slug.__PAGE__.txt +3 -3
- package/console/library/skills/__placeholder__/__placeholder__/__next.library.skills.$d$org.$d$slug.txt +3 -3
- package/console/library/skills/__placeholder__/__placeholder__/__next.library.skills.$d$org.txt +3 -3
- package/console/library/skills/__placeholder__/__placeholder__/__next.library.skills.txt +3 -3
- package/console/library/skills/__placeholder__/__placeholder__/__next.library.txt +5 -5
- package/console/library/skills/__placeholder__/__placeholder__.html +1 -1
- package/console/library/skills/__placeholder__/__placeholder__.txt +17 -17
- package/console/library/skills/new/__next._full.txt +18 -18
- package/console/library/skills/new/__next._head.txt +4 -4
- package/console/library/skills/new/__next._index.txt +9 -9
- package/console/library/skills/new/__next._tree.txt +1 -1
- package/console/library/skills/new/__next.library.skills.new.__PAGE__.txt +4 -4
- package/console/library/skills/new/__next.library.skills.new.txt +3 -3
- package/console/library/skills/new/__next.library.skills.txt +3 -3
- package/console/library/skills/new/__next.library.txt +5 -5
- package/console/library/skills/new.html +1 -1
- package/console/library/skills/new.txt +18 -18
- package/console/library/skills.html +1 -1
- package/console/library/skills.txt +17 -17
- package/console/library/workflows/__next._full.txt +17 -17
- package/console/library/workflows/__next._head.txt +4 -4
- package/console/library/workflows/__next._index.txt +9 -9
- package/console/library/workflows/__next._tree.txt +1 -1
- package/console/library/workflows/__next.library.txt +5 -5
- package/console/library/workflows/__next.library.workflows.__PAGE__.txt +3 -3
- package/console/library/workflows/__next.library.workflows.txt +3 -3
- package/console/library/workflows/__placeholder__/__placeholder__/__next._full.txt +17 -17
- package/console/library/workflows/__placeholder__/__placeholder__/__next._head.txt +4 -4
- package/console/library/workflows/__placeholder__/__placeholder__/__next._index.txt +9 -9
- package/console/library/workflows/__placeholder__/__placeholder__/__next._tree.txt +1 -1
- package/console/library/workflows/__placeholder__/__placeholder__/__next.library.txt +5 -5
- package/console/library/workflows/__placeholder__/__placeholder__/__next.library.workflows.$d$org.$d$slug.__PAGE__.txt +3 -3
- package/console/library/workflows/__placeholder__/__placeholder__/__next.library.workflows.$d$org.$d$slug.txt +3 -3
- package/console/library/workflows/__placeholder__/__placeholder__/__next.library.workflows.$d$org.txt +3 -3
- package/console/library/workflows/__placeholder__/__placeholder__/__next.library.workflows.txt +3 -3
- package/console/library/workflows/__placeholder__/__placeholder__.html +1 -1
- package/console/library/workflows/__placeholder__/__placeholder__.txt +17 -17
- package/console/library/workflows/executions/__next._full.txt +17 -17
- package/console/library/workflows/executions/__next._head.txt +4 -4
- package/console/library/workflows/executions/__next._index.txt +9 -9
- package/console/library/workflows/executions/__next._tree.txt +1 -1
- package/console/library/workflows/executions/__next.library.txt +5 -5
- package/console/library/workflows/executions/__next.library.workflows.executions.__PAGE__.txt +3 -3
- package/console/library/workflows/executions/__next.library.workflows.executions.txt +3 -3
- package/console/library/workflows/executions/__next.library.workflows.txt +3 -3
- package/console/library/workflows/executions.html +1 -1
- package/console/library/workflows/executions.txt +17 -17
- package/console/library/workflows/new/__next._full.txt +18 -18
- package/console/library/workflows/new/__next._head.txt +4 -4
- package/console/library/workflows/new/__next._index.txt +9 -9
- package/console/library/workflows/new/__next._tree.txt +1 -1
- package/console/library/workflows/new/__next.library.txt +5 -5
- package/console/library/workflows/new/__next.library.workflows.new.__PAGE__.txt +4 -4
- package/console/library/workflows/new/__next.library.workflows.new.txt +3 -3
- package/console/library/workflows/new/__next.library.workflows.txt +3 -3
- package/console/library/workflows/new.html +1 -1
- package/console/library/workflows/new.txt +18 -18
- package/console/library/workflows.html +1 -1
- package/console/library/workflows.txt +17 -17
- package/console/library.html +1 -1
- package/console/library.txt +17 -17
- package/console/login/__next._full.txt +16 -16
- package/console/login/__next._head.txt +4 -4
- package/console/login/__next._index.txt +9 -9
- package/console/login/__next._tree.txt +1 -1
- package/console/login/__next.login.__PAGE__.txt +4 -4
- package/console/login/__next.login.txt +3 -3
- package/console/login.html +1 -1
- package/console/login.txt +16 -16
- package/console/marketplace/__next._full.txt +15 -15
- package/console/marketplace/__next._head.txt +4 -4
- package/console/marketplace/__next._index.txt +9 -9
- package/console/marketplace/__next._tree.txt +1 -1
- package/console/marketplace/__next.marketplace.__PAGE__.txt +3 -3
- package/console/marketplace/__next.marketplace.txt +3 -3
- package/console/marketplace.html +1 -1
- package/console/marketplace.txt +15 -15
- package/console/oauth/slack/callback/__next._full.txt +16 -16
- package/console/oauth/slack/callback/__next._head.txt +4 -4
- package/console/oauth/slack/callback/__next._index.txt +9 -9
- package/console/oauth/slack/callback/__next._tree.txt +1 -1
- package/console/oauth/slack/callback/__next.oauth.slack.callback.__PAGE__.txt +4 -4
- package/console/oauth/slack/callback/__next.oauth.slack.callback.txt +3 -3
- package/console/oauth/slack/callback/__next.oauth.slack.txt +3 -3
- package/console/oauth/slack/callback/__next.oauth.txt +3 -3
- package/console/oauth/slack/callback.html +1 -1
- package/console/oauth/slack/callback.txt +16 -16
- package/console/sessions/__placeholder__/__next._full.txt +14 -14
- package/console/sessions/__placeholder__/__next._head.txt +4 -4
- package/console/sessions/__placeholder__/__next._index.txt +9 -9
- package/console/sessions/__placeholder__/__next._tree.txt +1 -1
- package/console/sessions/__placeholder__/__next.sessions.$d$id.__PAGE__.txt +2 -2
- package/console/sessions/__placeholder__/__next.sessions.$d$id.txt +3 -3
- package/console/sessions/__placeholder__/__next.sessions.txt +3 -3
- package/console/sessions/__placeholder__.html +1 -1
- package/console/sessions/__placeholder__.txt +14 -14
- package/console/settings/__next._full.txt +18 -18
- package/console/settings/__next._head.txt +4 -4
- package/console/settings/__next._index.txt +9 -9
- package/console/settings/__next._tree.txt +1 -1
- package/console/settings/__next.settings.__PAGE__.txt +4 -4
- package/console/settings/__next.settings.txt +5 -5
- package/console/settings/account-preferences/__next._full.txt +17 -17
- package/console/settings/account-preferences/__next._head.txt +4 -4
- package/console/settings/account-preferences/__next._index.txt +9 -9
- package/console/settings/account-preferences/__next._tree.txt +1 -1
- package/console/settings/account-preferences/__next.settings.account-preferences.__PAGE__.txt +3 -3
- package/console/settings/account-preferences/__next.settings.account-preferences.txt +3 -3
- package/console/settings/account-preferences/__next.settings.txt +5 -5
- package/console/settings/account-preferences.html +1 -1
- package/console/settings/account-preferences.txt +17 -17
- package/console/settings/api-keys/__next._full.txt +17 -17
- package/console/settings/api-keys/__next._head.txt +4 -4
- package/console/settings/api-keys/__next._index.txt +9 -9
- package/console/settings/api-keys/__next._tree.txt +1 -1
- package/console/settings/api-keys/__next.settings.api-keys.__PAGE__.txt +3 -3
- package/console/settings/api-keys/__next.settings.api-keys.txt +3 -3
- package/console/settings/api-keys/__next.settings.txt +5 -5
- package/console/settings/api-keys.html +1 -1
- package/console/settings/api-keys.txt +17 -17
- package/console/settings/billing/__next._full.txt +18 -18
- package/console/settings/billing/__next._head.txt +4 -4
- package/console/settings/billing/__next._index.txt +9 -9
- package/console/settings/billing/__next._tree.txt +1 -1
- package/console/settings/billing/__next.settings.billing.__PAGE__.txt +4 -4
- package/console/settings/billing/__next.settings.billing.txt +3 -3
- package/console/settings/billing/__next.settings.txt +5 -5
- package/console/settings/billing.html +1 -1
- package/console/settings/billing.txt +18 -18
- package/console/settings/channel-apps/__next._full.txt +18 -18
- package/console/settings/channel-apps/__next._head.txt +4 -4
- package/console/settings/channel-apps/__next._index.txt +9 -9
- package/console/settings/channel-apps/__next._tree.txt +1 -1
- package/console/settings/channel-apps/__next.settings.channel-apps.__PAGE__.txt +3 -3
- package/console/settings/channel-apps/__next.settings.channel-apps.txt +3 -3
- package/console/settings/channel-apps/__next.settings.txt +5 -5
- package/console/settings/channel-apps.html +1 -1
- package/console/settings/channel-apps.txt +18 -18
- package/console/settings/cursor-accounts/__next._full.txt +18 -18
- package/console/settings/cursor-accounts/__next._head.txt +4 -4
- package/console/settings/cursor-accounts/__next._index.txt +9 -9
- package/console/settings/cursor-accounts/__next._tree.txt +1 -1
- package/console/settings/cursor-accounts/__next.settings.cursor-accounts.__PAGE__.txt +4 -4
- package/console/settings/cursor-accounts/__next.settings.cursor-accounts.txt +3 -3
- package/console/settings/cursor-accounts/__next.settings.txt +5 -5
- package/console/settings/cursor-accounts.html +1 -1
- package/console/settings/cursor-accounts.txt +18 -18
- package/console/settings/environments/__next._full.txt +17 -17
- package/console/settings/environments/__next._head.txt +4 -4
- package/console/settings/environments/__next._index.txt +9 -9
- package/console/settings/environments/__next._tree.txt +1 -1
- package/console/settings/environments/__next.settings.environments.__PAGE__.txt +3 -3
- package/console/settings/environments/__next.settings.environments.txt +3 -3
- package/console/settings/environments/__next.settings.txt +5 -5
- package/console/settings/environments.html +1 -1
- package/console/settings/environments.txt +17 -17
- package/console/settings/identity-providers/__next._full.txt +17 -17
- package/console/settings/identity-providers/__next._head.txt +4 -4
- package/console/settings/identity-providers/__next._index.txt +9 -9
- package/console/settings/identity-providers/__next._tree.txt +1 -1
- package/console/settings/identity-providers/__next.settings.identity-providers.__PAGE__.txt +3 -3
- package/console/settings/identity-providers/__next.settings.identity-providers.txt +3 -3
- package/console/settings/identity-providers/__next.settings.txt +5 -5
- package/console/settings/identity-providers.html +1 -1
- package/console/settings/identity-providers.txt +17 -17
- package/console/settings/invitations/__next._full.txt +17 -17
- package/console/settings/invitations/__next._head.txt +4 -4
- package/console/settings/invitations/__next._index.txt +9 -9
- package/console/settings/invitations/__next._tree.txt +1 -1
- package/console/settings/invitations/__next.settings.invitations.__PAGE__.txt +3 -3
- package/console/settings/invitations/__next.settings.invitations.txt +3 -3
- package/console/settings/invitations/__next.settings.txt +5 -5
- package/console/settings/invitations.html +1 -1
- package/console/settings/invitations.txt +17 -17
- package/console/settings/licenses/__next._full.txt +18 -18
- package/console/settings/licenses/__next._head.txt +4 -4
- package/console/settings/licenses/__next._index.txt +9 -9
- package/console/settings/licenses/__next._tree.txt +1 -1
- package/console/settings/licenses/__next.settings.licenses.__PAGE__.txt +4 -4
- package/console/settings/licenses/__next.settings.licenses.txt +3 -3
- package/console/settings/licenses/__next.settings.txt +5 -5
- package/console/settings/licenses.html +1 -1
- package/console/settings/licenses.txt +18 -18
- package/console/settings/members/__next._full.txt +17 -17
- package/console/settings/members/__next._head.txt +4 -4
- package/console/settings/members/__next._index.txt +9 -9
- package/console/settings/members/__next._tree.txt +1 -1
- package/console/settings/members/__next.settings.members.__PAGE__.txt +3 -3
- package/console/settings/members/__next.settings.members.txt +3 -3
- package/console/settings/members/__next.settings.txt +5 -5
- package/console/settings/members.html +1 -1
- package/console/settings/members.txt +17 -17
- package/console/settings/memory/__next._full.txt +17 -17
- package/console/settings/memory/__next._head.txt +4 -4
- package/console/settings/memory/__next._index.txt +9 -9
- package/console/settings/memory/__next._tree.txt +1 -1
- package/console/settings/memory/__next.settings.memory.__PAGE__.txt +3 -3
- package/console/settings/memory/__next.settings.memory.txt +3 -3
- package/console/settings/memory/__next.settings.txt +5 -5
- package/console/settings/memory.html +1 -1
- package/console/settings/memory.txt +17 -17
- package/console/settings/oauth-apps/__next._full.txt +17 -17
- package/console/settings/oauth-apps/__next._head.txt +4 -4
- package/console/settings/oauth-apps/__next._index.txt +9 -9
- package/console/settings/oauth-apps/__next._tree.txt +1 -1
- package/console/settings/oauth-apps/__next.settings.oauth-apps.__PAGE__.txt +3 -3
- package/console/settings/oauth-apps/__next.settings.oauth-apps.txt +3 -3
- package/console/settings/oauth-apps/__next.settings.txt +5 -5
- package/console/settings/oauth-apps.html +1 -1
- package/console/settings/oauth-apps.txt +17 -17
- package/console/settings/org-preferences/__next._full.txt +17 -17
- package/console/settings/org-preferences/__next._head.txt +4 -4
- package/console/settings/org-preferences/__next._index.txt +9 -9
- package/console/settings/org-preferences/__next._tree.txt +1 -1
- package/console/settings/org-preferences/__next.settings.org-preferences.__PAGE__.txt +3 -3
- package/console/settings/org-preferences/__next.settings.org-preferences.txt +3 -3
- package/console/settings/org-preferences/__next.settings.txt +5 -5
- package/console/settings/org-preferences.html +1 -1
- package/console/settings/org-preferences.txt +17 -17
- package/console/settings/org-profile/__next._full.txt +17 -17
- package/console/settings/org-profile/__next._head.txt +4 -4
- package/console/settings/org-profile/__next._index.txt +9 -9
- package/console/settings/org-profile/__next._tree.txt +1 -1
- package/console/settings/org-profile/__next.settings.org-profile.__PAGE__.txt +3 -3
- package/console/settings/org-profile/__next.settings.org-profile.txt +3 -3
- package/console/settings/org-profile/__next.settings.txt +5 -5
- package/console/settings/org-profile.html +1 -1
- package/console/settings/org-profile.txt +17 -17
- package/console/settings/plans/__next._full.txt +18 -18
- package/console/settings/plans/__next._head.txt +4 -4
- package/console/settings/plans/__next._index.txt +9 -9
- package/console/settings/plans/__next._tree.txt +1 -1
- package/console/settings/plans/__next.settings.plans.__PAGE__.txt +4 -4
- package/console/settings/plans/__next.settings.plans.txt +3 -3
- package/console/settings/plans/__next.settings.txt +5 -5
- package/console/settings/plans.html +1 -1
- package/console/settings/plans.txt +18 -18
- package/console/settings/platform-clients/__next._full.txt +17 -17
- package/console/settings/platform-clients/__next._head.txt +4 -4
- package/console/settings/platform-clients/__next._index.txt +9 -9
- package/console/settings/platform-clients/__next._tree.txt +1 -1
- package/console/settings/platform-clients/__next.settings.platform-clients.__PAGE__.txt +3 -3
- package/console/settings/platform-clients/__next.settings.platform-clients.txt +3 -3
- package/console/settings/platform-clients/__next.settings.txt +5 -5
- package/console/settings/platform-clients.html +1 -1
- package/console/settings/platform-clients.txt +17 -17
- package/console/settings/pricing-governance/__next._full.txt +18 -18
- package/console/settings/pricing-governance/__next._head.txt +4 -4
- package/console/settings/pricing-governance/__next._index.txt +9 -9
- package/console/settings/pricing-governance/__next._tree.txt +1 -1
- package/console/settings/pricing-governance/__next.settings.pricing-governance.__PAGE__.txt +4 -4
- package/console/settings/pricing-governance/__next.settings.pricing-governance.txt +3 -3
- package/console/settings/pricing-governance/__next.settings.txt +5 -5
- package/console/settings/pricing-governance.html +1 -1
- package/console/settings/pricing-governance.txt +18 -18
- package/console/settings/provider-standing/__next._full.txt +18 -18
- package/console/settings/provider-standing/__next._head.txt +4 -4
- package/console/settings/provider-standing/__next._index.txt +9 -9
- package/console/settings/provider-standing/__next._tree.txt +1 -1
- package/console/settings/provider-standing/__next.settings.provider-standing.__PAGE__.txt +4 -4
- package/console/settings/provider-standing/__next.settings.provider-standing.txt +3 -3
- package/console/settings/provider-standing/__next.settings.txt +5 -5
- package/console/settings/provider-standing.html +1 -1
- package/console/settings/provider-standing.txt +18 -18
- package/console/settings/teams/__next._full.txt +17 -17
- package/console/settings/teams/__next._head.txt +4 -4
- package/console/settings/teams/__next._index.txt +9 -9
- package/console/settings/teams/__next._tree.txt +1 -1
- package/console/settings/teams/__next.settings.teams.__PAGE__.txt +3 -3
- package/console/settings/teams/__next.settings.teams.txt +3 -3
- package/console/settings/teams/__next.settings.txt +5 -5
- package/console/settings/teams.html +1 -1
- package/console/settings/teams.txt +17 -17
- package/console/settings/usage/__next._full.txt +17 -17
- package/console/settings/usage/__next._head.txt +4 -4
- package/console/settings/usage/__next._index.txt +9 -9
- package/console/settings/usage/__next._tree.txt +1 -1
- package/console/settings/usage/__next.settings.txt +5 -5
- package/console/settings/usage/__next.settings.usage.__PAGE__.txt +3 -3
- package/console/settings/usage/__next.settings.usage.txt +3 -3
- package/console/settings/usage.html +1 -1
- package/console/settings/usage.txt +17 -17
- package/console/settings.html +1 -1
- package/console/settings.txt +18 -18
- package/console/workflows/__next._full.txt +14 -14
- package/console/workflows/__next._head.txt +4 -4
- package/console/workflows/__next._index.txt +9 -9
- package/console/workflows/__next._tree.txt +1 -1
- package/console/workflows/__next.workflows.__PAGE__.txt +2 -2
- package/console/workflows/__next.workflows.txt +3 -3
- package/console/workflows/__placeholder__/__placeholder__/__next._full.txt +15 -15
- package/console/workflows/__placeholder__/__placeholder__/__next._head.txt +4 -4
- package/console/workflows/__placeholder__/__placeholder__/__next._index.txt +9 -9
- package/console/workflows/__placeholder__/__placeholder__/__next._tree.txt +1 -1
- package/console/workflows/__placeholder__/__placeholder__/__next.workflows.$d$org.$d$slug.__PAGE__.txt +3 -3
- package/console/workflows/__placeholder__/__placeholder__/__next.workflows.$d$org.$d$slug.txt +3 -3
- package/console/workflows/__placeholder__/__placeholder__/__next.workflows.$d$org.txt +3 -3
- package/console/workflows/__placeholder__/__placeholder__/__next.workflows.txt +3 -3
- package/console/workflows/__placeholder__/__placeholder__.html +1 -1
- package/console/workflows/__placeholder__/__placeholder__.txt +15 -15
- package/console/workflows/executions/__next._full.txt +14 -14
- package/console/workflows/executions/__next._head.txt +4 -4
- package/console/workflows/executions/__next._index.txt +9 -9
- package/console/workflows/executions/__next._tree.txt +1 -1
- package/console/workflows/executions/__next.workflows.executions.__PAGE__.txt +2 -2
- package/console/workflows/executions/__next.workflows.executions.txt +3 -3
- package/console/workflows/executions/__next.workflows.txt +3 -3
- package/console/workflows/executions/__placeholder__/__next._full.txt +15 -15
- package/console/workflows/executions/__placeholder__/__next._head.txt +4 -4
- package/console/workflows/executions/__placeholder__/__next._index.txt +9 -9
- package/console/workflows/executions/__placeholder__/__next._tree.txt +1 -1
- package/console/workflows/executions/__placeholder__/__next.workflows.executions.$d$id.__PAGE__.txt +3 -3
- package/console/workflows/executions/__placeholder__/__next.workflows.executions.$d$id.txt +3 -3
- package/console/workflows/executions/__placeholder__/__next.workflows.executions.txt +3 -3
- package/console/workflows/executions/__placeholder__/__next.workflows.txt +3 -3
- package/console/workflows/executions/__placeholder__.html +1 -1
- package/console/workflows/executions/__placeholder__.txt +15 -15
- package/console/workflows/executions.html +1 -1
- package/console/workflows/executions.txt +14 -14
- package/console/workflows.html +1 -1
- package/console/workflows.txt +14 -14
- package/main.js +2 -2
- package/package.json +6 -6
- package/console/_next/static/chunks/01t5bq-0-a_i1.js +0 -1
- package/console/_next/static/chunks/034-2xp~e539n.js +0 -1
- package/console/_next/static/chunks/0lq22-4n7_uyt.js +0 -34
- package/console/_next/static/chunks/0m94l3p58m6us.js +0 -1
- package/console/_next/static/chunks/0ruvic3m1tid0.js +0 -1
- package/console/_next/static/chunks/0vx4g_lnlck8u.js +0 -1
- /package/console/_next/static/{HRj8nfJ74nB80EJaNY136 → 8QW0GR8B_i8LjUXDFgwS7}/_buildManifest.js +0 -0
- /package/console/_next/static/{HRj8nfJ74nB80EJaNY136 → 8QW0GR8B_i8LjUXDFgwS7}/_clientMiddlewareManifest.js +0 -0
- /package/console/_next/static/{HRj8nfJ74nB80EJaNY136 → 8QW0GR8B_i8LjUXDFgwS7}/_ssgManifest.js +0 -0
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,630983,e=>{"use strict";var t=e.i(843476),s=e.i(893976);function a({className:e}){return(0,t.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",className:e,"aria-hidden":"true",children:[(0,t.jsx)("circle",{cx:"8",cy:"8",r:"6.25"}),(0,t.jsx)("path",{d:"M8 7v4"}),(0,t.jsx)("circle",{cx:"8",cy:"5",r:"0.5",fill:"currentColor",stroke:"none"})]})}e.s(["CloudFeatureNotice",0,function({children:e,className:r}){return(0,t.jsxs)("div",{role:"status",className:(0,s.cn)("stg:bg-muted-subtle stg:text-muted-foreground stg:flex stg:items-start stg:gap-2.5 stg:rounded-lg stg:border stg:border-transparent stg:px-4 stg:py-3",r),children:[(0,t.jsx)(a,{className:"stg:mt-0.5 stg:size-4 stg:shrink-0"}),(0,t.jsx)("p",{className:"stg:text-xs stg:leading-relaxed",children:e})]})}])},543727,914118,582688,e=>{"use strict";var t=e.i(843476);function s({className:e}){return(0,t.jsx)("svg",{className:e,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:(0,t.jsx)("path",{d:"M5.04 15.17a2.52 2.52 0 1 1-2.52-2.52h2.52v2.52zM6.31 15.17a2.52 2.52 0 0 1 5.04 0v6.31a2.52 2.52 0 1 1-5.04 0v-6.31zM8.83 5.04a2.52 2.52 0 1 1 2.52-2.52v2.52H8.83zM8.83 6.31a2.52 2.52 0 0 1 0 5.04H2.52a2.52 2.52 0 1 1 0-5.04h6.31zM18.96 8.83a2.52 2.52 0 1 1 2.52 2.52h-2.52V8.83zM17.69 8.83a2.52 2.52 0 0 1-5.04 0V2.52a2.52 2.52 0 1 1 5.04 0v6.31zM15.17 18.96a2.52 2.52 0 1 1-2.52 2.52v-2.52h2.52zM15.17 17.69a2.52 2.52 0 0 1 0-5.04h6.31a2.52 2.52 0 1 1 0 5.04h-6.31z"})})}function a({className:e}){return(0,t.jsx)("svg",{className:e,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:(0,t.jsx)("path",{d:"M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 0 1-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 0 1-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.884 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 0 1 2.893 6.994c-.003 5.45-4.437 9.884-9.885 9.884m8.413-18.297A11.815 11.815 0 0 0 12.05 0C5.495 0 .16 5.335.157 11.892c0 2.096.547 4.142 1.588 5.945L.057 24l6.305-1.654a11.882 11.882 0 0 0 5.683 1.448h.005c6.554 0 11.89-5.335 11.893-11.893a11.821 11.821 0 0 0-3.48-8.413Z"})})}e.s(["SlackMarkIcon",0,s],914118),e.s(["WhatsAppMarkIcon",0,a],582688);let r=[{id:"slack",label:"Slack",Icon:s,installStyle:"redirect",supportsMessageTemplates:!1,supportsStaffReplies:!1,timelineIncludesCustomerMessages:!1},{id:"whatsapp",label:"WhatsApp",Icon:a,installStyle:"direct",supportsMessageTemplates:!0,supportsStaffReplies:!0,timelineIncludesCustomerMessages:!0}];e.s(["CHANNEL_PROVIDERS",0,r,"channelProviderOf",0,function(e){return r.find(t=>t.id===e)??null}],543727)},699187,e=>{"use strict";var t=e.i(891287),s=e.i(109623),a=e.i(586108),r=e.i(583093);e.s(["useChannelAppList",0,function(e){let n=(0,a.useStigmer)(),{data:i,isLoading:l,isRefetching:o,error:d,refetch:c}=(0,r.useFetch)(e?()=>n.channelapp.listByOrg((0,t.create)(s.ListChannelAppsByOrgInputSchema,{org:e})).then(e=>[...e.entries]):null,[e,n],[]);return{channelApps:i,isLoading:l,isRefetching:o,error:d,refetch:c}}])},507768,e=>{"use strict";var t=e.i(843476),s=e.i(271645),a=e.i(893976),r=e.i(610595),n=e.i(17616),i=e.i(543727),l=e.i(699187);function o({org:e,onEdit:s,onRefetchRef:n,emptyState:i="No channel apps registered yet.",className:c}){let{channelApps:g,isLoading:p,error:u,refetch:m}=(0,l.useChannelAppList)(e);return(n&&n(m),p)?(0,t.jsx)("div",{className:(0,a.cn)("stg:space-y-2",c),"aria-busy":"true","aria-label":"Loading channel apps",children:Array.from({length:2},(e,s)=>(0,t.jsx)("div",{className:"stg:bg-muted-subtle stg:h-14 stg:animate-pulse stg:rounded-lg"},s))}):u?(0,t.jsx)("p",{className:(0,a.cn)("stg:text-destructive stg:text-xs",c),role:"alert",children:(0,r.getUserMessage)(u)}):0===g.length?(0,t.jsx)("p",{className:(0,a.cn)("stg:text-muted-foreground stg:py-4 stg:text-center stg:text-xs",c),children:i}):(0,t.jsx)("div",{className:(0,a.cn)("stg:space-y-2",c),role:"list","aria-label":"Channel apps",children:g.map(e=>(0,t.jsx)(d,{channelApp:e,onEdit:s?()=>s(e):void 0},e.metadata?.id??""))})}function d({channelApp:e,onEdit:s}){let r=e.metadata?.name??"",l=e.spec?.providerConfig?.case,o=(0,i.channelProviderOf)(l),g=e.spec?.providerConfig?.case==="slack"?e.spec.providerConfig.value.clientId:e.spec?.providerConfig?.case==="whatsapp"?e.spec.providerConfig.value.appId:void 0,p=e.status?.audit?.specAudit?.createdAt;return(0,t.jsxs)("div",{role:"listitem",className:(0,a.cn)("stg:border-border stg:bg-card stg:flex stg:items-center stg:gap-3 stg:rounded-lg stg:border stg:px-3 stg:py-2.5"),children:[(0,t.jsxs)("div",{className:"stg:min-w-0 stg:flex-1",children:[(0,t.jsxs)("div",{className:"stg:flex stg:items-baseline stg:gap-2",children:[(0,t.jsx)("span",{className:"stg:truncate stg:text-xs stg:font-medium stg:text-foreground",children:r}),(0,t.jsx)("span",{className:"stg:text-[0.65rem] stg:text-muted-foreground",children:o?.label??l??""})]}),(0,t.jsxs)("div",{className:"stg:flex stg:items-baseline stg:gap-2",children:[g&&(0,t.jsx)("span",{className:"stg:truncate stg:font-mono stg:text-[0.65rem] stg:text-muted-foreground",children:g}),p&&(0,t.jsx)("span",{className:"stg:shrink-0 stg:text-[0.65rem] stg:text-muted-foreground",children:(0,n.timestampDate)(p).toLocaleDateString()})]})]}),s&&(0,t.jsx)("button",{type:"button",onClick:s,"aria-label":`Edit ${r}`,className:(0,a.cn)("stg:text-muted-foreground stg:hover:text-foreground stg:hover:bg-accent-hover","stg:shrink-0 stg:rounded-md stg:p-1.5 stg:transition-colors"),children:(0,t.jsx)(c,{})})]})}function c(){return(0,t.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,t.jsx)("path",{d:"M11.5 2.5a1.4 1.4 0 0 1 2 2L5 13l-3 1 1-3 8.5-8.5z"})})}var g=e.i(869803),p=e.i(586108),u=e.i(326283);let m=["app_mentions:read","assistant:write","chat:write","im:history"],h=["app_home_opened","app_mention","app_uninstalled","assistant_thread_context_changed","assistant_thread_started","message.im","tokens_revoked"];function x(e){let t=e??window.location.origin;return`${t.replace(/\/+$/,"")}/oauth/slack/callback`}function f(e){let t=e.description??"Chat with your organization's Stigmer agent without leaving Slack.",s=e.webhookUrl?` event_subscriptions:
|
|
2
|
+
request_url: "${e.webhookUrl}"
|
|
3
|
+
bot_events:
|
|
4
|
+
${h.map(e=>` - ${e}`).join("\n")}
|
|
5
|
+
`:"";return`display_information:
|
|
6
|
+
name: ${e.name}
|
|
7
|
+
description: ${t}
|
|
8
|
+
|
|
9
|
+
features:
|
|
10
|
+
app_home:
|
|
11
|
+
home_tab_enabled: false
|
|
12
|
+
messages_tab_enabled: true
|
|
13
|
+
messages_tab_read_only_enabled: false
|
|
14
|
+
bot_user:
|
|
15
|
+
display_name: ${e.name}
|
|
16
|
+
always_online: true
|
|
17
|
+
assistant_view:
|
|
18
|
+
assistant_description: ${t}
|
|
19
|
+
suggested_prompts: []
|
|
20
|
+
|
|
21
|
+
oauth_config:
|
|
22
|
+
redirect_urls:
|
|
23
|
+
- "${e.redirectUrl}"
|
|
24
|
+
scopes:
|
|
25
|
+
bot:
|
|
26
|
+
${m.map(e=>` - ${e}`).join("\n")}
|
|
27
|
+
|
|
28
|
+
settings:
|
|
29
|
+
${s} interactivity:
|
|
30
|
+
is_enabled: false
|
|
31
|
+
org_deploy_enabled: false
|
|
32
|
+
socket_mode_enabled: false
|
|
33
|
+
token_rotation_enabled: false
|
|
34
|
+
`}let b=["messages"];function v(){let e=new Uint8Array(32);return crypto.getRandomValues(e),Array.from(e,e=>e.toString(16).padStart(2,"0")).join("")}var y=e.i(364802),j=e.i(193799);function k({id:e,label:s,value:r,onChange:n,placeholder:i,hint:l,type:o="text",disabled:d,required:c}){return(0,t.jsxs)("div",{className:"stg:space-y-1",children:[(0,t.jsx)("label",{htmlFor:e,className:"stg:text-xs stg:font-medium stg:text-foreground",children:s}),(0,t.jsx)("input",{id:e,type:o,value:r,onChange:e=>n(e.target.value),placeholder:i,disabled:d,required:c,className:(0,a.cn)("stg:w-full stg:rounded-md stg:border stg:border-input stg:bg-background stg:px-2.5 stg:py-1.5 stg:text-xs stg:text-foreground","stg:placeholder:text-muted-foreground","stg:focus-visible:outline-none stg:focus-visible:ring-1 stg:focus-visible:ring-ring","stg:disabled:pointer-events-none stg:disabled:opacity-50")}),l&&(0,t.jsx)("p",{className:"stg:text-[0.65rem] stg:text-muted-foreground",children:l})]})}function N({label:e,value:s,copyTargetId:r}){let{copied:n,copy:i}=w(s);return(0,t.jsxs)("div",{className:"stg:space-y-1",children:[(0,t.jsx)("p",{className:"stg:text-xs stg:font-medium stg:text-foreground",children:e}),(0,t.jsxs)("div",{className:"stg:flex stg:items-center stg:gap-1.5",children:[(0,t.jsx)(y.TruncatedText,{text:s,className:(0,a.cn)("stg:min-w-0 stg:flex-1 stg:rounded-md stg:border stg:border-border stg:bg-muted-subtle","stg:px-2 stg:py-1.5 stg:font-mono stg:text-[0.65rem] stg:text-foreground")}),(0,t.jsx)(S,{copied:n,onCopy:i,copyTargetId:r})]})]})}function C({label:e,value:s,copyTargetId:r}){let{copied:n,copy:i}=w(s);return(0,t.jsxs)("div",{className:"stg:space-y-1",children:[(0,t.jsxs)("div",{className:"stg:flex stg:items-center stg:justify-between",children:[(0,t.jsx)("p",{className:"stg:text-[0.65rem] stg:font-medium stg:text-muted-foreground",children:e}),(0,t.jsx)(S,{copied:n,onCopy:i,copyTargetId:r})]}),(0,t.jsx)("pre",{className:(0,a.cn)("stg:max-h-40 stg:overflow-auto stg:rounded-md stg:border stg:border-border stg:bg-muted-subtle","stg:px-2.5 stg:py-2 stg:font-mono stg:text-[0.65rem] stg:leading-relaxed stg:text-foreground"),children:s})]})}function S({copied:e,onCopy:s,copyTargetId:r}){return(0,t.jsx)("button",{type:"button",onClick:s,"data-cursor-target":r,className:(0,a.cn)("stg:shrink-0 stg:rounded-md stg:border stg:border-border stg:px-2 stg:py-1 stg:text-[0.65rem] stg:font-medium stg:transition-colors",e?"stg:text-success":"stg:text-muted-foreground stg:hover:text-foreground stg:hover:bg-accent-hover"),"aria-live":"polite",children:e?"Copied":"Copy"})}function w(e){let{copy:t,copied:a}=(0,j.useCopyFeedback)();return{copied:a,copy:(0,s.useCallback)(()=>{t(e)},[t,e])}}var A=e.i(379410);function _({org:e,consoleOrigin:n,onCreated:i,onCancel:l,className:o}){let d=(0,s.useId)(),{create:c,isCreating:g,error:m,clearError:h}=function(){let e=(0,p.useStigmer)(),[t,a]=(0,s.useState)(!1),[r,n]=(0,s.useState)(null),i=(0,s.useCallback)(()=>n(null),[]);return{create:(0,s.useCallback)(async t=>{a(!0),n(null);try{return await e.channelapp.create(t)}catch(e){throw n((0,u.toError)(e)),e}finally{a(!1)}},[e]),isCreating:t,error:r,clearError:i}}(),[b,y]=(0,s.useState)("slack"),[j,N]=(0,s.useState)(""),[C,S]=(0,s.useState)(""),[w,T]=(0,s.useState)(""),[U,L]=(0,s.useState)(""),[D,R]=(0,s.useState)(""),[q,E]=(0,s.useState)(""),[z,B]=(0,s.useState)(""),[F,O]=(0,s.useState)(v),V=j.trim(),P=(0,s.useMemo)(()=>f({name:V||"Your Bot Name",redirectUrl:x(n)}),[V,n]),W="slack"===b?""!==C.trim()&&""!==w.trim()&&""!==U.trim():""!==D.trim()&&""!==q.trim()&&""!==z.trim()&&""!==F.trim(),H=""!==V&&W&&!g,G=(0,s.useCallback)(async t=>{if(t.preventDefault(),H){h();try{let t=await c({name:V,org:e,..."slack"===b?{slack:{clientId:C.trim(),clientSecret:w.trim(),signingSecret:U.trim()}}:{whatsapp:{appId:D.trim(),appSecret:q.trim(),accessToken:z.trim(),verifyToken:F.trim()}}});i?.(t,"whatsapp"===b?{verifyToken:F.trim()}:{})}catch{}}},[H,V,e,b,C,w,U,D,q,z,F,c,h,i]);return(0,t.jsxs)("form",{onSubmit:G,className:(0,a.cn)("stg:space-y-4",o),children:[(0,t.jsxs)("div",{className:"stg:space-y-3",children:[(0,t.jsx)(I,{value:b,onChange:y,disabled:g}),(0,t.jsx)(k,{id:`${d}-name`,label:"Name",value:j,onChange:N,placeholder:"slack"===b?"e.g. Acme Support Bot":"e.g. Acme WhatsApp",hint:"slack"===b?"The bot name your workspace will @mention":"Names the app in Stigmer — pick something that identifies the Meta app",disabled:g,required:!0}),"slack"===b?(0,t.jsx)(M,{manifest:P,clientId:C,onClientIdChange:S,clientSecret:w,onClientSecretChange:T,signingSecret:U,onSigningSecretChange:L,disabled:g}):(0,t.jsx)($,{appId:D,onAppIdChange:R,appSecret:q,onAppSecretChange:E,accessToken:z,onAccessTokenChange:B,verifyToken:F,onVerifyTokenChange:O,disabled:g})]}),m&&(0,t.jsx)("p",{className:"stg:text-destructive stg:text-[0.65rem]",role:"alert",children:(0,r.getUserMessage)(m)}),(0,t.jsxs)("div",{className:"stg:flex stg:items-center stg:gap-2",children:[(0,t.jsxs)("button",{type:"submit",disabled:!H,className:(0,a.cn)("stg:inline-flex stg:items-center stg:gap-1.5 stg:rounded-md stg:px-3 stg:py-1.5 stg:text-xs stg:font-medium","stg:bg-primary stg:text-primary-foreground stg:hover:bg-primary-hover","stg:disabled:pointer-events-none stg:disabled:opacity-40"),children:[g&&(0,t.jsx)(A.SpinnerIcon,{size:12}),"Register channel app"]}),l&&(0,t.jsx)("button",{type:"button",onClick:l,disabled:g,className:(0,a.cn)("stg:rounded-md stg:px-3 stg:py-1.5 stg:text-xs","stg:text-muted-foreground stg:hover:text-foreground stg:hover:bg-accent-hover","stg:disabled:pointer-events-none stg:disabled:opacity-50"),children:"Cancel"})]})]})}function I({value:e,onChange:r,disabled:n}){let l=(0,s.useId)();return(0,t.jsxs)("fieldset",{className:g.UNSTYLED_FIELDSET,children:[(0,t.jsx)("legend",{className:"stg:mb-1.5 stg:block stg:text-xs stg:font-medium stg:text-foreground",children:"Provider"}),(0,t.jsx)("div",{role:"radiogroup",className:"stg:flex stg:gap-1.5",children:i.CHANNEL_PROVIDERS.map(s=>{let i=e===s.id;return(0,t.jsxs)("label",{htmlFor:`stgm-chapp-provider-${s.id}`,className:(0,a.cn)("stg:flex stg:flex-1 stg:cursor-pointer stg:items-center stg:gap-2 stg:rounded-md stg:border stg:px-2.5 stg:py-1.5",i?"stg:border-ring stg:bg-accent":"stg:border-border stg:hover:bg-accent-hover",n&&"stg:pointer-events-none stg:opacity-50"),children:[(0,t.jsx)("input",{id:`stgm-chapp-provider-${s.id}`,type:"radio",name:`${l}-provider`,checked:i,onChange:()=>r(s.id),disabled:n,className:"stg:accent-current"}),(0,t.jsx)(s.Icon,{className:"stg:size-3.5 stg:shrink-0 stg:text-foreground"}),(0,t.jsx)("span",{className:"stg:text-xs stg:font-medium stg:text-foreground",children:s.label})]},s.id)})})]})}function M({manifest:e,clientId:a,onClientIdChange:r,clientSecret:n,onClientSecretChange:i,signingSecret:l,onSigningSecretChange:o,disabled:d}){let c=(0,s.useId)();return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"stg:space-y-1.5",children:[(0,t.jsx)("p",{className:"stg:text-xs stg:font-medium stg:text-foreground",children:"1. Create the Slack app"}),(0,t.jsxs)("p",{className:"stg:text-[0.65rem] stg:text-muted-foreground",children:["On"," ",(0,t.jsx)("a",{href:"https://api.slack.com/apps?new_app=1",target:"_blank",rel:"noreferrer",className:"stg:text-primary stg:hover:text-foreground stg:underline stg:transition-colors",children:"api.slack.com/apps"}),", choose ",(0,t.jsx)("span",{className:"stg:font-medium",children:"From a manifest"})," and paste this. Event subscriptions come after the next step — the webhook URL is minted when this form is saved."]}),(0,t.jsx)(C,{label:"Slack app manifest",value:e,copyTargetId:"stgm-chapp-manifest-copy"})]}),(0,t.jsxs)("div",{className:"stg:space-y-3",children:[(0,t.jsx)("p",{className:"stg:text-xs stg:font-medium stg:text-foreground",children:"2. Paste the app's credentials"}),(0,t.jsxs)("p",{className:"stg:-mt-2 stg:text-[0.65rem] stg:text-muted-foreground",children:["From the app's ",(0,t.jsx)("span",{className:"stg:font-medium",children:"Basic Information"})," page. They are encrypted at rest and never shown again."]}),(0,t.jsx)(k,{id:`${c}-client-id`,label:"Client ID",value:a,onChange:r,placeholder:"1234567890.0987654321",disabled:d,required:!0}),(0,t.jsx)(k,{id:`${c}-client-secret`,label:"Client secret",value:n,onChange:i,placeholder:"Client secret",type:"password",disabled:d,required:!0}),(0,t.jsx)(k,{id:`${c}-signing-secret`,label:"Signing secret",value:l,onChange:o,placeholder:"Signing secret",type:"password",hint:"Verifies that webhook events really come from your app",disabled:d,required:!0})]})]})}function $({appId:e,onAppIdChange:a,appSecret:r,onAppSecretChange:n,accessToken:i,onAccessTokenChange:l,verifyToken:o,onVerifyTokenChange:d,disabled:c}){let g=(0,s.useId)();return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"stg:space-y-1.5",children:[(0,t.jsx)("p",{className:"stg:text-xs stg:font-medium stg:text-foreground",children:"1. Create the Meta app"}),(0,t.jsxs)("p",{className:"stg:text-[0.65rem] stg:text-muted-foreground",children:["On"," ",(0,t.jsx)("a",{href:"https://developers.facebook.com/apps",target:"_blank",rel:"noreferrer",className:"stg:text-primary stg:hover:text-foreground stg:underline stg:transition-colors",children:"developers.facebook.com"}),", create a ",(0,t.jsx)("span",{className:"stg:font-medium",children:"Business"}),"-type app and add the ",(0,t.jsx)("span",{className:"stg:font-medium",children:"WhatsApp"})," product. The webhook setup comes after the next step — the webhook URL is minted when this form is saved."]})]}),(0,t.jsxs)("div",{className:"stg:space-y-3",children:[(0,t.jsx)("p",{className:"stg:text-xs stg:font-medium stg:text-foreground",children:"2. Paste the app's credentials"}),(0,t.jsxs)("p",{className:"stg:-mt-2 stg:text-[0.65rem] stg:text-muted-foreground",children:["The app ID and secret are on ",(0,t.jsx)("span",{className:"stg:font-medium",children:"App settings → Basic"}),"; mint a long-lived system-user access token with WhatsApp permissions in Meta Business settings. The secrets are encrypted at rest and never shown again."]}),(0,t.jsx)(k,{id:`${g}-app-id`,label:"App ID",value:e,onChange:a,placeholder:"1234567890123456",disabled:c,required:!0}),(0,t.jsx)(k,{id:`${g}-app-secret`,label:"App secret",value:r,onChange:n,placeholder:"App secret",type:"password",hint:"Verifies that webhook events really come from your app",disabled:c,required:!0}),(0,t.jsx)(k,{id:`${g}-access-token`,label:"Access token",value:i,onChange:l,placeholder:"Long-lived system-user access token",type:"password",hint:"Sends messages on behalf of your WhatsApp Business account",disabled:c,required:!0}),(0,t.jsx)(k,{id:`${g}-verify-token`,label:"Verify token",value:o,onChange:d,placeholder:"Verify token",hint:"Generated for you — you'll paste this same value into Meta's webhook configuration after registering. Replace it if your Meta app already has one.",disabled:c,required:!0})]})]})}var T=e.i(857897);function U(){let e=(0,p.useStigmer)(),[t,a]=(0,s.useState)(!1),[r,n]=(0,s.useState)(null),i=(0,s.useCallback)(()=>n(null),[]);return{update:(0,s.useCallback)(async t=>{a(!0),n(null);try{return await e.channelapp.update(t)}catch(e){throw n((0,u.toError)(e)),e}finally{a(!1)}},[e]),isUpdating:t,error:r,clearError:i}}var L=e.i(590150);function D({channelApp:e,consoleOrigin:n,createHandoff:i,onUpdated:l,onDeleted:o,onBack:d,className:c}){let{deleteApp:g,isDeleting:m,error:h}=function(){let e=(0,p.useStigmer)(),[t,a]=(0,s.useState)(!1),[r,n]=(0,s.useState)(null),i=(0,s.useCallback)(()=>n(null),[]);return{deleteApp:(0,s.useCallback)(async t=>{a(!0),n(null);try{return await e.channelapp.delete({resourceId:t})}catch(e){throw n((0,u.toError)(e)),e}finally{a(!1)}},[e]),isDeleting:t,error:r,clearError:i}}(),[x,f]=(0,s.useState)(!1),b=e.metadata?.id??"",v=e.metadata?.name??"",y=e.spec?.providerConfig?.case,j=(0,s.useCallback)(async()=>{try{await g(b),o?.()}catch{}finally{f(!1)}},[g,b,o]);return(0,t.jsxs)("div",{className:(0,a.cn)("stg:space-y-5",c),children:[(0,t.jsxs)("div",{className:"stg:flex stg:items-center stg:justify-between",children:[(0,t.jsxs)("div",{className:"stg:min-w-0",children:[(0,t.jsx)("h3",{className:"stg:truncate stg:text-sm stg:font-semibold stg:text-foreground",children:v}),(0,t.jsx)("p",{className:"stg:font-mono stg:text-[0.65rem] stg:text-muted-foreground",children:b})]}),d&&(0,t.jsx)("button",{type:"button",onClick:d,className:"stg:text-muted-foreground stg:hover:text-foreground stg:shrink-0 stg:text-xs stg:transition-colors",children:"← Back"})]}),"slack"===y?(0,t.jsx)(R,{channelApp:e,consoleOrigin:n,onUpdated:l}):"whatsapp"===y?(0,t.jsx)(q,{channelApp:e,createHandoff:i,onUpdated:l}):null,(0,t.jsx)(L.PermissionGate,{resource:{kind:"channel_app",id:b},relation:"can_delete",children:(0,t.jsxs)("section",{className:"stg:border-t stg:border-border stg:pt-3","aria-label":"Danger zone",children:[h&&(0,t.jsx)("p",{className:"stg:text-destructive stg:mb-2 stg:text-[0.65rem]",role:"alert",children:(0,r.getUserMessage)(h)}),x?(0,t.jsxs)("div",{className:"stg:flex stg:items-center stg:gap-2",children:[(0,t.jsx)("p",{className:"stg:text-xs stg:text-foreground",children:"Delete this channel app? Channels installing through it must be disconnected first."}),(0,t.jsxs)("button",{type:"button",onClick:j,disabled:m,className:(0,a.cn)("stg:inline-flex stg:items-center stg:gap-1.5 stg:rounded-md stg:px-2.5 stg:py-1 stg:text-xs stg:font-medium","stg:bg-destructive stg:text-destructive-foreground stg:hover:opacity-90","stg:disabled:pointer-events-none stg:disabled:opacity-40"),children:[m&&(0,t.jsx)(A.SpinnerIcon,{size:12}),"Delete"]}),(0,t.jsx)("button",{type:"button",onClick:()=>f(!1),disabled:m,className:"stg:text-muted-foreground stg:hover:text-foreground stg:text-xs stg:transition-colors",children:"Keep"})]}):(0,t.jsx)("button",{type:"button",onClick:()=>f(!0),className:"stg:text-destructive stg:text-xs stg:font-medium stg:hover:opacity-80",children:"Delete channel app"})]})})]})}function R({channelApp:e,consoleOrigin:n,onUpdated:i}){let l=(0,s.useId)(),o=(0,p.useStigmer)(),{update:d,isUpdating:c,error:g,clearError:u}=U(),m=e.spec?.providerConfig?.case==="slack"?e.spec.providerConfig.value:void 0,[h,b]=(0,s.useState)(m?.clientId??""),[v,y]=(0,s.useState)(m?.clientSecret??""),[j,S]=(0,s.useState)(m?.signingSecret??""),w=e.metadata?.id??"",_=e.metadata?.name??"",I=(0,s.useMemo)(()=>{var e;return e=o.baseUrl,`${e.replace(/\/+$/,"")}/webhook/slack/${w}`},[o.baseUrl,w]),M=(0,s.useMemo)(()=>x(n),[n]),$=(0,s.useMemo)(()=>f({name:_,redirectUrl:M,webhookUrl:I}),[_,M,I]),D=""!==h.trim()&&""!==v.trim()&&""!==j.trim()&&!c,q=(0,s.useCallback)(async t=>{if(t.preventDefault(),D){u();try{let t=await d({...(0,T.toChannelAppUpdateInput)(e),slack:{clientId:h.trim(),clientSecret:v.trim(),signingSecret:j.trim()}});i?.(t)}catch{}}},[D,u,d,e,h,v,j,i]);return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("section",{className:"stg:space-y-2","aria-label":"Finish setup in Slack",children:[(0,t.jsx)("p",{className:"stg:text-xs stg:font-medium stg:text-foreground",children:"Finish setup in Slack"}),(0,t.jsxs)("p",{className:"stg:text-[0.65rem] stg:text-muted-foreground",children:["On the app's ",(0,t.jsx)("span",{className:"stg:font-medium",children:"Event Subscriptions"})," page, enable events and set the request URL below (Slack verifies it immediately). The completed manifest is also available for review or re-paste."]}),(0,t.jsx)(N,{label:"Events request URL",value:I,copyTargetId:"stgm-chapp-webhook-copy"}),(0,t.jsx)(N,{label:"OAuth redirect URL",value:M}),(0,t.jsx)(C,{label:"Completed app manifest",value:$})]}),(0,t.jsx)(L.PermissionGate,{resource:{kind:"channel_app",id:w},relation:"can_edit",children:(0,t.jsxs)("form",{onSubmit:q,className:"stg:space-y-3","aria-label":"Credentials",children:[(0,t.jsx)("p",{className:"stg:text-xs stg:font-medium stg:text-foreground",children:"Credentials"}),(0,t.jsxs)("p",{className:"stg:-mt-2 stg:text-[0.65rem] stg:text-muted-foreground",children:["Secrets show as ",(0,t.jsx)("code",{className:"stg:font-mono",children:"***REDACTED***"}),"; leave a field untouched to keep its stored value, or paste a new one to rotate it."]}),(0,t.jsx)(k,{id:`${l}-client-id`,label:"Client ID",value:h,onChange:b,placeholder:"1234567890.0987654321",disabled:c,required:!0}),(0,t.jsx)(k,{id:`${l}-client-secret`,label:"Client secret",value:v,onChange:y,placeholder:"Client secret",type:"password",disabled:c,required:!0}),(0,t.jsx)(k,{id:`${l}-signing-secret`,label:"Signing secret",value:j,onChange:S,placeholder:"Signing secret",type:"password",disabled:c,required:!0}),g&&(0,t.jsx)("p",{className:"stg:text-destructive stg:text-[0.65rem]",role:"alert",children:(0,r.getUserMessage)(g)}),(0,t.jsxs)("button",{type:"submit",disabled:!D,className:(0,a.cn)("stg:inline-flex stg:items-center stg:gap-1.5 stg:rounded-md stg:px-3 stg:py-1.5 stg:text-xs stg:font-medium","stg:bg-primary stg:text-primary-foreground stg:hover:bg-primary-hover","stg:disabled:pointer-events-none stg:disabled:opacity-40"),children:[c&&(0,t.jsx)(A.SpinnerIcon,{size:12}),"Save credentials"]})]})})]})}function q({channelApp:e,createHandoff:n,onUpdated:i}){let l=(0,s.useId)(),o=(0,p.useStigmer)(),{update:d,isUpdating:c,error:g,clearError:u}=U(),m=e.spec?.providerConfig?.case==="whatsapp"?e.spec.providerConfig.value:void 0,[h,x]=(0,s.useState)(m?.appId??""),[f,v]=(0,s.useState)(m?.appSecret??""),[y,j]=(0,s.useState)(m?.accessToken??""),[C,S]=(0,s.useState)(m?.verifyToken??""),w=e.metadata?.id??"";e.metadata?.name;let _=(0,s.useMemo)(()=>{var e;return e=o.baseUrl,`${e.replace(/\/+$/,"")}/webhook/whatsapp/${w}`},[o.baseUrl,w]),I=""!==h.trim()&&""!==f.trim()&&""!==y.trim()&&""!==C.trim()&&!c,M=(0,s.useCallback)(async t=>{if(t.preventDefault(),I){u();try{let t=await d({...(0,T.toChannelAppUpdateInput)(e),whatsapp:{appId:h.trim(),appSecret:f.trim(),accessToken:y.trim(),verifyToken:C.trim()}});i?.(t)}catch{}}},[I,u,d,e,h,f,y,C,i]);return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("section",{className:"stg:space-y-2","aria-label":"Finish setup in Meta",children:[(0,t.jsx)("p",{className:"stg:text-xs stg:font-medium stg:text-foreground",children:"Finish setup in Meta"}),(0,t.jsxs)("p",{className:"stg:text-[0.65rem] stg:text-muted-foreground",children:["On the app's ",(0,t.jsx)("span",{className:"stg:font-medium",children:"WhatsApp → Configuration"})," page, set the callback URL and verify token below, click ",(0,t.jsx)("span",{className:"stg:font-medium",children:"Verify and save"})," ","(Meta verifies immediately), then subscribe to the"," ",(0,t.jsx)("span",{className:"stg:font-medium",children:b.join(", ")})," ","webhook field."]}),(0,t.jsx)(N,{label:"Callback URL",value:_,copyTargetId:"stgm-chapp-webhook-copy"}),n?.verifyToken?(0,t.jsx)(N,{label:"Verify token",value:n.verifyToken,copyTargetId:"stgm-chapp-verify-token-copy"}):(0,t.jsxs)("div",{className:"stg:space-y-1",children:[(0,t.jsx)("p",{className:"stg:text-xs stg:font-medium stg:text-foreground",children:"Verify token"}),(0,t.jsx)("p",{className:"stg:text-[0.65rem] stg:text-muted-foreground",children:"Shown once at registration. If you no longer have it, paste a new one below and update Meta's webhook configuration to match."})]})]}),(0,t.jsx)(L.PermissionGate,{resource:{kind:"channel_app",id:w},relation:"can_edit",children:(0,t.jsxs)("form",{onSubmit:M,className:"stg:space-y-3","aria-label":"Credentials",children:[(0,t.jsx)("p",{className:"stg:text-xs stg:font-medium stg:text-foreground",children:"Credentials"}),(0,t.jsxs)("p",{className:"stg:-mt-2 stg:text-[0.65rem] stg:text-muted-foreground",children:["Secrets show as ",(0,t.jsx)("code",{className:"stg:font-mono",children:"***REDACTED***"}),"; leave a field untouched to keep its stored value, or paste a new one to rotate it."]}),(0,t.jsx)(k,{id:`${l}-app-id`,label:"App ID",value:h,onChange:x,placeholder:"1234567890123456",disabled:c,required:!0}),(0,t.jsx)(k,{id:`${l}-app-secret`,label:"App secret",value:f,onChange:v,placeholder:"App secret",type:"password",disabled:c,required:!0}),(0,t.jsx)(k,{id:`${l}-access-token`,label:"Access token",value:y,onChange:j,placeholder:"Long-lived system-user access token",type:"password",disabled:c,required:!0}),(0,t.jsx)(k,{id:`${l}-verify-token`,label:"Verify token",value:C,onChange:S,placeholder:"Verify token",type:"password",hint:"Rotating it? Update Meta's webhook configuration to the same value.",disabled:c,required:!0}),g&&(0,t.jsx)("p",{className:"stg:text-destructive stg:text-[0.65rem]",role:"alert",children:(0,r.getUserMessage)(g)}),(0,t.jsxs)("button",{type:"submit",disabled:!I,className:(0,a.cn)("stg:inline-flex stg:items-center stg:gap-1.5 stg:rounded-md stg:px-3 stg:py-1.5 stg:text-xs stg:font-medium","stg:bg-primary stg:text-primary-foreground stg:hover:bg-primary-hover","stg:disabled:pointer-events-none stg:disabled:opacity-40"),children:[c&&(0,t.jsx)(A.SpinnerIcon,{size:12}),"Save credentials"]})]})})]})}var E=e.i(597744),z=e.i(981922),B=e.i(630983),F=e.i(297629);e.s(["ChannelAppsSection",0,function(){let e=(0,s.useId)(),a=(0,F.useActiveOrgSlug)(),r=(0,F.useActiveOrgId)(),n="cloud"===(0,E.useDeploymentMode)(),i=(0,z.useCheckPermission)(n&&r?{kind:"organization",id:r}:null,"can_create_channel_app"),l=!i.isLoading&&i.allowed,d=!i.isLoading&&!i.allowed,[c,g]=(0,s.useState)({phase:"idle"}),p=(0,s.useRef)(null),u=(0,s.useCallback)(e=>{p.current=e},[]),m=(0,s.useCallback)((e,t)=>{p.current?.(),g({phase:"editing",channelApp:e,createHandoff:t})},[]),h=(0,s.useCallback)(()=>{p.current?.(),g({phase:"idle"})},[]),x=(0,s.useCallback)(()=>{p.current?.(),g({phase:"idle"})},[]);return(0,t.jsxs)("section",{"aria-labelledby":e,children:[(0,t.jsxs)("div",{className:"stg:mb-3 stg:flex stg:items-center stg:justify-between",children:[(0,t.jsx)("h2",{id:e,className:"stg:text-foreground stg:text-sm stg:font-semibold",children:"Channel Apps"}),n&&a&&l&&"idle"===c.phase&&(0,t.jsx)("button",{type:"button",onClick:()=>g({phase:"creating"}),className:"stg:text-primary stg:hover:text-foreground stg:text-xs stg:font-medium stg:transition-colors",children:"+ New channel app"})]}),(0,t.jsx)("p",{className:"stg:text-muted-foreground stg:mb-4 stg:text-xs",children:"Your own provider apps for serving agent channels. A Slack app gives the bot your name and icon, and lets multiple agents serve the same workspace — one per app. A Meta app is how WhatsApp channels connect — every WhatsApp channel installs through one."}),n?"creating"===c.phase?(0,t.jsx)("div",{className:"stg:border-border stg:bg-card stg:rounded-lg stg:border stg:p-4",children:(0,t.jsx)(_,{org:a,onCreated:m,onCancel:()=>g({phase:"idle"})})}):"editing"===c.phase?(0,t.jsx)("div",{className:"stg:border-border stg:bg-card stg:rounded-lg stg:border stg:p-4",children:(0,t.jsx)(D,{channelApp:c.channelApp,createHandoff:c.createHandoff,onUpdated:h,onDeleted:x,onBack:()=>g({phase:"idle"})})}):(0,t.jsx)(o,{org:a,onEdit:e=>g({phase:"editing",channelApp:e}),onRefetchRef:u,emptyState:d?"Channel apps are managed by your organization's admins.":void 0}):(0,t.jsx)(B.CloudFeatureNotice,{children:"Channel apps are not available in local mode. Channel installs require Stigmer Cloud."})]})}],507768)}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,597744,937111,283416,50086,940530,e=>{"use strict";var t,i,s,l,c,n,a,r,o=e.i(271645),u=e.i(170255),d=(e.i(113024),e.i(424407)),m=e.i(304532),g=e.i(499328),p=e.i(693569),b=e.i(761867);let A=(0,d.fileDesc)("CihhaS9zdGlnbWVyL3BsYXRmb3JtL3YxL2VudGl0bGVtZW50LnByb3RvEhZhaS5zdGlnbWVyLnBsYXRmb3JtLnYxIo8BCgxFbnRpdGxlbWVudHMSOQoGbGltaXRzGAEgASgLMikuYWkuc3RpZ21lci5wbGF0Zm9ybS52MS5FbnRpdGxlbWVudExpbWl0cxJECghmZWF0dXJlcxgCIAMoDjIfLmFpLnN0aWdtZXIucGxhdGZvcm0udjEuRmVhdHVyZUIRukgOkgELGAEiB4IBBBABIAAi2gEKEUVudGl0bGVtZW50TGltaXRzEicKEW1heF9vcmdhbml6YXRpb25zGAEgASgFQge6SAQaAiAASACIAQESHwoJbWF4X3VzZXJzGAIgASgFQge6SAQaAiAASAGIAQESNAoeaW5jbHVkZWRfbWFuYWdlZF9vcmdhbml6YXRpb25zGAMgASgFQge6SAQaAiAASAKIAQFCFAoSX21heF9vcmdhbml6YXRpb25zQgwKCl9tYXhfdXNlcnNCIQofX2luY2x1ZGVkX21hbmFnZWRfb3JnYW5pemF0aW9ucyqkAQoHRmVhdHVyZRIXChNmZWF0dXJlX3Vuc3BlY2lmaWVkEAASEwoPc3NvX2VuZm9yY2VtZW50EAESEwoPcGxhdGZvcm1fY2xpZW50EAISFQoRYnlvX3Byb3ZpZGVyX2tleXMQAxIMCghjaGFubmVscxAEEgsKB3NoYXJpbmcQBRIJCgV0ZWFtcxAGEhkKFW1hbmFnZWRfb3JnYW5pemF0aW9ucxAHQhJCEEVudGl0bGVtZW50UHJvdG9iBnByb3RvMw",[b.file_buf_validate_validate]),W=(0,m.messageDesc)(A,0),h=(0,m.messageDesc)(A,1);(t=c||(c={}))[t.feature_unspecified=0]="feature_unspecified",t[t.sso_enforcement=1]="sso_enforcement",t[t.platform_client=2]="platform_client",t[t.byo_provider_keys=3]="byo_provider_keys",t[t.channels=4]="channels",t[t.sharing=5]="sharing",t[t.teams=6]="teams",t[t.managed_organizations=7]="managed_organizations",e.s(["EntitlementLimitsSchema",0,h,"EntitlementsSchema",0,W,"Feature",0,c,"file_ai_stigmer_platform_v1_entitlement",0,A],937111);var G=e.i(732303);let R=(0,d.fileDesc)("CiRhaS9zdGlnbWVyL3BsYXRmb3JtL3YxL2xpY2Vuc2UucHJvdG8SFmFpLnN0aWdtZXIucGxhdGZvcm0udjEiiQUKDUxpY2Vuc2VDbGFpbXMSGgoKbGljZW5zZV9pZBgBIAEoCUIGukgDyAEBEkEKCGN1c3RvbWVyGAIgASgLMicuYWkuc3RpZ21lci5wbGF0Zm9ybS52MS5MaWNlbnNlQ3VzdG9tZXJCBrpIA8gBARJACgR0ZXJtGAMgASgOMiMuYWkuc3RpZ21lci5wbGF0Zm9ybS52MS5MaWNlbnNlVGVybUINukgKyAEBggEEEAEgABJCCgxlbnRpdGxlbWVudHMYBCABKAsyJC5haS5zdGlnbWVyLnBsYXRmb3JtLnYxLkVudGl0bGVtZW50c0IGukgDyAEBEjUKCWlzc3VlZF9hdBgFIAEoCzIaLmdvb2dsZS5wcm90b2J1Zi5UaW1lc3RhbXBCBrpIA8gBARI2CgpleHBpcmVzX2F0GAYgASgLMhouZ29vZ2xlLnByb3RvYnVmLlRpbWVzdGFtcEIGukgDyAEBEjcKC2dyYWNlX3VudGlsGAcgASgLMhouZ29vZ2xlLnByb3RvYnVmLlRpbWVzdGFtcEIGukgDyAEBOuoBukjmARpqCiJsaWNlbnNlX2NsYWltcy5leHBpcmVzX2FmdGVyX2lzc3VlEiJleHBpcmVzX2F0IG11c3QgYmUgYWZ0ZXIgaXNzdWVkX2F0GiB0aGlzLmV4cGlyZXNfYXQgPiB0aGlzLmlzc3VlZF9hdBp4CiZsaWNlbnNlX2NsYWltcy5ncmFjZV9ub3RfYmVmb3JlX2V4cGlyeRIpZ3JhY2VfdW50aWwgbXVzdCBub3QgYmUgYmVmb3JlIGV4cGlyZXNfYXQaI3RoaXMuZ3JhY2VfdW50aWwgPj0gdGhpcy5leHBpcmVzX2F0InwKD0xpY2Vuc2VDdXN0b21lchISCgJpZBgBIAEoCUIGukgDyAEBEhwKDGRpc3BsYXlfbmFtZRgCIAEoCUIGukgDyAEBEiEKDWNvbnRhY3RfZW1haWwYAyABKAlCCrpIB8gBAXICYAESFAoMb3JnYW5pemF0aW9uGAQgASgJKkAKC0xpY2Vuc2VUZXJtEhwKGGxpY2Vuc2VfdGVybV91bnNwZWNpZmllZBAAEgkKBXRyaWFsEAESCAoEcGFpZBACKncKDExpY2Vuc2VTdGF0ZRIdChlsaWNlbnNlX3N0YXRlX3Vuc3BlY2lmaWVkEAASCgoGYWJzZW50EAESCQoFdmFsaWQQAhIMCghleHBpcmluZxADEgkKBWdyYWNlEAQSCwoHZXhwaXJlZBAFEgsKB2ludmFsaWQQBkIOQgxMaWNlbnNlUHJvdG9iBnByb3RvMw",[A,b.file_buf_validate_validate,G.file_google_protobuf_timestamp]),V=(0,m.messageDesc)(R,1);(i=n||(n={}))[i.license_term_unspecified=0]="license_term_unspecified",i[i.trial=1]="trial",i[i.paid=2]="paid",(s=a||(a={}))[s.license_state_unspecified=0]="license_state_unspecified",s[s.absent=1]="absent",s[s.valid=2]="valid",s[s.expiring=3]="expiring",s[s.grace=4]="grace",s[s.expired=5]="expired",s[s.invalid=6]="invalid",e.s(["LicenseCustomerSchema",0,V,"LicenseState",0,a,"LicenseTerm",0,n,"file_ai_stigmer_platform_v1_license",0,R],283416);let Z=(0,d.fileDesc)("CihhaS9zdGlnbWVyL3BsYXRmb3JtL3YxL3NlcnZlcl9pbmZvLnByb3RvEhZhaS5zdGlnbWVyLnBsYXRmb3JtLnYxIhQKEkdldFNlcnZlckluZm9JbnB1dCKgAQoTR2V0U2VydmVySW5mb091dHB1dBI2CgdlZGl0aW9uGAEgASgOMiUuYWkuc3RpZ21lci5wbGF0Zm9ybS52MS5TZXJ2ZXJFZGl0aW9uEg8KB3ZlcnNpb24YAiABKAkSJAoXYXV0aGVudGljYXRpb25fcmVxdWlyZWQYAyABKAhIAIgBAUIaChhfYXV0aGVudGljYXRpb25fcmVxdWlyZWQiFwoVR2V0TGljZW5zZVN0YXR1c0lucHV0IsQBChZHZXRMaWNlbnNlU3RhdHVzT3V0cHV0EjMKBXN0YXRlGAEgASgOMiQuYWkuc3RpZ21lci5wbGF0Zm9ybS52MS5MaWNlbnNlU3RhdGUSNQoGY2xhaW1zGAIgASgLMiUuYWkuc3RpZ21lci5wbGF0Zm9ybS52MS5MaWNlbnNlQ2xhaW1zEg4KBmtleV9pZBgDIAEoCRIuCgpjaGVja2VkX2F0GAQgASgLMhouZ29vZ2xlLnByb3RvYnVmLlRpbWVzdGFtcCIfCh1HZXRSdW5uZXJCb290c3RyYXBDb25maWdJbnB1dCLjAgoeR2V0UnVubmVyQm9vdHN0cmFwQ29uZmlnT3V0cHV0EiEKEHRlbXBvcmFsX2FkZHJlc3MYASABKAlCB7pIBHICEAESIwoSdGVtcG9yYWxfbmFtZXNwYWNlGAIgASgJQge6SARyAhABEhsKE3J1bm5lcl9hY2Nlc3NfdG9rZW4YAyABKAkSEgoKdG9rZW5fdHlwZRgEIAEoCRIuCiZydW5uZXJfYWNjZXNzX3Rva2VuX2V4cGlyZXNfaW5fc2Vjb25kcxgFIAEoBRIeChZwYXlsb2FkX2VuY3J5cHRpb25fa2V5GAYgASgJEiEKGXBheWxvYWRfZW5jcnlwdGlvbl9rZXlfaWQYByABKAkSKAogcGF5bG9hZF9lbmNyeXB0aW9uX3NlY29uZGFyeV9rZXkYCCABKAkSKwojcGF5bG9hZF9lbmNyeXB0aW9uX3NlY29uZGFyeV9rZXlfaWQYCSABKAki3AEKGUdldFJ1bm5lclNjb3BlZFRva2VuSW5wdXQSHAoSYWdlbnRfZXhlY3V0aW9uX2lkGAEgASgJSAASHwoVd29ya2Zsb3dfZXhlY3V0aW9uX2lkGAIgASgJSAASNwoKcG9vbF9jbGFpbRgDIAEoCzIhLmFpLnN0aWdtZXIucGxhdGZvcm0udjEuUG9vbENsYWltSAASNwoHcmVuZXdhbBgEIAEoCzIkLmFpLnN0aWdtZXIucGxhdGZvcm0udjEuVG9rZW5SZW5ld2FsSABCDgoFc2NvcGUSBbpIAggBIigKCVBvb2xDbGFpbRIbCgpzZXNzaW9uX2lkGAEgASgJQge6SARyAhABIg4KDFRva2VuUmVuZXdhbCJpChpHZXRSdW5uZXJTY29wZWRUb2tlbk91dHB1dBIbChNydW5uZXJfc2NvcGVkX3Rva2VuGAEgASgJEhIKCnRva2VuX3R5cGUYAiABKAkSGgoSZXhwaXJlc19pbl9zZWNvbmRzGAMgASgFKlMKDVNlcnZlckVkaXRpb24SHgoac2VydmVyX2VkaXRpb25fdW5zcGVjaWZpZWQQABIHCgNvc3MQARIJCgVjbG91ZBACEg4KCmVudGVycHJpc2UQAzKaBAoXUGxhdGZvcm1RdWVyeUNvbnRyb2xsZXISbgoNZ2V0U2VydmVySW5mbxIqLmFpLnN0aWdtZXIucGxhdGZvcm0udjEuR2V0U2VydmVySW5mb0lucHV0GisuYWkuc3RpZ21lci5wbGF0Zm9ybS52MS5HZXRTZXJ2ZXJJbmZvT3V0cHV0IgTIuBgBEncKEGdldExpY2Vuc2VTdGF0dXMSLS5haS5zdGlnbWVyLnBsYXRmb3JtLnYxLkdldExpY2Vuc2VTdGF0dXNJbnB1dBouLmFpLnN0aWdtZXIucGxhdGZvcm0udjEuR2V0TGljZW5zZVN0YXR1c091dHB1dCIE0LgYARKPAQoYZ2V0UnVubmVyQm9vdHN0cmFwQ29uZmlnEjUuYWkuc3RpZ21lci5wbGF0Zm9ybS52MS5HZXRSdW5uZXJCb290c3RyYXBDb25maWdJbnB1dBo2LmFpLnN0aWdtZXIucGxhdGZvcm0udjEuR2V0UnVubmVyQm9vdHN0cmFwQ29uZmlnT3V0cHV0IgTQuBgBEoMBChRnZXRSdW5uZXJTY29wZWRUb2tlbhIxLmFpLnN0aWdtZXIucGxhdGZvcm0udjEuR2V0UnVubmVyU2NvcGVkVG9rZW5JbnB1dBoyLmFpLnN0aWdtZXIucGxhdGZvcm0udjEuR2V0UnVubmVyU2NvcGVkVG9rZW5PdXRwdXQiBNC4GAFCEUIPU2VydmVySW5mb1Byb3RvYgZwcm90bzM",[p.file_ai_stigmer_commons_rpc_method_options,R,b.file_buf_validate_validate,G.file_google_protobuf_timestamp]),S=(0,m.messageDesc)(Z,0),y=(0,m.messageDesc)(Z,2);(l=r||(r={}))[l.server_edition_unspecified=0]="server_edition_unspecified",l[l.oss=1]="oss",l[l.cloud=2]="cloud",l[l.enterprise=3]="enterprise";let Y=(0,g.serviceDesc)(Z,0);e.s(["GetLicenseStatusInputSchema",0,y,"GetServerInfoInputSchema",0,S,"PlatformQueryController",0,Y,"ServerEdition",0,r],50086);let B=new Map([[u.ApiResourceKind.api_resource_version,u.ResourceTier.cloud_only],[u.ApiResourceKind.iam_policy,u.ResourceTier.open_source],[u.ApiResourceKind.identity_account,u.ResourceTier.open_source],[u.ApiResourceKind.api_key,u.ResourceTier.open_source],[u.ApiResourceKind.invitation,u.ResourceTier.enterprise],[u.ApiResourceKind.identity_provider,u.ResourceTier.enterprise],[u.ApiResourceKind.oauth_app,u.ResourceTier.open_source],[u.ApiResourceKind.platform_client,u.ResourceTier.open_source],[u.ApiResourceKind.team,u.ResourceTier.enterprise],[u.ApiResourceKind.organization,u.ResourceTier.open_source],[u.ApiResourceKind.platform,u.ResourceTier.enterprise],[u.ApiResourceKind.agent,u.ResourceTier.open_source],[u.ApiResourceKind.agent_execution,u.ResourceTier.open_source],[u.ApiResourceKind.session,u.ResourceTier.open_source],[u.ApiResourceKind.skill,u.ResourceTier.open_source],[u.ApiResourceKind.mcp_server,u.ResourceTier.open_source],[u.ApiResourceKind.agent_instance,u.ResourceTier.open_source],[u.ApiResourceKind.agent_share,u.ResourceTier.open_source],[u.ApiResourceKind.agent_channel,u.ResourceTier.open_source],[u.ApiResourceKind.channel_app,u.ResourceTier.open_source],[u.ApiResourceKind.workflow,u.ResourceTier.open_source],[u.ApiResourceKind.workflow_instance,u.ResourceTier.open_source],[u.ApiResourceKind.workflow_execution,u.ResourceTier.open_source],[u.ApiResourceKind.environment,u.ResourceTier.open_source],[u.ApiResourceKind.execution_context,u.ResourceTier.open_source],[u.ApiResourceKind.artifact,u.ResourceTier.open_source],[u.ApiResourceKind.schedule,u.ResourceTier.open_source],[u.ApiResourceKind.memory,u.ResourceTier.open_source],[u.ApiResourceKind.plugin,u.ResourceTier.open_source],[u.ApiResourceKind.plan,u.ResourceTier.cloud_only],[u.ApiResourceKind.subscription,u.ResourceTier.cloud_only],[u.ApiResourceKind.license,u.ResourceTier.cloud_only]]);function v(e,t){let i=B.get(e);if(void 0===i)throw Error(`isResourceAvailable: kind ${e} has no tier — only kinds with kind_meta can be asked about`);return function(e){switch(e){case"local":return 1;case"enterprise":return 2;case"cloud":return 3;default:throw Error(`unknown deployment mode: ${String(e)}`)}}(t)>=function(e){switch(e){case u.ResourceTier.open_source:return 1;case u.ResourceTier.enterprise:return 2;case u.ResourceTier.cloud_only:return 3;case u.ResourceTier.resource_tier_unspecified:return 1;default:throw Error(`unknown resource tier: ${String(e)}`)}}(i)}e.s(["deploymentModeOf",0,function(e){switch(e){case r.oss:return"local";case r.enterprise:return"enterprise";case r.cloud:case r.server_edition_unspecified:default:return"cloud"}},"isResourceAvailable",0,v],940530);let x=(0,o.createContext)("cloud");function I(){return(0,o.useContext)(x)}e.s(["DeploymentModeContext",0,x,"useDeploymentMode",0,I,"useResourceAvailable",0,function(e){return v(e,I())}],597744)},267872,e=>{"use strict";var t,i;e.i(113024);let s=(0,e.i(424407).fileDesc)("CixhaS9zdGlnbWVyL2lhbS9pZGVudGl0eWFjY291bnQvdjEvZW51bS5wcm90bxIhYWkuc3RpZ21lci5pYW0uaWRlbnRpdHlhY2NvdW50LnYxKpIBCh9JZGVudGl0eUFjY291bnRQcm92aXNpb25pbmdNb2RlEjIKLmlkZW50aXR5X2FjY291bnRfcHJvdmlzaW9uaW5nX21vZGVfdW5zcGVjaWZpZWQQABIKCgZkaXJlY3QQARINCglmZWRlcmF0ZWQQAhILCgdtYWNoaW5lEAMSEwoPcGxhdGZvcm1fY2xpZW50EARiBnByb3RvMw");(i=t||(t={}))[i.identity_account_provisioning_mode_unspecified=0]="identity_account_provisioning_mode_unspecified",i[i.direct=1]="direct",i[i.federated=2]="federated",i[i.machine=3]="machine",i[i.platform_client=4]="platform_client",e.s(["IdentityAccountProvisioningMode",0,t,"file_ai_stigmer_iam_identityaccount_v1_enum",0,s])},452026,632897,626874,e=>{"use strict";var t=e.i(424407),i=e.i(304532),s=e.i(421415),l=e.i(988158),c=e.i(761867);let n=(0,t.fileDesc)("CiZhaS9zdGlnbWVyL2lhbS9pYW1wb2xpY3kvdjEvc3BlYy5wcm90bxIbYWkuc3RpZ21lci5pYW0uaWFtcG9saWN5LnYxIr4BCg1JYW1Qb2xpY3lTcGVjEkYKCXByaW5jaXBhbBgBIAEoCzIrLmFpLnN0aWdtZXIuaWFtLmlhbXBvbGljeS52MS5BcGlSZXNvdXJjZVJlZkIGukgDyAEBEkUKCHJlc291cmNlGAIgASgLMisuYWkuc3RpZ21lci5pYW0uaWFtcG9saWN5LnYxLkFwaVJlc291cmNlUmVmQga6SAPIAQESHgoIcmVsYXRpb24YAyABKAlCDLpICcgBAXIEEAEYQCJkCg5BcGlSZXNvdXJjZVJlZhIbCgRraW5kGAEgASgJQg26SArIAQFyBRABGIACEhkKAmlkGAIgASgJQg26SArIAQFyBRABGIACEhoKCHJlbGF0aW9uGAMgASgJQgi6SAVyAxiAAmIGcHJvdG8z",[c.file_buf_validate_validate]),a=(0,i.messageDesc)(n,0),r=(0,i.messageDesc)(n,1);e.s(["ApiResourceRefSchema",0,r,"IamPolicySpecSchema",0,a,"file_ai_stigmer_iam_iampolicy_v1_spec",0,n],632897);let o=(0,t.fileDesc)("CiVhaS9zdGlnbWVyL2lhbS9pYW1wb2xpY3kvdjEvYXBpLnByb3RvEhthaS5zdGlnbWVyLmlhbS5pYW1wb2xpY3kudjEimQIKCUlhbVBvbGljeRItCgthcGlfdmVyc2lvbhgBIAEoCUIYukgVchMKEWlhbS5zdGlnbWVyLmFpL3YxEh4KBGtpbmQYAiABKAlCELpIDXILCglJYW1Qb2xpY3kSRQoIbWV0YWRhdGEYAyABKAsyMy5haS5zdGlnbWVyLmNvbW1vbnMuYXBpcmVzb3VyY2UuQXBpUmVzb3VyY2VNZXRhZGF0YRI4CgRzcGVjGAQgASgLMiouYWkuc3RpZ21lci5pYW0uaWFtcG9saWN5LnYxLklhbVBvbGljeVNwZWMSPAoGc3RhdHVzGAUgASgLMiwuYWkuc3RpZ21lci5pYW0uaWFtcG9saWN5LnYxLklhbVBvbGljeVN0YXR1cyJSCg9JYW1Qb2xpY3lTdGF0dXMSPwoFYXVkaXQYASABKAsyMC5haS5zdGlnbWVyLmNvbW1vbnMuYXBpcmVzb3VyY2UuQXBpUmVzb3VyY2VBdWRpdGIGcHJvdG8z",[s.file_ai_stigmer_commons_apiresource_metadata,l.file_ai_stigmer_commons_apiresource_status,n,c.file_buf_validate_validate]);e.s(["file_ai_stigmer_iam_iampolicy_v1_api",0,o],626874);var u=e.i(267872);let d=(0,t.fileDesc)("CiRhaS9zdGlnbWVyL2lhbS9pYW1wb2xpY3kvdjEvaW8ucHJvdG8SG2FpLnN0aWdtZXIuaWFtLmlhbXBvbGljeS52MSLDAgoSQXBpUmVzb3VyY2VSZWZWaWV3EgwKBGtpbmQYASABKAkSCgoCaWQYAiABKAkSEAoIcmVsYXRpb24YAyABKAkSDAoEbmFtZRgEIAEoCRINCgVlbWFpbBgFIAEoCRIMCgRzbHVnGAYgASgJEg4KBmF2YXRhchgHIAEoCRJACgdtZW1iZXJzGAggAygLMi8uYWkuc3RpZ21lci5pYW0uaWFtcG9saWN5LnYxLkFwaVJlc291cmNlUmVmVmlldxI+CgV0ZWFtcxgJIAMoCzIvLmFpLnN0aWdtZXIuaWFtLmlhbXBvbGljeS52MS5BcGlSZXNvdXJjZVJlZlZpZXcSRAoPaWRlbnRpdHlfb3JpZ2luGAogASgLMisuYWkuc3RpZ21lci5pYW0uaWFtcG9saWN5LnYxLklkZW50aXR5T3JpZ2luIo4BCg5JZGVudGl0eU9yaWdpbhJdChFwcm92aXNpb25pbmdfbW9kZRgBIAEoDjJCLmFpLnN0aWdtZXIuaWFtLmlkZW50aXR5YWNjb3VudC52MS5JZGVudGl0eUFjY291bnRQcm92aXNpb25pbmdNb2RlEh0KFXByb3ZpZGVyX2Rpc3BsYXlfbmFtZRgCIAEoCSIkCgtJYW1Qb2xpY3lJZBIVCgV2YWx1ZRgBIAEoCUIGukgDyAEBIqcBChZQcmluY2lwYWxSZXNvdXJjZUlucHV0EkYKCXByaW5jaXBhbBgBIAEoCzIrLmFpLnN0aWdtZXIuaWFtLmlhbXBvbGljeS52MS5BcGlSZXNvdXJjZVJlZkIGukgDyAEBEkUKCHJlc291cmNlGAIgASgLMisuYWkuc3RpZ21lci5pYW0uaWFtcG9saWN5LnYxLkFwaVJlc291cmNlUmVmQga6SAPIAQEiqQEKF1Jlc291cmNlUHJpbmNpcGFsc0lucHV0EkUKCHJlc291cmNlGAEgASgLMisuYWkuc3RpZ21lci5pYW0uaWFtcG9saWN5LnYxLkFwaVJlc291cmNlUmVmQga6SAPIAQESRwoKcHJpbmNpcGFscxgCIAMoCzIrLmFpLnN0aWdtZXIuaWFtLmlhbXBvbGljeS52MS5BcGlSZXNvdXJjZVJlZkIGukgDyAEBImQKFFJldm9rZU9yZ0FjY2Vzc0lucHV0EicKE2lkZW50aXR5X2FjY291bnRfaWQYASABKAlCCrpIB8gBAXICEAESIwoPb3JnYW5pemF0aW9uX2lkGAIgASgJQgq6SAfIAQFyAhABIkoKD0lhbVBvbGljaWVzTGlzdBI3CgdlbnRyaWVzGAEgAygLMiYuYWkuc3RpZ21lci5pYW0uaWFtcG9saWN5LnYxLklhbVBvbGljeSJ7ChdMaXN0UmVzb3VyY2VBY2Nlc3NJbnB1dBJFCghyZXNvdXJjZRgBIAEoCzIrLmFpLnN0aWdtZXIuaWFtLmlhbXBvbGljeS52MS5BcGlSZXNvdXJjZVJlZkIGukgDyAEBEhkKEWluY2x1ZGVfaW5oZXJpdGVkGAIgASgIIl4KHVJlc291cmNlQWNjZXNzQnlQcmluY2lwYWxMaXN0Ej0KB2VudHJpZXMYASADKAsyLC5haS5zdGlnbWVyLmlhbS5pYW1wb2xpY3kudjEuUHJpbmNpcGFsQWNjZXNzIowBCg9QcmluY2lwYWxBY2Nlc3MSQgoJcHJpbmNpcGFsGAEgASgLMi8uYWkuc3RpZ21lci5pYW0uaWFtcG9saWN5LnYxLkFwaVJlc291cmNlUmVmVmlldxI1CgVyb2xlcxgCIAMoCzImLmFpLnN0aWdtZXIuaWFtLmlhbXBvbGljeS52MS5Sb2xlR3JhbnQimwEKCVJvbGVHcmFudBIzCgRyb2xlGAEgASgLMiUuYWkuc3RpZ21lci5pYW0uaWFtcG9saWN5LnYxLlJvbGVJbmZvEkMKDm93bmVyX3Jlc291cmNlGAIgASgLMisuYWkuc3RpZ21lci5pYW0uaWFtcG9saWN5LnYxLkFwaVJlc291cmNlUmVmEhQKDGlzX2luaGVyaXRlZBgDIAEoCCJUChhSZXNvdXJjZUFjY2Vzc0J5Um9sZUxpc3QSOAoHZW50cmllcxgBIAMoCzInLmFpLnN0aWdtZXIuaWFtLmlhbXBvbGljeS52MS5Sb2xlQWNjZXNzIocBCgpSb2xlQWNjZXNzEjQKBHJvbGUYASABKAsyJi5haS5zdGlnbWVyLmlhbS5pYW1wb2xpY3kudjEuUm9sZUdyYW50EkMKCnByaW5jaXBhbHMYAiADKAsyLy5haS5zdGlnbWVyLmlhbS5pYW1wb2xpY3kudjEuQXBpUmVzb3VyY2VSZWZWaWV3IkcKCFJvbGVJbmZvEgoKAmlkGAEgASgJEgwKBGNvZGUYAiABKAkSDAoEbmFtZRgDIAEoCRITCgtkZXNjcmlwdGlvbhgEIAEoCSJOChZQcmluY2lwYWxSZXNvdXJjZVJvbGVzEjQKBXJvbGVzGAEgAygLMiUuYWkuc3RpZ21lci5pYW0uaWFtcG9saWN5LnYxLlJvbGVJbmZvIqYBChdDaGVja0F1dGhvcml6YXRpb25JbnB1dBJCCgZwb2xpY3kYASABKAsyKi5haS5zdGlnbWVyLmlhbS5pYW1wb2xpY3kudjEuSWFtUG9saWN5U3BlY0IGukgDyAEBEkcKE2NvbnRleHR1YWxfcG9saWNpZXMYAiADKAsyKi5haS5zdGlnbWVyLmlhbS5pYW1wb2xpY3kudjEuSWFtUG9saWN5U3BlYyIxChhDaGVja0F1dGhvcml6YXRpb25SZXN1bHQSFQoNaXNfYXV0aG9yaXplZBgBIAEoCCLIAQoWQ2hlY2tNeVBlcm1pc3Npb25JbnB1dBJFCghyZXNvdXJjZRgBIAEoCzIrLmFpLnN0aWdtZXIuaWFtLmlhbXBvbGljeS52MS5BcGlSZXNvdXJjZVJlZkIGukgDyAEBEh4KCHJlbGF0aW9uGAIgASgJQgy6SAnIAQFyBBABGEASRwoTY29udGV4dHVhbF9wb2xpY2llcxgDIAMoCzIqLmFpLnN0aWdtZXIuaWFtLmlhbXBvbGljeS52MS5JYW1Qb2xpY3lTcGVjIvIBCh5MaXN0QXV0aG9yaXplZFJlc291cmNlSWRzSW5wdXQSRgoJcHJpbmNpcGFsGAEgASgLMisuYWkuc3RpZ21lci5pYW0uaWFtcG9saWN5LnYxLkFwaVJlc291cmNlUmVmQga6SAPIAQESIQoNcmVzb3VyY2Vfa2luZBgCIAEoCUIKukgHyAEBcgIQARIcCghyZWxhdGlvbhgDIAEoCUIKukgHyAEBcgIQARJHChNjb250ZXh0dWFsX3BvbGljaWVzGAQgAygLMiouYWkuc3RpZ21lci5pYW0uaWFtcG9saWN5LnYxLklhbVBvbGljeVNwZWMiMQoZQXV0aG9yaXplZFJlc291cmNlSWRzTGlzdBIUCgxyZXNvdXJjZV9pZHMYASADKAki8wEKH0xpc3RBdXRob3JpemVkUHJpbmNpcGFsSWRzSW5wdXQSRQoIcmVzb3VyY2UYASABKAsyKy5haS5zdGlnbWVyLmlhbS5pYW1wb2xpY3kudjEuQXBpUmVzb3VyY2VSZWZCBrpIA8gBARIiCg5wcmluY2lwYWxfa2luZBgCIAEoCUIKukgHyAEBcgIQARIcCghyZWxhdGlvbhgDIAEoCUIKukgHyAEBcgIQARJHChNjb250ZXh0dWFsX3BvbGljaWVzGAQgAygLMiouYWkuc3RpZ21lci5pYW0uaWFtcG9saWN5LnYxLklhbVBvbGljeVNwZWMiMwoaQXV0aG9yaXplZFByaW5jaXBhbElkc0xpc3QSFQoNcHJpbmNpcGFsX2lkcxgBIAMoCSJZChdHZXRQcmluY2lwYWxzQ291bnRJbnB1dBIaCgZvcmdfaWQYASABKAlCCrpIB8gBAXICEAESIgoOcHJpbmNpcGFsX2tpbmQYAiABKAlCCrpIB8gBAXICEAEiIAoPUHJpbmNpcGFsc0NvdW50Eg0KBWNvdW50GAEgASgFYgZwcm90bzM",[o,n,u.file_ai_stigmer_iam_identityaccount_v1_enum,c.file_buf_validate_validate]),m=(0,i.messageDesc)(d,2),g=(0,i.messageDesc)(d,5),p=(0,i.messageDesc)(d,7),b=(0,i.messageDesc)(d,17);e.s(["CheckMyPermissionInputSchema",0,b,"IamPolicyIdSchema",0,m,"ListResourceAccessInputSchema",0,p,"RevokeOrgAccessInputSchema",0,g,"file_ai_stigmer_iam_iampolicy_v1_io",0,d],452026)},981922,e=>{"use strict";var t=e.i(271645),i=e.i(891287),s=e.i(452026),l=e.i(632897),c=e.i(586108);e.s(["useCheckPermission",0,function(e,n,a){let r=(0,c.useStigmer)(),o="open"===(a?.fail??"open"),u=e?`${e.kind}:${e.id}:${n}`:null,d=(0,t.useRef)(new Map),[m,g]=(0,t.useState)(null);(0,t.useEffect)(()=>{if(!e||!u)return;let t=d.current.get(u);if(void 0!==t)return void g({key:u,verdict:t,error:null});let c=!1,a=(0,i.create)(s.CheckMyPermissionInputSchema,{resource:(0,i.create)(l.ApiResourceRefSchema,{kind:e.kind,id:e.id}),relation:n});return r.iamPolicy.checkMyPermission(a).then(e=>{c||(d.current.set(u,e.isAuthorized),g({key:u,verdict:e.isAuthorized,error:null}))}).catch(e=>{c||g({key:u,verdict:null,error:e instanceof Error?e:Error(String(e))})}),()=>{c=!0}},[u,e?.kind,e?.id,n,o,r]);let p=null!==u&&m?.key===u?m:null,b=p?.verdict??o,A=null!==u&&null===p,W=p?.error??null;return(0,t.useMemo)(()=>({allowed:b,isLoading:A,error:W}),[b,A,W])}])},590150,e=>{"use strict";var t=e.i(981922);e.s(["PermissionGate",0,function({resource:e,relation:i,children:s,fallback:l=null,loading:c=null}){let{allowed:n,isLoading:a}=(0,t.useCheckPermission)(e,i);return a?c:n?s:l}])},3422,11493,554212,e=>{"use strict";var t=e.i(424407),i=e.i(304532),s=e.i(421415),l=e.i(988158),c=e.i(761867);let n=(0,t.fileDesc)("CiFhaS9zdGlnbWVyL2lhbS90ZWFtL3YxL3NwZWMucHJvdG8SFmFpLnN0aWdtZXIuaWFtLnRlYW0udjEiKQoIVGVhbVNwZWMSHQoLZGVzY3JpcHRpb24YASABKAlCCLpIBXIDGPQDYgZwcm90bzM",[c.file_buf_validate_validate]),a=(0,i.messageDesc)(n,0);e.s(["TeamSpecSchema",0,a,"file_ai_stigmer_iam_team_v1_spec",0,n],11493);let r=(0,t.fileDesc)("CiBhaS9zdGlnbWVyL2lhbS90ZWFtL3YxL2FwaS5wcm90bxIWYWkuc3RpZ21lci5pYW0udGVhbS52MSKXAgoEVGVhbRItCgthcGlfdmVyc2lvbhgBIAEoCUIYukgVchMKEWlhbS5zdGlnbWVyLmFpL3YxEhkKBGtpbmQYAiABKAlCC7pICHIGCgRUZWFtEk0KCG1ldGFkYXRhGAMgASgLMjMuYWkuc3RpZ21lci5jb21tb25zLmFwaXJlc291cmNlLkFwaVJlc291cmNlTWV0YWRhdGFCBrpIA8gBARIuCgRzcGVjGAQgASgLMiAuYWkuc3RpZ21lci5pYW0udGVhbS52MS5UZWFtU3BlYxJGCgZzdGF0dXMYBSABKAsyNi5haS5zdGlnbWVyLmNvbW1vbnMuYXBpcmVzb3VyY2UuQXBpUmVzb3VyY2VBdWRpdFN0YXR1c2IGcHJvdG8z",[s.file_ai_stigmer_commons_apiresource_metadata,l.file_ai_stigmer_commons_apiresource_status,n,c.file_buf_validate_validate]),o=(0,i.messageDesc)(r,0);e.s(["TeamSchema",0,o,"file_ai_stigmer_iam_team_v1_api",0,r],554212);let u=(0,t.fileDesc)("Ch9haS9zdGlnbWVyL2lhbS90ZWFtL3YxL2lvLnByb3RvEhZhaS5zdGlnbWVyLmlhbS50ZWFtLnYxIjYKBVRlYW1zEi0KB2VudHJpZXMYASADKAsyHC5haS5zdGlnbWVyLmlhbS50ZWFtLnYxLlRlYW0iKwoTTGlzdFRlYW1zQnlPcmdJbnB1dBIUCgNvcmcYASABKAlCB7pIBHICEAFiBnByb3RvMw",[r,c.file_buf_validate_validate]),d=(0,i.messageDesc)(u,1);e.s(["ListTeamsByOrgInputSchema",0,d,"file_ai_stigmer_iam_team_v1_io",0,u],3422)},884561,e=>{"use strict";var t=e.i(891287),i=e.i(170255),s=e.i(267872),l=e.i(632897);let c=i.ApiResourceKind[i.ApiResourceKind.identity_account],n=i.ApiResourceKind[i.ApiResourceKind.team],a="member";function r(e){return{kind:"identity_account",id:e}}function o(e){return{kind:"team",id:e}}e.s(["granteeFromView",0,function(e){if(e.id){if(e.kind===c&&""===e.relation)return r(e.id);if(e.kind===n&&e.relation===a)return o(e.id)}},"granteeKey",0,function(e){return`${e.kind}:${e.id}`},"granteeRef",0,function(e){switch(e.kind){case"identity_account":return(0,t.create)(l.ApiResourceRefSchema,{kind:c,id:e.id});case"team":return(0,t.create)(l.ApiResourceRefSchema,{kind:n,id:e.id,relation:a});default:return e}},"isPlatformClientAccount",0,function(e){return e.kind===c&&e.identityOrigin?.provisioningMode===s.IdentityAccountProvisioningMode.platform_client},"personGrantee",0,r,"teamGrantee",0,o])},564035,288441,890079,e=>{"use strict";var t=e.i(891287),i=e.i(452026),s=e.i(632897),l=e.i(586108),c=e.i(583093);e.s(["useResourceAccess",0,function(e,n){let a=(0,l.useStigmer)(),r=e?.kind??null,o=e?.id??null,u=n?.includeInherited??!1,{data:d,isLoading:m,isRefetching:g,error:p,refetch:b}=(0,c.useFetch)(r&&o?()=>{let e=(0,t.create)(i.ListResourceAccessInputSchema,{resource:(0,t.create)(s.ApiResourceRefSchema,{kind:r,id:o}),includeInherited:u});return a.iamPolicy.listResourceAccessByPrincipal(e).then(e=>[...e.entries])}:null,[r,o,u,a],[]);return{members:d,isLoading:m,isRefetching:g,error:p,refetch:b}}],564035);var n=e.i(271645),a=e.i(326283);e.s(["useCreateIamPolicy",0,function(){let e=(0,l.useStigmer)(),[t,i]=(0,n.useState)(!1),[s,c]=(0,n.useState)(null),r=(0,n.useCallback)(()=>c(null),[]);return{create:(0,n.useCallback)(async t=>{i(!0),c(null);try{return await e.iamPolicy.create(t)}catch(e){throw c((0,a.toError)(e)),e}finally{i(!1)}},[e]),isCreating:t,error:s,clearError:r}}],288441),e.s(["useDeleteIamPolicy",0,function(){let e=(0,l.useStigmer)(),[t,i]=(0,n.useState)(!1),[s,c]=(0,n.useState)(null),r=(0,n.useCallback)(()=>c(null),[]);return{remove:(0,n.useCallback)(async t=>{i(!0),c(null);try{return await e.iamPolicy.delete(t)}catch(e){throw c((0,a.toError)(e)),e}finally{i(!1)}},[e]),isDeleting:t,error:s,clearError:r}}],890079)},32011,e=>{"use strict";var t=e.i(843476),i=e.i(893976),s=e.i(188482);function l(e){return e?.identityOrigin?.providerDisplayName??""}e.s(["ProviderBadge",0,function({principal:e,className:c}){let n=l(e);return n?(0,t.jsxs)(s.Tooltip,{children:[(0,t.jsx)(s.TooltipTrigger,{render:(0,t.jsx)("span",{className:(0,i.cn)("stg:inline-flex stg:items-center stg:rounded stg:px-1.5 stg:py-0.5 stg:text-[0.6rem] stg:font-medium","stg:bg-muted-subtle stg:text-muted-foreground",c)}),children:n}),(0,t.jsx)(s.TooltipContent,{side:"top",children:`Identity provider: ${n}`})]}):null},"providerLabel",0,l])},14606,e=>{"use strict";let t=(0,e.i(475254).default)("users-round",[["path",{d:"M18 21a8 8 0 0 0-16 0",key:"3ypg7q"}],["circle",{cx:"10",cy:"8",r:"5",key:"o932ke"}],["path",{d:"M22 20c0-3.37-2-6.5-4-8a5 5 0 0 0-.45-8.3",key:"10s06x"}]]);e.s(["UsersRound",0,t],14606)},681094,e=>{"use strict";var t=e.i(271645),i=e.i(891287),s=e.i(170255),l=e.i(632897),c=e.i(818094),n=e.i(884561),a=e.i(691444),r=e.i(597744),o=e.i(326283),u=e.i(564035),d=e.i(288441),m=e.i(890079);e.s(["useShareFlow",0,function(e){let g=(0,t.useMemo)(()=>e?{kind:e.kind,id:e.id}:null,[e?.kind,e?.id]),{members:p,isLoading:b,isRefetching:A,error:W,refetch:h}=(0,u.useResourceAccess)(g),G=e?.resourceKind??null,{roles:R,hasRoles:V}=(0,t.useMemo)(()=>null===G?{roles:[],hasRoles:!1}:{roles:(0,c.getGrantableRoles)(G),hasRoles:(0,c.hasGrantableRoles)(G)},[G]),Z=(0,r.useResourceAvailable)(s.ApiResourceKind.team),S=(0,t.useMemo)(()=>null===G?[]:(0,c.getTeamGrantableRoles)(G),[G]),y=Z&&S.length>0,{create:Y,isCreating:B,error:v,clearError:x}=(0,d.useCreateIamPolicy)(),{remove:I}=(0,m.useDeleteIamPolicy)(),[X,f]=(0,t.useState)(!1),[k,C]=(0,t.useState)(null),N=(0,t.useRef)(e);N.current=e;let E=(0,t.useRef)(p);E.current=p;let F=(0,t.useCallback)(async(e,t)=>{let s=N.current;s&&(await Y((0,i.create)(l.IamPolicySpecSchema,{principal:(0,n.granteeRef)(e),resource:(0,i.create)(l.ApiResourceRefSchema,{kind:s.kind,id:s.id}),relation:(0,a.iamRoleToString)(t)})),h())},[Y,h]),L=(0,t.useCallback)(async e=>{let t=N.current;if(!t)return;let s=(0,n.granteeKey)(e),c=E.current.filter(e=>{let t=e.principal?(0,n.granteeFromView)(e.principal):void 0;return void 0!==t&&(0,n.granteeKey)(t)===s}).flatMap(e=>e.roles).filter(e=>!e.isInherited&&e.role?.code).map(e=>e.role?.code??"");f(!0),C(null);try{for(let s of new Set(c))await I((0,i.create)(l.IamPolicySpecSchema,{principal:(0,n.granteeRef)(e),resource:(0,i.create)(l.ApiResourceRefSchema,{kind:t.kind,id:t.id}),relation:s}))}catch(e){throw C((0,o.toError)(e)),e}finally{f(!1),h()}},[I,h]),_=(0,t.useCallback)(()=>{x(),C(null)},[x]);return(0,t.useMemo)(()=>({accessList:p,isLoading:b,isRefetching:A,fetchError:W,grantableRoles:R,hasGrantableRoles:V,teamGrantableRoles:S,canShareWithTeams:y,grant:F,isGranting:B,grantError:v,revoke:L,isRevoking:X,revokeError:k,refetch:h,clearErrors:_}),[p,b,A,W,R,V,S,y,F,B,v,L,X,k,h,_])}],681094)},540279,9531,982943,e=>{"use strict";var t=e.i(843476),i=e.i(271645),s=e.i(893976),l=e.i(884561),c=e.i(14606);function n({kind:e,name:i,className:l}){return(0,t.jsx)("div",{className:(0,s.cn)("stg:flex stg:h-6 stg:w-6 stg:shrink-0 stg:items-center stg:justify-center stg:rounded-full stg:bg-avatar stg:text-[0.6rem] stg:font-medium stg:text-muted-foreground",l),"aria-hidden":"true",children:"team"===e?(0,t.jsx)(c.UsersRound,{className:"stg:h-3.5 stg:w-3.5"}):(i[0]??"?").toUpperCase()})}var a=e.i(590150);function r(){return(0,t.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true",children:(0,t.jsx)("path",{d:"M4 4l8 8M12 4l-8 8"})})}e.s(["AccessRow",0,function({entry:e,grantGate:c,onRemove:o,isRemoving:u,showRoles:d=!0}){let m=e.principal,g=m?(0,l.granteeFromView)(m):void 0,p=g?.kind==="team",b=m?.name||m?.email||m?.id||"Unknown",A=[...new Set(e.roles.map(e=>e.role?.name||e.role?.code).filter(Boolean))].join(", "),W=p?"Team":m?.email&&m.name?m.email:"",h=(0,i.useCallback)(async()=>{if(g)try{await o(g)}catch{}},[g,o]);return(0,t.jsxs)("li",{className:"stg:flex stg:items-center stg:justify-between stg:gap-2 stg:rounded-md stg:px-2 stg:py-1.5 stg:hover:bg-accent-hover stg:group",children:[(0,t.jsxs)("div",{className:"stg:flex stg:items-center stg:gap-2 stg:min-w-0",children:[(0,t.jsx)(n,{kind:p?"team":"identity_account",name:m?.name||m?.email||"?"}),(0,t.jsxs)("div",{className:"stg:min-w-0",children:[(0,t.jsx)("p",{className:"stg:text-xs stg:text-foreground stg:truncate",children:b}),W&&(0,t.jsx)("p",{className:"stg:text-[0.6rem] stg:text-muted-foreground stg:truncate",children:W})]})]}),(0,t.jsxs)("div",{className:"stg:flex stg:items-center stg:gap-1.5 stg:shrink-0",children:[d&&(0,t.jsx)("span",{className:"stg:text-[0.6rem] stg:text-muted-foreground stg:capitalize",children:A||"—"}),g&&(0,t.jsx)(a.PermissionGate,{resource:c,relation:"can_grant_access",children:(0,t.jsx)("button",{type:"button",onClick:h,disabled:u,"aria-label":`Remove ${b}'s access`,className:(0,s.cn)("stg:rounded stg:p-0.5 stg:text-muted-foreground stg:opacity-0 stg:group-hover:opacity-100 stg:focus-visible:opacity-100","stg:hover:text-destructive stg:hover:bg-destructive-subtle","stg:disabled:pointer-events-none stg:disabled:opacity-50","stg:transition-opacity"),children:(0,t.jsx)(r,{})})})]})]})},"accessEntryKey",0,function(e){let t=e.principal;return t?`${t.kind}:${t.id}#${t.relation}`:"unknown"}],540279);var o=e.i(610595),u=e.i(869803),d=e.i(32011),m=e.i(891287),g=e.i(3422),p=e.i(586108),b=e.i(583093);let A=[];function W(e){let t=(0,p.useStigmer)(),{data:s,isLoading:l,isRefetching:c,error:n,refetch:a}=(0,b.useFetch)(e?()=>t.team.listByOrg((0,m.create)(g.ListTeamsByOrgInputSchema,{org:e})).then(e=>[...e.entries]):null,[e,t],A);return(0,i.useMemo)(()=>({teams:s,isLoading:l,isRefetching:c,error:n,refetch:a}),[s,l,c,n,a])}e.s(["useTeamList",0,W],9531);var h=e.i(564035);function G({label:e,count:s,children:l}){let c=(0,i.useId)();return 0===s?null:(0,t.jsxs)("li",{role:"presentation",children:[(0,t.jsx)("div",{id:c,className:"stg:px-2.5 stg:pt-1.5 stg:pb-1 stg:text-[0.6rem] stg:font-medium stg:uppercase stg:tracking-wide stg:text-muted-foreground",children:e}),(0,t.jsx)("ul",{role:"group","aria-labelledby":c,className:u.UNSTYLED_LIST,children:l})]})}function R({candidate:e}){let i="team"===e.kind?e.description:e.email!==e.name?e.email:"";return i?(0,t.jsx)("span",{className:"stg:block stg:truncate stg:text-[0.6rem] stg:text-muted-foreground",children:i}):null}function V({value:e}){return"team"===e.kind?(0,t.jsx)("span",{className:"stg:block stg:truncate stg:text-[0.6rem] stg:text-muted-foreground",children:"Team"}):(0,t.jsx)(R,{candidate:e})}function Z(){return(0,t.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true",children:(0,t.jsx)("path",{d:"M4 4l8 8M12 4l-8 8"})})}e.s(["PrincipalPicker",0,function({orgId:e,value:c,onChange:a,includeTeams:r=!1,excludeGrantees:m,disabled:g=!1,label:p,autoFocus:b=!0,className:A}){let S=(0,i.useId)(),{people:y,teams:Y,isLoading:B,error:v}=function({orgId:e,includeTeams:t}){let s=(0,h.useResourceAccess)(e?{kind:"organization",id:e}:null),c=W(t?e:null),n=(0,i.useMemo)(()=>{let e=new Map;for(let t of s.members){let i=t.principal,s=i?(0,l.granteeFromView)(i):void 0;!i||s?.kind!=="identity_account"||e.has(s.id)||e.set(s.id,{kind:"identity_account",grantee:(0,l.personGrantee)(s.id),name:i.name||i.email||i.id,email:i.email,view:i})}return[...e.values()]},[s.members]),a=(0,i.useMemo)(()=>t?c.teams.flatMap(e=>{let t=e.metadata?.id;return t?[{kind:"team",grantee:(0,l.teamGrantee)(t),name:e.metadata?.name||t,description:e.spec?.description??"",team:e}]:[]}):[],[t,c.teams]),r=s.isLoading||t&&c.isLoading,o=s.error??(t?c.error:null);return(0,i.useMemo)(()=>({people:n,teams:a,isLoading:r,error:o}),[n,a,r,o])}({orgId:e||null,includeTeams:r}),[x,I]=(0,i.useState)(""),[X,f]=(0,i.useState)(!1),[k,C]=(0,i.useState)(0),N=(0,i.useRef)(null),E=(0,i.useMemo)(()=>new Set((m??[]).map(l.granteeKey)),[m]),F=(0,i.useCallback)(e=>E.has((0,l.granteeKey)(e.grantee)),[E]),L=(0,i.useMemo)(()=>{let e=new Map;for(let t of y){let i=t.email.toLowerCase();i&&e.set(i,(e.get(i)??0)+1)}return new Set([...e.entries()].filter(([,e])=>e>1).map(([e])=>e))},[y]),{matchingPeople:_,matchingTeams:J}=(0,i.useMemo)(()=>{let e=x.trim().toLowerCase();return{matchingPeople:e?y.filter(t=>t.name.toLowerCase().includes(e)||t.email.toLowerCase().includes(e)):y,matchingTeams:e?Y.filter(t=>t.name.toLowerCase().includes(e)||t.description.toLowerCase().includes(e)):Y}},[y,Y,x]),w=(0,i.useMemo)(()=>[...J,..._],[_,J]),j=(0,i.useCallback)(e=>{F(e)||(a(e),I(""),f(!1))},[F,a]),K=(0,i.useCallback)(e=>{if("ArrowDown"===e.key)e.preventDefault(),f(!0),C(e=>Math.min(e+1,w.length-1));else if("ArrowUp"===e.key)e.preventDefault(),C(e=>Math.max(e-1,0));else if("Enter"===e.key){e.preventDefault();let t=w[k];t&&j(t)}else"Escape"===e.key&&f(!1)},[w,k,j]),M=p??(r?"Person or team":"Person");if(c)return(0,t.jsxs)("div",{className:(0,s.cn)("stg:space-y-1",A),children:[(0,t.jsx)("span",{className:"stg:block stg:text-xs stg:font-medium stg:text-foreground",children:M}),(0,t.jsxs)("div",{className:"stg:flex stg:items-center stg:justify-between stg:gap-2 stg:rounded-md stg:border stg:border-input stg:bg-background stg:px-2.5 stg:py-1.5",children:[(0,t.jsxs)("div",{className:"stg:flex stg:min-w-0 stg:items-center stg:gap-2",children:[(0,t.jsx)(n,{kind:c.kind,name:c.name}),(0,t.jsxs)("div",{className:"stg:min-w-0",children:[(0,t.jsxs)("div",{className:"stg:flex stg:items-center stg:gap-1.5",children:[(0,t.jsx)("span",{className:"stg:truncate stg:text-xs stg:text-foreground",children:c.name}),"identity_account"===c.kind&&(0,t.jsx)(d.ProviderBadge,{principal:c.view})]}),(0,t.jsx)(V,{value:c})]})]}),(0,t.jsx)("button",{type:"button",onClick:()=>a(null),disabled:g,"aria-label":"team"===c.kind?"Clear selected team":"Clear selected person",className:(0,s.cn)("stg:shrink-0 stg:rounded stg:p-0.5 stg:text-muted-foreground","stg:hover:text-foreground stg:hover:bg-accent-hover","stg:disabled:pointer-events-none stg:disabled:opacity-50"),children:(0,t.jsx)(Z,{})})]})]});let Q=(e,i)=>{var c,a;let r=F(e),o=i===k;return(0,t.jsxs)("li",{role:"option","aria-selected":o,"aria-disabled":r,onMouseEnter:()=>C(i),onMouseDown:t=>{t.preventDefault(),j(e)},className:(0,s.cn)("stg:flex stg:items-center stg:justify-between stg:gap-2 stg:px-2.5 stg:py-1.5",r?"stg:cursor-not-allowed stg:opacity-50":"stg:cursor-pointer",o&&!r&&"stg:bg-accent-hover"),children:[(0,t.jsxs)("div",{className:"stg:flex stg:min-w-0 stg:items-center stg:gap-2",children:[(0,t.jsx)(n,{kind:e.kind,name:e.name}),(0,t.jsxs)("div",{className:"stg:min-w-0",children:[(0,t.jsxs)("div",{className:"stg:flex stg:items-center stg:gap-1.5",children:[(0,t.jsx)("span",{className:"stg:truncate stg:text-xs stg:text-foreground",children:e.name}),"identity_account"===e.kind&&(c=e,a=L,!!(0,d.providerLabel)(c.view)&&(c.view.identityOrigin?.providerDisplayName!=="Stigmer"||!!c.email&&a.has(c.email.toLowerCase())))&&(0,t.jsx)(d.ProviderBadge,{principal:e.view})]}),(0,t.jsx)(R,{candidate:e})]})]}),r&&(0,t.jsx)("span",{className:"stg:shrink-0 stg:text-[0.6rem] stg:text-muted-foreground",children:"Has access"})]},(0,l.granteeKey)(e.grantee))},z=0===w.length;return(0,t.jsxs)("div",{className:(0,s.cn)("stg:space-y-1",A),children:[(0,t.jsx)("label",{htmlFor:`${S}-input`,className:"stg:block stg:text-xs stg:font-medium stg:text-foreground",children:M}),(0,t.jsxs)("div",{className:"stg:relative",children:[(0,t.jsx)("input",{id:`${S}-input`,ref:N,type:"text",role:"combobox","aria-expanded":X,"aria-controls":S,"aria-autocomplete":"list",autoComplete:"off",value:x,onChange:e=>{I(e.target.value),f(!0),C(0)},onFocus:()=>f(!0),onBlur:()=>{window.setTimeout(()=>f(!1),120)},onKeyDown:K,placeholder:r?"Search people or teams":"Search by name or email",disabled:g||B,autoFocus:b,className:(0,s.cn)("stg:w-full stg:rounded-md stg:border stg:border-input stg:bg-background stg:px-2.5 stg:py-1.5 stg:text-xs stg:text-foreground","stg:placeholder:text-muted-foreground","stg:focus-visible:outline-none stg:focus-visible:ring-1 stg:focus-visible:ring-ring","stg:disabled:pointer-events-none stg:disabled:opacity-50")}),X&&(0,t.jsxs)("ul",{id:S,role:"listbox","aria-label":r?"People and teams":"Organization members",className:(0,s.cn)(u.UNSTYLED_LIST,"stg:absolute stg:z-10 stg:mt-1 stg:max-h-56 stg:w-full stg:overflow-auto stg:rounded-md stg:border stg:border-border stg:bg-popover stg:py-1 stg:shadow-md"),children:[B&&(0,t.jsx)("li",{className:"stg:px-2.5 stg:py-2 stg:text-xs stg:text-muted-foreground",children:r?"Loading people and teams…":"Loading members…"}),!B&&v&&(0,t.jsx)("li",{className:"stg:px-2.5 stg:py-2 stg:text-[0.65rem] stg:text-destructive",role:"alert",children:(0,o.getUserMessage)(v)}),!B&&!v&&z&&(0,t.jsx)("li",{className:"stg:px-2.5 stg:py-2 stg:text-xs stg:text-muted-foreground",children:x.trim()?"No one matches your search.":"No one to share with."}),!B&&!v&&!z&&!r&&_.map((e,t)=>Q(e,t)),!B&&!v&&!z&&r&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(G,{label:"Teams",count:J.length,children:J.map((e,t)=>Q(e,t))}),(0,t.jsx)(G,{label:"People",count:_.length,children:_.map((e,t)=>Q(e,J.length+t))})]})]})]})]})}],982943)}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,52595,e=>{"use strict";var t=e.i(843476),s=e.i(271645),r=e.i(893976);function n({className:e}){return(0,t.jsx)("svg",{className:e,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true",children:(0,t.jsx)("path",{d:"M8 3v10M3 8h10"})})}function i({className:e}){return(0,t.jsx)("svg",{className:e,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,t.jsx)("path",{d:"M2 4h12M5.333 4V2.667a1.333 1.333 0 0 1 1.334-1.334h2.666a1.333 1.333 0 0 1 1.334 1.334V4M12.667 4v9.333a1.333 1.333 0 0 1-1.334 1.334H4.667a1.333 1.333 0 0 1-1.334-1.334V4"})})}function o(){return(0,t.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",className:"stg:animate-spin","aria-hidden":"true",children:(0,t.jsx)("path",{d:"M8 2a6 6 0 1 0 6 6"})})}e.s(["InlineEditKeyValue",0,function({value:e,onSave:a,keyLabel:g="Key",showValue:l=!1,valueLabel:d="Value",showSecretToggle:c=!1,showOptionalToggle:u=!1,showDescription:x=!1,editing:m,onEditingChange:p,disabled:h,isSaving:f,error:v,className:b}){let[j,N]=(0,s.useState)(!1),y=m??j,k=(0,s.useCallback)(e=>{N(e),p?.(e)},[p]);(0,s.useEffect)(()=>{void 0!==m&&N(m)},[m]);let[C,w]=(0,s.useState)([...e]);(0,s.useCallback)(()=>{w([...e]),k(!0)},[e,k]);let S=(0,s.useCallback)(()=>{k(!1),w([...e])},[e,k]),E=(0,s.useCallback)(async()=>{let e=C.filter(e=>e.key.trim());await a(e)&&k(!1)},[C,a,k]),A=(0,s.useCallback)((e,t)=>{w(s=>s.map((s,r)=>r===e?{...s,...t}:s))},[]),O=(0,s.useCallback)(e=>{w(t=>t.filter((t,s)=>s!==e))},[]),L=(0,s.useCallback)(()=>{w(e=>[...e,{key:"",value:"",isSecret:!1,description:""}])},[]);return h||!y?(0,t.jsx)("div",{className:(0,r.cn)("stg:flex stg:flex-col",b),children:e.length>0?(0,t.jsx)("div",{className:"stg:flex stg:flex-col stg:divide-y stg:divide-border",children:e.map(e=>(0,t.jsxs)("div",{className:"stg:flex stg:items-start stg:gap-3 stg:px-3 stg:py-2.5",children:[(0,t.jsx)("code",{className:"stg:shrink-0 stg:font-mono stg:text-sm stg:font-medium stg:text-foreground",children:e.key}),l&&(0,t.jsx)("span",{className:"stg:min-w-0 stg:break-all stg:font-mono stg:text-xs stg:text-muted-foreground",children:e.value}),c&&(0,t.jsx)("span",{className:"stg:shrink-0 stg:rounded stg:bg-muted stg:px-1.5 stg:py-0.5 stg:text-[10px] stg:font-medium stg:text-muted-foreground",children:e.isSecret?"secret":"config"}),u&&e.optional&&(0,t.jsx)("span",{className:"stg:shrink-0 stg:rounded stg:bg-muted stg:px-1.5 stg:py-0.5 stg:text-[10px] stg:font-medium stg:text-muted-foreground-subtle",children:"optional"}),e.description&&(0,t.jsx)("span",{className:"stg:text-xs stg:text-muted-foreground",children:e.description})]},e.key))}):(0,t.jsx)("p",{className:"stg:px-3 stg:py-3 stg:text-xs stg:text-muted-foreground stg:italic",children:"No entries"})}):(0,t.jsxs)("div",{className:(0,r.cn)("stg:flex stg:flex-col stg:gap-3",b),children:[C.map((e,s)=>(0,t.jsxs)("div",{className:"stg:flex stg:items-start stg:gap-2 stg:rounded-md stg:border stg:border-border stg:bg-muted-faint stg:p-2.5",children:[(0,t.jsxs)("div",{className:"stg:flex stg:flex-1 stg:flex-col stg:gap-1.5",children:[(0,t.jsx)("input",{type:"text",value:e.key,onChange:e=>A(s,{key:e.target.value}),placeholder:g,className:(0,r.cn)("stg:rounded-md stg:border stg:border-border stg:bg-input-bg stg:px-2 stg:py-1 stg:font-mono stg:text-sm stg:text-foreground","stg:focus:outline-none stg:focus:ring-2 stg:focus:ring-ring")}),l&&(0,t.jsx)("input",{type:"text",value:e.value,onChange:e=>A(s,{value:e.target.value}),placeholder:d,className:(0,r.cn)("stg:rounded-md stg:border stg:border-border stg:bg-input-bg stg:px-2 stg:py-1 stg:font-mono stg:text-sm stg:text-foreground","stg:focus:outline-none stg:focus:ring-2 stg:focus:ring-ring")}),x&&(0,t.jsx)("input",{type:"text",value:e.description??"",onChange:e=>A(s,{description:e.target.value}),placeholder:"Description",className:(0,r.cn)("stg:rounded-md stg:border stg:border-border stg:bg-input-bg stg:px-2 stg:py-1 stg:text-xs stg:text-foreground","stg:focus:outline-none stg:focus:ring-2 stg:focus:ring-ring")}),(0,t.jsxs)("div",{className:"stg:flex stg:items-center stg:gap-3",children:[c&&(0,t.jsxs)("label",{className:"stg:inline-flex stg:items-center stg:gap-1.5 stg:text-xs stg:text-muted-foreground stg:cursor-pointer",children:[(0,t.jsx)("input",{type:"checkbox",checked:e.isSecret??!1,onChange:e=>A(s,{isSecret:e.target.checked}),className:"stg:size-3.5 stg:rounded stg:border-border"}),"Secret"]}),u&&(0,t.jsxs)("label",{className:"stg:inline-flex stg:items-center stg:gap-1.5 stg:text-xs stg:text-muted-foreground stg:cursor-pointer",children:[(0,t.jsx)("input",{type:"checkbox",checked:e.optional??!1,onChange:e=>A(s,{optional:e.target.checked}),className:"stg:size-3.5 stg:rounded stg:border-border"}),"Optional"]})]})]}),(0,t.jsx)("button",{type:"button",onClick:()=>O(s),"aria-label":`Remove ${e.key||"entry"}`,className:(0,r.cn)("stg:mt-1 stg:inline-flex stg:size-6 stg:items-center stg:justify-center stg:rounded-md stg:text-muted-foreground","stg:hover:bg-destructive-subtle stg:hover:text-destructive","stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring"),children:(0,t.jsx)(i,{className:"stg:size-3.5"})})]},s)),(0,t.jsxs)("button",{type:"button",onClick:L,className:(0,r.cn)("stg:inline-flex stg:items-center stg:gap-1 stg:rounded-md stg:px-2.5 stg:py-1.5 stg:text-xs stg:font-medium","stg:border stg:border-dashed stg:border-border stg:text-muted-foreground","stg:hover:border-muted-foreground stg:hover:text-foreground stg:hover:bg-muted-subtle","stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring","stg:transition-colors"),children:[(0,t.jsx)(n,{className:"stg:size-3"}),"Add entry"]}),(0,t.jsxs)("div",{className:"stg:flex stg:items-center stg:justify-end stg:gap-1.5",children:[(0,t.jsx)("button",{type:"button",onClick:S,disabled:f,className:(0,r.cn)("stg:rounded-md stg:px-2.5 stg:py-1 stg:text-xs stg:font-medium","stg:border stg:border-border stg:bg-background stg:text-foreground stg:hover:bg-accent","stg:disabled:opacity-50","stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring"),children:"Cancel"}),(0,t.jsxs)("button",{type:"button",onClick:E,disabled:f,className:(0,r.cn)("stg:inline-flex stg:items-center stg:gap-1 stg:rounded-md stg:px-2.5 stg:py-1 stg:text-xs stg:font-medium","stg:bg-primary stg:text-primary-foreground stg:hover:bg-primary-hover","stg:disabled:opacity-50","stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring"),children:[f&&(0,t.jsx)(o,{}),"Save changes"]})]}),v&&(0,t.jsx)("p",{className:"stg:px-1 stg:text-xs stg:text-destructive",role:"alert",children:v})]})}])},81346,e=>{"use strict";var t=e.i(843476),s=e.i(271645),r=e.i(893976);function n({className:e}){return(0,t.jsx)("svg",{className:e,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,t.jsx)("path",{d:"M11.5 1.5a2.121 2.121 0 0 1 3 3L5 14l-4 1 1-4Z"})})}function i({className:e}){return(0,t.jsx)("svg",{className:e,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,t.jsx)("path",{d:"m3 8.5 3.5 3.5 6.5-8"})})}function o({className:e}){return(0,t.jsx)("svg",{className:e,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,t.jsx)("path",{d:"m4 4 8 8M12 4l-8 8"})})}function a({className:e}){return(0,t.jsxs)("svg",{className:e,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,t.jsx)("rect",{x:"2",y:"2",width:"12",height:"12",rx:"1.5"}),(0,t.jsx)("circle",{cx:"5.5",cy:"5.5",r:"1"}),(0,t.jsx)("path",{d:"m14 10.5-3-3L4 14"})]})}function g(){return(0,t.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",className:"stg:animate-spin","aria-hidden":"true",children:(0,t.jsx)("path",{d:"M8 2a6 6 0 1 0 6 6"})})}e.s(["InlineEditImage",0,function({value:e,onSave:l,fallback:d,size:c="md",disabled:u,isSaving:x,error:m,className:p}){let[h,f]=(0,s.useState)(!1),[v,b]=(0,s.useState)(e),[j,N]=(0,s.useState)(null),y=(0,s.useRef)(null);(0,s.useEffect)(()=>{h&&(b(e),N(null),requestAnimationFrame(()=>y.current?.focus()))},[h,e]);let k=(0,s.useCallback)(async()=>{let t=v.trim();t===e?f(!1):t&&!function(e){try{return new URL(e),!0}catch{return!1}}(t)?N("Enter a valid URL"):await l(t)&&f(!1)},[v,e,l]),C=(0,s.useCallback)(()=>{f(!1),b(e),N(null)},[e]),w=(0,s.useCallback)(e=>{"Enter"===e.key?(e.preventDefault(),k()):"Escape"===e.key&&C()},[k,C]),S="sm"===c?"stg:size-6":"stg:size-8",E=j||m;return u||!h?(0,t.jsx)("div",{className:(0,r.cn)("stg:group/inline-edit stg:inline-flex",p),children:(0,t.jsxs)("button",{type:"button",onClick:()=>{u||f(!0)},disabled:u,className:(0,r.cn)("stg:relative stg:rounded-md stg:p-0.5 stg:transition-colors",!u&&"stg:hover:bg-accent-hover stg:cursor-pointer","stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring"),"aria-label":"Change icon",children:[e?(0,t.jsx)("img",{src:e,alt:"",className:(0,r.cn)(S,"stg:shrink-0 stg:rounded stg:object-cover")}):d??(0,t.jsx)(a,{className:(0,r.cn)(S,"stg:text-muted-foreground")}),!u&&(0,t.jsx)("span",{className:"stg:absolute stg:-bottom-0.5 stg:-right-0.5 stg:flex stg:size-4 stg:items-center stg:justify-center stg:rounded-full stg:bg-muted stg:text-muted-foreground stg:opacity-0 stg:transition-opacity stg:group-hover/inline-edit:opacity-100",children:(0,t.jsx)(n,{className:"stg:size-2.5"})})]})}):(0,t.jsxs)("div",{className:(0,r.cn)("stg:flex stg:flex-col stg:gap-1",p),children:[(0,t.jsxs)("div",{className:"stg:flex stg:items-center stg:gap-1.5",children:[(0,t.jsx)("input",{ref:y,type:"url",value:v,onChange:e=>{b(e.target.value),N(null)},onKeyDown:w,disabled:x,placeholder:"https://example.com/icon.png",className:(0,r.cn)("stg:flex-1 stg:rounded-md stg:border stg:border-border stg:bg-input-bg stg:px-2 stg:py-1 stg:text-sm stg:text-foreground","stg:focus:outline-none stg:focus:ring-2 stg:focus:ring-ring","stg:disabled:opacity-50",E&&"stg:border-destructive")}),(0,t.jsx)("button",{type:"button",onClick:k,disabled:x,"aria-label":"Save",className:(0,r.cn)("stg:inline-flex stg:size-7 stg:items-center stg:justify-center stg:rounded-md","stg:bg-primary stg:text-primary-foreground stg:hover:bg-primary-hover stg:disabled:opacity-50","stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring"),children:x?(0,t.jsx)(g,{}):(0,t.jsx)(i,{className:"stg:size-3.5"})}),(0,t.jsx)("button",{type:"button",onClick:C,disabled:x,"aria-label":"Cancel",className:(0,r.cn)("stg:inline-flex stg:size-7 stg:items-center stg:justify-center stg:rounded-md","stg:border stg:border-border stg:bg-background stg:text-foreground stg:hover:bg-accent stg:disabled:opacity-50","stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring"),children:(0,t.jsx)(o,{className:"stg:size-3.5"})}),v&&(0,t.jsx)("button",{type:"button",onClick:()=>b(""),disabled:x,"aria-label":"Clear",className:"stg:text-xs stg:text-muted-foreground stg:underline stg:decoration-muted-foreground/40 stg:underline-offset-2 stg:hover:text-foreground",children:"Clear"})]}),E&&(0,t.jsx)("p",{className:"stg:px-1 stg:text-xs stg:text-destructive",role:"alert",children:E})]})}])},521557,e=>{"use strict";e.s(["isUnimplemented",0,function(e){if(!e||"object"!=typeof e)return!1;if("connectCode"in e&&12===e.connectCode)return!0;let t=e.message??"";return t.includes("[unimplemented]")||t.includes("UNIMPLEMENTED")}])},141249,e=>{"use strict";var t=e.i(843476);e.s(["PluginIcon",0,function({className:e}){return(0,t.jsx)("svg",{className:e,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,t.jsx)("path",{d:"M6 2.5a1.5 1.5 0 0 1 3 0V4h2.5A1.5 1.5 0 0 1 13 5.5V8h-1.5a1.5 1.5 0 0 0 0 3H13v2.5a1.5 1.5 0 0 1-1.5 1.5H9v-1.5a1.5 1.5 0 0 0-3 0V15H3.5A1.5 1.5 0 0 1 2 13.5V11h1.5a1.5 1.5 0 0 0 0-3H2V5.5A1.5 1.5 0 0 1 3.5 4H6V2.5Z"})})}])},292420,e=>{"use strict";var t=e.i(843476),s=e.i(893976),r=e.i(141249);e.s(["ManagedByPluginNotice",0,function({plugin:e,onPluginClick:n,className:i}){if(null===e)return null;let o=e.metadata,a=o?.name||o?.slug||"a plugin",g=o?{org:o.org,slug:o.slug}:null;return(0,t.jsxs)("div",{role:"note",className:(0,s.cn)("stg:flex stg:items-start stg:gap-2 stg:rounded-md stg:border stg:border-border stg:bg-muted stg:px-3 stg:py-2 stg:text-sm stg:text-foreground",i),children:[(0,t.jsx)(r.PluginIcon,{className:"stg:mt-0.5 stg:size-4 stg:shrink-0 stg:text-muted-foreground"}),(0,t.jsxs)("p",{children:["Installed by the plugin"," ",n&&g?(0,t.jsx)("button",{type:"button",onClick:()=>n(g),className:"stg:cursor-pointer stg:font-medium stg:underline stg:decoration-dotted stg:underline-offset-2 stg:hover:text-primary",children:a}):(0,t.jsx)("span",{className:"stg:font-medium",children:a}),". To change it, change the plugin and push it again; to customise, compose your own agent over its skills and servers."]})]})}])},473489,e=>{"use strict";var t=e.i(271645),s=e.i(910304),r=e.i(586108),n=e.i(583093);let i="stigmer.ai/plugin";e.s(["PLUGIN_LABEL",0,i,"useManagingPlugin",0,function(e){let o=(0,r.useStigmer)(),a=e?.[i]??null,{data:g,isLoading:l}=(0,n.useFetch)(a?async()=>{try{return await o.plugin.get(a)}catch(e){if((0,s.isNotFound)(e))return null;throw e}}:null,[a,o],null);return(0,t.useMemo)(()=>({plugin:g,isLoading:l}),[g,l])}])},244990,e=>{"use strict";var t=e.i(843476),s=e.i(271645),r=e.i(893976);function n({className:e}){return(0,t.jsx)("svg",{className:e,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,t.jsx)("path",{d:"M11.5 1.5a2.121 2.121 0 0 1 3 3L5 14l-4 1 1-4Z"})})}function i({className:e}){return(0,t.jsx)("svg",{className:e,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,t.jsx)("path",{d:"m3 8.5 3.5 3.5 6.5-8"})})}function o({className:e}){return(0,t.jsx)("svg",{className:e,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,t.jsx)("path",{d:"m4 4 8 8M12 4l-8 8"})})}function a(){return(0,t.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",className:"stg:animate-spin","aria-hidden":"true",children:(0,t.jsx)("path",{d:"M8 2a6 6 0 1 0 6 6"})})}e.s(["InlineEditText",0,function({value:e,onSave:g,placeholder:l="Click to edit",validate:d,variant:c="default",disabled:u,isSaving:x,error:m,className:p}){let[h,f]=(0,s.useState)(!1),[v,b]=(0,s.useState)(e),[j,N]=(0,s.useState)(null),y=(0,s.useRef)(null);(0,s.useEffect)(()=>{h&&(b(e),N(null),requestAnimationFrame(()=>y.current?.focus()))},[h,e]);let k=(0,s.useCallback)(async()=>{let t=v.trim();if(t===e)return void f(!1);if(d){let e=d(t);if(e)return void N(e)}await g(t)&&f(!1)},[v,e,d,g]),C=(0,s.useCallback)(()=>{f(!1),b(e),N(null)},[e]),w=(0,s.useCallback)(e=>{"Enter"===e.key?(e.preventDefault(),k()):"Escape"===e.key&&C()},[k,C]),S=j||m;return u||!h?(0,t.jsx)("div",{className:(0,r.cn)("stg:group/inline-edit",p),children:(0,t.jsxs)("button",{type:"button",onClick:()=>{u||f(!0)},disabled:u,className:(0,r.cn)("stg:inline-flex stg:w-full stg:items-center stg:gap-1.5 stg:rounded-md stg:px-1.5 stg:py-0.5 stg:text-left stg:transition-colors",!u&&"stg:hover:bg-accent-hover stg:cursor-pointer",u&&"stg:cursor-default","stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-inset stg:focus-visible:ring-ring"),children:[(0,t.jsx)("span",{className:(0,r.cn)("stg:min-w-0 stg:truncate","heading"===c?"stg:text-lg stg:font-semibold stg:text-foreground":"stg:text-sm stg:text-foreground",!e&&"stg:text-muted-foreground stg:italic"),children:e||l}),!u&&(0,t.jsx)(n,{className:"stg:size-3 stg:shrink-0 stg:text-muted-foreground stg:opacity-0 stg:transition-opacity stg:group-hover/inline-edit:opacity-100"})]})}):(0,t.jsxs)("div",{className:(0,r.cn)("stg:flex stg:flex-col stg:gap-1",p),children:[(0,t.jsxs)("div",{className:"stg:flex stg:items-center stg:gap-1.5",children:[(0,t.jsx)("input",{ref:y,type:"text",value:v,onChange:e=>{b(e.target.value),N(null)},onKeyDown:w,disabled:x,placeholder:l,className:(0,r.cn)("stg:flex-1 stg:rounded-md stg:border stg:border-border stg:bg-input-bg stg:px-2 stg:py-1 stg:text-sm stg:text-foreground","stg:focus:outline-none stg:focus:ring-2 stg:focus:ring-ring","stg:disabled:opacity-50","heading"===c&&"stg:text-lg stg:font-semibold",S&&"stg:border-destructive")}),(0,t.jsx)("button",{type:"button",onClick:k,disabled:x,"aria-label":"Save",className:(0,r.cn)("stg:inline-flex stg:size-7 stg:items-center stg:justify-center stg:rounded-md","stg:bg-primary stg:text-primary-foreground stg:hover:bg-primary-hover","stg:disabled:opacity-50","stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring"),children:x?(0,t.jsx)(a,{}):(0,t.jsx)(i,{className:"stg:size-3.5"})}),(0,t.jsx)("button",{type:"button",onClick:C,disabled:x,"aria-label":"Cancel",className:(0,r.cn)("stg:inline-flex stg:size-7 stg:items-center stg:justify-center stg:rounded-md","stg:border stg:border-border stg:bg-background stg:text-foreground stg:hover:bg-accent stg:hover:text-accent-foreground","stg:disabled:opacity-50","stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring"),children:(0,t.jsx)(o,{className:"stg:size-3.5"})})]}),S&&(0,t.jsx)("p",{className:"stg:px-1 stg:text-xs stg:text-destructive",role:"alert",children:S})]})}])},674542,e=>{"use strict";var t=e.i(843476),s=e.i(271645),r=e.i(893976),n=e.i(610595),i=e.i(17616),o=e.i(336973),a=e.i(498931),g=e.i(727996),l=e.i(586108),d=e.i(326283),c=e.i(78946),u=e.i(862645),x=e.i(153158),m=e.i(168197),p=e.i(844533),h=e.i(801731),f=e.i(793907),v=e.i(388894),b=e.i(651424),j=e.i(379410);function N({providerName:e,vendorDocsUrl:i,onSubmit:o,onCancel:a,isSubmitting:g,error:l,className:d}){let[c,u]=(0,s.useState)(""),[x,m]=(0,s.useState)(""),[p,h]=(0,s.useState)(!1),f=(0,s.useId)(),v=`${f}-client-id`,b=`${f}-client-secret`,w=c.trim().length>0&&x.trim().length>0,S=(0,s.useCallback)(async e=>{e.preventDefault(),w&&!g&&await o(c.trim(),x.trim())},[w,g,o,c,x]);return(0,t.jsxs)("form",{onSubmit:S,className:(0,r.cn)("stg:flex stg:flex-col stg:gap-4",d),children:[(0,t.jsxs)("div",{className:"stg:space-y-1.5",children:[(0,t.jsxs)("p",{className:"stg:text-sm stg:text-foreground",children:["Register an OAuth app with"," ",(0,t.jsx)("span",{className:"stg:font-medium",children:e})," and enter your credentials below."]}),i&&(0,t.jsxs)("a",{href:i,target:"_blank",rel:"noopener noreferrer",className:"stg:inline-flex stg:items-center stg:gap-1 stg:text-xs stg:text-primary stg:underline stg:decoration-primary/40 stg:underline-offset-2 stg:hover:decoration-primary",children:[e," OAuth app registration",(0,t.jsx)(y,{className:"stg:size-3 stg:shrink-0"})]})]}),(0,t.jsxs)("div",{className:"stg:flex stg:flex-col stg:gap-3",children:[(0,t.jsxs)("div",{className:"stg:flex stg:flex-col stg:gap-1.5",children:[(0,t.jsx)("label",{htmlFor:v,className:"stg:text-xs stg:font-medium stg:text-foreground",children:"Client ID"}),(0,t.jsx)("input",{id:v,type:"text",value:c,onChange:e=>u(e.target.value),disabled:g,required:!0,"aria-required":!0,autoComplete:"off",autoFocus:!0,placeholder:"e.g. 1234567890abcdef",className:(0,r.cn)("stg:w-full stg:rounded-md stg:border stg:border-input stg:bg-background stg:px-2.5 stg:py-1.5 stg:text-xs stg:text-foreground","stg:placeholder:text-muted-foreground","stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring","stg:disabled:pointer-events-none stg:disabled:opacity-50")})]}),(0,t.jsxs)("div",{className:"stg:flex stg:flex-col stg:gap-1.5",children:[(0,t.jsx)("label",{htmlFor:b,className:"stg:text-xs stg:font-medium stg:text-foreground",children:"Client Secret"}),(0,t.jsxs)("div",{className:"stg:relative",children:[(0,t.jsx)("input",{id:b,type:p?"text":"password",value:x,onChange:e=>m(e.target.value),disabled:g,required:!0,"aria-required":!0,autoComplete:"off",placeholder:"Your client secret",className:(0,r.cn)("stg:w-full stg:rounded-md stg:border stg:border-input stg:bg-background stg:px-2.5 stg:py-1.5 stg:pr-8 stg:text-xs stg:text-foreground","stg:placeholder:text-muted-foreground","stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring","stg:disabled:pointer-events-none stg:disabled:opacity-50")}),(0,t.jsx)("button",{type:"button",onClick:()=>h(e=>!e),disabled:g,className:(0,r.cn)("stg:absolute stg:right-2 stg:top-1/2 stg:-translate-y-1/2","stg:text-muted-foreground stg:hover:text-foreground","stg:disabled:pointer-events-none stg:disabled:opacity-50"),"aria-label":p?"Hide client secret":"Show client secret",tabIndex:-1,children:p?(0,t.jsx)(C,{}):(0,t.jsx)(k,{})})]})]})]}),l&&(0,t.jsx)("div",{role:"alert",className:"stg:rounded-md stg:border stg:border-destructive/30 stg:bg-destructive-subtle stg:px-2.5 stg:py-2 stg:text-xs stg:text-destructive",children:(0,n.getUserMessage)(l)}),(0,t.jsxs)("div",{className:"stg:flex stg:items-center stg:justify-end stg:gap-2",children:[(0,t.jsx)("button",{type:"button",onClick:a,disabled:g,className:(0,r.cn)("stg:rounded-md stg:px-3 stg:py-1.5 stg:text-xs","stg:text-muted-foreground stg:hover:text-foreground stg:hover:bg-accent-hover","stg:disabled:pointer-events-none stg:disabled:opacity-50"),children:"Cancel"}),(0,t.jsxs)("button",{type:"submit",disabled:!w||g,className:(0,r.cn)("stg:inline-flex stg:items-center stg:gap-1.5 stg:rounded-md stg:px-3 stg:py-1.5 stg:text-xs stg:font-medium","stg:bg-primary stg:text-primary-foreground stg:hover:bg-primary-hover","stg:disabled:pointer-events-none stg:disabled:opacity-40"),children:[g&&(0,t.jsx)(j.SpinnerIcon,{size:12}),"Save"]})]})]})}function y({className:e}){return(0,t.jsxs)("svg",{className:e,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,t.jsx)("path",{d:"M6 3.5H3.5a1 1 0 0 0-1 1v8a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1V10"}),(0,t.jsx)("path",{d:"M9.5 2.5h4v4"}),(0,t.jsx)("path",{d:"M13.5 2.5 8 8"})]})}function k(){return(0,t.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,t.jsx)("path",{d:"M1.5 8s2.5-4.5 6.5-4.5S14.5 8 14.5 8s-2.5 4.5-6.5 4.5S1.5 8 1.5 8z"}),(0,t.jsx)("circle",{cx:"8",cy:"8",r:"2"})]})}function C(){return(0,t.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,t.jsx)("path",{d:"M6.59 6.59a2 2 0 0 0 2.82 2.82"}),(0,t.jsx)("path",{d:"M10.73 10.73A6.5 6.5 0 0 1 8 12.5c-4 0-6.5-4.5-6.5-4.5a11.5 11.5 0 0 1 3.77-3.73"}),(0,t.jsx)("path",{d:"M5.71 3.56A6.3 6.3 0 0 1 8 3.5c4 0 6.5 4.5 6.5 4.5a11.5 11.5 0 0 1-1.28 1.73"}),(0,t.jsx)("path",{d:"M2 2l12 12"})]})}var w=e.i(170255),S=e.i(476007),E=e.i(188482),A=e.i(468806),O=e.i(351240),L=e.i(758960),M=e.i(484763),T=e.i(927056),D=e.i(668093),B=e.i(652337),H=e.i(244990),z=e.i(261722),P=e.i(81346);function I({value:e,options:n,onSave:i,disabled:o,isSaving:a,error:g,className:l}){let[d,c]=(0,s.useState)(!1),u=(0,s.useRef)(null),x=n.find(t=>t.value===e)?.label??e;(0,s.useEffect)(()=>{if(!d)return;let e=e=>{u.current&&!u.current.contains(e.target)&&c(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[d]);let m=(0,s.useCallback)(async t=>{t===e?c(!1):await i(t)&&c(!1)},[e,i]);return o||!d?(0,t.jsx)("div",{className:(0,r.cn)("stg:group/inline-edit",l),children:(0,t.jsxs)("button",{type:"button",onClick:()=>{o||c(!0)},disabled:o,className:(0,r.cn)("stg:inline-flex stg:items-center stg:gap-1.5 stg:rounded-md stg:px-1.5 stg:py-0.5 stg:text-left stg:transition-colors",!o&&"stg:hover:bg-accent-hover stg:cursor-pointer","stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-inset stg:focus-visible:ring-ring"),children:[(0,t.jsx)("span",{className:"stg:rounded stg:bg-muted stg:px-1.5 stg:py-0.5 stg:font-mono stg:text-xs stg:font-medium stg:text-foreground",children:x}),!o&&(0,t.jsx)(U,{className:"stg:size-3 stg:shrink-0 stg:text-muted-foreground stg:opacity-0 stg:transition-opacity stg:group-hover/inline-edit:opacity-100"})]})}):(0,t.jsxs)("div",{ref:u,className:(0,r.cn)("stg:flex stg:flex-col stg:gap-1",l),children:[(0,t.jsx)("div",{className:"stg:rounded-lg stg:border stg:border-border stg:bg-background stg:p-1",role:"radiogroup",children:n.map(s=>(0,t.jsxs)("button",{type:"button",role:"radio","aria-checked":s.value===e,disabled:a,onClick:()=>m(s.value),className:(0,r.cn)("stg:flex stg:w-full stg:items-start stg:gap-2 stg:rounded-md stg:px-2.5 stg:py-1.5 stg:text-left stg:transition-colors",s.value===e?"stg:bg-muted-subtle stg:text-foreground":"stg:hover:bg-accent-hover stg:text-foreground","stg:disabled:opacity-50","stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-inset stg:focus-visible:ring-ring"),children:[(0,t.jsx)("div",{className:(0,r.cn)("stg:mt-0.5 stg:flex stg:size-4 stg:shrink-0 stg:items-center stg:justify-center stg:rounded-full stg:border",s.value===e?"stg:border-primary stg:bg-primary":"stg:border-muted-foreground"),children:s.value===e&&(0,t.jsx)("div",{className:"stg:size-1.5 stg:rounded-full stg:bg-primary-foreground"})}),(0,t.jsxs)("div",{className:"stg:min-w-0 stg:flex-1",children:[(0,t.jsx)("span",{className:"stg:text-sm stg:font-medium",children:s.label}),s.description&&(0,t.jsx)("p",{className:"stg:mt-0.5 stg:text-xs stg:text-muted-foreground",children:s.description})]}),a&&s.value!==e&&(0,t.jsx)(R,{})]},s.value))}),g&&(0,t.jsx)("p",{className:"stg:px-1 stg:text-xs stg:text-destructive",role:"alert",children:g})]})}function U({className:e}){return(0,t.jsx)("svg",{className:e,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,t.jsx)("path",{d:"m4 6 4 4 4-4"})})}function R(){return(0,t.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",className:"stg:animate-spin","aria-hidden":"true",children:(0,t.jsx)("path",{d:"M8 2a6 6 0 1 0 6 6"})})}var V=e.i(52595),_=e.i(292420),W=e.i(473489);function F({isConnecting:e,connectionError:i,connectionErrorMessage:a,onConnect:g,onClearConnectionError:l,hasDiscoveredTools:d,isOAuthStranded:c,credentialsLoading:u,oauthPhase:x,authMode:m,isOAuthConnected:p,connectionHealth:h,canDisconnect:v,onDisconnect:b,isDisconnecting:j,disconnectError:N,onClearDisconnectError:y,serverName:k,accessTokenExpiresAt:C,tokenLifetimeHint:w,isVendorApprovalPending:S,isVendorApprovalBlocked:E,vendorApprovalDocsUrl:A,canBringOwnApp:O,isOrgOAuthApp:L,onBringOwnApp:M,onRemoveOrgApp:T,isRemovingOrgApp:D,removeOrgAppError:B,onClearRemoveOrgAppError:H,manualEntrySupported:z,manualOverride:P,onManualOverride:I,onBackToOAuth:U,onCancelOAuth:R}){let[V,_]=(0,s.useState)("idle"),[W,q]=(0,s.useState)("idle"),K="initiating"===x||"awaiting-callback"===x||"completing"===x||"connecting"===x,X="oauth"===m&&!p&&!P,Z=h===o.OAuthConnectionHealth.OAUTH_CONNECTION_HEALTH_TOKEN_EXPIRED,Y=E&&X&&!L,G=e||K||j||D,J=K?$(x):e?"Connecting...":L&&X?"Sign in with your app":X||Z?"Sign in to connect":c?"Discover tools":d?"Reconnect":"Connect",Q=K||e?(0,t.jsx)(eN,{}):X||Z?(0,t.jsx)(eh,{className:"stg:size-3.5"}):d?(0,t.jsx)(eu,{className:"stg:size-3.5"}):(0,t.jsx)(ec,{className:"stg:size-3.5"}),ee=(()=>{if("oauth"===m&&p){if(c)return"Signed in — tools not discovered yet";let e=function(e,t,s){switch(e){case o.OAuthConnectionHealth.OAUTH_CONNECTION_HEALTH_HEALTHY:{let e=function(e){if(e===BigInt(0))return null;let t=e-BigInt(Math.floor(Date.now()/1e3));if(t<=BigInt(0))return"Token expired";let s=Number(t/BigInt(60));if(s<1)return"Expires in <1 min";if(s<60)return`Expires in ${s} min`;let r=Math.floor(s/60);if(r<24)return`Expires in ${r}h ${s%60}m`;let n=Math.floor(r/24);return`Expires in ${n}d`}(t);if(e)return`Tokens refresh automatically \u00B7 ${e}`;let r=s&&"never"!==s?` \u00B7 Session lasts ~${s}`:"";return`Tokens refresh automatically${r}`}case o.OAuthConnectionHealth.OAUTH_CONNECTION_HEALTH_TOKEN_EXPIRED_REFRESHABLE:return"Will refresh automatically on next use";case o.OAuthConnectionHealth.OAUTH_CONNECTION_HEALTH_TOKEN_EXPIRED:return"Token expired — sign in again to reconnect";default:return"Not connected yet"}}(h,C,w);return L?`${e} \u00B7 Using your OAuth app`:e}return L&&X?"Using your OAuth app":P?"Entering token manually":d?"Connected":"Not connected yet"})(),et=function(e,t){if(t)return{pillClass:"stg:bg-amber-500/10 stg:text-amber-600 stg:dark:text-amber-400",dotClass:"stg:bg-amber-500",label:"Pending approval"};switch(e){case o.OAuthConnectionHealth.OAUTH_CONNECTION_HEALTH_HEALTHY:return{pillClass:"stg:bg-success/10 stg:text-success",dotClass:"stg:bg-success",label:"Connected"};case o.OAuthConnectionHealth.OAUTH_CONNECTION_HEALTH_TOKEN_EXPIRED_REFRESHABLE:return{pillClass:"stg:bg-amber-500/10 stg:text-amber-600 stg:dark:text-amber-400",dotClass:"stg:bg-amber-500",label:"Token expired"};case o.OAuthConnectionHealth.OAUTH_CONNECTION_HEALTH_TOKEN_EXPIRED:return{pillClass:"stg:bg-destructive-subtle stg:text-destructive",dotClass:"stg:bg-destructive",label:"Re-auth needed"};default:return{pillClass:"stg:bg-muted stg:text-muted-foreground",dotClass:"stg:bg-muted-foreground",label:"Not connected"}}}(h,S&&!p),es=L&&!G&&"idle"===W;return"confirming"===V||"disconnecting"===V?(0,t.jsxs)("div",{className:"stg:flex stg:flex-col",children:[(0,t.jsxs)("div",{className:"stg:flex stg:items-center stg:gap-2 stg:px-3 stg:py-2",children:[(0,t.jsx)(ed,{className:"stg:size-3.5 stg:shrink-0 stg:text-destructive"}),(0,t.jsxs)("p",{className:"stg:flex-1 stg:text-xs stg:text-foreground",children:["Remove OAuth credentials for ",(0,t.jsx)("span",{className:"stg:font-medium",children:k}),"? You can reconnect at any time."]}),(0,t.jsxs)("div",{className:"stg:flex stg:shrink-0 stg:items-center stg:gap-1.5",children:[(0,t.jsxs)("button",{type:"button",disabled:j,onClick:async()=>{_("disconnecting");try{await b(),_("idle")}catch{_("confirming")}},className:(0,r.cn)("stg:inline-flex stg:items-center stg:gap-1 stg:rounded-md stg:px-2.5 stg:py-1 stg:text-xs stg:font-medium","stg:bg-destructive stg:text-destructive-foreground stg:hover:bg-destructive-hover","stg:disabled:pointer-events-none stg:disabled:opacity-50"),children:[j&&(0,t.jsx)(eN,{}),"Disconnect"]}),(0,t.jsx)("button",{type:"button",disabled:j,onClick:()=>{_("idle"),y()},className:(0,r.cn)("stg:inline-flex stg:items-center stg:rounded-md stg:px-2.5 stg:py-1 stg:text-xs stg:font-medium","stg:border stg:border-border stg:bg-background stg:text-foreground stg:hover:bg-accent stg:hover:text-accent-foreground","stg:disabled:pointer-events-none stg:disabled:opacity-50"),children:"Cancel"})]})]}),N&&(0,t.jsxs)("div",{className:"stg:flex stg:items-start stg:gap-2 stg:border-t stg:border-destructive/20 stg:bg-destructive-subtle stg:px-3 stg:py-2",children:[(0,t.jsx)(ed,{className:"stg:mt-0.5 stg:size-3.5 stg:shrink-0 stg:text-destructive"}),(0,t.jsx)("p",{className:"stg:flex-1 stg:text-xs stg:text-destructive",children:(0,n.getUserMessage)(N)}),(0,t.jsx)("button",{type:"button",onClick:y,className:"stg:shrink-0 stg:text-xs stg:text-destructive-muted stg:hover:text-destructive","aria-label":"Dismiss error",children:"Dismiss"})]})]}):"confirming"===W||"removing"===W?(0,t.jsxs)("div",{className:"stg:flex stg:flex-col",children:[(0,t.jsxs)("div",{className:"stg:flex stg:items-center stg:gap-2 stg:px-3 stg:py-2",children:[(0,t.jsx)(ed,{className:"stg:size-3.5 stg:shrink-0 stg:text-destructive"}),(0,t.jsxs)("p",{className:"stg:flex-1 stg:text-xs stg:text-foreground",children:["Remove your custom OAuth app for"," ",(0,t.jsx)("span",{className:"stg:font-medium",children:k}),"? The server will revert to the platform's OAuth app."]}),(0,t.jsxs)("div",{className:"stg:flex stg:shrink-0 stg:items-center stg:gap-1.5",children:[(0,t.jsxs)("button",{type:"button",disabled:D,onClick:async()=>{q("removing");try{await T(),q("idle")}catch{q("confirming")}},className:(0,r.cn)("stg:inline-flex stg:items-center stg:gap-1 stg:rounded-md stg:px-2.5 stg:py-1 stg:text-xs stg:font-medium","stg:bg-destructive stg:text-destructive-foreground stg:hover:bg-destructive-hover","stg:disabled:pointer-events-none stg:disabled:opacity-50"),children:[D&&(0,t.jsx)(eN,{}),"Remove"]}),(0,t.jsx)("button",{type:"button",disabled:D,onClick:()=>{q("idle"),H()},className:(0,r.cn)("stg:inline-flex stg:items-center stg:rounded-md stg:px-2.5 stg:py-1 stg:text-xs stg:font-medium","stg:border stg:border-border stg:bg-background stg:text-foreground stg:hover:bg-accent stg:hover:text-accent-foreground","stg:disabled:pointer-events-none stg:disabled:opacity-50"),children:"Cancel"})]})]}),B&&(0,t.jsxs)("div",{className:"stg:flex stg:items-start stg:gap-2 stg:border-t stg:border-destructive/20 stg:bg-destructive-subtle stg:px-3 stg:py-2",children:[(0,t.jsx)(ed,{className:"stg:mt-0.5 stg:size-3.5 stg:shrink-0 stg:text-destructive"}),(0,t.jsx)("p",{className:"stg:flex-1 stg:text-xs stg:text-destructive",children:(0,n.getUserMessage)(B)}),(0,t.jsx)("button",{type:"button",onClick:H,className:"stg:shrink-0 stg:text-xs stg:text-destructive-muted stg:hover:text-destructive","aria-label":"Dismiss error",children:"Dismiss"})]})]}):(0,t.jsxs)("div",{className:"stg:flex stg:flex-col",children:[(0,t.jsxs)("div",{className:"stg:flex stg:items-center stg:justify-between stg:px-3 stg:py-2",children:[(0,t.jsxs)("div",{className:"stg:flex stg:items-center stg:gap-2",children:["oauth"===m&&!P&&(0,t.jsxs)("span",{className:(0,r.cn)("stg:inline-flex stg:items-center stg:gap-1.5 stg:rounded-full stg:px-2 stg:py-0.5 stg:text-[10px] stg:font-medium",et.pillClass),children:[(0,t.jsx)("span",{className:(0,r.cn)("stg:size-1.5 stg:rounded-full",et.dotClass),"aria-hidden":"true"}),et.label]}),(0,t.jsx)("span",{className:"stg:text-xs stg:text-muted-foreground",children:Y?"OAuth sign-in is pending vendor approval":ee}),v&&!G&&!P&&"idle"===V&&(0,t.jsx)("button",{type:"button",onClick:()=>_("confirming"),className:"stg:text-[11px] stg:text-muted-foreground stg:underline stg:decoration-muted-foreground/40 stg:underline-offset-2 stg:hover:text-foreground stg:hover:decoration-foreground",children:"Disconnect"}),es&&(0,t.jsx)("button",{type:"button",onClick:()=>q("confirming"),className:"stg:text-[11px] stg:text-muted-foreground stg:underline stg:decoration-muted-foreground/40 stg:underline-offset-2 stg:hover:text-foreground stg:hover:decoration-foreground",children:"Remove custom app"})]}),(0,t.jsxs)("button",{type:"button",onClick:g,disabled:G||u||Y,"data-cursor-target":"connect-button",className:(0,r.cn)("stg:inline-flex stg:items-center stg:gap-1.5 stg:rounded-md stg:px-2.5 stg:py-1 stg:text-xs stg:font-medium",X||Z?"stg:bg-primary stg:text-primary-foreground stg:hover:bg-primary-hover":"stg:border stg:border-border stg:bg-background stg:text-foreground stg:hover:bg-accent stg:hover:text-accent-foreground","stg:disabled:pointer-events-none stg:disabled:opacity-50"),children:[Q,J]})]}),"awaiting-callback"===x&&(0,t.jsx)("div",{className:"stg:flex stg:items-center stg:gap-3 stg:border-t stg:border-border stg:px-3 stg:py-1.5",children:(0,t.jsx)("button",{type:"button",onClick:R,className:"stg:text-[11px] stg:text-muted-foreground stg:underline stg:decoration-muted-foreground/40 stg:underline-offset-2 stg:hover:text-foreground stg:hover:decoration-foreground",children:"Cancel sign-in"})}),Y&&(0,t.jsx)(f.VendorApprovalBlockedNotice,{blocked:!0,pending:S,manualEntrySupported:z,canBringOwnApp:O,docsUrl:A,onBringOwnApp:M,className:"stg:border-t stg:border-amber-500/20"}),"oauth"===m&&!p&&!K&&!e&&(P||z||O)&&(0,t.jsx)("div",{className:"stg:flex stg:items-center stg:gap-3 stg:border-t stg:border-border stg:px-3 stg:py-1.5",children:P?(0,t.jsx)("button",{type:"button",onClick:U,className:"stg:text-[11px] stg:text-muted-foreground stg:underline stg:decoration-muted-foreground/40 stg:underline-offset-2 stg:hover:text-foreground stg:hover:decoration-foreground",children:S?"Back to OAuth status":"Sign in with OAuth instead"}):(0,t.jsxs)(t.Fragment,{children:[z&&(0,t.jsx)("button",{type:"button",onClick:I,className:"stg:text-[11px] stg:text-muted-foreground stg:underline stg:decoration-muted-foreground/40 stg:underline-offset-2 stg:hover:text-foreground stg:hover:decoration-foreground",children:"Enter token manually"}),O&&!E&&(0,t.jsx)("button",{type:"button",onClick:M,className:"stg:text-[11px] stg:text-muted-foreground stg:underline stg:decoration-muted-foreground/40 stg:underline-offset-2 stg:hover:text-foreground stg:hover:decoration-foreground",children:"Use your own OAuth app"})]})}),i&&(0,t.jsxs)("div",{className:"stg:flex stg:items-start stg:gap-2 stg:border-t stg:border-destructive/20 stg:bg-destructive-subtle stg:px-3 stg:py-2",role:"alert",children:[(0,t.jsx)(ed,{className:"stg:mt-0.5 stg:size-3.5 stg:shrink-0 stg:text-destructive"}),(0,t.jsx)("p",{className:"stg:flex-1 stg:text-xs stg:text-destructive",children:a??(0,n.getUserMessage)(i)}),(0,t.jsxs)("div",{className:"stg:flex stg:shrink-0 stg:items-center stg:gap-2",children:[(0,n.isRetryableError)(i)&&(0,t.jsx)("button",{type:"button",onClick:()=>{l(),g()},className:"stg:text-xs stg:font-medium stg:text-destructive stg:underline stg:underline-offset-2 stg:hover:no-underline",children:"Try again"}),(0,t.jsx)("button",{type:"button",onClick:l,className:"stg:text-xs stg:text-destructive-muted stg:hover:text-destructive","aria-label":"Dismiss error",children:"Dismiss"})]})]})]})}function $(e){switch(e){case"initiating":return"Starting sign-in...";case"awaiting-callback":return"Waiting for authorization...";case"completing":return"Completing sign-in...";case"connecting":return"Discovering tools...";default:return"Connecting..."}}function q({message:e}){return(0,t.jsxs)("div",{role:"alert",className:"stg:flex stg:items-start stg:gap-2.5 stg:rounded-lg stg:border stg:border-destructive/30 stg:bg-destructive-subtle stg:px-4 stg:py-3",children:[(0,t.jsx)(ed,{className:"stg:mt-0.5 stg:size-4 stg:shrink-0 stg:text-destructive"}),(0,t.jsxs)("div",{className:"stg:min-w-0 stg:flex-1",children:[(0,t.jsx)("p",{className:"stg:text-sm stg:font-medium stg:text-destructive",children:"Invalid Configuration"}),(0,t.jsx)("p",{className:"stg:mt-0.5 stg:text-xs stg:text-destructive-muted",children:e})]})]})}function K({state:e}){switch(e){case a.ValidationState.valid:return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(ei,{}),(0,t.jsxs)("span",{className:"stg:inline-flex stg:items-center stg:gap-1 stg:text-emerald-600 stg:dark:text-emerald-400",children:[(0,t.jsx)(el,{className:"stg:size-3"}),"Valid"]})]});case a.ValidationState.invalid:return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(ei,{}),(0,t.jsx)("span",{className:"stg:text-destructive",children:"Invalid"})]});default:return null}}let X=[{value:"http",label:"HTTP",description:"Connect via HTTP/SSE endpoint"},{value:"stdio",label:"Stdio",description:"Launch a local process with stdin/stdout"}];function Z({serverType:e,editable:r,isSaving:n,saveMcpField:i}){let[o,a]=(0,s.useState)(!1),[g,l]=(0,s.useState)(!1),d=(0,s.useMemo)(()=>{if(e?.case!=="http")return null;let t=e.value;return{url:t.url,headers:t.headers&&Object.keys(t.headers).length>0?{...t.headers}:void 0,queryParams:t.queryParams&&Object.keys(t.queryParams).length>0?{...t.queryParams}:void 0,timeoutSeconds:t.timeoutSeconds||void 0}},[e]),c=(0,s.useCallback)(async e=>{if(!i)return!1;if("http"===e){let e=await i("http",{url:""});return e&&await i("stdio",void 0),e}let t=await i("stdio",{command:""});return t&&await i("http",void 0),t},[i]),u=(0,s.useMemo)(()=>d?.headers?Object.entries(d.headers).map(([e,t])=>({key:e,value:t})):[],[d?.headers]),x=(0,s.useMemo)(()=>d?.queryParams?Object.entries(d.queryParams).map(([e,t])=>({key:e,value:t})):[],[d?.queryParams]),m=(0,s.useCallback)(async e=>{if(!i||!d)return!1;let t={};for(let s of e)s.key.trim()&&(t[s.key.trim()]=s.value);return i("http",{...d,headers:Object.keys(t).length>0?t:void 0})},[i,d]),p=(0,s.useCallback)(async e=>{if(!i||!d)return!1;let t={};for(let s of e)s.key.trim()&&(t[s.key.trim()]=s.value);return i("http",{...d,queryParams:Object.keys(t).length>0?t:void 0})},[i,d]);return(0,t.jsxs)(B.Section,{title:"Server Configuration",children:[(0,t.jsxs)("div",{className:"stg:flex stg:flex-col stg:gap-2 stg:p-3",children:[(0,t.jsxs)("div",{className:"stg:flex stg:items-baseline stg:gap-2",children:[(0,t.jsx)("span",{className:"stg:text-xs stg:font-medium stg:text-muted-foreground",children:"Type"}),r&&i?(0,t.jsx)(I,{value:e?.case??"http",options:X,onSave:c,isSaving:n}):(0,t.jsx)("span",{className:"stg:rounded stg:bg-muted stg:px-1.5 stg:py-0.5 stg:font-mono stg:text-xs stg:font-medium stg:text-foreground",children:e?.case??"none"})]}),e?.case==="stdio"&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"stg:flex stg:items-baseline stg:gap-2",children:[(0,t.jsx)("span",{className:"stg:text-xs stg:font-medium stg:text-muted-foreground",children:"Command"}),r&&i?(0,t.jsx)(H.InlineEditText,{value:`${e.value.command}${e.value.args.length>0?` ${e.value.args.join(" ")}`:""}`,onSave:async e=>{let t=e.trim().split(/\s+/);return i("stdio",{command:t[0]||"",args:t.slice(1)})},isSaving:n,placeholder:"e.g. npx -y @modelcontextprotocol/server"}):(0,t.jsxs)("code",{className:"stg:font-mono stg:text-sm stg:text-foreground",children:[e.value.command,e.value.args.length>0&&` ${e.value.args.join(" ")}`]})]}),(r||e.value.workingDir)&&(0,t.jsxs)("div",{className:"stg:flex stg:items-baseline stg:gap-2",children:[(0,t.jsx)("span",{className:"stg:text-xs stg:font-medium stg:text-muted-foreground",children:"Working Dir"}),r&&i?(0,t.jsx)(H.InlineEditText,{value:e.value.workingDir??"",onSave:async t=>i("stdio",{command:e.value.command,args:[...e.value.args],workingDir:t||void 0}),isSaving:n,placeholder:"/path/to/working/dir"}):(0,t.jsx)("code",{className:"stg:font-mono stg:text-xs stg:text-foreground",children:e.value.workingDir})]})]}),e?.case==="http"&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"stg:flex stg:items-baseline stg:gap-2",children:[(0,t.jsx)("span",{className:"stg:text-xs stg:font-medium stg:text-muted-foreground",children:"URL"}),r&&i?(0,t.jsx)(H.InlineEditText,{value:e.value.url,onSave:async e=>i("http",{...d,url:e}),isSaving:n,placeholder:"https://example.com/mcp"}):(0,t.jsx)("code",{className:"stg:break-all stg:font-mono stg:text-sm stg:text-foreground",children:e.value.url})]}),(r||e.value.timeoutSeconds>0)&&(0,t.jsxs)("div",{className:"stg:flex stg:items-baseline stg:gap-2",children:[(0,t.jsx)("span",{className:"stg:text-xs stg:font-medium stg:text-muted-foreground",children:"Timeout"}),r&&i?(0,t.jsx)(H.InlineEditText,{value:e.value.timeoutSeconds>0?String(e.value.timeoutSeconds):"",onSave:async e=>i("http",{...d,timeoutSeconds:e?Number(e):void 0}),isSaving:n,placeholder:"30",validate:e=>e&&(isNaN(Number(e))||0>Number(e))?"Must be a positive number":null}):(0,t.jsxs)("span",{className:"stg:text-xs stg:text-foreground",children:[e.value.timeoutSeconds,"s"]})]})]})]}),e?.case==="http"&&(r||u.length>0)&&(0,t.jsx)(Y,{title:"Headers",count:u.length,rows:u,editable:r,isSaving:n,editing:o,onEditingChange:a,onSave:m,keyLabel:"Header name"}),e?.case==="http"&&(r||x.length>0)&&(0,t.jsx)(Y,{title:"Query Parameters",count:x.length,rows:x,editable:r,isSaving:n,editing:g,onEditingChange:l,onSave:p,keyLabel:"Parameter name"})]})}function Y({title:e,count:s,rows:r,editable:n,isSaving:i,editing:o,onEditingChange:a,onSave:g,keyLabel:l}){return(0,t.jsxs)("div",{className:"stg:border-t stg:border-border",children:[(0,t.jsxs)("div",{className:"stg:flex stg:items-center stg:justify-between stg:px-3 stg:py-2",children:[(0,t.jsxs)("div",{className:"stg:flex stg:items-center stg:gap-1.5",children:[(0,t.jsx)("span",{className:"stg:text-xs stg:font-medium stg:text-muted-foreground",children:e}),s>0&&(0,t.jsx)("span",{className:"stg:inline-flex stg:min-w-[1.25rem] stg:items-center stg:justify-center stg:rounded-full stg:bg-muted stg:px-1 stg:py-px stg:text-[10px] stg:font-medium stg:leading-none stg:text-muted-foreground",children:s})]}),n&&(0,t.jsx)("button",{type:"button",onClick:()=>a(!o),className:"stg:text-[11px] stg:text-muted-foreground stg:underline stg:decoration-muted-foreground/40 stg:underline-offset-2 stg:hover:text-foreground stg:hover:decoration-foreground",children:o?"Done":"Edit"})]}),n&&o?(0,t.jsx)(V.InlineEditKeyValue,{value:[...r],onSave:g,isSaving:i,editing:o,onEditingChange:a,keyLabel:l,showValue:!0,valueLabel:"Value"}):(0,t.jsx)("div",{className:"stg:flex stg:flex-col stg:divide-y stg:divide-border",children:r.map(e=>(0,t.jsxs)("div",{className:"stg:flex stg:items-start stg:gap-2 stg:px-3 stg:py-1.5",children:[(0,t.jsx)("code",{className:"stg:shrink-0 stg:font-mono stg:text-xs stg:font-medium stg:text-foreground",children:e.key}),(0,t.jsx)("span",{className:"stg:min-w-0 stg:break-all stg:font-mono stg:text-xs stg:text-muted-foreground",children:function(e){let s;if(!G.test(e))return e;G.lastIndex=0;let r=[],n=0;for(;null!==(s=G.exec(e));)s.index>n&&r.push(e.slice(n,s.index)),r.push((0,t.jsxs)(E.Tooltip,{children:[(0,t.jsx)(E.TooltipTrigger,{render:(0,t.jsx)("span",{className:"stg:inline-flex stg:items-center stg:gap-0.5 stg:rounded stg:bg-primary-subtle stg:px-1 stg:py-px stg:text-[10px] stg:font-medium stg:text-primary"}),children:s[0]}),(0,t.jsx)(E.TooltipContent,{side:"top",children:`Resolved from environment variable: ${s[1]}`})]},s.index)),n=s.index+s[0].length;return n<e.length&&r.push(e.slice(n)),(0,t.jsx)(t.Fragment,{children:r})}(e.value)})]},e.key))})]})}let G=/\$\{([^}]+)\}/g;function J({spec:e}){return(0,t.jsx)(B.Section,{title:"Source",children:(0,t.jsxs)("div",{className:"stg:flex stg:flex-col stg:gap-2 stg:p-3",children:[e.repositoryUrl&&(0,t.jsxs)("div",{className:"stg:flex stg:items-baseline stg:gap-2",children:[(0,t.jsx)("span",{className:"stg:shrink-0 stg:text-xs stg:font-medium stg:text-muted-foreground",children:"Repository"}),(0,t.jsxs)("a",{href:e.repositoryUrl,target:"_blank",rel:"noopener noreferrer",className:"stg:inline-flex stg:items-center stg:gap-1 stg:break-all stg:font-mono stg:text-xs stg:text-foreground stg:underline stg:decoration-muted-foreground/40 stg:underline-offset-2 stg:hover:decoration-foreground",children:[e.repositoryUrl,(0,t.jsx)(ef,{className:"stg:size-3 stg:shrink-0"})]})]}),e.githubStars>0&&(0,t.jsxs)("div",{className:"stg:flex stg:items-baseline stg:gap-2",children:[(0,t.jsx)("span",{className:"stg:shrink-0 stg:text-xs stg:font-medium stg:text-muted-foreground",children:"Stars"}),(0,t.jsx)("span",{className:"stg:text-xs stg:text-foreground",children:e.githubStars.toLocaleString()})]})]})})}function Q({templates:e}){return 0===e.length?null:(0,t.jsx)("div",{className:"stg:flex stg:flex-col stg:divide-y stg:divide-border",children:e.map(e=>(0,t.jsxs)("div",{className:"stg:px-3 stg:py-2.5",children:[(0,t.jsxs)("div",{className:"stg:flex stg:items-baseline stg:gap-2",children:[(0,t.jsx)("span",{className:"stg:text-sm stg:font-medium stg:text-foreground",children:e.name}),(0,t.jsx)("code",{className:"stg:font-mono stg:text-[10px] stg:text-muted-foreground",children:e.uriTemplate})]}),e.description&&(0,t.jsx)("p",{className:"stg:mt-0.5 stg:text-xs stg:text-muted-foreground",children:e.description})]},e.uriTemplate||e.name))})}function ee({data:e,oauthTargetEnvVar:r,editable:n,isSaving:i,saveMcpField:o}){let a=Object.entries(e).sort(([e],[t])=>e.localeCompare(t)),g=(0,s.useMemo)(()=>a.map(([e,t])=>({key:e,value:"",isSecret:t.isSecret,description:t.description,optional:t.optional})),[a]),l=(0,s.useCallback)(async e=>{if(!o)return!1;let t={};for(let s of e)s.key.trim()&&(t[s.key.trim()]={isSecret:s.isSecret||void 0,description:s.description||void 0,optional:s.optional||void 0});return o("env",Object.keys(t).length>0?t:void 0)},[o]),[d,c]=(0,s.useState)(!1);return(0,t.jsx)(B.Section,{title:"Environment Variables",count:a.length,onEdit:n?()=>c(e=>!e):void 0,children:n?(0,t.jsx)(V.InlineEditKeyValue,{value:g,onSave:l,isSaving:i,editing:d,onEditingChange:c,showSecretToggle:!0,showOptionalToggle:!0,showDescription:!0,keyLabel:"Variable name"}):(0,t.jsx)("div",{className:"stg:flex stg:flex-col stg:divide-y stg:divide-border",children:a.map(([e,s])=>{let n=e===r;return(0,t.jsxs)("div",{className:"stg:flex stg:items-start stg:gap-3 stg:px-3 stg:py-2",children:[(0,t.jsx)("code",{className:"stg:shrink-0 stg:font-mono stg:text-sm stg:font-medium stg:text-foreground",children:e}),(0,t.jsx)("span",{className:"stg:shrink-0 stg:rounded stg:bg-muted stg:px-1.5 stg:py-0.5 stg:text-[10px] stg:font-medium stg:text-muted-foreground",children:s.isSecret?"secret":"config"}),n&&(0,t.jsx)("span",{className:"stg:shrink-0 stg:rounded stg:bg-primary-subtle stg:px-1.5 stg:py-0.5 stg:text-[10px] stg:font-medium stg:text-primary",children:"oauth"}),s.optional&&(0,t.jsx)("span",{className:"stg:shrink-0 stg:rounded stg:bg-muted stg:px-1.5 stg:py-0.5 stg:text-[10px] stg:font-medium stg:text-muted-foreground-subtle",children:"optional"}),s.description&&(0,t.jsx)("span",{className:"stg:text-xs stg:text-muted-foreground",children:s.description})]},e)})})})}function et({tags:e,editable:s}){return(0,t.jsx)(B.Section,{title:"Tags",count:e.length,children:(0,t.jsxs)("div",{className:"stg:flex stg:flex-wrap stg:gap-1.5 stg:p-3",children:[e.map(e=>(0,t.jsx)("span",{className:"stg:rounded-full stg:bg-muted stg:px-2.5 stg:py-0.5 stg:text-xs stg:font-medium stg:text-muted-foreground",children:e},e)),s&&0===e.length&&(0,t.jsx)("p",{className:"stg:text-xs stg:text-muted-foreground stg:italic",children:"No tags"})]})})}function es({tools:e,isOAuthStranded:n,onDiscover:i,isDiscovering:o}){let[a,g]=(0,s.useState)(""),[l,d]=(0,s.useState)(null),c=(0,s.useMemo)(()=>{if(!a.trim())return e;let t=a.toLowerCase();return e.filter(e=>e.name.toLowerCase().includes(t)||e.description?.toLowerCase().includes(t))},[e,a]);if(0===e.length)return(0,t.jsxs)("div",{className:"stg:px-3 stg:py-8 stg:text-center",children:[(0,t.jsx)(ec,{className:"stg:mx-auto stg:mb-2 stg:size-6 stg:text-muted-foreground-faint"}),n?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("p",{className:"stg:text-xs stg:text-muted-foreground",children:"Signed in, but tools haven't been discovered yet."}),(0,t.jsxs)("button",{type:"button",onClick:i,disabled:o,className:(0,r.cn)("stg:mt-3 stg:inline-flex stg:items-center stg:gap-1.5 stg:rounded-md stg:px-2.5 stg:py-1 stg:text-xs stg:font-medium","stg:bg-primary stg:text-primary-foreground stg:hover:bg-primary-hover","stg:disabled:pointer-events-none stg:disabled:opacity-50"),children:[o&&(0,t.jsx)(eN,{}),o?"Discovering tools...":"Discover tools"]})]}):(0,t.jsx)("p",{className:"stg:text-xs stg:text-muted-foreground",children:"Connect to this MCP server to discover its available tools."})]});let u=a.trim().length>0;return(0,t.jsxs)("div",{className:"stg:flex stg:flex-col",children:[(0,t.jsxs)("div",{className:"stg:flex stg:items-center stg:gap-2 stg:px-3 stg:pb-2",children:[(0,t.jsxs)("div",{className:"stg:relative stg:flex-1",children:[(0,t.jsx)(ev,{className:"stg:pointer-events-none stg:absolute stg:left-2 stg:top-1/2 stg:size-3.5 stg:-translate-y-1/2 stg:text-muted-foreground"}),(0,t.jsx)("input",{type:"text",value:a,onChange:e=>g(e.target.value),placeholder:"Search tools…","aria-label":"Search tools",className:"stg:w-full stg:rounded-md stg:border stg:border-border stg:bg-background stg:py-1.5 stg:pl-7 stg:pr-7 stg:text-xs stg:text-foreground stg:placeholder:text-muted-foreground stg:focus:outline-none stg:focus:ring-2 stg:focus:ring-ring"}),u&&(0,t.jsx)("button",{type:"button",onClick:()=>g(""),"aria-label":"Clear search",className:"stg:absolute stg:right-2 stg:top-1/2 stg:-translate-y-1/2 stg:text-muted-foreground stg:hover:text-foreground",children:(0,t.jsx)(eb,{className:"stg:size-3"})})]}),(0,t.jsx)("span",{className:"stg:shrink-0 stg:text-[10px] stg:text-muted-foreground",children:u?`${c.length} of ${e.length}`:e.length})]}),0===c.length?(0,t.jsx)("div",{className:"stg:px-3 stg:py-6 stg:text-center",children:(0,t.jsxs)("p",{className:"stg:text-xs stg:text-muted-foreground",children:["No tools matching “",a,"”"]})}):(0,t.jsx)("div",{className:"stg:max-h-96 stg:overflow-y-auto",children:(0,t.jsx)("div",{className:"stg:flex stg:flex-col stg:divide-y stg:divide-border",children:c.map(e=>{let s=l===e.name,n=null!=e.inputSchema&&Object.keys(e.inputSchema).length>0;return(0,t.jsxs)("div",{children:[(0,t.jsxs)("button",{type:"button",onClick:()=>d(s?null:e.name),className:"stg:flex stg:w-full stg:items-start stg:gap-2 stg:px-3 stg:py-2.5 stg:text-left stg:transition-colors stg:hover:bg-muted-faint","aria-expanded":s,children:[(0,t.jsx)(ej,{className:(0,r.cn)("stg:mt-0.5 stg:size-3 stg:shrink-0 stg:text-muted-foreground stg:transition-transform",s&&"stg:rotate-90")}),(0,t.jsxs)("div",{className:"stg:min-w-0 stg:flex-1",children:[(0,t.jsx)("code",{className:"stg:font-mono stg:text-sm stg:font-medium stg:text-foreground",children:e.name}),e.description&&(0,t.jsx)("p",{className:"stg:mt-0.5 stg:text-xs stg:text-muted-foreground",children:e.description})]}),n&&(0,t.jsx)("span",{className:"stg:mt-0.5 stg:shrink-0 stg:rounded stg:bg-muted stg:px-1.5 stg:py-0.5 stg:text-[10px] stg:font-medium stg:text-muted-foreground",children:"schema"})]}),s&&n&&(0,t.jsx)("div",{className:"stg:border-t stg:border-border stg:bg-muted-faint stg:px-3 stg:py-2",children:(0,t.jsx)("pre",{className:"stg:max-h-64 stg:overflow-auto stg:whitespace-pre-wrap stg:break-words stg:rounded stg:border stg:border-border stg:bg-background stg:p-2 stg:font-mono stg:text-[11px] stg:text-foreground",children:JSON.stringify(e.inputSchema,null,2)})})]},e.name)})})})]})}function er({pinnedPolicies:e,classifiedPolicies:r,hasDiscoveredTools:n,isOAuthStranded:i}){let[o,a]=(0,s.useState)(""),g=e.length+r.length,l=g>0,d=(0,s.useMemo)(()=>{if(!o.trim())return e;let t=o.toLowerCase();return e.filter(e=>e.toolName.toLowerCase().includes(t)||e.message?.toLowerCase().includes(t))},[e,o]),c=(0,s.useMemo)(()=>{if(!o.trim())return r;let e=o.toLowerCase();return r.filter(t=>t.toolName.toLowerCase().includes(e)||t.message?.toLowerCase().includes(e))},[r,o]),u=d.length+c.length,x=o.trim().length>0;return l?(0,t.jsxs)("div",{className:"stg:flex stg:flex-col",children:[(0,t.jsxs)("div",{className:"stg:flex stg:items-center stg:gap-2 stg:px-3 stg:pb-2",children:[(0,t.jsxs)("div",{className:"stg:relative stg:flex-1",children:[(0,t.jsx)(ev,{className:"stg:pointer-events-none stg:absolute stg:left-2 stg:top-1/2 stg:size-3.5 stg:-translate-y-1/2 stg:text-muted-foreground"}),(0,t.jsx)("input",{type:"text",value:o,onChange:e=>a(e.target.value),placeholder:"Search policies…","aria-label":"Search policies",className:"stg:w-full stg:rounded-md stg:border stg:border-border stg:bg-background stg:py-1.5 stg:pl-7 stg:pr-7 stg:text-xs stg:text-foreground stg:placeholder:text-muted-foreground stg:focus:outline-none stg:focus:ring-2 stg:focus:ring-ring"}),x&&(0,t.jsx)("button",{type:"button",onClick:()=>a(""),"aria-label":"Clear search",className:"stg:absolute stg:right-2 stg:top-1/2 stg:-translate-y-1/2 stg:text-muted-foreground stg:hover:text-foreground",children:(0,t.jsx)(eb,{className:"stg:size-3"})})]}),(0,t.jsx)("span",{className:"stg:shrink-0 stg:text-[10px] stg:text-muted-foreground",children:x?`${u} of ${g}`:g})]}),0===u?(0,t.jsx)("div",{className:"stg:px-3 stg:py-6 stg:text-center",children:(0,t.jsxs)("p",{className:"stg:text-xs stg:text-muted-foreground",children:["No policies matching “",o,"”"]})}):(0,t.jsxs)("div",{className:"stg:max-h-96 stg:overflow-y-auto",children:[d.length>0&&(0,t.jsx)(en,{icon:(0,t.jsx)(em,{className:"stg:size-3.5"}),label:"Pinned",policies:d}),c.length>0&&(0,t.jsx)(en,{icon:(0,t.jsx)(ep,{className:"stg:size-3.5"}),label:"Auto-classified",policies:c})]})]}):(0,t.jsxs)("div",{className:"stg:px-3 stg:py-8 stg:text-center",children:[(0,t.jsx)(ex,{className:"stg:mx-auto stg:mb-2 stg:size-6 stg:text-muted-foreground-faint"}),(0,t.jsx)("p",{className:"stg:text-xs stg:text-muted-foreground",children:n?"No approval policies yet. Reconnect to reclassify tools.":i?"Signed in — discover tools to auto-classify approval policies.":"Connect to discover tools and auto-classify approval policies."})]})}function en({icon:e,label:s,policies:r}){return(0,t.jsxs)("div",{className:"stg:flex stg:flex-col",children:[(0,t.jsxs)("div",{className:"stg:flex stg:items-center stg:gap-1.5 stg:border-b stg:border-border stg:bg-muted-faint stg:px-3 stg:py-1.5",children:[(0,t.jsx)("span",{className:"stg:text-muted-foreground",children:e}),(0,t.jsx)("span",{className:"stg:text-[10px] stg:font-medium stg:uppercase stg:tracking-wider stg:text-muted-foreground",children:s}),(0,t.jsxs)("span",{className:"stg:text-[10px] stg:text-muted-foreground",children:["(",r.length,")"]})]}),(0,t.jsx)("div",{className:"stg:flex stg:flex-col stg:divide-y stg:divide-border",children:r.map(e=>(0,t.jsxs)("div",{className:"stg:px-3 stg:py-2.5",children:[(0,t.jsxs)("div",{className:"stg:flex stg:items-baseline stg:gap-2",children:[(0,t.jsx)("code",{className:"stg:font-mono stg:text-sm stg:font-medium stg:text-foreground",children:e.toolName}),(0,t.jsxs)("span",{className:"stg:inline-flex stg:items-center stg:gap-1 stg:rounded stg:bg-amber-500/10 stg:px-1.5 stg:py-0.5 stg:text-[10px] stg:font-medium stg:text-amber-600 stg:dark:text-amber-400",children:[(0,t.jsx)(ex,{className:"stg:size-2.5"}),"requires approval"]})]}),e.message&&(0,t.jsx)("p",{className:"stg:mt-0.5 stg:text-xs stg:text-muted-foreground",children:e.message})]},e.toolName))})]})}function ei(){return(0,t.jsx)("span",{className:"stg:shrink-0","aria-hidden":"true",children:"·"})}function eo({className:e}){return(0,t.jsxs)("div",{className:(0,r.cn)("stg:flex stg:flex-col stg:gap-6",e),"aria-busy":"true","aria-label":"Loading MCP server details",children:[(0,t.jsxs)("div",{className:"stg:flex stg:items-start stg:gap-3",children:[(0,t.jsx)("div",{className:"stg:mt-1 stg:size-6 stg:shrink-0 stg:animate-pulse stg:rounded stg:bg-muted"}),(0,t.jsxs)("div",{className:"stg:flex-1 stg:space-y-2",children:[(0,t.jsx)("div",{className:"stg:h-5 stg:w-48 stg:animate-pulse stg:rounded stg:bg-muted"}),(0,t.jsx)("div",{className:"stg:h-3 stg:w-64 stg:animate-pulse stg:rounded stg:bg-muted"}),(0,t.jsx)("div",{className:"stg:h-4 stg:w-full stg:max-w-md stg:animate-pulse stg:rounded stg:bg-muted"})]})]}),[24,48,16,12].map((e,s)=>(0,t.jsxs)("div",{className:"stg:space-y-2",children:[(0,t.jsx)("div",{className:"stg:h-3 stg:w-28 stg:animate-pulse stg:rounded stg:bg-muted"}),(0,t.jsx)("div",{className:"stg:animate-pulse stg:rounded-lg stg:border stg:border-border stg:bg-muted-faint",style:{height:`${4*e}px`}})]},s))]})}function ea({className:e}){return(0,t.jsxs)("div",{role:"status",className:(0,r.cn)("stg:flex stg:flex-col stg:items-center stg:gap-2 stg:py-12 stg:text-center",e),children:[(0,t.jsx)(eg,{className:"stg:size-10 stg:text-muted-foreground-faint"}),(0,t.jsx)("p",{className:"stg:text-sm stg:font-medium stg:text-muted-foreground",children:"MCP Server not found"}),(0,t.jsx)("p",{className:"stg:text-xs stg:text-muted-foreground-subtle",children:"This MCP server doesn't exist or you don't have access to it."})]})}function eg({className:e}){return(0,t.jsxs)("svg",{className:e,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,t.jsx)("rect",{x:"2",y:"2",width:"12",height:"5",rx:"1"}),(0,t.jsx)("rect",{x:"2",y:"9",width:"12",height:"5",rx:"1"}),(0,t.jsx)("circle",{cx:"5",cy:"4.5",r:"0.75",fill:"currentColor",stroke:"none"}),(0,t.jsx)("circle",{cx:"5",cy:"11.5",r:"0.75",fill:"currentColor",stroke:"none"})]})}function el({className:e}){return(0,t.jsx)("svg",{className:e,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,t.jsx)("path",{d:"m3 8.5 3.5 3.5 6.5-8"})})}function ed({className:e}){return(0,t.jsxs)("svg",{className:e,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,t.jsx)("path",{d:"M8 1.5 1 14h14L8 1.5Z"}),(0,t.jsx)("path",{d:"M8 6v3.5"}),(0,t.jsx)("circle",{cx:"8",cy:"11.5",r:"0.5",fill:"currentColor",stroke:"none"})]})}function ec({className:e}){return(0,t.jsxs)("svg",{className:e,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,t.jsx)("path",{d:"M6.5 6.5 4.25 4.25"}),(0,t.jsx)("path",{d:"m9.5 9.5 2.25 2.25"}),(0,t.jsx)("rect",{x:"1.5",y:"1.5",width:"5",height:"5",rx:"1"}),(0,t.jsx)("rect",{x:"9.5",y:"9.5",width:"5",height:"5",rx:"1"}),(0,t.jsx)("path",{d:"m6.5 9.5-3 3"}),(0,t.jsx)("path",{d:"m9.5 6.5 3-3"})]})}function eu({className:e}){return(0,t.jsxs)("svg",{className:e,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,t.jsx)("path",{d:"M2.5 8a5.5 5.5 0 0 1 9.36-3.92"}),(0,t.jsx)("path",{d:"M13.5 8a5.5 5.5 0 0 1-9.36 3.92"}),(0,t.jsx)("path",{d:"M12 2v3h-3"}),(0,t.jsx)("path",{d:"M4 14v-3h3"})]})}function ex({className:e}){return(0,t.jsx)("svg",{className:e,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,t.jsx)("path",{d:"M8 1.5 2.5 4v4c0 3.31 2.35 6.4 5.5 7 3.15-.6 5.5-3.69 5.5-7V4L8 1.5Z"})})}function em({className:e}){return(0,t.jsxs)("svg",{className:e,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,t.jsx)("path",{d:"M9.5 2.5 13.5 6.5"}),(0,t.jsx)("path",{d:"M5 7 3 14l7-2"}),(0,t.jsx)("path",{d:"m5 7 2-2 4.5-1 1.5 1.5-1 4.5-2 2z"})]})}function ep({className:e}){return(0,t.jsx)("svg",{className:e,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,t.jsx)("path",{d:"M8 1v2M8 13v2M1 8h2M13 8h2M3.05 3.05l1.41 1.41M11.54 11.54l1.41 1.41M3.05 12.95l1.41-1.41M11.54 4.46l1.41-1.41"})})}function eh({className:e}){return(0,t.jsxs)("svg",{className:e,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,t.jsx)("rect",{x:"1.5",y:"5",width:"13",height:"8",rx:"1.5"}),(0,t.jsx)("path",{d:"M4.5 5V3.5a3.5 3.5 0 0 1 7 0V5"}),(0,t.jsx)("circle",{cx:"8",cy:"9.5",r:"1.25"})]})}function ef({className:e}){return(0,t.jsxs)("svg",{className:e,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,t.jsx)("path",{d:"M12 8.667v4A1.333 1.333 0 0 1 10.667 14H3.333A1.333 1.333 0 0 1 2 12.667V5.333A1.333 1.333 0 0 1 3.333 4h4"}),(0,t.jsx)("path",{d:"M10 2h4v4"}),(0,t.jsx)("path",{d:"M6.667 9.333 14 2"})]})}function ev({className:e}){return(0,t.jsxs)("svg",{className:e,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,t.jsx)("circle",{cx:"7",cy:"7",r:"4.5"}),(0,t.jsx)("path",{d:"m10.5 10.5 3 3"})]})}function eb({className:e}){return(0,t.jsx)("svg",{className:e,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,t.jsx)("path",{d:"m4 4 8 8M12 4l-8 8"})})}function ej({className:e}){return(0,t.jsx)("svg",{className:e,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,t.jsx)("path",{d:"m6 4 4 4-4 4"})})}function eN(){return(0,t.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",className:"stg:animate-spin","aria-hidden":"true",children:(0,t.jsx)("path",{d:"M8 2a6 6 0 1 0 6 6"})})}e.s(["McpServerDetailView",0,function({org:e,slug:r,mcpServerState:f,onResourceLoad:j,defaultCapabilityTab:y="tools",defaultShowCredentialForm:k=!1,credentialPoolValues:C,activeOrg:E,primaryAction:I,actions:U,onPluginClick:R,editable:V=!1,onResourceUpdated:$,className:X}){let Y=(0,g.useMcpServer)(f?null:e,f?null:r),{mcpServer:G,isLoading:en,error:el,refetch:ed}=f??Y,ec=(0,W.useManagingPlugin)(G?.metadata?.labels),eu=V&&null===ec.plugin,{update:ex,isUpdating:em}=function(){let e=(0,l.useStigmer)(),[t,r]=(0,s.useState)(!1),[n,i]=(0,s.useState)(null),o=(0,s.useCallback)(()=>i(null),[]);return{update:(0,s.useCallback)(async t=>{r(!0),i(null);try{return await e.mcpServer.update(t)}catch(e){throw i((0,d.toError)(e)),e}finally{r(!1)}},[e]),isUpdating:t,error:n,clearError:o}}(),ep=(0,s.useCallback)(async(e,t)=>{if(!G)return!1;let s=(0,c.toMcpServerUpdateInput)(G);s[e]=t;try{let e=await ex(s);return $?.(e),ed(),!0}catch{return!1}},[G,ex,$,ed]),eh=(0,x.useMcpServerCredentials)(E??e,G??null),ef=(0,u.useMcpServerConnect)(),ev=(0,m.useMcpServerOAuthConnect)(),eb=(0,v.useDisconnectOAuth)(),ej=(0,b.useOrgOAuthApp)(G?.metadata?.id??null,E??e),[eN,ey]=(0,s.useState)(k),[ek,eC]=(0,s.useState)(!1),[ew,eS]=(0,s.useState)(y),eE=(0,s.useRef)(j);eE.current=j,(0,s.useEffect)(()=>{G?.metadata?.name&&eE.current?.({name:G.metadata.name,id:G.metadata.id})},[G]);let eA=(0,s.useCallback)(async()=>{if(!G?.metadata?.id)return;let t=Object.keys(G.spec?.env??{});try{await ev.startOAuth(G.metadata.id,E??e,t),eh.refetch(),ed()}catch{eh.refetch(),ed()}},[G,ev,eh,ed]),eO="oauth"===eh.authMode&&"connecting"===ev.failedPhase,eL=(0,s.useCallback)(async()=>{if(!G?.metadata?.id)return;if("oauth"===eh.authMode&&!eh.isOAuthConnected&&!eh.manualOverride&&!eO)return void eA();if(!eh.isReady&&!eO)return void ey(!0);let t=Object.keys(G.spec?.env??{});try{await ef.connect(G.metadata.id,E??e,void 0,t),ev.clearError(),ed()}catch{}},[G,eh.authMode,eh.isOAuthConnected,eh.manualOverride,eh.isReady,eO,ef,ev.clearError,ed,eA,E,e]),eM=(0,s.useCallback)(async(t,s)=>{try{if(s.saveForFuture&&(await eh.saveCredentials(t),eh.refetch()),G?.metadata?.id){let s=Object.keys(G.spec?.env??{}),r=E??e;await ef.connect(G.metadata.id,r,t,s),ed()}ey(!1)}catch{}},[eh,G,ef,ed]),eT=(0,s.useCallback)(async()=>{if(G?.metadata?.id)try{await eb.disconnect(G.metadata.id,E??e),eh.refetch(),ed()}catch{}},[G,eb,eh,ed,E,e]),eD=(0,s.useCallback)(e=>{e||(eC(!1),ej.clearErrors())},[ej]),eB=(0,s.useCallback)(async(e,t)=>{await ej.setOrgOAuthApp(e,t),eC(!1),ej.refetch(),eh.refetch(),ed()},[ej,eh,ed]),eH=(0,s.useCallback)(async()=>{await ej.deleteOrgOAuthApp(),ej.refetch(),eh.refetch(),ed()},[ej,eh,ed]),ez=G?.spec,eP=G?.status,eI=ez&&(ez.repositoryUrl||ez.githubStars>0),eU=eP?.audit?.specAudit,eR=eP?.discoveredCapabilities,eV=ez?.pinnedToolApprovals??[],e_=eP?.toolApprovals??[],eW=eV.length+e_.length,eF=eR?.tools??[],e$=eR?.resourceTemplates??[],eq=eF.length>0,eK="oauth"===eh.authMode&&eh.isOAuthConnected&&eh.connectionHealth!==o.OAuthConnectionHealth.OAUTH_CONNECTION_HEALTH_TOKEN_EXPIRED&&!eq,eX=(0,s.useMemo)(()=>{let e=[{id:"tools",label:"Tools",badge:eF.length},{id:"policies",label:"Policies",badge:eW}];return e$.length>0&&e.push({id:"resources",label:"Resources",badge:e$.length}),e},[eF.length,eW,e$.length]),eZ=ef.error??ev.error,eY=ef.error?(0,n.getUserMessage)(ef.error):ev.error?(0,m.getOAuthConnectErrorMessage)(ev.error,ev.failedPhase):null,eG=(0,s.useCallback)(()=>{ef.clearError(),ev.clearError()},[ef,ev]),eJ=(0,M.useManageAccess)({resource:G?.metadata?{kind:w.ApiResourceKind.mcp_server,kindString:"mcp_server",id:G.metadata.id,org:G.metadata.org,name:G.metadata.name}:null,visibility:G?.metadata?{kind:"mcpServer",current:G.metadata.visibility,org:G.metadata.org,onChanged:ed}:void 0});if(en)return(0,t.jsx)(eo,{className:X});if(el)return(0,t.jsx)(S.ErrorMessage,{error:el,retry:ed,className:X});if(!G)return(0,t.jsx)(ea,{className:X});let eQ=G.metadata,e0=eR?.lastDiscoveredAt?(0,i.timestampDate)(eR.lastDiscoveredAt):null,e1={name:eQ?.name||eQ?.slug||"Untitled",nameElement:eu&&ep?(0,t.jsx)(H.InlineEditText,{value:eQ?.name||"",onSave:e=>ep("name",e),isSaving:em,variant:"heading",placeholder:"Server name",validate:e=>e.trim()?null:"Name is required"}):void 0,id:eQ?.id||"",org:eQ?.org,slug:eQ?.slug,qualifiedSlug:eQ?.slug?eQ.org?`${eQ.org}/${eQ.slug}`:eQ.slug:void 0,icon:eu&&ep?(0,t.jsx)(P.InlineEditImage,{value:ez?.iconUrl??"",onSave:e=>ep("iconUrl",e||void 0),isSaving:em,fallback:(0,t.jsx)(eg,{className:"stg:size-6 stg:text-muted-foreground"}),size:"md"}):ez?.iconUrl?void 0:(0,t.jsx)(eg,{className:"stg:size-6 stg:text-muted-foreground"}),iconUrl:eu?void 0:ez?.iconUrl||void 0,createdAt:eU?.createdAt?(0,i.timestampDate)(eU.createdAt):null,updatedAt:eU?.updatedAt?(0,i.timestampDate)(eU.updatedAt):null},e5=eQ?(0,t.jsx)(L.VisibilityBadge,{visibility:eQ.visibility,onClick:eJ.action?eJ.open:void 0}):void 0,e2=eJ.action?[...U??[],eJ.action]:U,e3=(0,t.jsxs)(t.Fragment,{children:[eP&&(0,t.jsx)(K,{state:eP.validationState}),e0&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(ei,{}),(0,t.jsxs)("span",{children:["Discovered ",e0.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})]})]})]}),e6=(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(_.ManagedByPluginNotice,{plugin:ec.plugin,onPluginClick:R}),eP?.validationState===a.ValidationState.invalid&&eP.validationMessage?(0,t.jsx)(q,{message:eP.validationMessage}):null]});return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(D.ResourceDetailShell,{header:e1,visibilityControl:e5,headerMetaExtra:e3,headerBanner:e6,primaryAction:I,actions:e2,className:X,children:[(eu||ez?.description)&&(0,t.jsx)(B.Section,{title:"Description",children:eu&&ep?(0,t.jsx)("div",{className:"stg:max-h-20 stg:overflow-y-auto stg:p-3",children:(0,t.jsx)(z.InlineEditTextarea,{value:ez?.description||"",onSave:e=>ep("description",e||void 0),isSaving:em,placeholder:"Add a description",minRows:2})}):(0,t.jsx)("div",{className:"stg:p-3",children:(0,t.jsx)("pre",{className:"stg:whitespace-pre-wrap stg:break-words stg:text-sm stg:text-foreground stg:font-sans",children:ez?.description})})}),eI&&(0,t.jsx)(J,{spec:ez}),(eu||ez?.serverType.case)&&(0,t.jsx)(Z,{serverType:ez?.serverType,editable:eu,isSaving:em,saveMcpField:ep}),(eu||ez?.env&&Object.keys(ez.env).length>0)&&(0,t.jsx)(ee,{data:ez?.env??{},oauthTargetEnvVar:eh.oauthTargetEnvVar,editable:eu,isSaving:em,saveMcpField:ep}),(0,t.jsxs)(B.Section,{title:"Connection",scrollTarget:"mcp-connection",children:[(0,t.jsx)(p.StdioSandboxNotice,{serverType:ez?.serverType,className:"stg:mb-3"}),(0,t.jsx)(h.OAuthRequiredNotice,{oauthOnly:ez?.auth?.oauthOnly,className:"stg:mb-3"}),(0,t.jsx)(F,{manualEntrySupported:eh.manualEntrySupported,isConnecting:ef.isConnecting||ev.isInProgress,connectionError:eZ,connectionErrorMessage:eY,onConnect:eL,onClearConnectionError:eG,hasDiscoveredTools:eq,isOAuthStranded:eK,credentialsLoading:eh.isLoading,oauthPhase:ev.phase,authMode:eh.authMode,isOAuthConnected:eh.isOAuthConnected,connectionHealth:eh.connectionHealth,canDisconnect:eh.canDisconnect,onDisconnect:eT,isDisconnecting:eb.isDisconnecting,disconnectError:eb.error,onClearDisconnectError:eb.clearError,serverName:G?.metadata?.name??r,accessTokenExpiresAt:eh.accessTokenExpiresAt,tokenLifetimeHint:eh.tokenLifetimeHint,isVendorApprovalPending:eh.isVendorApprovalPending,isVendorApprovalBlocked:eh.isVendorApprovalBlocked,vendorApprovalDocsUrl:eh.vendorApprovalDocsUrl,canBringOwnApp:eh.canBringOwnApp,isOrgOAuthApp:eh.isOrgOAuthApp,onBringOwnApp:()=>eC(!0),onRemoveOrgApp:eH,isRemovingOrgApp:ej.isDeleting,removeOrgAppError:ej.deleteError,onClearRemoveOrgAppError:ej.clearErrors,manualOverride:eh.manualOverride,onManualOverride:()=>{eh.setManualOverride(!0),ey(!0)},onBackToOAuth:()=>{eh.setManualOverride(!1),ey(!1)},onCancelOAuth:ev.clearError}),eN&&eh.missingVariables.length>0&&(0,t.jsx)("div",{className:"stg:border-b stg:border-border stg:p-4","data-cursor-target":"credential-form",children:(0,t.jsx)(O.EnvVarForm,{title:"Credentials Required",description:'Enter the credentials needed to connect to this MCP server. Toggle "Save for future runs" to persist them in your personal environment, or leave it off for one-time use.',variables:eh.missingVariables,onSubmit:(e,t)=>eM(e,t),onCancel:()=>ey(!1),isSubmitting:eh.isSaving,poolValues:C,className:"stg:w-full stg:max-w-md"})})]}),(0,t.jsxs)(A.DialogShell,{open:ek,onOpenChange:eD,width:"md",className:"stg:p-6","aria-label":"Use your own OAuth app",children:[(0,t.jsx)("h3",{className:"stg:mb-4 stg:text-base stg:font-semibold stg:text-foreground",children:"Use your own OAuth app"}),(0,t.jsx)(N,{providerName:G?.metadata?.name??r,vendorDocsUrl:eh.vendorApprovalDocsUrl,onSubmit:eB,onCancel:()=>{eC(!1),ej.clearErrors()},isSubmitting:ej.isSetting,error:ej.setError})]}),(0,t.jsx)(B.Section,{title:"Capabilities",scrollTarget:"mcp-capabilities",children:(0,t.jsxs)(T.Tabs,{tabs:eX,activeTab:ew,onTabChange:e=>eS(e),"aria-label":"MCP server capabilities",children:["tools"===ew&&(0,t.jsx)(es,{tools:eF,isOAuthStranded:eK,onDiscover:eL,isDiscovering:ef.isConnecting||ev.isInProgress}),"policies"===ew&&(0,t.jsx)(er,{pinnedPolicies:eV,classifiedPolicies:e_,hasDiscoveredTools:eq,isOAuthStranded:eK}),"resources"===ew&&(0,t.jsx)(Q,{templates:e$})]})}),(eu||ez&&ez.tags.length>0)&&(0,t.jsx)(et,{tags:ez?.tags??[],editable:eu})]}),eJ.dialog]})},"oauthPhaseLabel",0,$],674542)}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,691444,e=>{"use strict";var t=e.i(430182);let s={[t.IamRole.iam_role_unspecified]:"unspecified",[t.IamRole.owner]:"owner",[t.IamRole.admin]:"admin",[t.IamRole.member]:"member",[t.IamRole.viewer]:"viewer",[t.IamRole.participant]:"participant"},n={owner:t.IamRole.owner,admin:t.IamRole.admin,member:t.IamRole.member,viewer:t.IamRole.viewer,participant:t.IamRole.participant},r={[t.IamRole.iam_role_unspecified]:"Unspecified",[t.IamRole.owner]:"Owner",[t.IamRole.admin]:"Admin",[t.IamRole.member]:"Member",[t.IamRole.viewer]:"Viewer",[t.IamRole.participant]:"Participant"},i={[t.IamRole.iam_role_unspecified]:"",[t.IamRole.owner]:"Full access including delete and access management",[t.IamRole.admin]:"Edit access and member management",[t.IamRole.member]:"Standard access to organization resources",[t.IamRole.viewer]:"Read-only access",[t.IamRole.participant]:"Reply to customers and manage conversation takeover"};e.s(["iamRoleDescription",0,function(e){return i[e]??""},"iamRoleDisplayName",0,function(e){return r[e]??"Unknown"},"iamRoleFromString",0,function(e){return n[e]},"iamRoleToString",0,function(e){return s[e]??"unspecified"}])},818094,e=>{"use strict";var t=e.i(170255),s=e.i(430182);let n=new Map([[t.ApiResourceKind.identity_provider,[s.IamRole.viewer]],[t.ApiResourceKind.oauth_app,[s.IamRole.viewer]],[t.ApiResourceKind.platform_client,[s.IamRole.viewer]],[t.ApiResourceKind.team,[s.IamRole.member]],[t.ApiResourceKind.organization,[s.IamRole.owner,s.IamRole.admin,s.IamRole.member,s.IamRole.viewer]],[t.ApiResourceKind.agent,[s.IamRole.owner,s.IamRole.viewer]],[t.ApiResourceKind.session,[s.IamRole.owner,s.IamRole.viewer]],[t.ApiResourceKind.skill,[s.IamRole.owner,s.IamRole.viewer]],[t.ApiResourceKind.mcp_server,[s.IamRole.owner,s.IamRole.viewer]],[t.ApiResourceKind.agent_instance,[s.IamRole.owner,s.IamRole.viewer]],[t.ApiResourceKind.agent_share,[s.IamRole.owner,s.IamRole.viewer]],[t.ApiResourceKind.agent_channel,[s.IamRole.owner,s.IamRole.viewer,s.IamRole.participant]],[t.ApiResourceKind.channel_app,[s.IamRole.owner,s.IamRole.viewer]],[t.ApiResourceKind.workflow,[s.IamRole.owner,s.IamRole.viewer]],[t.ApiResourceKind.workflow_instance,[s.IamRole.owner,s.IamRole.viewer]],[t.ApiResourceKind.workflow_execution,[s.IamRole.owner,s.IamRole.viewer]],[t.ApiResourceKind.environment,[s.IamRole.owner,s.IamRole.viewer]],[t.ApiResourceKind.artifact,[s.IamRole.owner,s.IamRole.viewer]],[t.ApiResourceKind.schedule,[s.IamRole.owner,s.IamRole.viewer]],[t.ApiResourceKind.plugin,[s.IamRole.owner,s.IamRole.viewer]]]),r=new Map([[t.ApiResourceKind.agent,[s.IamRole.viewer]],[t.ApiResourceKind.skill,[s.IamRole.viewer]],[t.ApiResourceKind.mcp_server,[s.IamRole.viewer]],[t.ApiResourceKind.agent_instance,[s.IamRole.viewer]],[t.ApiResourceKind.agent_channel,[s.IamRole.viewer,s.IamRole.participant]],[t.ApiResourceKind.workflow,[s.IamRole.viewer]],[t.ApiResourceKind.workflow_instance,[s.IamRole.viewer]],[t.ApiResourceKind.workflow_execution,[s.IamRole.viewer]],[t.ApiResourceKind.schedule,[s.IamRole.viewer]],[t.ApiResourceKind.plugin,[s.IamRole.viewer]]]),i=Object.freeze([]);e.s(["getGrantableRoles",0,function(e){return n.get(e)??i},"getTeamGrantableRoles",0,function(e){return r.get(e)??i},"hasGrantableRoles",0,function(e){let t=n.get(e);return void 0!==t&&t.length>0},"hasTeamGrantableRoles",0,function(e){let t=r.get(e);return void 0!==t&&t.length>0},"isRoleGrantable",0,function(e,t){let s=n.get(e);return void 0!==s&&s.includes(t)},"isRoleTeamGrantable",0,function(e,t){let s=r.get(e);return void 0!==s&&s.includes(t)}],818094)},146312,e=>{"use strict";var t=e.i(843476),s=e.i(271645),n=e.i(893976),r=e.i(869803),i=e.i(818094),a=e.i(691444);let o=[];e.s(["RoleSelector",0,function({kind:e,onSelect:l,selected:g,defaultRole:c,disabled:d=!1,granteeKind:u="identity_account",omitRoles:m,className:x}){let p=(0,s.useId)(),{options:f,selected:h,select:b}=function(e,t,n="identity_account",r=o){let[l,g]=(0,s.useState)(t??null),c=(0,s.useMemo)(()=>{if(null===e)return[];let t=new Set(r);return("team"===n?(0,i.getTeamGrantableRoles)(e):(0,i.getGrantableRoles)(e)).filter(e=>!t.has(e)).map(e=>({role:e,label:(0,a.iamRoleDisplayName)(e),description:(0,a.iamRoleDescription)(e),value:(0,a.iamRoleToString)(e)}))},[e,n,r]),d=(0,s.useMemo)(()=>null!==l?(0,a.iamRoleToString)(l):"",[l]),u=(0,s.useCallback)(e=>g(e),[]),m=(0,s.useCallback)(()=>g(null),[]);return(0,s.useMemo)(()=>({options:c,selected:l,selectedValue:d,select:u,clear:m,hasOptions:c.length>0}),[c,l,d,u,m])}(e,c,u,m),v=void 0!==g?g:h;return 0===f.length?null:(0,t.jsxs)("fieldset",{className:(0,n.cn)(r.UNSTYLED_FIELDSET,"stg:space-y-1.5",x),children:[(0,t.jsx)("legend",{className:"stg:text-xs stg:font-medium stg:text-foreground",children:"Role"}),(0,t.jsx)("div",{className:"stg:flex stg:flex-wrap stg:gap-2",children:f.map(e=>{let s=v===e.role;return(0,t.jsxs)("label",{className:(0,n.cn)("stg:inline-flex stg:cursor-pointer stg:flex-col stg:rounded-md stg:border stg:px-3 stg:py-1.5 stg:text-xs stg:transition-colors",s?"stg:border-primary stg:bg-primary-subtle stg:text-primary stg:font-medium":"stg:border-input stg:bg-background stg:text-muted-foreground stg:hover:border-border stg:hover:text-foreground",d&&"stg:pointer-events-none stg:opacity-50"),children:[(0,t.jsx)("input",{type:"radio",name:p,value:e.value,checked:s,disabled:d,onChange:()=>{var t;b(t=e.role),l?.(t)},className:"stg:sr-only"}),(0,t.jsx)("span",{children:e.label}),(0,t.jsx)("span",{className:"stg:text-[0.625rem] stg:text-muted-foreground stg:font-normal stg:mt-0.5",children:e.description})]},e.value)})})]})}],146312)},213149,e=>{"use strict";var t=e.i(843476),s=e.i(271645),n=e.i(893976),r=e.i(468806),i=e.i(170255),a=e.i(818094),o=e.i(597744),l=e.i(610595),g=e.i(884561),c=e.i(869803),d=e.i(681094),u=e.i(540279),m=e.i(891287),x=e.i(632897),p=e.i(691444),f=e.i(288441),h=e.i(146312),b=e.i(982943),v=e.i(379410);function j({resourceKind:e,resourceKindString:r,resourceId:i,orgId:o,includeTeams:c=!1,excludeGrantees:d,onGranted:u,onCancel:R,className:w}){let{create:y,isCreating:N,error:k,clearError:I}=(0,f.useCreateIamPolicy)(),[C,M]=(0,s.useState)(null),[A,S]=(0,s.useState)(null),K=(0,s.useCallback)(t=>{M(t),S(s=>null===s||null===t||("team"===t.kind?(0,a.isRoleTeamGrantable)(e,s):(0,a.isRoleGrantable)(e,s))?s:null)},[e]),_=null!==C&&null!==A&&!N,T=(0,s.useCallback)(async e=>{if(e.preventDefault(),_&&null!==A&&null!==C){I();try{let e=(0,m.create)(x.IamPolicySpecSchema,{principal:(0,g.granteeRef)(C.grantee),resource:(0,m.create)(x.ApiResourceRefSchema,{kind:r,id:i}),relation:(0,p.iamRoleToString)(A)}),t=await y(e);u?.(t)}catch{}}},[_,A,C,r,i,y,I,u]);return(0,t.jsxs)("form",{onSubmit:T,className:(0,n.cn)("stg:space-y-3",w),children:[(0,t.jsxs)("div",{className:"stg:space-y-3",children:[(0,t.jsx)(b.PrincipalPicker,{orgId:o,value:C,onChange:K,includeTeams:c,excludeGrantees:d,disabled:N}),(0,t.jsx)(h.RoleSelector,{kind:e,granteeKind:C?.kind??"identity_account",selected:A,onSelect:S,disabled:N})]}),k&&(0,t.jsx)("p",{className:"stg:text-destructive stg:text-[0.65rem]",role:"alert",children:(0,l.getUserMessage)(k)}),(0,t.jsxs)("div",{className:"stg:flex stg:items-center stg:gap-2",children:[(0,t.jsxs)("button",{type:"submit",disabled:!_,className:(0,n.cn)("stg:inline-flex stg:items-center stg:gap-1.5 stg:rounded-md stg:px-3 stg:py-1.5 stg:text-xs stg:font-medium","stg:bg-primary stg:text-primary-foreground stg:hover:bg-primary-hover","stg:disabled:pointer-events-none stg:disabled:opacity-40"),children:[N&&(0,t.jsx)(v.SpinnerIcon,{size:12}),"Grant access"]}),R&&(0,t.jsx)("button",{type:"button",onClick:R,disabled:N,className:(0,n.cn)("stg:rounded-md stg:px-3 stg:py-1.5 stg:text-xs","stg:text-muted-foreground stg:hover:text-foreground stg:hover:bg-accent-hover","stg:disabled:pointer-events-none stg:disabled:opacity-50"),children:"Cancel"})]})]})}var R=e.i(590150);function w({resource:e,resourceKindString:r,resourceKind:i,orgId:a,className:m}){let{accessList:x,isLoading:p,fetchError:f,revoke:h,isRevoking:b,revokeError:v,refetch:y,hasGrantableRoles:N,canShareWithTeams:k}=(0,d.useShareFlow)(e),I=(0,o.useDeploymentMode)(),[C,M]=(0,s.useState)(!1),A=(0,s.useMemo)(()=>x.flatMap(e=>{let t=e.principal?(0,g.granteeFromView)(e.principal):void 0;return t?[t]:[]}),[x]);if("local"===I&&"organization"!==e.kind)return(0,t.jsxs)("p",{className:(0,n.cn)("stg:text-xs stg:text-muted-foreground",m),children:["This edition does not share ",r.replaceAll("_"," "),"s with individual people. Sharing with specific people is available in Stigmer Enterprise and Cloud."]});let S={kind:r,id:e.id};return(0,t.jsxs)("div",{className:(0,n.cn)("stg:flex stg:flex-col stg:gap-4",m),children:[(0,t.jsxs)("div",{className:"stg:space-y-1",children:[(0,t.jsx)("p",{className:"stg:text-xs stg:text-muted-foreground",children:p?"Loading access list...":`${x.length} with access`}),f&&(0,t.jsx)("p",{className:"stg:text-destructive stg:text-[0.65rem]",role:"alert",children:(0,l.getUserMessage)(f)}),!p&&x.length>0&&(0,t.jsx)("ul",{className:(0,n.cn)(c.UNSTYLED_LIST,"stg:space-y-1 stg:mt-2"),"aria-label":"Who has access",children:x.map(e=>(0,t.jsx)(u.AccessRow,{entry:e,grantGate:S,onRemove:h,isRemoving:b},(0,u.accessEntryKey)(e)))}),v&&(0,t.jsx)("p",{className:"stg:text-destructive stg:text-[0.65rem]",role:"alert",children:(0,l.getUserMessage)(v)})]}),N&&(0,t.jsx)(R.PermissionGate,{resource:S,relation:"can_grant_access",children:(0,t.jsx)("div",{className:"stg:border-t stg:border-border stg:pt-3",children:C?(0,t.jsx)(j,{resourceKind:i,resourceKindString:r,resourceId:e.id,orgId:a,includeTeams:k,excludeGrantees:A,onGranted:()=>{M(!1),y()},onCancel:()=>M(!1)}):(0,t.jsx)("button",{type:"button",onClick:()=>M(!0),className:(0,n.cn)("stg:w-full stg:rounded-md stg:px-3 stg:py-1.5 stg:text-xs stg:font-medium stg:text-center","stg:border stg:border-dashed stg:border-border","stg:text-muted-foreground stg:hover:text-foreground stg:hover:border-border-prominent","stg:hover:bg-accent-hover stg:transition-colors"),children:k?"+ Add people or teams":"+ Add people"})})})]})}var y=e.i(388023);function N({title:e,description:s,children:n}){return(0,t.jsxs)("section",{className:"stg:px-6 stg:py-4",children:[(0,t.jsx)("h3",{className:"stg:text-xs stg:font-medium stg:text-muted-foreground",children:e}),s&&(0,t.jsx)("p",{className:"stg:mt-0.5 stg:text-[0.65rem] stg:text-muted-foreground",children:s}),(0,t.jsx)("div",{className:"stg:mt-2.5",children:n})]})}function k(){return(0,t.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:(0,t.jsx)("path",{d:"M4 4l8 8M12 4l-8 8",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})}e.s(["ManageAccessDialog",0,function({open:e,onOpenChange:l,resource:g,visibility:c,extraSection:d}){let u=(0,s.useId)(),m=(0,s.useCallback)(()=>{l(!1)},[l]),x=(0,a.hasGrantableRoles)(g.kind),p=(0,o.useResourceAvailable)(i.ApiResourceKind.team)&&(0,a.hasTeamGrantableRoles)(g.kind)?"People and teams with access":"People with access";return(0,t.jsx)(r.DialogShell,{open:e,onOpenChange:l,width:"md","aria-labelledby":u,children:e&&(0,t.jsxs)("div",{className:"stg:flex stg:flex-col",children:[(0,t.jsxs)("div",{className:"stg:flex stg:items-start stg:justify-between stg:border-b stg:border-border stg:px-6 stg:py-4",children:[(0,t.jsxs)("div",{className:"stg:min-w-0",children:[(0,t.jsx)("h2",{id:u,className:"stg:text-base stg:font-semibold stg:text-foreground",children:"Manage access"}),g.name&&(0,t.jsx)("p",{className:"stg:mt-0.5 stg:truncate stg:text-xs stg:text-muted-foreground",children:g.name})]}),(0,t.jsx)("button",{type:"button",onClick:m,"aria-label":"Close",className:(0,n.cn)("stg:rounded-md stg:p-1 stg:text-muted-foreground","stg:hover:text-foreground stg:hover:bg-accent-hover","stg:focus:outline-none stg:focus:ring-2 stg:focus:ring-ring"),children:(0,t.jsx)(k,{})})]}),(0,t.jsxs)("div",{className:"stg:flex stg:flex-col stg:divide-y stg:divide-border",children:[c&&(0,t.jsx)(N,{title:"General access",description:"Who can find and open this resource.",children:(0,t.jsx)(y.ResourceVisibilityControl,{kind:c.kind,resourceId:g.id,visibility:c.current,org:c.org,onChanged:c.onChanged})}),x&&(0,t.jsx)(N,{title:p,children:(0,t.jsx)(w,{resource:{kind:g.kindString,id:g.id,resourceKind:g.kind},resourceKindString:g.kindString,resourceKind:g.kind,orgId:g.org})}),d&&(0,t.jsx)(N,{title:d.title,description:d.description,children:d.content})]}),(0,t.jsx)("div",{className:"stg:flex stg:items-center stg:justify-end stg:border-t stg:border-border stg:px-6 stg:py-3",children:(0,t.jsx)("button",{type:"button",onClick:m,className:(0,n.cn)("stg:rounded-md stg:px-3 stg:py-1.5 stg:text-sm stg:font-medium","stg:bg-primary stg:text-primary-foreground stg:hover:bg-primary-hover","stg:focus:outline-none stg:focus:ring-2 stg:focus:ring-ring stg:focus:ring-offset-2"),children:"Done"})})]})})}],213149)},10337,e=>{"use strict";var t=e.i(843476),s=e.i(271645),n=e.i(893976),r=e.i(468806);e.s(["ConfirmDialog",0,function({state:e,onConfirm:i,onCancel:a}){let o=(0,s.useCallback)(e=>{e||a()},[a]);if(!e)return null;let l="destructive"===e.variant;return(0,t.jsx)(r.DialogShell,{open:!0,onOpenChange:o,width:"sm","aria-label":e.title,children:(0,t.jsxs)("div",{className:"stg:flex stg:flex-col stg:gap-4 stg:p-6",children:[(0,t.jsxs)("div",{className:"stg:flex stg:flex-col stg:gap-1.5",children:[(0,t.jsx)("h3",{className:"stg:text-base stg:font-semibold stg:text-foreground",children:e.title}),(0,t.jsx)("p",{className:"stg:text-sm stg:text-muted-foreground",children:e.description})]}),(0,t.jsxs)("div",{className:"stg:flex stg:justify-end stg:gap-2",children:[(0,t.jsx)("button",{type:"button",onClick:a,className:(0,n.cn)("stg:rounded-md stg:px-3 stg:py-1.5 stg:text-sm stg:font-medium stg:transition-colors","stg:border stg:border-input stg:bg-background stg:text-foreground","stg:hover:bg-accent stg:hover:text-accent-foreground","stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring"),children:e.cancelLabel??"Cancel"}),(0,t.jsx)("button",{type:"button",onClick:i,className:(0,n.cn)("stg:rounded-md stg:px-3 stg:py-1.5 stg:text-sm stg:font-medium stg:transition-colors","stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring",l?"stg:bg-destructive stg:text-destructive-foreground stg:hover:bg-destructive-hover":"stg:bg-primary stg:text-primary-foreground stg:hover:bg-primary-hover"),children:e.confirmLabel??"Confirm"})]})]})})}])},966205,e=>{"use strict";var t=e.i(271645);e.s(["useConfirmAction",0,function(){let[e,s]=(0,t.useState)(null),n=(0,t.useCallback)(e=>new Promise(t=>{s({...e,resolve:t})}),[]),r=(0,t.useCallback)(()=>{e?.resolve(!0),s(null)},[e]),i=(0,t.useCallback)(()=>{e?.resolve(!1),s(null)},[e]);return(0,t.useMemo)(()=>({confirmState:e,confirm:n,handleConfirm:r,handleCancel:i}),[e,n,r,i])}])},678745,e=>{"use strict";let t=(0,e.i(475254).default)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);e.s(["default",0,t])},845132,678784,916624,e=>{"use strict";var t=e.i(843476),s=e.i(893976),n=e.i(704077),r=e.i(678745);e.s(["CheckIcon",()=>r.default],678784);var r=r,i=e.i(364354);function a(e){return(0,t.jsx)(n.Menu.Root,{...e})}function o(e){return(0,t.jsx)(n.Menu.Trigger,{...e})}function l({align:e="start",alignOffset:r=0,side:a="bottom",sideOffset:o=4,className:g,...c}){let d=(0,i.useStigmerPortalContainer)();return(0,t.jsx)(n.Menu.Portal,{container:d,children:(0,t.jsx)(n.Menu.Positioner,{className:"stg:isolate stg:z-50 stg:outline-none",align:e,alignOffset:r,side:a,sideOffset:o,children:(0,t.jsx)(n.Menu.Popup,{className:(0,s.cn)("stg:bg-popover stg:text-popover-foreground stg:ring-foreground/10","stg:data-[side=bottom]:slide-in-from-top-2 stg:data-[side=inline-end]:slide-in-from-left-2 stg:data-[side=inline-start]:slide-in-from-right-2 stg:data-[side=left]:slide-in-from-right-2 stg:data-[side=right]:slide-in-from-left-2 stg:data-[side=top]:slide-in-from-bottom-2","stg:data-open:animate-in stg:data-open:fade-in-0 stg:data-open:zoom-in-95","stg:data-closed:animate-out stg:data-closed:fade-out-0 stg:data-closed:zoom-out-95","stg:z-50 stg:max-h-(--available-height) stg:w-(--anchor-width) stg:min-w-32 stg:origin-(--transform-origin) stg:overflow-x-hidden stg:overflow-y-auto stg:rounded-lg stg:p-1 stg:shadow-md stg:ring-1 stg:duration-100 stg:outline-none stg:data-closed:overflow-hidden",g),...c})})})}function g({className:e,variant:r="default",...i}){return(0,t.jsx)(n.Menu.Item,{"data-variant":r,className:(0,s.cn)("stg:focus:bg-accent stg:focus:text-accent-foreground stg:not-data-[variant=destructive]:focus:**:text-accent-foreground","stg:data-[variant=destructive]:text-destructive stg:data-[variant=destructive]:focus:bg-destructive-subtle stg:data-[variant=destructive]:focus:text-destructive stg:data-[variant=destructive]:*:[svg]:text-destructive","stg:relative stg:flex stg:cursor-default stg:items-center stg:gap-1.5 stg:rounded-md stg:px-1.5 stg:py-1 stg:text-sm stg:outline-hidden stg:select-none","stg:data-disabled:pointer-events-none stg:data-disabled:opacity-50","stg:[&_svg]:pointer-events-none stg:[&_svg]:shrink-0 stg:[&_svg:not([class*='size-'])]:size-4",e),...i})}function c({className:e,...r}){return(0,t.jsx)(n.Menu.Separator,{className:(0,s.cn)("stg:bg-border stg:-mx-1 stg:my-1 stg:h-px",e),...r})}function d({className:e,...s}){return(0,t.jsx)("div",{role:"group",className:e,...s})}function u({className:e,...n}){return(0,t.jsx)("span",{className:(0,s.cn)("stg:text-muted-foreground stg:block stg:px-1.5 stg:py-1 stg:text-[11px] stg:font-medium stg:uppercase stg:tracking-wider stg:select-none",e),...n})}e.s(["Menu",0,a,"MenuContent",0,l,"MenuGroup",0,d,"MenuItem",0,g,"MenuLabel",0,u,"MenuRadioGroup",0,function(e){return(0,t.jsx)(n.Menu.RadioGroup,{...e})},"MenuRadioItem",0,function({className:e,children:i,...a}){return(0,t.jsxs)(n.Menu.RadioItem,{className:(0,s.cn)("stg:focus:bg-accent stg:focus:text-accent-foreground stg:focus:**:text-accent-foreground","stg:relative stg:flex stg:cursor-default stg:items-center stg:gap-1.5 stg:rounded-md stg:py-1 stg:pr-8 stg:pl-1.5 stg:text-sm stg:outline-hidden stg:select-none","stg:data-disabled:pointer-events-none stg:data-disabled:opacity-50","stg:[&_svg]:pointer-events-none stg:[&_svg]:shrink-0 stg:[&_svg:not([class*='size-'])]:size-4",e),...a,children:[(0,t.jsx)("span",{className:"stg:pointer-events-none stg:absolute stg:right-2 stg:flex stg:items-center stg:justify-center",children:(0,t.jsx)(n.Menu.RadioItemIndicator,{children:(0,t.jsx)(r.default,{})})}),i]})},"MenuSeparator",0,c,"MenuTrigger",0,o],916624);let m=Object.assign(function({children:e}){return(0,t.jsx)(a,{children:e})},{Trigger:function({children:e,className:n,"aria-label":r="Actions"}){return(0,t.jsx)(o,{className:(0,s.cn)("stg:inline-flex stg:items-center stg:justify-center stg:rounded-md stg:p-1","stg:text-muted-foreground stg:hover:text-foreground stg:hover:bg-accent","stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring","stg:data-popup-open:bg-accent stg:data-popup-open:text-foreground",n),"aria-label":r,children:e})},Content:function({children:e,align:n="end",className:r}){return(0,t.jsx)(l,{align:n,className:(0,s.cn)("stg:min-w-44",r),children:e})},Item:function({children:e,onSelect:n,icon:r,shortcut:i,variant:a="default",disabled:o,className:l}){return(0,t.jsxs)(g,{variant:a,disabled:o,onClick:n,className:(0,s.cn)("stg:justify-between",l),children:[(0,t.jsxs)("span",{className:"stg:flex stg:items-center stg:gap-2",children:[r,(0,t.jsx)("span",{children:e})]}),i&&(0,t.jsx)("kbd",{className:"stg:ml-auto stg:text-[11px] stg:tracking-widest stg:text-muted-foreground-subtle",children:i})]})},Separator:function({className:e}){return(0,t.jsx)(c,{className:e})},Group:function({children:e,label:s,className:n}){return(0,t.jsxs)(d,{className:n,children:[s&&(0,t.jsx)(u,{children:s}),e]})}});e.s(["ActionMenu",0,m],845132)},266442,e=>{"use strict";var t=e.i(843476),s=e.i(893976),n=e.i(188482);let r={ready:"Ready",running:"Running",pending:"Pending",degraded:"Degraded",failed:"Failed",disabled:"Disabled",draft:"Draft"};e.s(["StatusBadge",0,function({phase:e,label:i,tooltip:a,className:o}){let l=i??r[e],g=(0,t.jsxs)("span",{className:(0,s.cn)("stg:inline-flex stg:items-center stg:gap-1.5 stg:rounded-full stg:px-2 stg:py-0.5 stg:text-[11px] stg:font-medium stg:leading-none",function(e){switch(e){case"ready":return"stg:bg-[var(--stgm-status-ready-subtle)] stg:text-[var(--stgm-status-ready)]";case"running":return"stg:bg-[var(--stgm-status-running-subtle)] stg:text-[var(--stgm-status-running)]";case"pending":return"stg:bg-[var(--stgm-status-pending-subtle)] stg:text-[var(--stgm-status-pending)]";case"degraded":return"stg:bg-[var(--stgm-status-degraded-subtle)] stg:text-[var(--stgm-status-degraded)]";case"failed":return"stg:bg-[var(--stgm-status-failed-subtle)] stg:text-[var(--stgm-status-failed)]";case"disabled":return"stg:bg-[var(--stgm-status-disabled-subtle)] stg:text-[var(--stgm-status-disabled)]";case"draft":return"stg:bg-[var(--stgm-status-draft-subtle)] stg:text-[var(--stgm-status-draft)]"}}(e),o),children:[(0,t.jsx)("span",{className:(0,s.cn)("stg:size-1.5 stg:shrink-0 stg:rounded-full",function(e){switch(e){case"ready":return"stg:bg-[var(--stgm-status-ready)]";case"running":return"stg:bg-[var(--stgm-status-running)]";case"pending":return"stg:bg-[var(--stgm-status-pending)]";case"degraded":return"stg:bg-[var(--stgm-status-degraded)]";case"failed":return"stg:bg-[var(--stgm-status-failed)]";case"disabled":return"stg:bg-[var(--stgm-status-disabled)]";case"draft":return"stg:bg-[var(--stgm-status-draft)]"}}(e)),"aria-hidden":"true"}),l]});return a?(0,t.jsxs)(n.Tooltip,{children:[(0,t.jsx)(n.TooltipTrigger,{render:(0,t.jsx)("span",{className:"stg:inline-flex"}),children:g}),(0,t.jsx)(n.TooltipContent,{side:"top",children:a})]}):g}])},476007,e=>{"use strict";var t=e.i(843476),s=e.i(271645),n=e.i(610595),r=e.i(893976);let i={auth:"Authentication required",permission:"Access denied","not-found":"Not found",validation:"Invalid request",server:"Server error",unavailable:"Service unavailable",cancelled:"Request cancelled",unknown:"Something went wrong"};function a({className:e}){return(0,t.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",className:e,"aria-hidden":"true",children:[(0,t.jsx)("path",{d:"M7.13 2.5a1 1 0 0 1 1.74 0l5.5 9.5A1 1 0 0 1 13.5 13.5h-11a1 1 0 0 1-.87-1.5l5.5-9.5z"}),(0,t.jsx)("path",{d:"M8 6v3"}),(0,t.jsx)("circle",{cx:"8",cy:"11",r:"0.5",fill:"currentColor",stroke:"none"})]})}function o({className:e}){return(0,t.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",className:e,"aria-hidden":"true",children:[(0,t.jsx)("path",{d:"M8 1.5l5 2v4c0 3.5-2.5 5.5-5 6.5-2.5-1-5-3-5-6.5v-4l5-2z"}),(0,t.jsx)("path",{d:"M6 6.5l4 4M10 6.5l-4 4"})]})}function l({className:e}){return(0,t.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:e,"aria-hidden":"true",children:(0,t.jsx)("path",{d:"M4 6l4 4 4-4"})})}function g({className:e}){return(0,t.jsxs)("svg",{width:"12",height:"12",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",className:e,"aria-hidden":"true",children:[(0,t.jsx)("path",{d:"M2 6.5h4v-4"}),(0,t.jsx)("path",{d:"M3.5 11.5a5.5 5.5 0 1 0 .5-6l-2 1"})]})}e.s(["ErrorMessage",0,function({error:e,title:c,retry:d,className:u}){let[m,x]=(0,s.useState)(!1);if(!e)return null;let p=(0,n.classifyError)(e),f=(0,n.getUserMessage)(e),h=(0,n.getRpcMetadata)(e),b=(0,n.isRetryableError)(e);return(0,t.jsx)("div",{role:"alert",className:(0,r.cn)("stg:bg-destructive-subtle stg:border-destructive/20 stg:text-destructive stg:rounded-lg stg:border stg:p-4",u),children:(0,t.jsxs)("div",{className:"stg:flex stg:items-start stg:gap-3",children:["auth"===p||"permission"===p?(0,t.jsx)(o,{className:"stg:mt-0.5 stg:size-4 stg:shrink-0"}):(0,t.jsx)(a,{className:"stg:mt-0.5 stg:size-4 stg:shrink-0"}),(0,t.jsxs)("div",{className:"stg:min-w-0 stg:flex-1 stg:space-y-1",children:[(0,t.jsx)("p",{className:"stg:text-sm stg:font-medium",children:c??i[p]}),(0,t.jsx)("p",{className:"stg:text-destructive-muted stg:text-sm",children:f}),h&&(0,t.jsxs)("div",{className:"stg:pt-1",children:[(0,t.jsxs)("button",{type:"button",onClick:()=>x(e=>!e),className:"stg:text-destructive-muted stg:hover:text-destructive-muted stg:inline-flex stg:items-center stg:gap-1 stg:text-xs stg:transition-colors",children:[(0,t.jsx)(l,{className:(0,r.cn)("stg:size-3 stg:transition-transform",m&&"stg:rotate-180")}),"Technical details"]}),m&&(0,t.jsxs)("dl",{className:"stg:text-destructive-muted stg:mt-1.5 stg:space-y-0.5 stg:font-mono stg:text-xs",children:[(0,t.jsxs)("div",{className:"stg:flex stg:gap-2",children:[(0,t.jsx)("dt",{className:"stg:shrink-0",children:"Method:"}),(0,t.jsx)("dd",{className:"stg:truncate",children:h.method})]}),(0,t.jsxs)("div",{className:"stg:flex stg:gap-2",children:[(0,t.jsx)("dt",{className:"stg:shrink-0",children:"Path:"}),(0,t.jsx)("dd",{className:"stg:truncate",children:h.path})]})]})]})]}),d&&b&&(0,t.jsxs)("button",{type:"button",onClick:d,className:(0,r.cn)("stg:inline-flex stg:shrink-0 stg:items-center stg:gap-1.5 stg:rounded-md stg:border stg:px-2.5 stg:py-1.5 stg:text-xs stg:font-medium","stg:border-destructive/20 stg:text-destructive stg:hover:bg-destructive-subtle","stg:transition-colors"),children:[(0,t.jsx)(g,{className:"stg:size-3"}),"Retry"]})]})})}])},193799,e=>{"use strict";var t=e.i(271645);e.s(["useCopyFeedback",0,function(){let[e,s]=(0,t.useState)(!1),n=(0,t.useRef)(null);(0,t.useEffect)(()=>()=>{null!==n.current&&clearTimeout(n.current)},[]);let r=(0,t.useCallback)(async e=>{try{await navigator.clipboard.writeText(e)}catch{return!1}return s(!0),null!==n.current&&clearTimeout(n.current),n.current=setTimeout(()=>s(!1),2e3),!0},[]);return(0,t.useMemo)(()=>({copy:r,copied:e}),[r,e])}])},927056,e=>{"use strict";var t=e.i(843476),s=e.i(271645),n=e.i(893976);e.s(["Tabs",0,function({tabs:e,activeTab:r,onTabChange:i,children:a,"aria-label":o,className:l}){let g=(0,s.useId)(),c=(0,s.useRef)(new Map),d=e=>`${g}-tab-${e}`,u=e=>`${g}-panel-${e}`,m=(0,s.useCallback)(e=>{c.current.get(e)?.focus(),i(e)},[i]),x=(0,s.useCallback)(t=>{let s=e.findIndex(e=>e.id===r);if(-1===s)return;let n=null;switch(t.key){case"ArrowRight":n=(s+1)%e.length;break;case"ArrowLeft":n=(s-1+e.length)%e.length;break;case"Home":n=0;break;case"End":n=e.length-1;break;default:return}t.preventDefault(),m(e[n].id)},[e,r,m]);return(0,t.jsxs)("div",{className:(0,n.cn)("stg:flex stg:flex-col",l),children:[(0,t.jsx)("div",{role:"tablist","aria-label":o,onKeyDown:x,className:"stg:flex stg:border-b stg:border-border",children:e.map(e=>{let s=e.id===r;return(0,t.jsxs)("button",{ref:t=>{t?c.current.set(e.id,t):c.current.delete(e.id)},id:d(e.id),role:"tab",type:"button","aria-selected":s,"aria-controls":u(e.id),tabIndex:s?0:-1,onClick:()=>i(e.id),"data-cursor-target":`tab-${e.id}`,className:(0,n.cn)("stg:relative stg:inline-flex stg:items-center stg:gap-1.5 stg:px-3 stg:py-2 stg:text-xs stg:font-medium stg:transition-colors","stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring stg:focus-visible:ring-offset-1",s?"stg:text-foreground":"stg:text-muted-foreground stg:hover:text-foreground"),children:[e.icon,e.label,null!=e.badge&&e.badge>0&&(0,t.jsx)("span",{"aria-hidden":"true",className:(0,n.cn)("stg:inline-flex stg:min-w-[1.25rem] stg:items-center stg:justify-center stg:rounded-full stg:px-1 stg:py-px stg:text-[10px] stg:font-medium stg:leading-none",s?"stg:bg-primary-subtle stg:text-primary":"stg:bg-muted stg:text-muted-foreground"),children:e.badge}),s&&(0,t.jsx)("span",{className:"stg:absolute stg:inset-x-0 stg:-bottom-px stg:h-0.5 stg:bg-primary","aria-hidden":"true"})]},e.id)})}),(0,t.jsx)("div",{id:u(r),role:"tabpanel","aria-labelledby":d(r),tabIndex:0,className:"stg:min-h-0 stg:flex-1 stg:pt-4 stg:focus-visible:outline-none",children:a})]})}])},107141,e=>{"use strict";var t=e.i(271645),s=e.i(618566);let n="__placeholder__";e.s(["useStaticRouteParam",0,function(e,r=1){let i=(0,s.useParams)()[e];return(0,t.useMemo)(()=>{if(i!==n)return i;let e=window.location.pathname.split("/").filter(Boolean),t=e[e.length-r];return t&&t!==n?t:null},[i,r])}])},668093,652337,e=>{"use strict";var t=e.i(843476),s=e.i(893976),n=e.i(266442),r=e.i(927056),i=e.i(271645),a=e.i(845132);function o({primaryAction:e,actions:n,className:r}){let i=null!=n&&n.length>0;return e||i?(0,t.jsxs)("div",{className:(0,s.cn)("stg:flex stg:items-center stg:gap-2",r),children:[e&&(0,t.jsxs)("button",{type:"button",onClick:e.onAction,disabled:e.disabled,className:(0,s.cn)("stg:inline-flex stg:items-center stg:gap-1.5 stg:rounded-md stg:px-3 stg:py-1.5 stg:text-sm stg:font-medium stg:transition-colors","stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring","stg:bg-primary stg:text-primary-foreground stg:hover:bg-primary-hover","stg:disabled:pointer-events-none stg:disabled:opacity-50"),children:[e.icon,e.label]}),i&&(0,t.jsx)(l,{actions:n})]}):null}function l({actions:e}){var s;let n=(s=e,(0,i.useMemo)(()=>{let e=new Map;for(let t of s){let s=t.group??"__default",n=e.get(s);n?n.push(t):e.set(s,[t])}return Array.from(e.entries()).map(([e,t])=>({key:e,items:t}))},[s]));return(0,t.jsxs)(a.ActionMenu,{children:[(0,t.jsx)(a.ActionMenu.Trigger,{"aria-label":"More actions",children:(0,t.jsx)(g,{className:"stg:size-4"})}),(0,t.jsx)(a.ActionMenu.Content,{children:n.map((e,s)=>(0,t.jsxs)(a.ActionMenu.Group,{children:[s>0&&(0,t.jsx)(a.ActionMenu.Separator,{}),e.items.map(e=>(0,t.jsx)(a.ActionMenu.Item,{icon:e.icon,shortcut:e.shortcut,variant:e.variant,disabled:e.disabled,onSelect:e.onAction,children:e.label},e.id))]},e.key))})]})}function g({className:e}){return(0,t.jsxs)("svg",{className:e,viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true",children:[(0,t.jsx)("circle",{cx:"8",cy:"3",r:"1.25"}),(0,t.jsx)("circle",{cx:"8",cy:"8",r:"1.25"}),(0,t.jsx)("circle",{cx:"8",cy:"13",r:"1.25"})]})}function c({header:e,visibilityControl:s,metaExtra:r}){let{name:i,nameElement:a,org:o,slug:l,qualifiedSlug:g,description:m,iconUrl:x,icon:p,createdAt:f,updatedAt:h,status:b,statusLabel:v}=e,j=l&&l!==i&&!g;return(0,t.jsxs)("div",{className:"stg:flex stg:min-w-0 stg:items-start stg:gap-3",children:[x?(0,t.jsx)("img",{src:x,alt:"",className:"stg:mt-0.5 stg:size-8 stg:shrink-0 stg:rounded stg:object-cover"}):p?(0,t.jsx)("span",{className:"stg:mt-1 stg:shrink-0",children:p}):null,(0,t.jsxs)("div",{className:"stg:min-w-0 stg:flex-1",children:[(0,t.jsxs)("div",{className:"stg:flex stg:items-center stg:gap-2",children:[a??(0,t.jsx)("h2",{className:"stg:truncate stg:text-lg stg:font-semibold stg:text-foreground",children:i}),j&&(0,t.jsx)("code",{className:"stg:shrink-0 stg:rounded stg:bg-muted stg:px-1.5 stg:py-0.5 stg:text-xs stg:font-medium stg:text-muted-foreground",children:l}),b&&(0,t.jsx)(n.StatusBadge,{phase:b,label:v}),s]}),g&&(0,t.jsx)("span",{className:"stg:mt-0.5 stg:block stg:truncate stg:font-mono stg:text-xs stg:text-muted-foreground",children:g}),(0,t.jsxs)("div",{className:"stg:mt-0.5 stg:flex stg:flex-wrap stg:items-center stg:gap-x-1.5 stg:text-xs stg:text-muted-foreground",children:[o&&(0,t.jsx)("span",{children:o}),r,f&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(d,{}),(0,t.jsxs)("span",{children:["Created ",u(f)]})]}),h&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(d,{}),(0,t.jsxs)("span",{children:["Updated ",u(h)]})]})]}),m&&(0,t.jsx)("p",{className:"stg:mt-2 stg:text-sm stg:text-muted-foreground",children:m})]})]})}function d(){return(0,t.jsx)("span",{className:"stg:shrink-0","aria-hidden":"true",children:"·"})}function u(e){return e.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})}function m({className:e}){return(0,t.jsx)("svg",{className:e,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,t.jsx)("path",{d:"M11.5 1.5a2.121 2.121 0 0 1 3 3L5 14l-4 1 1-4Z"})})}e.s(["ResourceDetailShell",0,function({header:e,visibilityControl:n,headerMetaExtra:i,headerBanner:a,primaryAction:l,actions:g,tabs:d,activeTab:u,onTabChange:m,tabsAriaLabel:x,children:p,className:f}){let h=null!=d&&d.length>0;return(0,t.jsxs)("div",{className:(0,s.cn)("stg:flex stg:flex-col stg:gap-6",f),children:[a,(0,t.jsxs)("div",{className:"stg:flex stg:items-start stg:justify-between stg:gap-4",children:[(0,t.jsx)(c,{header:e,visibilityControl:n,metaExtra:i}),(0,t.jsx)(o,{primaryAction:l,actions:g,className:"stg:shrink-0"})]}),h&&u&&m?(0,t.jsx)(r.Tabs,{tabs:d,activeTab:u,onTabChange:m,"aria-label":x,children:p}):p]})}],668093),e.s(["Section",0,function({title:e,count:n,headerActions:r,onEdit:i,scrollTarget:a,children:o,className:l}){return(0,t.jsxs)("section",{className:l,"data-scroll-target":a,children:[(0,t.jsxs)("div",{className:"stg:mb-2 stg:flex stg:items-center stg:gap-2",children:[(0,t.jsx)("h3",{className:"stg:text-xs stg:font-medium stg:uppercase stg:tracking-wider stg:text-muted-foreground",children:e}),null!=n&&n>0&&(0,t.jsx)("span",{className:"stg:inline-flex stg:size-5 stg:items-center stg:justify-center stg:rounded-full stg:bg-muted stg:text-[10px] stg:font-semibold stg:text-muted-foreground",children:n}),(r||i)&&(0,t.jsxs)("div",{className:"stg:ml-auto stg:flex stg:items-center stg:gap-1",children:[r,i&&(0,t.jsx)("button",{type:"button",onClick:i,"aria-label":`Edit ${e.toLowerCase()}`,className:(0,s.cn)("stg:inline-flex stg:size-6 stg:items-center stg:justify-center stg:rounded-md stg:text-muted-foreground","stg:hover:bg-accent-hover stg:hover:text-foreground","stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring","stg:transition-colors"),children:(0,t.jsx)(m,{className:"stg:size-3.5"})})]})]}),(0,t.jsx)("div",{className:"stg:overflow-hidden stg:rounded-lg stg:border stg:border-border",children:o})]})}],652337)},261722,e=>{"use strict";var t=e.i(843476),s=e.i(271645),n=e.i(893976);function r({className:e}){return(0,t.jsx)("svg",{className:e,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,t.jsx)("path",{d:"M11.5 1.5a2.121 2.121 0 0 1 3 3L5 14l-4 1 1-4Z"})})}function i(){return(0,t.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",className:"stg:animate-spin","aria-hidden":"true",children:(0,t.jsx)("path",{d:"M8 2a6 6 0 1 0 6 6"})})}e.s(["InlineEditTextarea",0,function({value:e,onSave:a,placeholder:o="Click to edit",validate:l,minRows:g=3,disabled:c,isSaving:d,error:u,className:m}){let[x,p]=(0,s.useState)(!1),[f,h]=(0,s.useState)(e),[b,v]=(0,s.useState)(null),j=(0,s.useRef)(null);(0,s.useEffect)(()=>{x&&(h(e),v(null),requestAnimationFrame(()=>{let e=j.current;e&&(e.focus(),e.selectionStart=e.value.length)}))},[x,e]),(0,s.useEffect)(()=>{let e=j.current;e&&(e.style.height="auto",e.style.height=`${e.scrollHeight}px`)},[f,x]);let R=(0,s.useCallback)(async()=>{if(f===e)return void p(!1);if(l){let e=l(f);if(e)return void v(e)}await a(f)&&p(!1)},[f,e,l,a]),w=(0,s.useCallback)(()=>{p(!1),h(e),v(null)},[e]),y=(0,s.useCallback)(e=>{"Enter"===e.key&&(e.ctrlKey||e.metaKey)?(e.preventDefault(),R()):"Escape"===e.key&&w()},[R,w]),N=b||u;return c||!x?(0,t.jsx)("div",{className:(0,n.cn)("stg:group/inline-edit",m),children:(0,t.jsx)("button",{type:"button",onClick:()=>{c||p(!0)},disabled:c,className:(0,n.cn)("stg:w-full stg:rounded-md stg:px-2 stg:py-1.5 stg:text-left stg:transition-colors",!c&&"stg:hover:bg-accent-hover stg:cursor-pointer",c&&"stg:cursor-default","stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-inset stg:focus-visible:ring-ring"),children:(0,t.jsxs)("div",{className:"stg:flex stg:items-start stg:justify-between stg:gap-2",children:[(0,t.jsx)("pre",{className:(0,n.cn)("stg:min-w-0 stg:whitespace-pre-wrap stg:break-words stg:font-mono stg:text-sm stg:text-foreground",!e&&"stg:text-muted-foreground stg:italic stg:font-sans"),children:e||o}),!c&&(0,t.jsx)(r,{className:"stg:mt-0.5 stg:size-3 stg:shrink-0 stg:text-muted-foreground stg:opacity-0 stg:transition-opacity stg:group-hover/inline-edit:opacity-100"})]})})}):(0,t.jsxs)("div",{className:(0,n.cn)("stg:flex stg:flex-col stg:gap-1.5",m),children:[(0,t.jsx)("textarea",{ref:j,value:f,onChange:e=>{h(e.target.value),v(null)},onKeyDown:y,disabled:d,placeholder:o,rows:g,className:(0,n.cn)("stg:w-full stg:resize-y stg:rounded-md stg:border stg:border-border stg:bg-input-bg stg:px-3 stg:py-2 stg:font-mono stg:text-sm stg:text-foreground","stg:focus:outline-none stg:focus:ring-2 stg:focus:ring-ring","stg:disabled:opacity-50",N&&"stg:border-destructive")}),(0,t.jsxs)("div",{className:"stg:flex stg:items-center stg:justify-between",children:[(0,t.jsx)("span",{className:"stg:text-[10px] stg:text-muted-foreground",children:d?"Saving...":"Ctrl+Enter to save, Escape to cancel"}),(0,t.jsxs)("div",{className:"stg:flex stg:items-center stg:gap-1.5",children:[(0,t.jsx)("button",{type:"button",onClick:w,disabled:d,className:(0,n.cn)("stg:rounded-md stg:px-2.5 stg:py-1 stg:text-xs stg:font-medium","stg:border stg:border-border stg:bg-background stg:text-foreground stg:hover:bg-accent stg:hover:text-accent-foreground","stg:disabled:opacity-50","stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring"),children:"Cancel"}),(0,t.jsxs)("button",{type:"button",onClick:R,disabled:d,className:(0,n.cn)("stg:inline-flex stg:items-center stg:gap-1 stg:rounded-md stg:px-2.5 stg:py-1 stg:text-xs stg:font-medium","stg:bg-primary stg:text-primary-foreground stg:hover:bg-primary-hover","stg:disabled:opacity-50","stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring"),children:[d&&(0,t.jsx)(i,{}),"Save"]})]})]}),N&&(0,t.jsx)("p",{className:"stg:px-1 stg:text-xs stg:text-destructive",role:"alert",children:N})]})}])},484763,e=>{"use strict";var t=e.i(843476),s=e.i(271645),n=e.i(981922),r=e.i(213149);e.s(["useManageAccess",0,function({resource:e,visibility:i,extraSection:a,label:o="Manage access"}){let[l,g]=(0,s.useState)(!1),{allowed:c}=(0,n.useCheckPermission)(e?{kind:e.kindString,id:e.id}:null,"can_view_access"),d=(0,s.useCallback)(()=>g(!0),[]);return{action:e&&c?{id:"manage-access",label:o,group:"sharing",onAction:d}:null,dialog:e?(0,t.jsx)(r.ManageAccessDialog,{open:l,onOpenChange:g,resource:e,visibility:i,extraSection:a}):null,open:d,isOpen:l}}])}]);
|