@adecore/agents-react 0.31.11 → 0.32.0
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/dist/agents/AccountDot.js +57 -6
- package/dist/agents/AgentIcon.js +88 -12
- package/dist/agents/ModelOptionControl.js +153 -18
- package/dist/agents/ProviderLogo.js +49 -4
- package/dist/agents/account-limits.js +17 -14
- package/dist/agents/accounts.js +99 -67
- package/dist/agents/agent-marks.js +5 -3
- package/dist/agents/model-name.js +42 -31
- package/dist/agents/model-options.js +8 -8
- package/dist/agents/model-requirement.js +17 -14
- package/dist/agents/option-words.d.ts +7 -0
- package/dist/agents/option-words.js +35 -0
- package/dist/agents/provider-paths.js +6 -6
- package/dist/agents/status-look.js +32 -12
- package/dist/chat/account-choice.d.ts +13 -0
- package/dist/chat/account-choice.js +90 -20
- package/dist/chat/actions.js +126 -59
- package/dist/chat/activity.js +5 -5
- package/dist/chat/attachments.js +74 -53
- package/dist/chat/bookmarks.js +58 -48
- package/dist/chat/chat-client.js +344 -263
- package/dist/chat/chat-references.js +3 -3
- package/dist/chat/composer-effort.d.ts +5 -0
- package/dist/chat/composer-effort.js +26 -0
- package/dist/chat/composer-send.js +13 -13
- package/dist/chat/drafts.js +115 -79
- package/dist/chat/forks.js +81 -24
- package/dist/chat/guards.js +15 -43
- package/dist/chat/index.d.ts +3 -1
- package/dist/chat/index.js +3 -2
- package/dist/chat/logic/ansi.js +170 -167
- package/dist/chat/logic/answers.js +2 -2
- package/dist/chat/logic/bookmarks.js +19 -19
- package/dist/chat/logic/command-looks.js +138 -96
- package/dist/chat/logic/context-usage.js +13 -9
- package/dist/chat/logic/continue-after-stop.js +15 -19
- package/dist/chat/logic/effort.d.ts +14 -0
- package/dist/chat/logic/effort.js +34 -0
- package/dist/chat/logic/embedded-code.js +387 -326
- package/dist/chat/logic/fork.js +134 -110
- package/dist/chat/logic/generated-image.js +54 -23
- package/dist/chat/logic/goal.js +28 -20
- package/dist/chat/logic/handback.js +6 -6
- package/dist/chat/logic/json.js +2 -2
- package/dist/chat/logic/limit.js +46 -30
- package/dist/chat/logic/picker-entries.d.ts +5 -3
- package/dist/chat/logic/picker-entries.js +83 -43
- package/dist/chat/logic/resume-compaction.d.ts +14 -1
- package/dist/chat/logic/resume-compaction.js +93 -24
- package/dist/chat/logic/scrubber.js +188 -136
- package/dist/chat/logic/thought.js +13 -16
- package/dist/chat/logic/thread-cards.js +60 -48
- package/dist/chat/logic/timeline-copy.js +30 -38
- package/dist/chat/logic/timeline-target.js +92 -63
- package/dist/chat/logic/timeline.js +499 -355
- package/dist/chat/logic/tool-catalog.js +54 -34
- package/dist/chat/logic/tools.js +106 -82
- package/dist/chat/logic/visual-height.js +18 -18
- package/dist/chat/logic/visual-viewport.js +6 -3
- package/dist/chat/logic/welcome.js +9 -9
- package/dist/chat/logic/workflow.js +45 -34
- package/dist/chat/mentions.js +149 -109
- package/dist/chat/persisted-json.js +51 -54
- package/dist/chat/preferences.d.ts +4 -0
- package/dist/chat/preferences.js +162 -84
- package/dist/chat/prompt-hold.js +9 -9
- package/dist/chat/quote.js +21 -30
- package/dist/chat/reading-width.js +12 -10
- package/dist/chat/recent-messages.js +34 -21
- package/dist/chat/resume-compaction-dismissals.js +25 -5
- package/dist/chat/runtime-modes.js +3 -3
- package/dist/chat/send-key.js +11 -7
- package/dist/chat/stash.js +89 -69
- package/dist/chat/subagent-conversation.js +181 -139
- package/dist/chat/subagent-list.js +65 -67
- package/dist/chat/subagent-support.js +12 -7
- package/dist/chat/subagent-view.js +132 -44
- package/dist/chat/thumbnails.js +88 -60
- package/dist/chat/timeline-flash.js +24 -12
- package/dist/chat/timeline-scroll.js +116 -86
- package/dist/chat/ui/AccountPill.js +126 -15
- package/dist/chat/ui/AnsiOutput.js +62 -6
- package/dist/chat/ui/BookmarkMarker.js +231 -41
- package/dist/chat/ui/BookmarkSubmenu.js +165 -18
- package/dist/chat/ui/ChatActivity.js +649 -70
- package/dist/chat/ui/ChatReferenceChip.js +104 -9
- package/dist/chat/ui/CodeBlock.js +132 -58
- package/dist/chat/ui/Composer.js +866 -132
- package/dist/chat/ui/ComposerInput.js +309 -120
- package/dist/chat/ui/DiffPool.js +75 -14
- package/dist/chat/ui/EditDiff.js +160 -21
- package/dist/chat/ui/FadingWords.js +32 -3
- package/dist/chat/ui/GoalDock.js +235 -42
- package/dist/chat/ui/ImageView.js +617 -61
- package/dist/chat/ui/LimitState.js +446 -72
- package/dist/chat/ui/Markdown.js +991 -173
- package/dist/chat/ui/MermaidBlock.js +238 -68
- package/dist/chat/ui/MessageActions.js +251 -39
- package/dist/chat/ui/ModelMarks.js +55 -5
- package/dist/chat/ui/Pickers.js +664 -113
- package/dist/chat/ui/PromptComposer.js +281 -51
- package/dist/chat/ui/QuoteButton.js +151 -57
- package/dist/chat/ui/ResumeCompactionDock.d.ts +6 -2
- package/dist/chat/ui/ResumeCompactionDock.js +141 -6
- package/dist/chat/ui/RowTime.js +59 -5
- package/dist/chat/ui/RunSettings.js +1744 -154
- package/dist/chat/ui/Scrubber.js +517 -88
- package/dist/chat/ui/ShellCommand.js +183 -107
- package/dist/chat/ui/SubagentControls.js +212 -24
- package/dist/chat/ui/SubagentInfo.js +170 -13
- package/dist/chat/ui/SubagentStopButton.js +115 -24
- package/dist/chat/ui/SubagentTimeline.js +357 -91
- package/dist/chat/ui/Timeline.js +988 -476
- package/dist/chat/ui/TimelineMenu.js +552 -37
- package/dist/chat/ui/UnifiedDiff.js +234 -27
- package/dist/chat/ui/UploadThumb.js +37 -7
- package/dist/chat/ui/VisualDialogs.js +251 -20
- package/dist/chat/ui/VisualFrame.js +321 -95
- package/dist/chat/ui/Welcome.js +72 -7
- package/dist/chat/ui/chips.js +1 -1
- package/dist/chat/ui/code-lines.js +36 -36
- package/dist/chat/ui/code-streaming.js +1 -1
- package/dist/chat/ui/code-theme.js +7 -7
- package/dist/chat/ui/composer/ComposerControls.js +329 -21
- package/dist/chat/ui/composer/ComposerMenu.js +358 -30
- package/dist/chat/ui/composer/DraftParts.js +185 -11
- package/dist/chat/ui/composer/QueuedMessages.js +138 -13
- package/dist/chat/ui/composer/chips.js +29 -19
- package/dist/chat/ui/composer/editor.js +79 -63
- package/dist/chat/ui/composer/insert.js +26 -12
- package/dist/chat/ui/composer/key-handler.js +180 -127
- package/dist/chat/ui/composer/keys.js +90 -73
- package/dist/chat/ui/composer/menu-aria.js +18 -9
- package/dist/chat/ui/composer/placeholder.js +78 -31
- package/dist/chat/ui/composer/surface.js +13 -37
- package/dist/chat/ui/composer/use-chat-controls.js +230 -90
- package/dist/chat/ui/composer/use-compaction-offer.js +50 -18
- package/dist/chat/ui/composer/use-composer-draft.js +65 -34
- package/dist/chat/ui/composer/use-composer-menus.js +478 -193
- package/dist/chat/ui/composer/use-composer-submit.js +251 -109
- package/dist/chat/ui/composer/use-continuable-turn.js +33 -6
- package/dist/chat/ui/composer/use-draft-files.js +245 -93
- package/dist/chat/ui/composer/use-effort-stepper.d.ts +13 -0
- package/dist/chat/ui/composer/use-effort-stepper.js +88 -0
- package/dist/chat/ui/composer/use-notice.js +61 -16
- package/dist/chat/ui/composer/use-pending-requests.js +38 -17
- package/dist/chat/ui/composer/use-prompt-history.js +117 -45
- package/dist/chat/ui/composer/use-prompt-hold.js +119 -35
- package/dist/chat/ui/composer/use-take-back.js +94 -72
- package/dist/chat/ui/diff/ApprovalReview.js +101 -23
- package/dist/chat/ui/diff/DiffFallbackBoundary.js +21 -13
- package/dist/chat/ui/diff/DiffOmitted.js +56 -6
- package/dist/chat/ui/diff/DiffStack.js +92 -8
- package/dist/chat/ui/diff/DiffUnavailable.js +56 -6
- package/dist/chat/ui/diff/EditorEditDiff.js +263 -51
- package/dist/chat/ui/diff/EditorPatchDiff.js +39 -14
- package/dist/chat/ui/diff/LegacyDiffPool.js +27 -10
- package/dist/chat/ui/diff/LegacyEditDiff.js +97 -20
- package/dist/chat/ui/diff/LegacyUnifiedDiff.js +172 -42
- package/dist/chat/ui/diff/RawDiff.js +65 -5
- package/dist/chat/ui/diff/ReviewDiff.js +77 -5
- package/dist/chat/ui/diff/diff-props.js +1 -1
- package/dist/chat/ui/diff/diff-source-budget.js +46 -35
- package/dist/chat/ui/diff/editor-edit-model.js +18 -14
- package/dist/chat/ui/diff/review-plan.js +63 -40
- package/dist/chat/ui/diff/review-settle.js +24 -9
- package/dist/chat/ui/diff/syntax-runtime.js +236 -201
- package/dist/chat/ui/diff/use-review-stack.js +146 -25
- package/dist/chat/ui/diff-syntax.js +70 -58
- package/dist/chat/ui/diff-theme.js +31 -12
- package/dist/chat/ui/file-links.js +39 -10
- package/dist/chat/ui/find-reveal.js +29 -8
- package/dist/chat/ui/full-diff.js +17 -12
- package/dist/chat/ui/highlighter.js +143 -113
- package/dist/chat/ui/icons.js +16 -7
- package/dist/chat/ui/index.js +1 -1
- package/dist/chat/ui/intelligent-ui/UiBlockFrame.js +556 -82
- package/dist/chat/ui/intelligent-ui/UiFallbackPart.js +73 -5
- package/dist/chat/ui/intelligent-ui/UiReply.js +666 -262
- package/dist/chat/ui/intelligent-ui/block-local.js +59 -31
- package/dist/chat/ui/intelligent-ui/chart-data.js +77 -67
- package/dist/chat/ui/intelligent-ui/node-text.js +77 -91
- package/dist/chat/ui/intelligent-ui/registry.js +46 -46
- package/dist/chat/ui/intelligent-ui/render-context.js +1 -1
- package/dist/chat/ui/intelligent-ui/renderers/base-land.js +1 -1
- package/dist/chat/ui/intelligent-ui/renderers/binding.js +3 -3
- package/dist/chat/ui/intelligent-ui/renderers/chart.js +1223 -123
- package/dist/chat/ui/intelligent-ui/renderers/choices.js +312 -34
- package/dist/chat/ui/intelligent-ui/renderers/content.js +1241 -86
- package/dist/chat/ui/intelligent-ui/renderers/data.js +619 -54
- package/dist/chat/ui/intelligent-ui/renderers/inputs.js +868 -67
- package/dist/chat/ui/intelligent-ui/renderers/links.js +366 -62
- package/dist/chat/ui/intelligent-ui/renderers/map-slots.js +118 -60
- package/dist/chat/ui/intelligent-ui/renderers/map-style.js +85 -78
- package/dist/chat/ui/intelligent-ui/renderers/map-view.js +282 -217
- package/dist/chat/ui/intelligent-ui/renderers/map.js +621 -69
- package/dist/chat/ui/intelligent-ui/renderers/place-point.js +15 -8
- package/dist/chat/ui/intelligent-ui/renderers/structure.js +262 -20
- package/dist/chat/ui/intelligent-ui/renderers/text.js +674 -49
- package/dist/chat/ui/intelligent-ui/reply-parts.js +24 -15
- package/dist/chat/ui/intelligent-ui/table-data.js +97 -57
- package/dist/chat/ui/intelligent-ui/tones.js +31 -31
- package/dist/chat/ui/intelligent-ui/use-in-view.js +30 -12
- package/dist/chat/ui/intelligent-ui/use-later.js +28 -13
- package/dist/chat/ui/intelligent-ui/use-truncated.js +45 -21
- package/dist/chat/ui/intelligent-ui/use-ui-links.js +296 -109
- package/dist/chat/ui/intelligent-ui/use-ui-queries.js +256 -246
- package/dist/chat/ui/markdown-blocks.js +296 -262
- package/dist/chat/ui/mermaid.js +60 -72
- package/dist/chat/ui/quote-selection.js +32 -29
- package/dist/chat/ui/rehype-chips.js +35 -23
- package/dist/chat/ui/rehype-fade.js +28 -17
- package/dist/chat/ui/remark-html-as-text.js +22 -15
- package/dist/chat/ui/reply-context.js +1 -1
- package/dist/chat/ui/reveal.js +161 -72
- package/dist/chat/ui/rows/ForksRow.js +226 -24
- package/dist/chat/ui/rows/GeneratedImageRow.js +541 -87
- package/dist/chat/ui/rows/MessageRows.js +1706 -159
- package/dist/chat/ui/rows/RowContainer.js +57 -7
- package/dist/chat/ui/rows/Rows.js +463 -54
- package/dist/chat/ui/rows/SubagentRow.js +577 -60
- package/dist/chat/ui/rows/TaskRow.js +359 -40
- package/dist/chat/ui/rows/VisualRow.js +233 -11
- package/dist/chat/ui/rows/WorkRows.js +1946 -163
- package/dist/chat/ui/rows/WorkflowRow.js +293 -34
- package/dist/chat/ui/rows/row-rhythm.js +27 -17
- package/dist/chat/ui/theme-watch.js +26 -23
- package/dist/chat/ui/timestamp-format.js +4 -1
- package/dist/chat/ui/use-diff-source-tokens.js +70 -34
- package/dist/chat/ui/useToggleSet.js +51 -19
- package/dist/chat/ui/visual-theme.js +153 -128
- package/dist/chat/visual-bridge.js +123 -123
- package/dist/chat/visual-viewport.js +94 -83
- package/dist/chat/visuals.js +13 -5
- package/dist/host-hooks.d.ts +29 -0
- package/dist/host-hooks.js +78 -0
- package/dist/host.js +120 -48
- package/dist/index.js +1 -1
- package/dist/lazy.js +38 -32
- package/dist/locales/en/agent-chat.d.ts +35 -0
- package/dist/locales/en/agent-chat.js +747 -712
- package/dist/locales/en/agent-prompts.js +42 -42
- package/dist/locales/en/agent-providers.d.ts +1 -0
- package/dist/locales/en/agent-providers.js +166 -165
- package/dist/locales/en/agent-usage.d.ts +6 -0
- package/dist/locales/en/agent-usage.js +129 -123
- package/dist/locales/nl/agent-chat.d.ts +35 -0
- package/dist/locales/nl/agent-chat.js +747 -712
- package/dist/locales/nl/agent-prompts.js +42 -42
- package/dist/locales/nl/agent-providers.d.ts +1 -0
- package/dist/locales/nl/agent-providers.js +166 -165
- package/dist/locales/nl/agent-usage.d.ts +6 -0
- package/dist/locales/nl/agent-usage.js +129 -123
- package/dist/locales.js +14 -14
- package/dist/mounted-registry.js +31 -30
- package/dist/port-transport.js +122 -111
- package/dist/prompts/index.js +1 -1
- package/dist/prompts/logic/focus.js +15 -14
- package/dist/prompts/logic/keys.js +93 -59
- package/dist/prompts/logic/prompts.js +27 -14
- package/dist/prompts/logic/subjects.js +60 -46
- package/dist/prompts/logic/useFocusAfterAnswer.js +60 -20
- package/dist/prompts/logic/usePromptSession.js +88 -77
- package/dist/prompts/ui/ApprovalBody.js +246 -25
- package/dist/prompts/ui/PromptActions.js +215 -9
- package/dist/prompts/ui/PromptCard.js +215 -36
- package/dist/prompts/ui/PromptView.js +372 -34
- package/dist/prompts/ui/QuestionBody.js +269 -73
- package/dist/providers/AccountColors.js +36 -5
- package/dist/providers/AccountDetail.js +683 -50
- package/dist/providers/AccountVariables.js +139 -32
- package/dist/providers/AddAccountForm.js +125 -38
- package/dist/providers/CliDetail.js +343 -36
- package/dist/providers/InstallPage.js +644 -59
- package/dist/providers/ProviderList.d.ts +2 -1
- package/dist/providers/ProviderList.js +215 -23
- package/dist/providers/ProvidersPane.d.ts +4 -2
- package/dist/providers/ProvidersPane.js +244 -64
- package/dist/providers/account-actions.js +54 -30
- package/dist/providers/index.js +1 -1
- package/dist/providers/install-steps.js +12 -9
- package/dist/providers/pane-target.d.ts +3 -0
- package/dist/providers/pane-target.js +34 -13
- package/dist/providers/parts.js +62 -12
- package/dist/providers/provider-abilities.js +5 -5
- package/dist/providers/provider-groups.js +75 -40
- package/dist/providers/variables.js +73 -39
- package/dist/scope.js +6 -6
- package/dist/settings/sections.js +18 -18
- package/dist/state/chats.d.ts +1 -0
- package/dist/state/chats.js +408 -192
- package/dist/state/index.js +1 -1
- package/dist/state/provider-accounts.js +70 -47
- package/dist/state/providers.js +45 -16
- package/dist/state/usage.js +154 -77
- package/dist/storage.js +69 -68
- package/dist/testing/index.js +1 -1
- package/dist/testing/prompts.js +105 -67
- package/dist/transport.js +10 -10
- package/dist/ui/PlainTextarea.js +27 -3
- package/dist/usage/LimitsList.js +646 -40
- package/dist/usage/UsageBreakdown.js +879 -38
- package/dist/usage/UsageChart.js +311 -32
- package/dist/usage/UsageDialog.js +46 -4
- package/dist/usage/UsageLimits.js +467 -34
- package/dist/usage/UsageLimitsCard.js +95 -11
- package/dist/usage/UsagePage.js +817 -96
- package/dist/usage/UsagePane.js +164 -10
- package/dist/usage/UsageSummary.js +151 -6
- package/dist/usage/UsageTiles.js +164 -14
- package/dist/usage/format.js +32 -32
- package/dist/usage/index.d.ts +1 -1
- package/dist/usage/index.js +2 -1
- package/dist/usage/limit-groups.d.ts +2 -0
- package/dist/usage/limit-groups.js +77 -59
- package/dist/usage/limits.js +78 -43
- package/dist/usage/money.js +20 -4
- package/dist/usage/summary.js +85 -64
- package/package.json +8 -8
- package/src/agents/ModelOptionControl.tsx +3 -1
- package/src/agents/option-words.ts +27 -0
- package/src/chat/account-choice.ts +41 -1
- package/src/chat/composer-effort.ts +32 -0
- package/src/chat/forks.ts +4 -5
- package/src/chat/index.ts +3 -1
- package/src/chat/logic/effort.ts +32 -0
- package/src/chat/logic/picker-entries.ts +45 -10
- package/src/chat/logic/resume-compaction.ts +95 -17
- package/src/chat/logic/timeline.ts +11 -3
- package/src/chat/preferences.ts +35 -0
- package/src/chat/subagent-view.ts +2 -3
- package/src/chat/ui/AnsiOutput.tsx +1 -2
- package/src/chat/ui/BookmarkSubmenu.tsx +3 -3
- package/src/chat/ui/ChatActivity.tsx +14 -22
- package/src/chat/ui/ChatReferenceChip.tsx +2 -3
- package/src/chat/ui/Composer.tsx +15 -7
- package/src/chat/ui/EditDiff.tsx +2 -3
- package/src/chat/ui/LimitState.tsx +2 -2
- package/src/chat/ui/Markdown.tsx +10 -8
- package/src/chat/ui/MermaidBlock.tsx +2 -3
- package/src/chat/ui/Pickers.tsx +49 -29
- package/src/chat/ui/PromptComposer.tsx +7 -9
- package/src/chat/ui/ResumeCompactionDock.tsx +16 -4
- package/src/chat/ui/RunSettings.tsx +67 -28
- package/src/chat/ui/Scrubber.tsx +3 -3
- package/src/chat/ui/ShellCommand.tsx +2 -0
- package/src/chat/ui/SubagentInfo.tsx +2 -3
- package/src/chat/ui/SubagentTimeline.tsx +12 -16
- package/src/chat/ui/Timeline.tsx +6 -6
- package/src/chat/ui/UnifiedDiff.tsx +3 -4
- package/src/chat/ui/VisualFrame.tsx +5 -8
- package/src/chat/ui/code-theme.ts +4 -4
- package/src/chat/ui/composer/placeholder.ts +2 -2
- package/src/chat/ui/composer/use-compaction-offer.ts +36 -16
- package/src/chat/ui/composer/use-composer-menus.ts +4 -9
- package/src/chat/ui/composer/use-composer-submit.ts +2 -1
- package/src/chat/ui/composer/use-effort-stepper.ts +56 -0
- package/src/chat/ui/composer/use-notice.ts +2 -2
- package/src/chat/ui/diff/EditorEditDiff.tsx +9 -13
- package/src/chat/ui/diff/LegacyEditDiff.tsx +12 -17
- package/src/chat/ui/diff/LegacyUnifiedDiff.tsx +13 -21
- package/src/chat/ui/diff/use-review-stack.ts +4 -4
- package/src/chat/ui/diff-theme.ts +3 -3
- package/src/chat/ui/file-links.ts +2 -2
- package/src/chat/ui/intelligent-ui/UiReply.tsx +2 -0
- package/src/chat/ui/intelligent-ui/renderers/chart.tsx +3 -3
- package/src/chat/ui/intelligent-ui/renderers/content.tsx +5 -6
- package/src/chat/ui/intelligent-ui/renderers/map-view.tsx +2 -1
- package/src/chat/ui/intelligent-ui/renderers/map.tsx +2 -1
- package/src/chat/ui/intelligent-ui/use-truncated.ts +16 -19
- package/src/chat/ui/intelligent-ui/use-ui-links.ts +3 -3
- package/src/chat/ui/rows/ForksRow.tsx +3 -5
- package/src/chat/ui/rows/GeneratedImageRow.tsx +2 -1
- package/src/chat/ui/rows/MessageRows.tsx +12 -21
- package/src/chat/ui/rows/SubagentRow.tsx +3 -3
- package/src/chat/ui/rows/TaskRow.tsx +1 -1
- package/src/chat/ui/rows/WorkRows.tsx +20 -7
- package/src/chat/ui/useToggleSet.ts +15 -18
- package/src/chat/ui/visual-theme.ts +2 -3
- package/src/host-hooks.ts +113 -0
- package/src/lazy.tsx +2 -0
- package/src/locales/en/agent-chat.ts +135 -108
- package/src/locales/en/agent-prompts.ts +7 -7
- package/src/locales/en/agent-providers.ts +35 -34
- package/src/locales/en/agent-usage.ts +26 -20
- package/src/locales/nl/agent-chat.ts +127 -100
- package/src/locales/nl/agent-prompts.ts +5 -5
- package/src/locales/nl/agent-providers.ts +33 -32
- package/src/locales/nl/agent-usage.ts +25 -20
- package/src/prompts/ui/ApprovalBody.tsx +3 -1
- package/src/providers/CliDetail.tsx +2 -1
- package/src/providers/InstallPage.tsx +2 -4
- package/src/providers/ProviderList.tsx +12 -2
- package/src/providers/ProvidersPane.tsx +45 -15
- package/src/providers/pane-target.ts +20 -4
- package/src/state/chats.ts +7 -2
- package/src/usage/LimitsList.tsx +12 -13
- package/src/usage/UsageBreakdown.tsx +17 -6
- package/src/usage/UsageLimits.tsx +2 -1
- package/src/usage/UsagePage.tsx +3 -3
- package/src/usage/index.ts +1 -1
- package/src/usage/limit-groups.ts +12 -0
- package/src/usage/limits.ts +2 -2
- package/src/usage/money.ts +1 -2
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { c as _c } from "react/compiler-runtime";
|
|
2
2
|
import { useId, useState } from 'react';
|
|
3
3
|
import clsx from 'clsx';
|
|
4
4
|
import { useTranslation } from 'react-i18next';
|
|
5
5
|
import { Button, LazyBoundary, Spinner } from '@adecore/ui';
|
|
6
6
|
import { useChatHost } from '../../../../host.js';
|
|
7
|
+
import { useHostMapSource } from '../../../../host-hooks.js';
|
|
7
8
|
import { lazyNamed } from '../../../../lazy.js';
|
|
8
9
|
import { DiffFallbackBoundary } from '../../diff/DiffFallbackBoundary.js';
|
|
9
10
|
import { uiChildrenOf, uiNodeLabel } from '../node-text.js';
|
|
@@ -13,101 +14,652 @@ import { useLater } from '../use-later.js';
|
|
|
13
14
|
import { bindingOf, PENDING } from './binding.js';
|
|
14
15
|
import { useMapSlot } from './map-slots.js';
|
|
15
16
|
// MapLibre and its stylesheet load with the first map that is drawn, never with the chat.
|
|
17
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
16
18
|
const MapView = lazyNamed(() => import('./map-view.js'), 'MapView');
|
|
17
19
|
/* A map that is still loading shows a spinner only once the wait is noticeable. */
|
|
18
20
|
const LOADING_SPINNER_MS = 1000;
|
|
19
21
|
/* The number that ties a row to its marker. The list numbers itself for a screen reader, so the chip is only for the eye. */
|
|
20
|
-
function NumberChip(
|
|
21
|
-
|
|
22
|
+
function NumberChip(t0) {
|
|
23
|
+
const $ = _c(5);
|
|
24
|
+
const {
|
|
25
|
+
number,
|
|
26
|
+
selected
|
|
27
|
+
} = t0;
|
|
28
|
+
const t1 = selected ? "bg-accent text-accent-text" : "bg-ui-inset text-text";
|
|
29
|
+
let t2;
|
|
30
|
+
if ($[0] !== t1) {
|
|
31
|
+
t2 = clsx("mt-px flex size-5 shrink-0 items-center justify-center rounded-md text-2xs font-semibold tabular-nums", t1);
|
|
32
|
+
$[0] = t1;
|
|
33
|
+
$[1] = t2;
|
|
34
|
+
} else {
|
|
35
|
+
t2 = $[1];
|
|
36
|
+
}
|
|
37
|
+
let t3;
|
|
38
|
+
if ($[2] !== number || $[3] !== t2) {
|
|
39
|
+
t3 = /*#__PURE__*/_jsx("span", {
|
|
40
|
+
"aria-hidden": true,
|
|
41
|
+
className: t2,
|
|
42
|
+
children: number
|
|
43
|
+
});
|
|
44
|
+
$[2] = number;
|
|
45
|
+
$[3] = t2;
|
|
46
|
+
$[4] = t3;
|
|
47
|
+
} else {
|
|
48
|
+
t3 = $[4];
|
|
49
|
+
}
|
|
50
|
+
return t3;
|
|
22
51
|
}
|
|
23
|
-
function PlaceRow(
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
52
|
+
function PlaceRow(t0) {
|
|
53
|
+
const $ = _c(28);
|
|
54
|
+
const {
|
|
55
|
+
listed,
|
|
56
|
+
number,
|
|
57
|
+
selected,
|
|
58
|
+
onPick
|
|
59
|
+
} = t0;
|
|
60
|
+
const {
|
|
61
|
+
t
|
|
62
|
+
} = useTranslation("agent-chat");
|
|
63
|
+
const {
|
|
64
|
+
detail,
|
|
65
|
+
address
|
|
66
|
+
} = listed.node.props;
|
|
67
|
+
let t1;
|
|
68
|
+
if ($[0] !== number || $[1] !== selected) {
|
|
69
|
+
t1 = /*#__PURE__*/_jsx(NumberChip, {
|
|
70
|
+
number: number,
|
|
71
|
+
selected: selected
|
|
72
|
+
});
|
|
73
|
+
$[0] = number;
|
|
74
|
+
$[1] = selected;
|
|
75
|
+
$[2] = t1;
|
|
76
|
+
} else {
|
|
77
|
+
t1 = $[2];
|
|
78
|
+
}
|
|
79
|
+
let t2;
|
|
80
|
+
if ($[3] !== listed.name) {
|
|
81
|
+
t2 = /*#__PURE__*/_jsx("span", {
|
|
82
|
+
className: "text-xs font-medium wrap-break-word text-text",
|
|
83
|
+
children: listed.name
|
|
84
|
+
});
|
|
85
|
+
$[3] = listed.name;
|
|
86
|
+
$[4] = t2;
|
|
87
|
+
} else {
|
|
88
|
+
t2 = $[4];
|
|
89
|
+
}
|
|
90
|
+
let t3;
|
|
91
|
+
if ($[5] !== detail) {
|
|
92
|
+
t3 = detail !== undefined && detail !== "" && /*#__PURE__*/_jsx("span", {
|
|
93
|
+
className: "text-xs wrap-break-word text-text-muted",
|
|
94
|
+
children: detail
|
|
95
|
+
});
|
|
96
|
+
$[5] = detail;
|
|
97
|
+
$[6] = t3;
|
|
98
|
+
} else {
|
|
99
|
+
t3 = $[6];
|
|
100
|
+
}
|
|
101
|
+
let t4;
|
|
102
|
+
if ($[7] !== address) {
|
|
103
|
+
t4 = address !== undefined && address !== "" && /*#__PURE__*/_jsx("span", {
|
|
104
|
+
className: "text-xs wrap-break-word text-text-faint",
|
|
105
|
+
children: address
|
|
106
|
+
});
|
|
107
|
+
$[7] = address;
|
|
108
|
+
$[8] = t4;
|
|
109
|
+
} else {
|
|
110
|
+
t4 = $[8];
|
|
111
|
+
}
|
|
112
|
+
let t5;
|
|
113
|
+
if ($[9] !== listed.point || $[10] !== t) {
|
|
114
|
+
t5 = listed.point === undefined && /*#__PURE__*/_jsx("span", {
|
|
115
|
+
className: "text-xs text-text-faint",
|
|
116
|
+
children: t("blocks.map.lookingUp")
|
|
117
|
+
});
|
|
118
|
+
$[9] = listed.point;
|
|
119
|
+
$[10] = t;
|
|
120
|
+
$[11] = t5;
|
|
121
|
+
} else {
|
|
122
|
+
t5 = $[11];
|
|
123
|
+
}
|
|
124
|
+
let t6;
|
|
125
|
+
if ($[12] !== listed.point || $[13] !== t) {
|
|
126
|
+
t6 = listed.point === null && /*#__PURE__*/_jsx("span", {
|
|
127
|
+
className: "text-xs text-text-faint",
|
|
128
|
+
children: t("blocks.map.notFound")
|
|
129
|
+
});
|
|
130
|
+
$[12] = listed.point;
|
|
131
|
+
$[13] = t;
|
|
132
|
+
$[14] = t6;
|
|
133
|
+
} else {
|
|
134
|
+
t6 = $[14];
|
|
135
|
+
}
|
|
136
|
+
let t7;
|
|
137
|
+
if ($[15] !== t2 || $[16] !== t3 || $[17] !== t4 || $[18] !== t5 || $[19] !== t6) {
|
|
138
|
+
t7 = /*#__PURE__*/_jsxs("span", {
|
|
139
|
+
className: "flex min-w-0 grow flex-col gap-0.5",
|
|
140
|
+
children: [t2, t3, t4, t5, t6]
|
|
141
|
+
});
|
|
142
|
+
$[15] = t2;
|
|
143
|
+
$[16] = t3;
|
|
144
|
+
$[17] = t4;
|
|
145
|
+
$[18] = t5;
|
|
146
|
+
$[19] = t6;
|
|
147
|
+
$[20] = t7;
|
|
148
|
+
} else {
|
|
149
|
+
t7 = $[20];
|
|
150
|
+
}
|
|
151
|
+
let t8;
|
|
152
|
+
if ($[21] !== t1 || $[22] !== t7) {
|
|
153
|
+
t8 = /*#__PURE__*/_jsxs(_Fragment, {
|
|
154
|
+
children: [t1, t7]
|
|
155
|
+
});
|
|
156
|
+
$[21] = t1;
|
|
157
|
+
$[22] = t7;
|
|
158
|
+
$[23] = t8;
|
|
159
|
+
} else {
|
|
160
|
+
t8 = $[23];
|
|
161
|
+
}
|
|
162
|
+
const body = t8;
|
|
163
|
+
let t9;
|
|
164
|
+
if ($[24] !== body || $[25] !== onPick || $[26] !== selected) {
|
|
165
|
+
t9 = /*#__PURE__*/_jsx("li", {
|
|
166
|
+
children: onPick === null ? /*#__PURE__*/_jsx("div", {
|
|
167
|
+
className: clsx("flex h-full w-full min-h-12 items-start gap-2.5 rounded-xl bg-ui-tile px-3 py-2 text-left", selected && "ring-2 ring-accent ring-inset"),
|
|
168
|
+
children: body
|
|
169
|
+
}) : /*#__PURE__*/_jsx("button", {
|
|
170
|
+
type: "button",
|
|
171
|
+
"aria-pressed": selected,
|
|
172
|
+
className: clsx("flex h-full w-full min-h-12 items-start gap-2.5 rounded-xl bg-ui-tile px-3 py-2 text-left", "hover:bg-surface-active", selected && "ring-2 ring-accent ring-inset"),
|
|
173
|
+
onClick: onPick,
|
|
174
|
+
children: body
|
|
175
|
+
})
|
|
176
|
+
});
|
|
177
|
+
$[24] = body;
|
|
178
|
+
$[25] = onPick;
|
|
179
|
+
$[26] = selected;
|
|
180
|
+
$[27] = t9;
|
|
181
|
+
} else {
|
|
182
|
+
t9 = $[27];
|
|
183
|
+
}
|
|
184
|
+
return t9;
|
|
29
185
|
}
|
|
30
186
|
/* Why the map is not the host's: its own reason when the source has none, or what the view found out on the way. */
|
|
31
187
|
function noteFor(t, source, status) {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
188
|
+
if (status === 'offline') {
|
|
189
|
+
return t('blocks.map.offline');
|
|
190
|
+
}
|
|
191
|
+
if (status === 'unavailable' || status === 'failed' || status === 'lost') {
|
|
192
|
+
return t('blocks.map.unavailable');
|
|
193
|
+
}
|
|
194
|
+
if (source?.state === 'off') {
|
|
195
|
+
return t(source.reason === 'disabled' ? 'blocks.map.disabled' : source.reason === 'signed-out' ? 'blocks.map.signedOut' : 'blocks.map.unavailable');
|
|
196
|
+
}
|
|
197
|
+
return source?.state === 'tiles' && status === 'tiles' ? source.attribution ?? null : null;
|
|
42
198
|
}
|
|
43
199
|
/*
|
|
44
200
|
* The picture of the places and the line under it that says whose tiles these are, or why there are none.
|
|
45
201
|
* The map is only drawn while the frame is near the viewport and holds one of the page's few map slots
|
|
46
202
|
* (`MAX_LIVE_MAPS`); one that waits for a slot, or whose graphics context the browser took back, offers a button.
|
|
47
203
|
*/
|
|
48
|
-
function MapFrame(
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
204
|
+
function MapFrame(t0) {
|
|
205
|
+
const $ = _c(36);
|
|
206
|
+
const {
|
|
207
|
+
markers,
|
|
208
|
+
source,
|
|
209
|
+
selected,
|
|
210
|
+
onPick
|
|
211
|
+
} = t0;
|
|
212
|
+
const {
|
|
213
|
+
t
|
|
214
|
+
} = useTranslation("agent-chat");
|
|
215
|
+
const id = useId();
|
|
216
|
+
const [element, setElement] = useState(null);
|
|
217
|
+
const [status, setStatus] = useState("loading");
|
|
218
|
+
const [attempt, setAttempt] = useState(0);
|
|
219
|
+
const inView = useInView(element);
|
|
220
|
+
const broken = status === "failed" || status === "lost";
|
|
221
|
+
const slot = useMapSlot(id, inView && !broken);
|
|
222
|
+
const drawn = slot.state === "granted" && !broken;
|
|
223
|
+
const waiting = useLater(drawn && status === "loading", LOADING_SPINNER_MS);
|
|
224
|
+
let t1;
|
|
225
|
+
if ($[0] !== source || $[1] !== status || $[2] !== t) {
|
|
226
|
+
t1 = noteFor(t, source, status);
|
|
227
|
+
$[0] = source;
|
|
228
|
+
$[1] = status;
|
|
229
|
+
$[2] = t;
|
|
230
|
+
$[3] = t1;
|
|
231
|
+
} else {
|
|
232
|
+
t1 = $[3];
|
|
233
|
+
}
|
|
234
|
+
const note = t1;
|
|
235
|
+
const quiet = _temp;
|
|
236
|
+
let t2;
|
|
237
|
+
if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
|
|
238
|
+
t2 = () => {
|
|
239
|
+
setStatus("loading");
|
|
240
|
+
setAttempt(_temp2);
|
|
64
241
|
};
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
242
|
+
$[4] = t2;
|
|
243
|
+
} else {
|
|
244
|
+
t2 = $[4];
|
|
245
|
+
}
|
|
246
|
+
const retry = t2;
|
|
247
|
+
let body = null;
|
|
248
|
+
if (status === "failed") {
|
|
249
|
+
let t3;
|
|
250
|
+
if ($[5] !== t) {
|
|
251
|
+
t3 = quiet(t("blocks.map.unavailable"));
|
|
252
|
+
$[5] = t;
|
|
253
|
+
$[6] = t3;
|
|
254
|
+
} else {
|
|
255
|
+
t3 = $[6];
|
|
68
256
|
}
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
257
|
+
body = t3;
|
|
258
|
+
} else {
|
|
259
|
+
if (status === "lost") {
|
|
260
|
+
let t3;
|
|
261
|
+
if ($[7] !== t) {
|
|
262
|
+
t3 = quiet(t("blocks.map.contextLost"), {
|
|
263
|
+
label: t("blocks.map.show"),
|
|
264
|
+
run: retry
|
|
265
|
+
});
|
|
266
|
+
$[7] = t;
|
|
267
|
+
$[8] = t3;
|
|
268
|
+
} else {
|
|
269
|
+
t3 = $[8];
|
|
270
|
+
}
|
|
271
|
+
body = t3;
|
|
272
|
+
} else {
|
|
273
|
+
if (slot.state === "queued") {
|
|
274
|
+
let t3;
|
|
275
|
+
if ($[9] !== slot.take || $[10] !== t) {
|
|
276
|
+
t3 = quiet(t("blocks.map.waiting"), {
|
|
277
|
+
label: t("blocks.map.show"),
|
|
278
|
+
run: slot.take
|
|
279
|
+
});
|
|
280
|
+
$[9] = slot.take;
|
|
281
|
+
$[10] = t;
|
|
282
|
+
$[11] = t3;
|
|
283
|
+
} else {
|
|
284
|
+
t3 = $[11];
|
|
285
|
+
}
|
|
286
|
+
body = t3;
|
|
287
|
+
} else {
|
|
288
|
+
if (drawn) {
|
|
289
|
+
let t3;
|
|
290
|
+
if ($[12] !== t) {
|
|
291
|
+
t3 = quiet(t("blocks.map.unavailable"));
|
|
292
|
+
$[12] = t;
|
|
293
|
+
$[13] = t3;
|
|
294
|
+
} else {
|
|
295
|
+
t3 = $[13];
|
|
296
|
+
}
|
|
297
|
+
let t4;
|
|
298
|
+
if ($[14] === Symbol.for("react.memo_cache_sentinel")) {
|
|
299
|
+
t4 = [];
|
|
300
|
+
$[14] = t4;
|
|
301
|
+
} else {
|
|
302
|
+
t4 = $[14];
|
|
303
|
+
}
|
|
304
|
+
let t5;
|
|
305
|
+
if ($[15] !== source) {
|
|
306
|
+
t5 = source ?? {
|
|
307
|
+
state: "off",
|
|
308
|
+
reason: "unavailable"
|
|
309
|
+
};
|
|
310
|
+
$[15] = source;
|
|
311
|
+
$[16] = t5;
|
|
312
|
+
} else {
|
|
313
|
+
t5 = $[16];
|
|
314
|
+
}
|
|
315
|
+
let t6;
|
|
316
|
+
if ($[17] !== attempt || $[18] !== markers || $[19] !== onPick || $[20] !== selected || $[21] !== t5) {
|
|
317
|
+
t6 = /*#__PURE__*/_jsx(LazyBoundary, {
|
|
318
|
+
children: /*#__PURE__*/_jsx(MapView, {
|
|
319
|
+
markers: markers,
|
|
320
|
+
source: t5,
|
|
321
|
+
selected: selected,
|
|
322
|
+
onPick: onPick,
|
|
323
|
+
onStatus: setStatus
|
|
324
|
+
}, attempt)
|
|
325
|
+
});
|
|
326
|
+
$[17] = attempt;
|
|
327
|
+
$[18] = markers;
|
|
328
|
+
$[19] = onPick;
|
|
329
|
+
$[20] = selected;
|
|
330
|
+
$[21] = t5;
|
|
331
|
+
$[22] = t6;
|
|
332
|
+
} else {
|
|
333
|
+
t6 = $[22];
|
|
334
|
+
}
|
|
335
|
+
let t7;
|
|
336
|
+
if ($[23] !== t3 || $[24] !== t6) {
|
|
337
|
+
t7 = /*#__PURE__*/_jsx(DiffFallbackBoundary, {
|
|
338
|
+
fallback: t3,
|
|
339
|
+
resetKeys: t4,
|
|
340
|
+
children: t6
|
|
341
|
+
});
|
|
342
|
+
$[23] = t3;
|
|
343
|
+
$[24] = t6;
|
|
344
|
+
$[25] = t7;
|
|
345
|
+
} else {
|
|
346
|
+
t7 = $[25];
|
|
347
|
+
}
|
|
348
|
+
body = t7;
|
|
349
|
+
}
|
|
350
|
+
}
|
|
77
351
|
}
|
|
78
|
-
|
|
352
|
+
}
|
|
353
|
+
let t3;
|
|
354
|
+
if ($[26] !== waiting) {
|
|
355
|
+
t3 = waiting && /*#__PURE__*/_jsx("div", {
|
|
356
|
+
className: "pointer-events-none absolute inset-0 grid place-items-center",
|
|
357
|
+
children: /*#__PURE__*/_jsx(Spinner, {
|
|
358
|
+
size: 16
|
|
359
|
+
})
|
|
360
|
+
});
|
|
361
|
+
$[26] = waiting;
|
|
362
|
+
$[27] = t3;
|
|
363
|
+
} else {
|
|
364
|
+
t3 = $[27];
|
|
365
|
+
}
|
|
366
|
+
let t4;
|
|
367
|
+
if ($[28] !== body || $[29] !== t3) {
|
|
368
|
+
t4 = /*#__PURE__*/_jsxs("div", {
|
|
369
|
+
ref: setElement,
|
|
370
|
+
className: "relative h-50 overflow-hidden rounded-xl bg-ui-tile @min-[420px]:h-60",
|
|
371
|
+
children: [body, t3]
|
|
372
|
+
});
|
|
373
|
+
$[28] = body;
|
|
374
|
+
$[29] = t3;
|
|
375
|
+
$[30] = t4;
|
|
376
|
+
} else {
|
|
377
|
+
t4 = $[30];
|
|
378
|
+
}
|
|
379
|
+
let t5;
|
|
380
|
+
if ($[31] !== note) {
|
|
381
|
+
t5 = note !== null && /*#__PURE__*/_jsx("p", {
|
|
382
|
+
className: "px-0.5 text-xs text-text-faint",
|
|
383
|
+
children: note
|
|
384
|
+
});
|
|
385
|
+
$[31] = note;
|
|
386
|
+
$[32] = t5;
|
|
387
|
+
} else {
|
|
388
|
+
t5 = $[32];
|
|
389
|
+
}
|
|
390
|
+
let t6;
|
|
391
|
+
if ($[33] !== t4 || $[34] !== t5) {
|
|
392
|
+
t6 = /*#__PURE__*/_jsxs(_Fragment, {
|
|
393
|
+
children: [t4, t5]
|
|
394
|
+
});
|
|
395
|
+
$[33] = t4;
|
|
396
|
+
$[34] = t5;
|
|
397
|
+
$[35] = t6;
|
|
398
|
+
} else {
|
|
399
|
+
t6 = $[35];
|
|
400
|
+
}
|
|
401
|
+
return t6;
|
|
79
402
|
}
|
|
80
403
|
/* Asks the host for its tiles in a component of its own, since a host that offers none has no hook to call. */
|
|
81
|
-
function
|
|
82
|
-
|
|
404
|
+
function _temp2(previous) {
|
|
405
|
+
return previous + 1;
|
|
406
|
+
}
|
|
407
|
+
function _temp(text, action) {
|
|
408
|
+
return /*#__PURE__*/_jsxs("div", {
|
|
409
|
+
className: "grid h-full place-items-center content-center justify-items-center gap-2 p-3 text-center",
|
|
410
|
+
children: [/*#__PURE__*/_jsx("p", {
|
|
411
|
+
className: "text-xs text-text-faint",
|
|
412
|
+
children: text
|
|
413
|
+
}), action !== undefined && /*#__PURE__*/_jsx(Button, {
|
|
414
|
+
size: "sm",
|
|
415
|
+
variant: "secondary",
|
|
416
|
+
onClick: action.run,
|
|
417
|
+
children: action.label
|
|
418
|
+
})]
|
|
419
|
+
});
|
|
420
|
+
}
|
|
421
|
+
function HostedFrame(t0) {
|
|
422
|
+
const $ = _c(7);
|
|
423
|
+
let frame;
|
|
424
|
+
let maps;
|
|
425
|
+
let scopeId;
|
|
426
|
+
if ($[0] !== t0) {
|
|
427
|
+
({
|
|
428
|
+
maps,
|
|
429
|
+
scopeId,
|
|
430
|
+
...frame
|
|
431
|
+
} = t0);
|
|
432
|
+
$[0] = t0;
|
|
433
|
+
$[1] = frame;
|
|
434
|
+
$[2] = maps;
|
|
435
|
+
$[3] = scopeId;
|
|
436
|
+
} else {
|
|
437
|
+
frame = $[1];
|
|
438
|
+
maps = $[2];
|
|
439
|
+
scopeId = $[3];
|
|
440
|
+
}
|
|
441
|
+
const t1 = useHostMapSource(maps, scopeId);
|
|
442
|
+
let t2;
|
|
443
|
+
if ($[4] !== frame || $[5] !== t1) {
|
|
444
|
+
t2 = /*#__PURE__*/_jsx(MapFrame, {
|
|
445
|
+
...frame,
|
|
446
|
+
source: t1
|
|
447
|
+
});
|
|
448
|
+
$[4] = frame;
|
|
449
|
+
$[5] = t1;
|
|
450
|
+
$[6] = t2;
|
|
451
|
+
} else {
|
|
452
|
+
t2 = $[6];
|
|
453
|
+
}
|
|
454
|
+
return t2;
|
|
83
455
|
}
|
|
84
456
|
/*
|
|
85
457
|
* The places of a map as a numbered list, which is also the form a screen reader, an offline page and a
|
|
86
458
|
* map without tiles all rely on. A place that carries a `value` is a button when the map is bound, and
|
|
87
459
|
* picking it sets the binding. A place the lookup could not place stays in the list without a marker.
|
|
88
460
|
*/
|
|
89
|
-
export function MapRenderer(
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
461
|
+
export function MapRenderer(t0) {
|
|
462
|
+
const $ = _c(46);
|
|
463
|
+
const {
|
|
464
|
+
node,
|
|
465
|
+
children,
|
|
466
|
+
context
|
|
467
|
+
} = t0;
|
|
468
|
+
const {
|
|
469
|
+
t
|
|
470
|
+
} = useTranslation("agent-chat");
|
|
471
|
+
let t1;
|
|
472
|
+
if ($[0] !== context || $[1] !== node) {
|
|
473
|
+
t1 = bindingOf(node, context);
|
|
474
|
+
$[0] = context;
|
|
475
|
+
$[1] = node;
|
|
476
|
+
$[2] = t1;
|
|
477
|
+
} else {
|
|
478
|
+
t1 = $[2];
|
|
479
|
+
}
|
|
480
|
+
const binding = t1;
|
|
481
|
+
const current = binding?.value ?? node.props.value;
|
|
482
|
+
const maps = useChatHost().maps;
|
|
483
|
+
let markers;
|
|
484
|
+
let places;
|
|
485
|
+
let t2;
|
|
486
|
+
if ($[3] !== context || $[4] !== current || $[5] !== node) {
|
|
487
|
+
let t3;
|
|
488
|
+
if ($[9] !== context) {
|
|
489
|
+
t3 = place => ({
|
|
95
490
|
node: place,
|
|
96
491
|
name: uiNodeLabel(place),
|
|
97
492
|
point: placePoint(place.props, place.id, context)
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
493
|
+
});
|
|
494
|
+
$[9] = context;
|
|
495
|
+
$[10] = t3;
|
|
496
|
+
} else {
|
|
497
|
+
t3 = $[10];
|
|
498
|
+
}
|
|
499
|
+
places = uiChildrenOf(node, "Place").map(t3);
|
|
500
|
+
markers = places.flatMap(_temp3);
|
|
501
|
+
t2 = places.find(listed_0 => listed_0.node.props.value !== undefined && listed_0.node.props.value === current)?.node.id ?? null;
|
|
502
|
+
$[3] = context;
|
|
503
|
+
$[4] = current;
|
|
504
|
+
$[5] = node;
|
|
505
|
+
$[6] = markers;
|
|
506
|
+
$[7] = places;
|
|
507
|
+
$[8] = t2;
|
|
508
|
+
} else {
|
|
509
|
+
markers = $[6];
|
|
510
|
+
places = $[7];
|
|
511
|
+
t2 = $[8];
|
|
512
|
+
}
|
|
513
|
+
const selectedId = t2;
|
|
514
|
+
let t3;
|
|
515
|
+
if ($[11] !== binding || $[12] !== places) {
|
|
516
|
+
t3 = id => {
|
|
517
|
+
const value = places.find(listed_1 => listed_1.node.id === id)?.node.props.value;
|
|
518
|
+
if (value !== undefined) {
|
|
519
|
+
binding?.onValueChange(value);
|
|
520
|
+
}
|
|
106
521
|
};
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
522
|
+
$[11] = binding;
|
|
523
|
+
$[12] = places;
|
|
524
|
+
$[13] = t3;
|
|
525
|
+
} else {
|
|
526
|
+
t3 = $[13];
|
|
527
|
+
}
|
|
528
|
+
const pick = t3;
|
|
529
|
+
const onPick = binding !== null ? pick : null;
|
|
530
|
+
let t4;
|
|
531
|
+
if ($[14] !== context || $[15] !== maps || $[16] !== markers || $[17] !== onPick || $[18] !== selectedId) {
|
|
532
|
+
t4 = maps ? /*#__PURE__*/_jsx(HostedFrame, {
|
|
533
|
+
maps: maps,
|
|
534
|
+
scopeId: context.scopeId,
|
|
535
|
+
markers: markers,
|
|
536
|
+
selected: selectedId,
|
|
537
|
+
onPick: onPick
|
|
538
|
+
}) : /*#__PURE__*/_jsx(MapFrame, {
|
|
539
|
+
markers: markers,
|
|
540
|
+
source: null,
|
|
541
|
+
selected: selectedId,
|
|
542
|
+
onPick: onPick
|
|
543
|
+
});
|
|
544
|
+
$[14] = context;
|
|
545
|
+
$[15] = maps;
|
|
546
|
+
$[16] = markers;
|
|
547
|
+
$[17] = onPick;
|
|
548
|
+
$[18] = selectedId;
|
|
549
|
+
$[19] = t4;
|
|
550
|
+
} else {
|
|
551
|
+
t4 = $[19];
|
|
552
|
+
}
|
|
553
|
+
const frame = t4;
|
|
554
|
+
const t5 = !node.complete && PENDING;
|
|
555
|
+
let t6;
|
|
556
|
+
if ($[20] !== t5) {
|
|
557
|
+
t6 = clsx("@container flex flex-col gap-1.5", t5);
|
|
558
|
+
$[20] = t5;
|
|
559
|
+
$[21] = t6;
|
|
560
|
+
} else {
|
|
561
|
+
t6 = $[21];
|
|
562
|
+
}
|
|
563
|
+
let t7;
|
|
564
|
+
if ($[22] !== places.length || $[23] !== t) {
|
|
565
|
+
t7 = t("blocks.map.label", {
|
|
566
|
+
count: places.length
|
|
567
|
+
});
|
|
568
|
+
$[22] = places.length;
|
|
569
|
+
$[23] = t;
|
|
570
|
+
$[24] = t7;
|
|
571
|
+
} else {
|
|
572
|
+
t7 = $[24];
|
|
573
|
+
}
|
|
574
|
+
let t8;
|
|
575
|
+
if ($[25] !== binding || $[26] !== current || $[27] !== places) {
|
|
576
|
+
let t9;
|
|
577
|
+
if ($[29] !== binding || $[30] !== current) {
|
|
578
|
+
t9 = (listed_2, index_0) => {
|
|
579
|
+
const {
|
|
580
|
+
value: value_0
|
|
581
|
+
} = listed_2.node.props;
|
|
582
|
+
return /*#__PURE__*/_jsx(PlaceRow, {
|
|
583
|
+
listed: listed_2,
|
|
584
|
+
number: index_0 + 1,
|
|
585
|
+
selected: value_0 !== undefined && value_0 === current,
|
|
586
|
+
onPick: binding !== null && value_0 !== undefined ? () => binding.onValueChange(value_0) : null
|
|
587
|
+
}, listed_2.node.id);
|
|
588
|
+
};
|
|
589
|
+
$[29] = binding;
|
|
590
|
+
$[30] = current;
|
|
591
|
+
$[31] = t9;
|
|
592
|
+
} else {
|
|
593
|
+
t9 = $[31];
|
|
594
|
+
}
|
|
595
|
+
t8 = places.map(t9);
|
|
596
|
+
$[25] = binding;
|
|
597
|
+
$[26] = current;
|
|
598
|
+
$[27] = places;
|
|
599
|
+
$[28] = t8;
|
|
600
|
+
} else {
|
|
601
|
+
t8 = $[28];
|
|
602
|
+
}
|
|
603
|
+
let t9;
|
|
604
|
+
if ($[32] !== t7 || $[33] !== t8) {
|
|
605
|
+
t9 = /*#__PURE__*/_jsx("ol", {
|
|
606
|
+
"aria-label": t7,
|
|
607
|
+
className: "grid gap-1.5 @min-[420px]:grid-cols-2",
|
|
608
|
+
children: t8
|
|
609
|
+
});
|
|
610
|
+
$[32] = t7;
|
|
611
|
+
$[33] = t8;
|
|
612
|
+
$[34] = t9;
|
|
613
|
+
} else {
|
|
614
|
+
t9 = $[34];
|
|
615
|
+
}
|
|
616
|
+
let t10;
|
|
617
|
+
if ($[35] !== node.omitted || $[36] !== t) {
|
|
618
|
+
t10 = node.omitted !== undefined && node.omitted > 0 && /*#__PURE__*/_jsx("p", {
|
|
619
|
+
className: "text-2xs text-text-faint",
|
|
620
|
+
children: t("blocks.map.omitted", {
|
|
621
|
+
count: node.omitted
|
|
622
|
+
})
|
|
623
|
+
});
|
|
624
|
+
$[35] = node.omitted;
|
|
625
|
+
$[36] = t;
|
|
626
|
+
$[37] = t10;
|
|
627
|
+
} else {
|
|
628
|
+
t10 = $[37];
|
|
629
|
+
}
|
|
630
|
+
let t11;
|
|
631
|
+
if ($[38] !== children) {
|
|
632
|
+
t11 = /*#__PURE__*/_jsx("div", {
|
|
633
|
+
className: "chat-ui-nodes flex flex-col gap-1.5 empty:hidden",
|
|
634
|
+
children: children
|
|
635
|
+
});
|
|
636
|
+
$[38] = children;
|
|
637
|
+
$[39] = t11;
|
|
638
|
+
} else {
|
|
639
|
+
t11 = $[39];
|
|
640
|
+
}
|
|
641
|
+
let t12;
|
|
642
|
+
if ($[40] !== frame || $[41] !== t10 || $[42] !== t11 || $[43] !== t6 || $[44] !== t9) {
|
|
643
|
+
t12 = /*#__PURE__*/_jsxs("div", {
|
|
644
|
+
className: t6,
|
|
645
|
+
children: [frame, t9, t10, t11]
|
|
646
|
+
});
|
|
647
|
+
$[40] = frame;
|
|
648
|
+
$[41] = t10;
|
|
649
|
+
$[42] = t11;
|
|
650
|
+
$[43] = t6;
|
|
651
|
+
$[44] = t9;
|
|
652
|
+
$[45] = t12;
|
|
653
|
+
} else {
|
|
654
|
+
t12 = $[45];
|
|
655
|
+
}
|
|
656
|
+
return t12;
|
|
113
657
|
}
|
|
658
|
+
function _temp3(listed, index) {
|
|
659
|
+
return listed.point ? [{
|
|
660
|
+
id: listed.node.id,
|
|
661
|
+
number: index + 1,
|
|
662
|
+
lat: listed.point.lat,
|
|
663
|
+
lon: listed.point.lon
|
|
664
|
+
}] : [];
|
|
665
|
+
}
|