@gloom-sh/terminal 0.20.12 → 0.20.14
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/package.json +2 -1
- package/patches/@opentui%2Fcore@0.3.2.patch +22 -4
- package/src/account/auth-dialog.tsx +22 -4
- package/src/account/auth-form.tsx +6 -1
- package/src/account/billing.ts +3 -2
- package/src/account/checkout-handoff.tsx +7 -14
- package/src/account/device-signin-dialog.tsx +35 -24
- package/src/account/upgrade-dialog.tsx +8 -8
- package/src/api-client/crypto-markets.ts +10 -0
- package/src/api-client/errors.ts +3 -1
- package/src/api-client/index.ts +10 -2
- package/src/api-client/install-experiments.ts +146 -0
- package/src/api-client/money-markets.ts +7 -0
- package/src/api-client/request.ts +12 -2
- package/src/api-client/telemetry.ts +47 -0
- package/src/api-client/types/market.ts +4 -0
- package/src/api-client/types/news.ts +16 -0
- package/src/architecture/floating-promise-allowlist.json +17 -34
- package/src/brokers/signed-in/adapter.ts +2 -2
- package/src/brokers/signed-in/catalog.ts +13 -4
- package/src/brokers/signed-in/sign-in-dialog.tsx +38 -38
- package/src/cli/commands/market.ts +146 -55
- package/src/cli/commands/overview.ts +21 -7
- package/src/cli/commands/search.ts +103 -9
- package/src/cli/commands/ticker.ts +22 -13
- package/src/cli/earnings-calendar.ts +33 -53
- package/src/cli/errors.ts +3 -1
- package/src/cli/freshness.ts +7 -2
- package/src/cli/glossary.ts +10 -5
- package/src/cli/helpers.ts +8 -16
- package/src/cli/history-export.ts +4 -0
- package/src/cli/history-rows.ts +18 -1
- package/src/cli/known-gaps.ts +11 -2
- package/src/cli/listing-arg.ts +183 -28
- package/src/cli/not-a-ticker.ts +4 -0
- package/src/cli/pane-functions/catalog.ts +81 -12
- package/src/cli/pane-functions/dom.ts +8 -1
- package/src/cli/pane-functions/freshness.ts +2 -2
- package/src/cli/pane-functions/headless.ts +13 -10
- package/src/cli/pane-functions/index.ts +1 -1
- package/src/cli/pane-functions/options.ts +7 -0
- package/src/cli/pane-functions/report.ts +4 -1
- package/src/cli/pane-functions/resolver.ts +61 -15
- package/src/cli/perpetual-contract.ts +4 -4
- package/src/cli/quote-answer.ts +6 -2
- package/src/cli/result.ts +24 -5
- package/src/cli/symbol-args.ts +5 -3
- package/src/cli/symbol-list.ts +23 -10
- package/src/cli/symbol-rows.ts +135 -3
- package/src/cli/treasury-yields.ts +15 -1
- package/src/components/chart/composite/axis-overlays.tsx +5 -2
- package/src/components/chart/composite/composite-chart.tsx +1 -0
- package/src/components/chart/composite/format.ts +103 -16
- package/src/components/chart/composite/legend.tsx +60 -25
- package/src/components/chart/composite/panel-surface/axis-markers.ts +133 -0
- package/src/components/chart/composite/panel-surface/level-labels.tsx +78 -0
- package/src/components/chart/composite/panel-surface/overlays.ts +108 -0
- package/src/components/chart/composite/panel-surface/pan-coast.ts +54 -0
- package/src/components/chart/composite/panel-surface/panel-cursor.tsx +138 -0
- package/src/components/chart/composite/panel-surface/panel-levels.ts +47 -0
- package/src/components/chart/composite/panel-surface/plot-gestures.ts +403 -0
- package/src/components/chart/composite/panel-surface/plot-pointer.ts +65 -0
- package/src/components/chart/composite/panel-surface/plot-wheel.ts +102 -0
- package/src/components/chart/composite/panel-surface/pointer.ts +12 -0
- package/src/components/chart/composite/panel-surface/props.ts +79 -0
- package/src/components/chart/composite/panel-surface/tool-readout.ts +151 -0
- package/src/components/chart/composite/panel-surface/value-axis-gestures.ts +152 -0
- package/src/components/chart/composite/panel-surface.tsx +81 -1177
- package/src/components/chart/composite/time-axis.ts +51 -29
- package/src/components/chart/composite/toolbar.tsx +42 -6
- package/src/components/chart/curve/curve-surface.tsx +5 -5
- package/src/components/command-bar/commands/collection-list.ts +1 -0
- package/src/components/command-bar/list/badge.ts +8 -5
- package/src/components/command-bar/list/model.ts +0 -5
- package/src/components/command-bar/list/view.tsx +39 -2
- package/src/components/command-bar/routes/root/plugin-install.ts +4 -2
- package/src/components/command-bar/routes/root/provider-search.ts +23 -3
- package/src/components/command-bar/routes/root/results.ts +23 -11
- package/src/components/command-bar/routes/root/runtime.ts +3 -2
- package/src/components/command-bar/routes/root/selection.ts +3 -2
- package/src/components/command-bar/routes/root/shortcuts.ts +15 -0
- package/src/components/command-bar/routes/root/start-here.ts +1 -2
- package/src/components/command-bar/routes/ticker-search/actions.ts +2 -3
- package/src/components/command-bar/routes/ticker-search/results.ts +23 -4
- package/src/components/data-table/view.tsx +29 -6
- package/src/components/form-modal/host.tsx +1 -1
- package/src/components/layout/header.tsx +3 -2
- package/src/components/layout/market-summary.ts +3 -3
- package/src/components/layout/pane/error-boundary.tsx +2 -1
- package/src/components/layout/pane/title.ts +10 -4
- package/src/components/markdown-text.tsx +36 -0
- package/src/components/market-board/index.tsx +4 -3
- package/src/components/onboarding/first-run-workspace.ts +46 -11
- package/src/components/onboarding/onboarding-keyboard.ts +57 -5
- package/src/components/onboarding/onboarding-wizard.tsx +91 -24
- package/src/components/onboarding/portfolio-step/index.tsx +1 -0
- package/src/components/onboarding/portfolio-step/positions-panel.tsx +36 -9
- package/src/components/onboarding/portfolio-step/types.ts +2 -0
- package/src/components/onboarding/tickers-step-model.ts +140 -0
- package/src/components/onboarding/tickers-step.tsx +116 -0
- package/src/components/onboarding/use-onboarding-broker-form.ts +1 -1
- package/src/components/onboarding/use-onboarding-progress.ts +100 -11
- package/src/components/onboarding/use-onboarding-upgrade.ts +3 -2
- package/src/components/onboarding/wizard-model.ts +3 -1
- package/src/components/onboarding/wizard-tickers.ts +139 -0
- package/src/components/pane-settings-dialog/tui.tsx +6 -3
- package/src/components/pane-settings-dialog.tsx +2 -1
- package/src/components/pane-template-wizard.tsx +2 -0
- package/src/components/price-performance.tsx +2 -2
- package/src/components/speedometer-gauge/model.ts +2 -1
- package/src/components/speedometer-gauge/terminal.tsx +13 -8
- package/src/components/ui/choice-dialog.tsx +102 -33
- package/src/components/ui/confirm-dialog.tsx +3 -2
- package/src/components/ui/frame.tsx +7 -3
- package/src/components/ui/icon.tsx +4 -2
- package/src/components/ui/list-view.tsx +8 -0
- package/src/components/ui/multi-select/dialog.tsx +1 -7
- package/src/components/ui/not-meaningful.ts +16 -0
- package/src/components/ui/number-prompt-dialog.tsx +2 -1
- package/src/components/ui/query-bar.tsx +16 -4
- package/src/components/ui/stat-grid.tsx +27 -6
- package/src/components/use-pane-notice-footer.tsx +3 -1
- package/src/data/config/store/normalize.ts +2 -0
- package/src/docs/snapshot.json +3 -3
- package/src/i18n/es.ts +6 -2
- package/src/i18n/ja.ts +6 -2
- package/src/i18n/ko.ts +6 -2
- package/src/i18n/zh-cn.ts +6 -2
- package/src/i18n/zh-tw.ts +6 -2
- package/src/layout-marketplace/model.ts +2 -1
- package/src/market-data/futures-contract.ts +2 -1
- package/src/market-data/hooks.tsx +1 -1
- package/src/market-data/market/change-basis.ts +27 -5
- package/src/market-data/market/format.ts +48 -14
- package/src/market-data/quotes/contributions.ts +13 -0
- package/src/market-data/quotes/export-identity.ts +36 -1
- package/src/market-data/quotes/listing-enterprise-value.ts +3 -3
- package/src/market-data/quotes/resolution.ts +16 -0
- package/src/market-data/quotes/time.ts +17 -10
- package/src/market-data/tax-equivalent.ts +3 -2
- package/src/news/aggregator.ts +19 -8
- package/src/news/hooks.ts +1 -1
- package/src/news/news-model.ts +49 -0
- package/src/news/types.ts +9 -0
- package/src/plugins/builtin/account-management/calendar-tab.tsx +8 -3
- package/src/plugins/builtin/account-management/pane.tsx +9 -8
- package/src/plugins/builtin/account-management/password-dialog.tsx +2 -2
- package/src/plugins/builtin/alerts/calendar-events.ts +4 -5
- package/src/plugins/builtin/alerts/format.ts +6 -5
- package/src/plugins/builtin/alerts/headless.ts +3 -2
- package/src/plugins/builtin/alerts/history.ts +2 -1
- package/src/plugins/builtin/alerts/pane.tsx +2 -1
- package/src/plugins/builtin/alerts/price-text.ts +2 -1
- package/src/plugins/builtin/alerts/scheduled.ts +6 -5
- package/src/plugins/builtin/analytics/account-returns.ts +6 -7
- package/src/plugins/builtin/analytics/display.ts +2 -1
- package/src/plugins/builtin/analytics/pane-model.ts +5 -9
- package/src/plugins/builtin/analytics/risk-client.ts +12 -2
- package/src/plugins/builtin/analytics/risk-headless.ts +66 -6
- package/src/plugins/builtin/analytics/risk-math.ts +23 -6
- package/src/plugins/builtin/analytics/risk-model.ts +26 -15
- package/src/plugins/builtin/analytics/risk-pane.tsx +8 -7
- package/src/plugins/builtin/analytics/view.tsx +5 -5
- package/src/plugins/builtin/attention/model.ts +6 -5
- package/src/plugins/builtin/attention/pane.tsx +5 -4
- package/src/plugins/builtin/awards/detail.tsx +5 -4
- package/src/plugins/builtin/awards/headless.ts +8 -7
- package/src/plugins/builtin/awards/model.ts +4 -3
- package/src/plugins/builtin/awards/pane.tsx +4 -4
- package/src/plugins/builtin/backtest/format.ts +3 -2
- package/src/plugins/builtin/backtest/report.ts +3 -2
- package/src/plugins/builtin/bond-calculator/headless.ts +2 -1
- package/src/plugins/builtin/bond-calculator/pane.tsx +2 -1
- package/src/plugins/builtin/broker-manager/add-flow.tsx +1 -1
- package/src/plugins/builtin/broker-trading/orders-data.ts +3 -3
- package/src/plugins/builtin/broker-trading/orders.tsx +3 -2
- package/src/plugins/builtin/broker-trading/ticket.tsx +2 -2
- package/src/plugins/builtin/buildout/cells.tsx +2 -1
- package/src/plugins/builtin/buildout/company/pane.tsx +4 -3
- package/src/plugins/builtin/buildout/data-runtime.ts +21 -23
- package/src/plugins/builtin/buildout/detail/values.ts +2 -1
- package/src/plugins/builtin/buildout/format.ts +4 -3
- package/src/plugins/builtin/buildout/pane/index.tsx +3 -3
- package/src/plugins/builtin/catalysts/detail.tsx +2 -1
- package/src/plugins/builtin/catalysts/model.ts +6 -5
- package/src/plugins/builtin/catalysts/pane.tsx +2 -1
- package/src/plugins/builtin/cds/headless.ts +3 -2
- package/src/plugins/builtin/cds/model.ts +8 -8
- package/src/plugins/builtin/cds/pane.tsx +3 -2
- package/src/plugins/builtin/central-bank-rates/headless.ts +2 -1
- package/src/plugins/builtin/central-bank-rates/model.ts +3 -2
- package/src/plugins/builtin/central-bank-rates/pane.tsx +5 -5
- package/src/plugins/builtin/changelog/index.tsx +2 -2
- package/src/plugins/builtin/chart-composer/catalog-inventory.ts +5 -2
- package/src/plugins/builtin/chart-composer/editor.tsx +1 -0
- package/src/plugins/builtin/chart-composer/index.tsx +4 -2
- package/src/plugins/builtin/chart-composer/pane.tsx +8 -4
- package/src/plugins/builtin/chart-composer/quick-add.tsx +4 -1
- package/src/plugins/builtin/chart-composer/series-catalog.ts +17 -1
- package/src/plugins/builtin/chart-composer/use-series-catalog.ts +3 -1
- package/src/plugins/builtin/chart-composer/user-series.ts +3 -1
- package/src/plugins/builtin/chat/attachments/desktop.tsx +2 -1
- package/src/plugins/builtin/chat/controller/utils.ts +2 -1
- package/src/plugins/builtin/clinical-trials/model.ts +4 -3
- package/src/plugins/builtin/clinical-trials/sponsor-tickers.ts +4 -2
- package/src/plugins/builtin/cloud/askg/lock-note.ts +16 -4
- package/src/plugins/builtin/cloud/askg/model.ts +2 -1
- package/src/plugins/builtin/cloud/askg/pane.tsx +35 -1
- package/src/plugins/builtin/cloud/company-picker.tsx +1 -3
- package/src/plugins/builtin/cloud/plugin.tsx +2 -0
- package/src/plugins/builtin/cloud/team/pane.tsx +12 -12
- package/src/plugins/builtin/cloud/thesis/detail.tsx +13 -8
- package/src/plugins/builtin/cloud/thesis/module.tsx +2 -0
- package/src/plugins/builtin/cloud/upgrade-status-widget.tsx +6 -2
- package/src/plugins/builtin/cloud-tweets/model.ts +2 -2
- package/src/plugins/builtin/comment-letters/pane.tsx +2 -1
- package/src/plugins/builtin/commodity-balances/headless.ts +3 -2
- package/src/plugins/builtin/company-attention/app-rank.tsx +5 -4
- package/src/plugins/builtin/company-attention/building-model.ts +7 -7
- package/src/plugins/builtin/company-attention/headless.ts +6 -5
- package/src/plugins/builtin/company-attention/model.ts +4 -4
- package/src/plugins/builtin/company-attention/moves-model.ts +9 -9
- package/src/plugins/builtin/company-attention/signals-model.ts +9 -9
- package/src/plugins/builtin/company-kpis/headless.ts +2 -1
- package/src/plugins/builtin/company-kpis/model.ts +15 -10
- package/src/plugins/builtin/company-kpis/pane.tsx +2 -2
- package/src/plugins/builtin/congress-trades/detail.tsx +6 -5
- package/src/plugins/builtin/congress-trades/headless.ts +2 -1
- package/src/plugins/builtin/congress-trades/model.ts +6 -6
- package/src/plugins/builtin/congress-trades/table.tsx +7 -6
- package/src/plugins/builtin/connections/pane.tsx +5 -5
- package/src/plugins/builtin/correlation/headless.ts +2 -2
- package/src/plugins/builtin/correlation/index.tsx +4 -1
- package/src/plugins/builtin/correlation/matrix/selection.ts +2 -1
- package/src/plugins/builtin/correlation/relationship/view-model.ts +3 -3
- package/src/plugins/builtin/cot/headless.ts +3 -2
- package/src/plugins/builtin/cot/model.ts +2 -1
- package/src/plugins/builtin/cot/pane.tsx +4 -3
- package/src/plugins/builtin/cpi/headless.ts +10 -4
- package/src/plugins/builtin/cpi/model.ts +25 -7
- package/src/plugins/builtin/cpi/pane.tsx +3 -1
- package/src/plugins/builtin/credit-boards/cdx-pane.tsx +5 -4
- package/src/plugins/builtin/credit-boards/headless.ts +2 -1
- package/src/plugins/builtin/credit-boards/model.ts +5 -5
- package/src/plugins/builtin/credit-conditions/headless.ts +2 -1
- package/src/plugins/builtin/credit-conditions/index.tsx +2 -2
- package/src/plugins/builtin/credit-documents/model.ts +2 -2
- package/src/plugins/builtin/crypto-board/client.ts +6 -1
- package/src/plugins/builtin/crypto-board/defi-view.tsx +7 -7
- package/src/plugins/builtin/crypto-board/defi.ts +2 -2
- package/src/plugins/builtin/crypto-board/headless.ts +10 -2
- package/src/plugins/builtin/crypto-board/model.ts +93 -14
- package/src/plugins/builtin/crypto-board/pane.tsx +28 -13
- package/src/plugins/builtin/crypto-board/supply.ts +2 -2
- package/src/plugins/builtin/crypto-etf-flows/model.ts +4 -4
- package/src/plugins/builtin/custom-view/index.tsx +3 -1
- package/src/plugins/builtin/custom-view/pane.tsx +5 -1
- package/src/plugins/builtin/custom-view/view-spec.ts +11 -0
- package/src/plugins/builtin/debt-maturities/model.ts +3 -3
- package/src/plugins/builtin/debt-maturities/pane.tsx +2 -2
- package/src/plugins/builtin/dividend-yield/client.ts +31 -5
- package/src/plugins/builtin/dividend-yield/headless.ts +20 -13
- package/src/plugins/builtin/dividend-yield/pane.tsx +12 -10
- package/src/plugins/builtin/dividend-yield/ranking-view.tsx +4 -1
- package/src/plugins/builtin/dividend-yield/ranking.ts +21 -12
- package/src/plugins/builtin/dividend-yield/types.ts +4 -0
- package/src/plugins/builtin/dividend-yield/view.ts +8 -4
- package/src/plugins/builtin/docs/use-docs.ts +4 -2
- package/src/plugins/builtin/doe/headless.ts +2 -1
- package/src/plugins/builtin/doe/model.ts +12 -11
- package/src/plugins/builtin/earnings/board-model.ts +14 -8
- package/src/plugins/builtin/earnings/board-table.ts +13 -8
- package/src/plugins/builtin/earnings/calendar-model.ts +5 -5
- package/src/plugins/builtin/earnings/calendar.tsx +2 -1
- package/src/plugins/builtin/earnings/format.ts +16 -14
- package/src/plugins/builtin/earnings/headless.ts +57 -19
- package/src/plugins/builtin/earnings/history-model.ts +11 -7
- package/src/plugins/builtin/earnings/history-table.ts +22 -9
- package/src/plugins/builtin/earnings/history.tsx +4 -3
- package/src/plugins/builtin/earnings-calls/calendar.tsx +2 -1
- package/src/plugins/builtin/earnings-calls/format.ts +6 -5
- package/src/plugins/builtin/earnings-calls/upcoming.ts +5 -5
- package/src/plugins/builtin/earnings-ripple/headless.ts +2 -1
- package/src/plugins/builtin/earnings-ripple/index.tsx +2 -0
- package/src/plugins/builtin/earnings-ripple/model.ts +3 -2
- package/src/plugins/builtin/earnings-ripple/pane.tsx +6 -6
- package/src/plugins/builtin/econ/calendar-model.ts +19 -3
- package/src/plugins/builtin/econ/detail-view.tsx +2 -2
- package/src/plugins/builtin/econ/fred-catalog.ts +33 -4
- package/src/plugins/builtin/econ/index.tsx +7 -6
- package/src/plugins/builtin/econ-statistics/detail.tsx +2 -1
- package/src/plugins/builtin/econ-statistics/headless.ts +25 -4
- package/src/plugins/builtin/econ-statistics/pane.tsx +2 -2
- package/src/plugins/builtin/equity-screener/headless.ts +5 -5
- package/src/plugins/builtin/equity-screener/model.ts +6 -4
- package/src/plugins/builtin/equity-screener/pane.tsx +7 -7
- package/src/plugins/builtin/equity-screener/screen-check.ts +2 -1
- package/src/plugins/builtin/equity-screener/ticker-check.tsx +2 -1
- package/src/plugins/builtin/estimate-revisions/model.ts +3 -2
- package/src/plugins/builtin/estimate-revisions/pane.tsx +8 -8
- package/src/plugins/builtin/executives/format.ts +4 -4
- package/src/plugins/builtin/exposure/headless.ts +8 -8
- package/src/plugins/builtin/exposure/model.ts +4 -3
- package/src/plugins/builtin/exposure/pane.tsx +6 -5
- package/src/plugins/builtin/fear-greed/format.ts +7 -7
- package/src/plugins/builtin/fear-greed/headless.ts +2 -1
- package/src/plugins/builtin/filing-events/feed.ts +2 -1
- package/src/plugins/builtin/futures/table.tsx +8 -8
- package/src/plugins/builtin/futures-curve/headless.ts +18 -18
- package/src/plugins/builtin/futures-curve/model.ts +5 -5
- package/src/plugins/builtin/futures-curve/pane.tsx +8 -8
- package/src/plugins/builtin/fx-matrix/index.tsx +2 -2
- package/src/plugins/builtin/fx-matrix/pairs.ts +2 -1
- package/src/plugins/builtin/gpu/board.tsx +6 -5
- package/src/plugins/builtin/gpu/changes.tsx +2 -1
- package/src/plugins/builtin/gpu/equities.tsx +2 -2
- package/src/plugins/builtin/gpu/headless.ts +4 -3
- package/src/plugins/builtin/gpu/model.ts +8 -7
- package/src/plugins/builtin/help/functions-table.tsx +41 -9
- package/src/plugins/builtin/help/index.tsx +6 -3
- package/src/plugins/builtin/help/keybindings-editor.tsx +35 -7
- package/src/plugins/builtin/help/shortcut-table.tsx +19 -7
- package/src/plugins/builtin/help/table-cells.tsx +51 -0
- package/src/plugins/builtin/holders/pane.tsx +4 -1
- package/src/plugins/builtin/insider/base-values.ts +2 -2
- package/src/plugins/builtin/insider/display.ts +2 -1
- package/src/plugins/builtin/insider/headless.ts +16 -16
- package/src/plugins/builtin/insider/insider-data.ts +2 -1
- package/src/plugins/builtin/insider/signals-model.ts +3 -3
- package/src/plugins/builtin/insider/table-model.ts +27 -13
- package/src/plugins/builtin/insider/table.tsx +1 -1
- package/src/plugins/builtin/ipo-calendar/model.ts +4 -4
- package/src/plugins/builtin/iv-history/format.ts +8 -7
- package/src/plugins/builtin/iv-history/headless.ts +9 -8
- package/src/plugins/builtin/iv-history/pane.tsx +3 -2
- package/src/plugins/builtin/iv-history/screen-pane.tsx +5 -4
- package/src/plugins/builtin/jobs/headless.ts +11 -11
- package/src/plugins/builtin/jobs/model.ts +2 -2
- package/src/plugins/builtin/jobs/pane.tsx +5 -5
- package/src/plugins/builtin/jodi/model.ts +2 -2
- package/src/plugins/builtin/jodi/pane.tsx +2 -1
- package/src/plugins/builtin/kelly-sizer/headless.ts +4 -4
- package/src/plugins/builtin/kelly-sizer/model.ts +2 -1
- package/src/plugins/builtin/kelly-sizer/sections.tsx +2 -2
- package/src/plugins/builtin/macro-day/headless.ts +27 -15
- package/src/plugins/builtin/macro-day/model.ts +42 -4
- package/src/plugins/builtin/macro-day/pane.tsx +30 -12
- package/src/plugins/builtin/macro-day/releases.ts +24 -1
- package/src/plugins/builtin/market-halts/model.ts +11 -10
- package/src/plugins/builtin/market-halts/pane.tsx +2 -1
- package/src/plugins/builtin/market-heatmap/index.tsx +4 -4
- package/src/plugins/builtin/market-movers/session-table.ts +3 -3
- package/src/plugins/builtin/market-movers/session.ts +2 -1
- package/src/plugins/builtin/market-movers/table.ts +5 -5
- package/src/plugins/builtin/market-valuation/detail.tsx +2 -2
- package/src/plugins/builtin/market-valuation/headless.ts +7 -7
- package/src/plugins/builtin/market-valuation/pane.tsx +7 -7
- package/src/plugins/builtin/members/breadth-pane.tsx +5 -4
- package/src/plugins/builtin/members/headless.ts +2 -1
- package/src/plugins/builtin/members/model.ts +3 -2
- package/src/plugins/builtin/members/pane.tsx +10 -9
- package/src/plugins/builtin/mna/distress/model.ts +2 -1
- package/src/plugins/builtin/mna/model.ts +5 -5
- package/src/plugins/builtin/money-markets/client.ts +4 -1
- package/src/plugins/builtin/money-markets/headless.ts +17 -5
- package/src/plugins/builtin/money-markets/index.tsx +1 -1
- package/src/plugins/builtin/money-markets/model.ts +3 -2
- package/src/plugins/builtin/money-markets/pane.tsx +11 -5
- package/src/plugins/builtin/news/headless.ts +5 -2
- package/src/plugins/builtin/news/wire/breaking/notifications.ts +21 -19
- package/src/plugins/builtin/news/wire/news/row.ts +3 -1
- package/src/plugins/builtin/news/wire/news/table.tsx +3 -2
- package/src/plugins/builtin/news/wire/persisted-articles.ts +28 -3
- package/src/plugins/builtin/notes/headless.ts +2 -1
- package/src/plugins/builtin/notes/model.ts +2 -1
- package/src/plugins/builtin/openfda/pane.tsx +4 -3
- package/src/plugins/builtin/options/carry.ts +3 -2
- package/src/plugins/builtin/options/market-reference.ts +2 -1
- package/src/plugins/builtin/options/table.ts +48 -9
- package/src/plugins/builtin/options/view.tsx +47 -17
- package/src/plugins/builtin/options-calculator/headless.ts +3 -2
- package/src/plugins/builtin/options-calculator/pane.tsx +7 -7
- package/src/plugins/builtin/options-positioning/headless.ts +8 -7
- package/src/plugins/builtin/options-positioning/model.ts +10 -10
- package/src/plugins/builtin/options-positioning/pane.tsx +5 -5
- package/src/plugins/builtin/options-scenario/collar.ts +5 -4
- package/src/plugins/builtin/options-scenario/csp-screen-headless.ts +11 -10
- package/src/plugins/builtin/options-scenario/csp-screen-pane.tsx +15 -14
- package/src/plugins/builtin/options-scenario/csp-screen.ts +2 -1
- package/src/plugins/builtin/options-scenario/csp.ts +6 -5
- package/src/plugins/builtin/options-scenario/headless.ts +6 -5
- package/src/plugins/builtin/options-scenario/hedge.ts +3 -3
- package/src/plugins/builtin/options-scenario/pane.tsx +7 -6
- package/src/plugins/builtin/options-scenario/strategy-screen.ts +1 -1
- package/src/plugins/builtin/pe-band/headless.ts +9 -8
- package/src/plugins/builtin/pe-band/pane.tsx +7 -7
- package/src/plugins/builtin/perps/cascade.ts +3 -2
- package/src/plugins/builtin/perps/headless.ts +10 -9
- package/src/plugins/builtin/perps/model.ts +14 -14
- package/src/plugins/builtin/perps/pane.tsx +3 -2
- package/src/plugins/builtin/portfolio-list/cli/bulk-symbols.ts +4 -2
- package/src/plugins/builtin/portfolio-list/cli/period-report.ts +61 -11
- package/src/plugins/builtin/portfolio-list/cli/portfolio-command.ts +11 -3
- package/src/plugins/builtin/portfolio-list/cli/watchlist-command.ts +2 -0
- package/src/plugins/builtin/portfolio-list/header.tsx +2 -2
- package/src/plugins/builtin/portfolio-list/headless.ts +33 -6
- package/src/plugins/builtin/portfolio-list/index.tsx +3 -2
- package/src/plugins/builtin/portfolio-list/pane/futures-terms.ts +4 -2
- package/src/plugins/builtin/portfolio-list/pane/index.tsx +5 -3
- package/src/plugins/builtin/portfolio-list/pane/period-pnl.ts +26 -7
- package/src/plugins/builtin/portfolio-list/pane/purchase-date-fx.ts +4 -2
- package/src/plugins/builtin/portfolio-list/period-pnl.ts +16 -1
- package/src/plugins/builtin/portfolio-list/quick-add/index.tsx +2 -2
- package/src/plugins/builtin/portfolio-list/settings.ts +4 -1
- package/src/plugins/builtin/portfolio-list/summary/index.tsx +8 -5
- package/src/plugins/builtin/portfolio-list/summary/totals.ts +6 -4
- package/src/plugins/builtin/portfolio-list/table.tsx +25 -15
- package/src/plugins/builtin/power/detail.tsx +6 -5
- package/src/plugins/builtin/power/gas-model.ts +8 -7
- package/src/plugins/builtin/power/gas.tsx +2 -1
- package/src/plugins/builtin/power/headless.ts +7 -6
- package/src/plugins/builtin/power/model.ts +3 -2
- package/src/plugins/builtin/power/prices-headless.ts +10 -9
- package/src/plugins/builtin/power/prices-model.ts +3 -2
- package/src/plugins/builtin/power/prices.tsx +2 -1
- package/src/plugins/builtin/primary-dealers/model.ts +3 -3
- package/src/plugins/builtin/primary-dealers/pane.tsx +2 -2
- package/src/plugins/builtin/rate-path/headless.ts +8 -7
- package/src/plugins/builtin/rate-path/model.ts +6 -5
- package/src/plugins/builtin/rate-path/pane.tsx +6 -5
- package/src/plugins/builtin/realized-vol/fx-proxy.ts +2 -1
- package/src/plugins/builtin/realized-vol/headless.ts +11 -10
- package/src/plugins/builtin/realized-vol/pane.tsx +5 -4
- package/src/plugins/builtin/relative-rotation/headless.ts +2 -1
- package/src/plugins/builtin/relative-rotation/pane.tsx +6 -6
- package/src/plugins/builtin/research/analyst-headless.ts +5 -5
- package/src/plugins/builtin/research/analyst-model.ts +7 -7
- package/src/plugins/builtin/research/analyst-pane.tsx +7 -7
- package/src/plugins/builtin/research/client.ts +14 -0
- package/src/plugins/builtin/research/corporate-actions-pane.tsx +40 -30
- package/src/plugins/builtin/research/event-model.ts +55 -22
- package/src/plugins/builtin/research/event-sources.ts +26 -8
- package/src/plugins/builtin/research/relative-valuation-columns.ts +20 -12
- package/src/plugins/builtin/research/relative-valuation-currency.ts +16 -0
- package/src/plugins/builtin/research/relative-valuation-headless.ts +33 -21
- package/src/plugins/builtin/research/relative-valuation-model.ts +31 -17
- package/src/plugins/builtin/research/relative-valuation-pane.tsx +29 -14
- package/src/plugins/builtin/research-search/model.ts +2 -1
- package/src/plugins/builtin/research-search/saved-view.tsx +4 -3
- package/src/plugins/builtin/revenue-breakdown/model.ts +4 -4
- package/src/plugins/builtin/reverse-dcf/headless.ts +7 -7
- package/src/plugins/builtin/reverse-dcf/model.ts +4 -4
- package/src/plugins/builtin/reverse-dcf/pane.tsx +2 -2
- package/src/plugins/builtin/scanner/flow-model.ts +7 -4
- package/src/plugins/builtin/scanner/flow-pane.tsx +1 -1
- package/src/plugins/builtin/scanner/headless.ts +3 -2
- package/src/plugins/builtin/scanner/hilo-model.ts +2 -1
- package/src/plugins/builtin/scanner/live-headless.ts +2 -2
- package/src/plugins/builtin/scanner/live-model.ts +3 -2
- package/src/plugins/builtin/scanner/live-pane.tsx +5 -5
- package/src/plugins/builtin/seasonality/headless.ts +2 -1
- package/src/plugins/builtin/seasonality/pane.tsx +4 -3
- package/src/plugins/builtin/sec/filing-display.tsx +12 -15
- package/src/plugins/builtin/sec/fund-facts.ts +2 -2
- package/src/plugins/builtin/sec/headless.ts +2 -1
- package/src/plugins/builtin/sec/index.tsx +6 -2
- package/src/plugins/builtin/sectors/headless.ts +4 -4
- package/src/plugins/builtin/sectors/index.tsx +7 -7
- package/src/plugins/builtin/shared/cloud-upgrade.ts +4 -2
- package/src/plugins/builtin/shared/cpi-year-gap.ts +67 -0
- package/src/plugins/builtin/shared/earnings-calendar.ts +90 -6
- package/src/plugins/builtin/shared/earnings-report.ts +13 -6
- package/src/plugins/builtin/shared/research-cells.tsx +2 -2
- package/src/plugins/builtin/shared/source-footer.ts +2 -1
- package/src/plugins/builtin/shared/trend.ts +2 -2
- package/src/plugins/builtin/shared/use-quote-board.ts +9 -8
- package/src/plugins/builtin/short-interest/headless.ts +6 -6
- package/src/plugins/builtin/short-interest/model.ts +9 -9
- package/src/plugins/builtin/short-interest/publications-model.ts +5 -5
- package/src/plugins/builtin/short-interest/publications-pane.tsx +3 -2
- package/src/plugins/builtin/short-interest/watch-headless.ts +5 -5
- package/src/plugins/builtin/short-interest/watch-pane.tsx +6 -6
- package/src/plugins/builtin/short-volume/model.ts +5 -5
- package/src/plugins/builtin/short-volume/pane.tsx +4 -4
- package/src/plugins/builtin/social-mentions/headless.ts +2 -1
- package/src/plugins/builtin/social-mentions/model.ts +4 -4
- package/src/plugins/builtin/supply-chain/graph-model.ts +2 -1
- package/src/plugins/builtin/supply-chain/graph-pane.tsx +2 -2
- package/src/plugins/builtin/supply-chain/headless.ts +3 -2
- package/src/plugins/builtin/supply-chain/model.ts +4 -4
- package/src/plugins/builtin/supply-chain/pane.tsx +2 -2
- package/src/plugins/builtin/supply-chain/row-evidence.tsx +2 -1
- package/src/plugins/builtin/themes/headless.ts +2 -1
- package/src/plugins/builtin/themes/model.ts +3 -2
- package/src/plugins/builtin/themes/pane.tsx +3 -2
- package/src/plugins/builtin/thirteenf/format.ts +9 -9
- package/src/plugins/builtin/thirteenf/headless.ts +3 -2
- package/src/plugins/builtin/thirteenf/model.ts +2 -1
- package/src/plugins/builtin/thirteenf/overlap-pane.tsx +2 -1
- package/src/plugins/builtin/thirteenf/pane.tsx +5 -4
- package/src/plugins/builtin/thirteenf/report-notes.ts +2 -1
- package/src/plugins/builtin/thirteenf/signals-pane.tsx +3 -2
- package/src/plugins/builtin/thirteenf/table.ts +6 -5
- package/src/plugins/builtin/ticker-detail/adr-pair/headless.ts +45 -2
- package/src/plugins/builtin/ticker-detail/adr-pair/model.ts +4 -3
- package/src/plugins/builtin/ticker-detail/data-panes/historical-prices.tsx +4 -4
- package/src/plugins/builtin/ticker-detail/data-panes/returns-pane.tsx +3 -3
- package/src/plugins/builtin/ticker-detail/financials/model.ts +83 -35
- package/src/plugins/builtin/ticker-detail/financials/ratio-table.tsx +3 -1
- package/src/plugins/builtin/ticker-detail/financials/ratios.ts +2 -2
- package/src/plugins/builtin/ticker-detail/financials/schema.ts +14 -18
- package/src/plugins/builtin/ticker-detail/financials/tab.tsx +8 -13
- package/src/plugins/builtin/ticker-detail/headless.ts +33 -6
- package/src/plugins/builtin/ticker-detail/overview/chart-scale.ts +52 -0
- package/src/plugins/builtin/ticker-detail/overview/components.tsx +8 -9
- package/src/plugins/builtin/ticker-detail/overview/model.ts +28 -14
- package/src/plugins/builtin/ticker-detail/overview/pane.tsx +6 -0
- package/src/plugins/builtin/ticker-detail/overview/tax-equivalent.ts +2 -1
- package/src/plugins/builtin/ticker-detail/overview-tab.tsx +43 -9
- package/src/plugins/builtin/ticker-detail/quote-monitor/card.tsx +7 -5
- package/src/plugins/builtin/ticker-detail/quote-monitor/rows.ts +4 -4
- package/src/plugins/builtin/ticker-detail/settings.ts +17 -0
- package/src/plugins/builtin/time-sales/headless.ts +3 -2
- package/src/plugins/builtin/time-sales/model.ts +7 -5
- package/src/plugins/builtin/time-sales/pane.tsx +7 -6
- package/src/plugins/builtin/trace-bonds/model.ts +3 -2
- package/src/plugins/builtin/trace-bonds/pane.tsx +3 -2
- package/src/plugins/builtin/treasury-auctions/client.ts +2 -1
- package/src/plugins/builtin/treasury-auctions/headless.ts +6 -6
- package/src/plugins/builtin/treasury-auctions/hk-headless.ts +3 -2
- package/src/plugins/builtin/treasury-auctions/hk-view.tsx +10 -9
- package/src/plugins/builtin/treasury-auctions/hk.ts +5 -5
- package/src/plugins/builtin/treasury-auctions/model.ts +4 -4
- package/src/plugins/builtin/treasury-auctions/pane.tsx +18 -18
- package/src/plugins/builtin/treasury-auctions/treasury-direct.ts +2 -1
- package/src/plugins/builtin/treasury-daily/model.ts +2 -2
- package/src/plugins/builtin/vol-surface/events.ts +5 -4
- package/src/plugins/builtin/vol-surface/headless.ts +19 -18
- package/src/plugins/builtin/vol-surface/heat-grid.tsx +2 -1
- package/src/plugins/builtin/vol-surface/pane.tsx +8 -7
- package/src/plugins/builtin/vol-surface/stored.ts +2 -1
- package/src/plugins/builtin/vol-surface/tables.ts +4 -3
- package/src/plugins/builtin/volatility/headless.ts +5 -4
- package/src/plugins/builtin/volatility/pane.tsx +6 -6
- package/src/plugins/builtin/world-indices/headless.ts +7 -7
- package/src/plugins/builtin/world-indices/index.tsx +3 -1
- package/src/plugins/builtin/world-venue-map/headless.ts +2 -1
- package/src/plugins/builtin/world-venue-map/layered-pane.tsx +2 -1
- package/src/plugins/builtin/world-venue-map/layers.ts +3 -2
- package/src/plugins/builtin/world-venue-map/use-geo.ts +4 -2
- package/src/plugins/builtin/yield-curve/curves.ts +3 -3
- package/src/plugins/builtin/yield-curve/headless.ts +7 -6
- package/src/plugins/builtin/yield-curve/index.tsx +5 -4
- package/src/plugins/builtin/yield-curve/swaps.tsx +2 -1
- package/src/portfolio/allocation.ts +5 -5
- package/src/portfolio/collection-name.ts +2 -1
- package/src/portfolio/column-values.ts +61 -45
- package/src/portfolio/futures-positions.ts +2 -1
- package/src/portfolio/listed-symbol.ts +4 -2
- package/src/portfolio/period-pnl.ts +51 -1
- package/src/renderers/dom/dialog-host.tsx +5 -5
- package/src/renderers/electrobun/bun/desktop/backend-requests.ts +7 -1
- package/src/renderers/electrobun/view/remote/capability-invoker.ts +1 -1
- package/src/renderers/opentui/dialog-host.tsx +3 -4
- package/src/renderers/opentui/ui-host.tsx +32 -2
- package/src/renderers/share/layout-view.tsx +2 -1
- package/src/sources/gloomberb-cloud/news.ts +9 -0
- package/src/sources/gloomberb-cloud/normalizers.ts +7 -0
- package/src/sources/provider-router/history.ts +5 -2
- package/src/sources/provider-router/search.ts +15 -10
- package/src/state/hooks/inline-tickers.ts +3 -2
- package/src/state/hooks/quote-streaming.ts +9 -10
- package/src/team/collections-sync.ts +8 -3
- package/src/telemetry/usage-counts.ts +26 -0
- package/src/test-support/plugin-persistence.ts +12 -0
- package/src/tickers/company-name-listing.ts +6 -5
- package/src/tickers/company-name.ts +36 -2
- package/src/tickers/instrument-coverage.ts +27 -0
- package/src/tickers/listing-venues.ts +26 -1
- package/src/tickers/renamed-listings.ts +2 -1
- package/src/tickers/search/home-listing.ts +38 -1
- package/src/tickers/search/index.ts +22 -2
- package/src/tickers/search/ranking.ts +21 -2
- package/src/tickers/starter-symbols.ts +7 -0
- package/src/time-series/base-series.ts +4 -0
- package/src/time-series/fundamentals/statement-fields.ts +11 -14
- package/src/time-series/history-acquisition.ts +1 -1
- package/src/time-series/log-scale.ts +9 -0
- package/src/time-series/reporting.ts +3 -3
- package/src/time-series/resolve.ts +6 -4
- package/src/time-series/transforms.ts +10 -5
- package/src/time-series/types.ts +5 -2
- package/src/types/config.ts +9 -0
- package/src/types/data-provider.ts +3 -2
- package/src/types/financials.ts +28 -0
- package/src/types/headless.ts +2 -0
- package/src/types/instrument.ts +6 -0
- package/src/types/plugin-panes.ts +1 -1
- package/src/types/plugin-reports.ts +8 -0
- package/src/ui/dialog-stack.ts +17 -0
- package/src/ui/dialog.tsx +6 -2
- package/src/utils/crypto-pair.ts +9 -0
- package/src/utils/datetime-format.ts +74 -33
- package/src/utils/exchanges.ts +13 -0
- package/src/utils/financial-statements.ts +98 -17
- package/src/utils/format.ts +4 -9
- package/src/utils/fundamentals.ts +38 -16
- package/src/utils/futures-generic.ts +14 -0
- package/src/utils/growth.ts +67 -0
- package/src/utils/keyboard.ts +6 -0
- package/src/utils/options.ts +1 -1
- package/src/utils/report-timing.ts +2 -2
- package/src/utils/served-rates.ts +45 -0
- package/src/utils/text-wrap.ts +84 -3
- package/src/utils/trailing-dividend.ts +13 -3
- package/src/utils/zoned-date-time.ts +47 -22
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { portfolioSectorReport } from "./risk-sectors";
|
|
2
2
|
import { loadPortfolioOptionBook } from "./risk-options";
|
|
3
3
|
import type { HeadlessPaneDefinition } from "../../../types/plugin";
|
|
4
|
-
import { fetchPortfolioRiskMarket, RISK_HISTORY_LIMIT } from "./risk-client";
|
|
4
|
+
import { fetchPortfolioRiskMarket, riskInstrumentOf, RISK_HISTORY_LIMIT } from "./risk-client";
|
|
5
5
|
import { parsePortfolioRiskEvidence } from "./risk-evidence";
|
|
6
6
|
import { cloudEpisodeReader, fetchRiskEpisodeHistory, onceEpisodeReader, riskEpisodeTargets } from "./risk-episodes";
|
|
7
7
|
import { describeCollections } from "../../../portfolio/collection-name";
|
|
@@ -71,6 +71,51 @@ function emptyPortfolioHint(name: string, listed: readonly string[]): string {
|
|
|
71
71
|
+ `then their shares with gloom portfolio position set ${portfolio} AAPL 10 150.`;
|
|
72
72
|
}
|
|
73
73
|
|
|
74
|
+
/**
|
|
75
|
+
* Why a view of PORT has no rows, in one line, as its section says it in
|
|
76
|
+
* place of a bare "No data.": what it needs, and where the trustee's question
|
|
77
|
+
* is answered instead. Performance reads the account's own history, which a
|
|
78
|
+
* book entered by hand has none of; its P&L over a period is `portfolio show
|
|
79
|
+
* --from`.
|
|
80
|
+
*/
|
|
81
|
+
function riskSectionEmpty(
|
|
82
|
+
view: RiskView,
|
|
83
|
+
{ name, brokerLinked, unvaluedOptions, failedHistories }: {
|
|
84
|
+
name: string; brokerLinked: boolean; unvaluedOptions: boolean;
|
|
85
|
+
/** Holdings whose daily closes did not load: the reason a view of returns is empty, not what the book holds. */
|
|
86
|
+
failedHistories: readonly string[];
|
|
87
|
+
},
|
|
88
|
+
): string {
|
|
89
|
+
if (failedHistories.length > 0 && !RISK_OWN_DATA_VIEWS.has(view)) return failedClosesText(failedHistories);
|
|
90
|
+
switch (view) {
|
|
91
|
+
case "performance":
|
|
92
|
+
return `No account history${brokerLinked ? " from its broker" : ""} (daily values and flows) to measure. `
|
|
93
|
+
+ `For P&L over a period: gloom portfolio show ${shellWord(name)} --from <date>.`;
|
|
94
|
+
case "attribution":
|
|
95
|
+
return "No sector weights and returns for this account and its benchmark; import them with --evidence.";
|
|
96
|
+
case "greeks":
|
|
97
|
+
return unvaluedOptions ? "No option position in this portfolio could be valued." : "No option positions in this portfolio.";
|
|
98
|
+
case "correlation":
|
|
99
|
+
return "Needs two holdings with 60 daily returns each.";
|
|
100
|
+
default:
|
|
101
|
+
return "No holding has the daily closes this view needs.";
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/** Views read from the account's own records or option positions, not from its holdings' daily closes. */
|
|
106
|
+
const RISK_OWN_DATA_VIEWS: ReadonlySet<RiskView> = new Set(["performance", "attribution", "greeks"]);
|
|
107
|
+
|
|
108
|
+
/** The holdings whose daily closes did not load, for an empty view's reason. */
|
|
109
|
+
function failedHistories(coverage: RiskCoverage | undefined): string[] {
|
|
110
|
+
return (coverage?.leftOut ?? []).filter((line) => line.historyFailed).map((line) => line.symbol);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/** "Daily closes did not load for US02, US03 and 4 more; try again in a moment." */
|
|
114
|
+
function failedClosesText(symbols: readonly string[]): string {
|
|
115
|
+
const more = symbols.length > 3 ? ` and ${symbols.length - 3} more` : "";
|
|
116
|
+
return `Daily closes did not load for ${symbols.slice(0, 3).join(", ")}${more}; try again in a moment.`;
|
|
117
|
+
}
|
|
118
|
+
|
|
74
119
|
/** Rows of one view in the compact result; the pane and reports keep every row. */
|
|
75
120
|
const COMPACT_ROW_LIMIT = 100;
|
|
76
121
|
/** The correlation view is every pair of holdings; the compact result keeps the strongest. */
|
|
@@ -127,7 +172,11 @@ function coverageSummary(coverage: RiskCoverage, limit = Infinity) {
|
|
|
127
172
|
function coverageLine(coverage: RiskCoverage | undefined): { error?: string; note?: string } {
|
|
128
173
|
const shortfall = riskCoverageShortfall(coverage);
|
|
129
174
|
// No estimate at all is a failure; an estimate that leaves holdings out is a caveat.
|
|
130
|
-
if (shortfall)
|
|
175
|
+
if (shortfall) {
|
|
176
|
+
// Closes that did not load are why, which asked again may not be.
|
|
177
|
+
const failed = failedHistories(coverage);
|
|
178
|
+
return { error: [`Basket estimates unavailable: ${shortfall.title} ${shortfall.message}`.trim(), ...failed.length ? [failedClosesText(failed)] : []].join(" ") };
|
|
179
|
+
}
|
|
131
180
|
const line = coverage?.leftOut.length ? riskCoverageLine(coverage) : null;
|
|
132
181
|
return line ? { note: `${line[0]!.toUpperCase()}${line.slice(1)}; metadata.coverage lists each with its reason.` } : {};
|
|
133
182
|
}
|
|
@@ -307,7 +356,8 @@ export const portfolioRiskHeadless: HeadlessPaneDefinition<"bundle"> = {
|
|
|
307
356
|
// go unused. A bigger book waits for the basket, so it reads no closes it does not replay.
|
|
308
357
|
const warming = wantsEpisodes && tickers.length <= EPISODE_WARM_LIMIT
|
|
309
358
|
? fetchRiskEpisodeHistory(
|
|
310
|
-
|
|
359
|
+
// With the currency each is saved in, so the FX closes the replay converts at are read alongside, not after.
|
|
360
|
+
tickers.map((ticker) => ({ instrument: riskInstrumentOf(ticker), currency: ticker.metadata.currency || null })),
|
|
311
361
|
local.portfolio.currency, episodeReader, ctx.signal,
|
|
312
362
|
).catch(() => {
|
|
313
363
|
// Intentional ignore: the replayed load below reads the same closes and reports their failures.
|
|
@@ -335,7 +385,7 @@ export const portfolioRiskHeadless: HeadlessPaneDefinition<"bundle"> = {
|
|
|
335
385
|
: loadPortfolioOptionBook(tickers, local.portfolio),
|
|
336
386
|
]);
|
|
337
387
|
const episodeTargets = wantsEpisodes
|
|
338
|
-
? riskEpisodeTargets(prices, tickers.map(
|
|
388
|
+
? riskEpisodeTargets(prices, tickers.map(riskInstrumentOf))
|
|
339
389
|
: [];
|
|
340
390
|
const episodes = episodeTargets.length
|
|
341
391
|
? await fetchRiskEpisodeHistory(episodeTargets, local.portfolio.currency, episodeReader, ctx.signal)
|
|
@@ -406,7 +456,13 @@ export const portfolioRiskHeadless: HeadlessPaneDefinition<"bundle"> = {
|
|
|
406
456
|
complete,
|
|
407
457
|
errors: model.warnings,
|
|
408
458
|
notes: [...riskCoverageNotices(model.coverage), ...model.notes.filter((note) => note !== fallback)],
|
|
409
|
-
|
|
459
|
+
// A view with nothing to show says why in one line.
|
|
460
|
+
sections: shown.map(({ view, rows }) => ({ title: view, columns: RISK_COLUMNS, rows, ...(rows.length === 0 ? { empty: riskSectionEmpty(view, {
|
|
461
|
+
name: local.portfolio.name,
|
|
462
|
+
brokerLinked: !!(local.portfolio.brokerId || local.portfolio.brokerInstanceId),
|
|
463
|
+
unvaluedOptions: (model.greeks?.warnings.length ?? 0) > 0,
|
|
464
|
+
failedHistories: failedHistories(model.coverage),
|
|
465
|
+
}) } : {}) })),
|
|
410
466
|
metadata: { coverage: coverageSummary(model.coverage), model, benchmark: model.benchmark, window: model.window,
|
|
411
467
|
notices: [...(shortfall ? [shortfall] : []), ...notices] },
|
|
412
468
|
};
|
|
@@ -426,7 +482,11 @@ export const portfolioRiskHeadless: HeadlessPaneDefinition<"bundle"> = {
|
|
|
426
482
|
complete: result.complete,
|
|
427
483
|
...(errors.length ? { errors } : {}),
|
|
428
484
|
...(notes.length ? { notes } : {}),
|
|
429
|
-
sections: [{ title: view, columns: RISK_COLUMNS, rows: rows.map(displayRow)
|
|
485
|
+
sections: [{ title: view, columns: RISK_COLUMNS, rows: rows.map(displayRow), ...(rows.length === 0 ? { empty: riskSectionEmpty(view, {
|
|
486
|
+
name: model.portfolio.name, brokerLinked: !!(model.portfolio.brokerId || model.portfolio.brokerInstanceId),
|
|
487
|
+
unvaluedOptions: (model.greeks?.warnings.length ?? 0) > 0,
|
|
488
|
+
failedHistories: failedHistories(model.coverage),
|
|
489
|
+
}) } : {}) }],
|
|
430
490
|
metadata: {
|
|
431
491
|
portfolio: {
|
|
432
492
|
id: model.portfolio.id,
|
|
@@ -106,12 +106,13 @@ function byInterval(series: readonly DatedReturn[]): Map<string, number> {
|
|
|
106
106
|
}
|
|
107
107
|
return index;
|
|
108
108
|
}
|
|
109
|
-
/**
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
109
|
+
/**
|
|
110
|
+
* The asset's returns over the same start and end dates as the factor's, in
|
|
111
|
+
* the asset's order, the latest `window` of them when given. The window is
|
|
112
|
+
* taken after matching: two series that end on different days (a US close
|
|
113
|
+
* today, a Singapore close yesterday) still pair their latest common returns.
|
|
114
|
+
*/
|
|
115
|
+
function matchReturns(asset: readonly DatedReturn[], factor: readonly DatedReturn[], window?: number) {
|
|
115
116
|
const other = byInterval(factor);
|
|
116
117
|
const sample: DatedReturn[] = [],
|
|
117
118
|
x: number[] = [],
|
|
@@ -124,6 +125,22 @@ export function regressReturns(
|
|
|
124
125
|
x.push(matched);
|
|
125
126
|
y.push(point.value);
|
|
126
127
|
}
|
|
128
|
+
const from = window == null ? 0 : Math.max(0, sample.length - window);
|
|
129
|
+
return { sample: sample.slice(from), x: x.slice(from), y: y.slice(from) };
|
|
130
|
+
}
|
|
131
|
+
/** How many daily returns two series share, by start and end date. */
|
|
132
|
+
export const matchedReturnCount = (asset: readonly DatedReturn[], factor: readonly DatedReturn[]) =>
|
|
133
|
+
matchReturns(asset, factor).sample.length;
|
|
134
|
+
/**
|
|
135
|
+
* Matched start and end dates prevent pairing a multi-session return with a
|
|
136
|
+
* daily one. `window`: the latest so many matched returns, else every one.
|
|
137
|
+
*/
|
|
138
|
+
export function regressReturns(
|
|
139
|
+
asset: readonly DatedReturn[],
|
|
140
|
+
factor: readonly DatedReturn[],
|
|
141
|
+
{ window, minimum = 60 }: { window?: number; minimum?: number } = {},
|
|
142
|
+
): Regression | null {
|
|
143
|
+
const { sample, x, y } = matchReturns(asset, factor, window);
|
|
127
144
|
if (sample.length < minimum) return null;
|
|
128
145
|
const meanX = x.reduce((a, b) => a + b, 0) / x.length,
|
|
129
146
|
meanY = y.reduce((a, b) => a + b, 0) / y.length;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { portfolioOptionGreeks } from "./risk-options";
|
|
2
2
|
import type { Portfolio, TickerRecord } from "../../../types/ticker";
|
|
3
|
-
import { formatCurrency, formatNumber } from "../../../utils/format";
|
|
3
|
+
import { MISSING_VALUE, formatCurrency, formatNumber } from "../../../utils/format";
|
|
4
4
|
import { resolveCurrencyUnit } from "../../../utils/currency-units";
|
|
5
5
|
import {
|
|
6
6
|
getPortfolioPositionMetrics,
|
|
@@ -19,6 +19,7 @@ import {
|
|
|
19
19
|
import {
|
|
20
20
|
buyAndHoldReturns,
|
|
21
21
|
concentration,
|
|
22
|
+
matchedReturnCount,
|
|
22
23
|
pairedReturns,
|
|
23
24
|
regressReturns,
|
|
24
25
|
RISK_TAIL_CONFIDENCE,
|
|
@@ -46,6 +47,7 @@ import {
|
|
|
46
47
|
import {
|
|
47
48
|
RISK_FACTOR_INSTRUMENTS,
|
|
48
49
|
riskInstrumentId,
|
|
50
|
+
riskInstrumentOf,
|
|
49
51
|
type RiskHoldingRequest,
|
|
50
52
|
type RiskMarketSnapshot,
|
|
51
53
|
} from "./risk-client";
|
|
@@ -92,6 +94,8 @@ interface PortfolioRiskHolding {
|
|
|
92
94
|
error: string | null;
|
|
93
95
|
/** Why the holding is outside the basket; null when it qualifies. */
|
|
94
96
|
leftOut: string | null;
|
|
97
|
+
/** Set when that is its daily closes not loading, which asked again they may. */
|
|
98
|
+
historyFailed?: true;
|
|
95
99
|
}
|
|
96
100
|
/** A holding or a currency's cash outside the basket, with its share of the book when one is known. */
|
|
97
101
|
interface RiskLeftOut {
|
|
@@ -102,6 +106,8 @@ interface RiskLeftOut {
|
|
|
102
106
|
share: number | null;
|
|
103
107
|
/** Set on a currency's cash, which is never in the basket and does not make a report incomplete. */
|
|
104
108
|
cash?: true;
|
|
109
|
+
/** Set when its daily closes did not load, which asked again they may. */
|
|
110
|
+
historyFailed?: true;
|
|
105
111
|
}
|
|
106
112
|
/** One currency of the book's cash, valued in the account currency. */
|
|
107
113
|
interface RiskCashHolding extends RiskCashLine {
|
|
@@ -204,7 +210,7 @@ function bookCurrencyShares(lines: ReadonlyArray<{ currency: string; value: numb
|
|
|
204
210
|
|
|
205
211
|
/** A factor row's evidence without its fit, for a table that gives the fit a column of its own. */
|
|
206
212
|
export function withoutFactorFit(detail: string): string {
|
|
207
|
-
return detail.replace(
|
|
213
|
+
return detail.replace(new RegExp(String.raw`; R² (?:${MISSING_VALUE}|[0-9.]+(?:, weak fit)?)`), "");
|
|
208
214
|
}
|
|
209
215
|
|
|
210
216
|
/** Whether a fit is weak as it reads to two decimals: 0.0999 shows as 0.10 and is not. */
|
|
@@ -214,7 +220,7 @@ export function isWeakFactorFit(rSquared: number | null | undefined): boolean {
|
|
|
214
220
|
|
|
215
221
|
/** "R² 0.28", or "R² 0.03, weak fit" below WEAK_FACTOR_FIT; "R² --" without a fit. */
|
|
216
222
|
export function factorFitText(rSquared: number | null | undefined): string {
|
|
217
|
-
if (rSquared == null || !Number.isFinite(rSquared)) return
|
|
223
|
+
if (rSquared == null || !Number.isFinite(rSquared)) return `R² ${MISSING_VALUE}`;
|
|
218
224
|
return `R² ${rSquared.toFixed(2)}${isWeakFactorFit(rSquared) ? ", weak fit" : ""}`;
|
|
219
225
|
}
|
|
220
226
|
/** The tail-loss rows, which also read in money on the covered basket. */
|
|
@@ -412,8 +418,7 @@ export function portfolioRiskRequests(
|
|
|
412
418
|
? lots.reduce((sum, row) => sum + Math.abs(row.marketValue!), 0)
|
|
413
419
|
: null;
|
|
414
420
|
return {
|
|
415
|
-
|
|
416
|
-
exchange: ticker.metadata.exchange,
|
|
421
|
+
...riskInstrumentOf(ticker),
|
|
417
422
|
quantity: signedQuantity(lots),
|
|
418
423
|
currency,
|
|
419
424
|
snapshotValue: snapshot,
|
|
@@ -717,10 +722,7 @@ export function buildPortfolioRisk(
|
|
|
717
722
|
tickers,
|
|
718
723
|
portfolio.id,
|
|
719
724
|
).map((ticker) => {
|
|
720
|
-
const instrument =
|
|
721
|
-
symbol: ticker.metadata.ticker,
|
|
722
|
-
exchange: ticker.metadata.exchange,
|
|
723
|
-
},
|
|
725
|
+
const instrument = riskInstrumentOf(ticker),
|
|
724
726
|
id = riskInstrumentId(instrument);
|
|
725
727
|
const history = byId.get(id),
|
|
726
728
|
quote = history?.quote,
|
|
@@ -808,6 +810,7 @@ export function buildPortfolioRisk(
|
|
|
808
810
|
fxBridged: holdingFxBridges(convertedFrom, history?.converted?.fxBridged, account, inAccount?.bridged),
|
|
809
811
|
error,
|
|
810
812
|
leftOut,
|
|
813
|
+
...(history?.loadFailed && leftOut === history.error ? { historyFailed: true as const } : {}),
|
|
811
814
|
};
|
|
812
815
|
});
|
|
813
816
|
// Each currency's cash once, valued in the portfolio currency.
|
|
@@ -858,6 +861,7 @@ export function buildPortfolioRisk(
|
|
|
858
861
|
reason: row.leftOut!,
|
|
859
862
|
value: row.marketValue,
|
|
860
863
|
share: bookShare(row.marketValue),
|
|
864
|
+
...(row.historyFailed ? { historyFailed: true as const } : {}),
|
|
861
865
|
})),
|
|
862
866
|
...cashHoldings.map((row): RiskLeftOut => {
|
|
863
867
|
const value = row.value == null ? null : Math.abs(row.value);
|
|
@@ -1019,17 +1023,24 @@ export function buildPortfolioRisk(
|
|
|
1019
1023
|
: []),
|
|
1020
1024
|
].map((factor) => ({
|
|
1021
1025
|
...rollingBeta(basket, factor.series, factor.label, factor.id),
|
|
1022
|
-
regression: regressReturns(basket
|
|
1026
|
+
regression: regressReturns(basket, factor.series, { window: 60 }),
|
|
1023
1027
|
}));
|
|
1028
|
+
// The latest 60 returns both holdings have: a US close today and a Singapore close yesterday still pair their common days.
|
|
1024
1029
|
const correlation = members.flatMap((left, index) =>
|
|
1025
1030
|
members.slice(index + 1).map((right) => {
|
|
1026
|
-
const regression = regressReturns(left.returns
|
|
1031
|
+
const regression = regressReturns(left.returns, right.returns, { window: 60 });
|
|
1032
|
+
const matched = regression?.samples ?? matchedReturnCount(left.returns, right.returns);
|
|
1027
1033
|
return {
|
|
1028
1034
|
left: left.id,
|
|
1029
1035
|
right: right.id,
|
|
1030
1036
|
label: `${left.symbol} / ${right.symbol}`,
|
|
1031
1037
|
...regression,
|
|
1032
1038
|
value: regression?.correlation ?? null,
|
|
1039
|
+
// Why a pair has no correlation, in words.
|
|
1040
|
+
evidence: regression?.correlation != null ? `${matched} matched daily returns`
|
|
1041
|
+
: matched === 0 ? "no daily returns on the same dates"
|
|
1042
|
+
: matched < 60 ? `only ${matched} daily returns on the same dates; 60 needed`
|
|
1043
|
+
: `a price that did not move over ${matched} matched daily returns`,
|
|
1033
1044
|
};
|
|
1034
1045
|
}),
|
|
1035
1046
|
);
|
|
@@ -1212,7 +1223,7 @@ export function buildPortfolioRisk(
|
|
|
1212
1223
|
unit: "correlation",
|
|
1213
1224
|
percentile: null,
|
|
1214
1225
|
asOf: row.asOf ?? null,
|
|
1215
|
-
detail:
|
|
1226
|
+
detail: row.evidence,
|
|
1216
1227
|
}))
|
|
1217
1228
|
.sort((left, right) => (right.value == null ? -1 : Math.abs(right.value)) - (left.value == null ? -1 : Math.abs(left.value))),
|
|
1218
1229
|
stress: [
|
|
@@ -1224,7 +1235,7 @@ export function buildPortfolioRisk(
|
|
|
1224
1235
|
unit: "%",
|
|
1225
1236
|
percentile: null,
|
|
1226
1237
|
asOf: row.regression?.asOf ?? null,
|
|
1227
|
-
detail: `% of basket; ${row.regression?.samples ?? 0} sessions; R² ${row.regression?.rSquared?.toFixed(2) ??
|
|
1238
|
+
detail: `% of basket; ${row.regression?.samples ?? 0} sessions; R² ${row.regression?.rSquared?.toFixed(2) ?? MISSING_VALUE}; ${row.source}`,
|
|
1228
1239
|
})),
|
|
1229
1240
|
// Dated as the index scenario is: the weights and betas are today's, the window is in the label and the evidence.
|
|
1230
1241
|
...(episodeState
|
|
@@ -1429,7 +1440,7 @@ export const riskValue = (row: RiskDisplayRow) =>
|
|
|
1429
1440
|
row.leftOut
|
|
1430
1441
|
? "left out"
|
|
1431
1442
|
: row.value == null
|
|
1432
|
-
?
|
|
1443
|
+
? MISSING_VALUE
|
|
1433
1444
|
: `${row.value.toFixed(2)}${row.unit === "%" ? "%" : ` ${row.unit}`}${riskAmount(row)}`;
|
|
1434
1445
|
/** A row's evidence with what a tail loss in money is taken on: the basket, its share of the book and what it leaves out. */
|
|
1435
1446
|
export function riskEvidence(row: RiskDisplayRow): string {
|
|
@@ -1441,4 +1452,4 @@ function riskAmount(row: RiskDisplayRow): string {
|
|
|
1441
1452
|
return ` (${formatCurrency(row.amount, row.amountCurrency, 0)})`;
|
|
1442
1453
|
}
|
|
1443
1454
|
export const riskPercentile = (row: RiskDisplayRow) =>
|
|
1444
|
-
row.percentile == null ?
|
|
1455
|
+
row.percentile == null ? MISSING_VALUE : String(Math.round(row.percentile));
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { MISSING_VALUE } from "../../../utils/format";
|
|
1
2
|
import {
|
|
2
3
|
staticSeries,
|
|
3
4
|
scalarPoint,
|
|
@@ -44,7 +45,7 @@ import { useThemeColors } from "../../../theme/theme-context";
|
|
|
44
45
|
import type { PaneProps } from "../../../types/plugin";
|
|
45
46
|
import { isAccessDenied } from "../../../api-client/errors";
|
|
46
47
|
import { useResearchCloudSession } from "../shared/research-cloud-session";
|
|
47
|
-
import { loadPortfolioRiskMarket } from "./risk-client";
|
|
48
|
+
import { loadPortfolioRiskMarket, riskInstrumentOf } from "./risk-client";
|
|
48
49
|
import { loadRiskEpisodeHistory, riskEpisodeTargets, type RiskEpisodeState, type RiskEpisodeTarget } from "./risk-episodes";
|
|
49
50
|
import { brokerPerformanceEvidence, parsePortfolioRiskEvidence } from "./risk-evidence";
|
|
50
51
|
import { useBrokerPortfolioPerformance } from "./broker-performance";
|
|
@@ -154,7 +155,7 @@ function sharedWordUnit(rows: RiskDisplayRow[]): string | null {
|
|
|
154
155
|
if (!unit || unit === "%" || !rows.every((row) => row.unit === unit)) return null;
|
|
155
156
|
return unit;
|
|
156
157
|
}
|
|
157
|
-
const bareValue = (row: RiskDisplayRow) => row.value == null ?
|
|
158
|
+
const bareValue = (row: RiskDisplayRow) => row.value == null ? MISSING_VALUE : row.value.toFixed(2);
|
|
158
159
|
const HOLDINGS_SUMMARY_LABELS: Record<string, string> = { top: "Largest", "top-five": "Top five" };
|
|
159
160
|
const CASH_ASIDE = ", cash aside";
|
|
160
161
|
/** The book concentration figures that lead the holdings view, as a summary band. */
|
|
@@ -173,7 +174,7 @@ function holdingsSummaryItems(rows: RiskDisplayRow[]): StatItem[] {
|
|
|
173
174
|
return {
|
|
174
175
|
id: row.id,
|
|
175
176
|
label: HOLDINGS_SUMMARY_LABELS[row.id] ?? row.label,
|
|
176
|
-
value: row.value == null ?
|
|
177
|
+
value: row.value == null ? MISSING_VALUE : share ? `${row.value.toFixed(2)}%` : row.value.toFixed(2),
|
|
177
178
|
detail,
|
|
178
179
|
};
|
|
179
180
|
});
|
|
@@ -442,7 +443,7 @@ export function PortfolioRiskPane({ focused, width, height }: PaneProps) {
|
|
|
442
443
|
// load only there, once the market load says which holdings the basket takes.
|
|
443
444
|
const episodeTargetsKey = useMemo(() => {
|
|
444
445
|
if (frozen || view !== "stress" || !resource.data) return null;
|
|
445
|
-
const held = localTickers.map(
|
|
446
|
+
const held = localTickers.map(riskInstrumentOf);
|
|
446
447
|
const targets = riskEpisodeTargets(resource.data, held);
|
|
447
448
|
return targets.length ? JSON.stringify(targets) : null;
|
|
448
449
|
}, [frozen, localTickers, resource.data, view]);
|
|
@@ -970,13 +971,13 @@ export function PortfolioRiskPane({ focused, width, height }: PaneProps) {
|
|
|
970
971
|
: { text: sharedUnit || attributionParts ? bareValue(row) : riskValue(row), ...(weakFit ? { color: colors.textMuted } : {}) };
|
|
971
972
|
if (column.id === "rSquared")
|
|
972
973
|
return row.rSquared == null
|
|
973
|
-
? { text:
|
|
974
|
+
? { text: MISSING_VALUE }
|
|
974
975
|
: { text: `${weakFit ? "weak " : ""}${row.rSquared.toFixed(2)}`, value: row.rSquared, ...(weakFit ? { color: colors.textMuted } : {}) };
|
|
975
976
|
if (column.id === "percentile") return { text: riskPercentile(row) };
|
|
976
|
-
if (column.id === "asOf") return { text: row.asOf?.slice(0, 10) ??
|
|
977
|
+
if (column.id === "asOf") return { text: row.asOf?.slice(0, 10) ?? MISSING_VALUE };
|
|
977
978
|
if (column.id === "allocation" || column.id === "selection" || column.id === "interaction") {
|
|
978
979
|
const part = row[column.id];
|
|
979
|
-
return { text: part == null ?
|
|
980
|
+
return { text: part == null ? MISSING_VALUE : part.toFixed(2) };
|
|
980
981
|
}
|
|
981
982
|
return { text: factorFits ? withoutFactorFit(row.detail) : row.detail };
|
|
982
983
|
}}
|
|
@@ -3,7 +3,7 @@ import { DataTableView, type StatItem } from "../../../components";
|
|
|
3
3
|
import { statGridColumns } from "../../../components/ui/stat-grid";
|
|
4
4
|
import type { DataTableCell } from "../../../components/ui/data-table/types";
|
|
5
5
|
import { colors, priceColor } from "../../../theme/colors";
|
|
6
|
-
import { formatCompactAmount, formatPercentRaw } from "../../../utils/format";
|
|
6
|
+
import { MISSING_VALUE, formatCompactAmount, formatPercentRaw } from "../../../utils/format";
|
|
7
7
|
import { formatWeight, renderBar } from "./display";
|
|
8
8
|
import type {
|
|
9
9
|
SectorSortPreference,
|
|
@@ -66,7 +66,7 @@ export function analyticsFigures(
|
|
|
66
66
|
width = 0,
|
|
67
67
|
): StatItem[] {
|
|
68
68
|
const short = figuresFrom(summaryRows, riskRows, false);
|
|
69
|
-
if (!riskRows.some((row) => row.value !==
|
|
69
|
+
if (!riskRows.some((row) => row.value !== MISSING_VALUE && row.detail)) return short;
|
|
70
70
|
const windowed = figuresFrom(summaryRows, riskRows, true);
|
|
71
71
|
return statGridColumns(windowed, width) >= statGridColumns(short, width) ? windowed : short;
|
|
72
72
|
}
|
|
@@ -82,7 +82,7 @@ function figuresFrom(
|
|
|
82
82
|
.map(({ row }) => {
|
|
83
83
|
const percent = row.id === "day-pnl" || row.id === "pnl" ? row.detail?.replace(/^\((.*)\)$/, "$1") : row.detail;
|
|
84
84
|
const risk = RISK_FIGURE_IDS.has(row.id);
|
|
85
|
-
const detail = percent ===
|
|
85
|
+
const detail = percent === MISSING_VALUE || (risk && (!riskWindows || row.value === MISSING_VALUE)) ? undefined : percent;
|
|
86
86
|
return {
|
|
87
87
|
id: row.id,
|
|
88
88
|
label: row.label,
|
|
@@ -98,7 +98,7 @@ function figuresFrom(
|
|
|
98
98
|
export function riskFigureNotices(riskRows: readonly AnalyticsMetricRow[]): string[] {
|
|
99
99
|
const byReason = new Map<string, string[]>();
|
|
100
100
|
for (const row of riskRows) {
|
|
101
|
-
if (row.value !==
|
|
101
|
+
if (row.value !== MISSING_VALUE || !row.detail) continue;
|
|
102
102
|
byReason.set(row.detail, [...(byReason.get(row.detail) ?? []), row.label]);
|
|
103
103
|
}
|
|
104
104
|
return [...byReason].map(([reason, labels]) => `${labels.join(", ")}: ${reason}`);
|
|
@@ -122,7 +122,7 @@ function renderSectorCell(row: SectorTableRow, column: SectorTableColumn): DataT
|
|
|
122
122
|
};
|
|
123
123
|
case "return":
|
|
124
124
|
return {
|
|
125
|
-
text: row.returnPct == null ?
|
|
125
|
+
text: row.returnPct == null ? MISSING_VALUE : formatPercentRaw(row.returnPct),
|
|
126
126
|
color: row.returnPct == null ? colors.textMuted : priceColor(row.returnPct),
|
|
127
127
|
};
|
|
128
128
|
case "bar":
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { MISSING_VALUE } from "../../../utils/format";
|
|
1
2
|
import type { AttentionPayload, AttentionPoint, AttentionRow, AttentionWindow } from "../../../api-client/attention";
|
|
2
3
|
import type { DataTableColumn } from "../../../components";
|
|
3
4
|
import { countOf, freePreviewNote, previewCantFilter } from "../shared/free-preview";
|
|
@@ -7,9 +8,9 @@ export type AttentionTab = typeof ATTENTION_TABS[number]["value"];
|
|
|
7
8
|
export const attentionTab = (value: unknown): AttentionTab => ATTENTION_TABS.find((tab) => tab.value === value)?.value ?? "ranking";
|
|
8
9
|
export const attentionWindow = (value: unknown): AttentionWindow => value === "today" || value === "week" ? value : "now";
|
|
9
10
|
export const WINDOWS = [{ value: "now", label: "Now" }, { value: "today", label: "Today" }, { value: "week", label: "Week" }];
|
|
10
|
-
export const number = (value: number | null | undefined, digits = 0) => value == null ?
|
|
11
|
-
export const signed = (value: number | null | undefined, suffix = "") => value == null ?
|
|
12
|
-
export const date = (value: string | null | undefined) => value ? value.slice(0, 16).replace("T", " ") + " UTC" :
|
|
11
|
+
export const number = (value: number | null | undefined, digits = 0) => value == null ? MISSING_VALUE : value.toLocaleString("en-US", { maximumFractionDigits: digits, minimumFractionDigits: digits });
|
|
12
|
+
export const signed = (value: number | null | undefined, suffix = "") => value == null ? MISSING_VALUE : `${value > 0 ? "+" : ""}${number(value, 2)}${suffix}`;
|
|
13
|
+
export const date = (value: string | null | undefined) => value ? value.slice(0, 16).replace("T", " ") + " UTC" : MISSING_VALUE;
|
|
13
14
|
/** A time in a column whose header already says UTC. */
|
|
14
15
|
export const hour = (value: string) => value.slice(0, 16).replace("T", " ");
|
|
15
16
|
export const COLUMNS: DataTableColumn[] = [
|
|
@@ -38,9 +39,9 @@ export function rowCell(row: AttentionRow, column: string) {
|
|
|
38
39
|
const value = row[column as keyof AttentionRow];
|
|
39
40
|
if (column === "zScore") return signed(row.zScore);
|
|
40
41
|
if (column === "priceChangePct") return signed(row.priceChangePct, "%");
|
|
41
|
-
if (column === "relativeVolume") return row.relativeVolume === null ?
|
|
42
|
+
if (column === "relativeVolume") return row.relativeVolume === null ? MISSING_VALUE : `${number(row.relativeVolume, 2)}x`;
|
|
42
43
|
if (column === "sharePct") return number(row.sharePct, 1);
|
|
43
|
-
return typeof value === "number" ? number(value) : typeof value === "string" ? value :
|
|
44
|
+
return typeof value === "number" ? number(value) : typeof value === "string" ? value : MISSING_VALUE;
|
|
44
45
|
}
|
|
45
46
|
export const emptyAttention = (data: AttentionPayload | null | undefined) => data?.status === "disabled"
|
|
46
47
|
? "Research attention collection is not enabled yet." : "Waiting for privacy-qualified research activity.";
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { MISSING_VALUE } from "../../../utils/format";
|
|
1
2
|
import { useCallback, useMemo } from "react";
|
|
2
3
|
import { isAccessDenied } from "../../../api-client/errors";
|
|
3
4
|
import { usePlanAccess } from "../../../api-client/plan-access";
|
|
@@ -67,17 +68,17 @@ function Evidence({ row, data, width, height }: { row: DetailRow; data: Attentio
|
|
|
67
68
|
<KeyValueRow label="Hour" value={period} labelWidth={20} />
|
|
68
69
|
<KeyValueRow label="Published" value={date(row.evidence.asOf)} detail={`after ${data.privacy.lagHours}h minimum`} labelWidth={20} />
|
|
69
70
|
<KeyValueRow label="Privacy threshold" value={`${data.privacy.minimumContributors} contributors per hour`} detail={`passed · methodology ${row.evidence.methodologyVersion}`} labelWidth={20} />
|
|
70
|
-
<KeyValueRow label="Baseline" value={row.baselinePeriods === null ?
|
|
71
|
+
<KeyValueRow label="Baseline" value={row.baselinePeriods === null ? MISSING_VALUE : `${row.baselinePeriods} qualified periods`} detail={row.zScore === null ? "Z-score unavailable" : `Z ${signed(row.zScore)}`} labelWidth={20} />
|
|
71
72
|
{row.marketAsOf || row.relativeVolumeAsOf ? <>
|
|
72
73
|
<SectionHeading title="Market Context" />
|
|
73
74
|
{row.marketAsOf ? <KeyValueRow label="Price move" value={signed(row.priceChangePct, "%")} detail={date(row.marketAsOf)} labelWidth={20} /> : null}
|
|
74
|
-
{row.relativeVolumeAsOf ? <KeyValueRow label="Relative volume" value={row.relativeVolume === null ?
|
|
75
|
+
{row.relativeVolumeAsOf ? <KeyValueRow label="Relative volume" value={row.relativeVolume === null ? MISSING_VALUE : `${number(row.relativeVolume, 2)}x`} detail={date(row.relativeVolumeAsOf)} labelWidth={20} /> : null}
|
|
75
76
|
</> : null}
|
|
76
77
|
{point?.publishedAt && !latest ? <>
|
|
77
78
|
<SectionHeading title="Selected Hour" />
|
|
78
79
|
<KeyValueRow label="Hour" value={date(point.bucketStart)} labelWidth={20} />
|
|
79
|
-
<KeyValueRow label="Research hours" value={number(point.researchUnits)} detail={`rounded to ${point.rounding ??
|
|
80
|
-
<KeyValueRow label="Published" value={date(point.publishedAt)} detail={`${point.minimumContributors ??
|
|
80
|
+
<KeyValueRow label="Research hours" value={number(point.researchUnits)} detail={`rounded to ${point.rounding ?? MISSING_VALUE}`} labelWidth={20} />
|
|
81
|
+
<KeyValueRow label="Published" value={date(point.publishedAt)} detail={`${point.minimumContributors ?? MISSING_VALUE} contributors · ${point.lagHours ?? MISSING_VALUE}h lag · version ${point.methodologyVersion ?? MISSING_VALUE}`} labelWidth={20} />
|
|
81
82
|
</> : null}
|
|
82
83
|
<SectionHeading title="Related News" />
|
|
83
84
|
{row.news.length ? row.news.map((article) => <ActionRow key={article.url} label={`${hour(article.publishedAt)} ${article.title}`} onPress={() => void host.openExternal(article.url)} />)
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { MISSING_VALUE } from "../../../utils/format";
|
|
1
2
|
import { useMemo, useRef } from "react";
|
|
2
3
|
import type { AwardRow } from "../../../api-client/awards";
|
|
3
4
|
import { ActionRow, KeyValueRow, PaneStatusBody, Section, StatGrid, usePagedRows, usePaneNoticeFooter, usePaneStatusFooter, useTableLoadMore } from "../../../components";
|
|
@@ -57,8 +58,8 @@ export function AwardDetail({ row, accessKey, width, height, focused, openAward,
|
|
|
57
58
|
{current.awardStatus ? <KeyValueRow label="Status" value={current.awardStatus} labelWidth={labelWidth} /> : null}
|
|
58
59
|
{current.dataBasis === "bulk-latest-transaction" ? <KeyValueRow label="Record basis" value="Latest published transaction" labelWidth={labelWidth} /> : null}
|
|
59
60
|
<KeyValueRow label="Performance period" value={awardPeriod(current)} labelWidth={labelWidth} />
|
|
60
|
-
<KeyValueRow label="Performance place" value={[current.placeOfPerformance?.city, current.placeOfPerformance?.region, current.placeOfPerformance?.country].filter(Boolean).join(", ") ||
|
|
61
|
-
<KeyValueRow label="NAICS / PSC" value={`${current.naics ??
|
|
61
|
+
<KeyValueRow label="Performance place" value={[current.placeOfPerformance?.city, current.placeOfPerformance?.region, current.placeOfPerformance?.country].filter(Boolean).join(", ") || MISSING_VALUE} labelWidth={labelWidth} />
|
|
62
|
+
<KeyValueRow label="NAICS / PSC" value={`${current.naics ?? MISSING_VALUE} / ${current.psc ?? MISSING_VALUE}`} labelWidth={labelWidth} />
|
|
62
63
|
{current.classifications?.map((classification) => <KeyValueRow key={`${classification.scheme}:${classification.code}`} label={classification.scheme.toUpperCase()} value={classification.code} detail={classification.label} labelWidth={labelWidth} />)}
|
|
63
64
|
<KeyValueRow label="Award id" value={current.sourceAwardId} labelWidth={labelWidth} />
|
|
64
65
|
{current.parentAwardId ? <KeyValueRow label="Parent award" value={current.parentAwardId} labelWidth={labelWidth} /> : null}
|
|
@@ -76,7 +77,7 @@ export function AwardDetail({ row, accessKey, width, height, focused, openAward,
|
|
|
76
77
|
<Section title="Evidence" width={width - 2}>
|
|
77
78
|
<KeyValueRow label="Observed (UTC)" value={current.observedAt.replace("T", " ").slice(0, 19)} labelWidth={labelWidth} />
|
|
78
79
|
{current.dataEffectiveDate ? <KeyValueRow label="Record effective" value={current.dataEffectiveDate.slice(0, 10)} labelWidth={labelWidth} /> : null}
|
|
79
|
-
<KeyValueRow label="Confidence" value={current.confidence == null ?
|
|
80
|
+
<KeyValueRow label="Confidence" value={current.confidence == null ? MISSING_VALUE : `${Math.round(current.confidence * 100)}%`} labelWidth={labelWidth} />
|
|
80
81
|
{current.entity ? <KeyValueRow label="Entity match" value={`${current.entity.method.replaceAll("-", " ")} · ${Math.round(current.entity.confidence * 100)}%`} labelWidth={labelWidth} /> : null}
|
|
81
82
|
{current.evidenceQuote ? <Box paddingY={1}><Text fg={colors.textBright} width={width - 2} wrapMode="word" wrapText>{current.evidenceQuote}</Text></Box> : null}
|
|
82
83
|
<Text fg={colors.textDim} width={width - 2} wrapMode="word" wrapText>{current.sourceUrl}</Text>
|
|
@@ -94,7 +95,7 @@ export function AwardDetail({ row, accessKey, width, height, focused, openAward,
|
|
|
94
95
|
<KeyValueRow label="Awardee" value={revision.award.recipient.name} labelWidth={labelWidth} />
|
|
95
96
|
<KeyValueRow label="Agency" value={revision.award.agency.name} labelWidth={labelWidth} />
|
|
96
97
|
<KeyValueRow label="Award date / value" value={`${revision.award.awardDate} · ${amountWithheld(revision.award) ? WITHHELD_AMOUNT : `${revision.award.currency} ${money(revision.award.awardAmount)}`}`} labelWidth={labelWidth} />
|
|
97
|
-
<KeyValueRow label="Performance period" value={`${revision.award.periodStart ??
|
|
98
|
+
<KeyValueRow label="Performance period" value={`${revision.award.periodStart ?? MISSING_VALUE} / ${revision.award.periodEnd ?? MISSING_VALUE}`} labelWidth={labelWidth} />
|
|
98
99
|
<Text fg={colors.textDim} width={width - 2} wrapMode="word" wrapText>{revision.award.title}</Text>
|
|
99
100
|
{revision.award.evidenceQuote ? <Text fg={colors.text} width={width - 2} wrapMode="word" wrapText>{revision.award.evidenceQuote}</Text> : null}
|
|
100
101
|
<ActionRow label="Open revision source" onPress={() => void host.openExternal(revision.award.sourceUrl)} />
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { MISSING_VALUE } from "../../../utils/format";
|
|
1
2
|
import type { AwardFilter, AwardRow, AwardType } from "../../../api-client/awards";
|
|
2
3
|
import { notATickerSymbol } from "../../../sources/provider-errors";
|
|
3
4
|
import type { HeadlessBundleSection, HeadlessPaneColumn, HeadlessPaneContext, HeadlessPaneDefinition, HeadlessPaneRow } from "../../../types/headless";
|
|
@@ -48,15 +49,15 @@ const awardRecord = (row: AwardRow) => ({ id: row.id, date: row.awardDate, dateB
|
|
|
48
49
|
* types and scopes by name. Amounts are decimal strings from the source, so
|
|
49
50
|
* exports keep them whole: the compact form is the text report's alone.
|
|
50
51
|
*/
|
|
51
|
-
const text = (value: unknown) => value == null || value === "" ?
|
|
52
|
+
const text = (value: unknown) => value == null || value === "" ? MISSING_VALUE : String(value);
|
|
52
53
|
const amount = (key: string, header: string): HeadlessPaneColumn => ({ key, header, align: "right", textFormat: (value) => money(value as string | null) });
|
|
53
54
|
const nested = (pick: (row: HeadlessPaneRow) => unknown, key: string, header: string): HeadlessPaneColumn => ({ key, header, align: "right",
|
|
54
55
|
format: (_value, row) => text(pick(row)), textFormat: (_value, row) => money(pick(row) as string | null) });
|
|
55
|
-
const share: HeadlessPaneColumn = { key: "sharePercent", header: "Share %", align: "right", format: (value) => typeof value === "number" ? `${value.toFixed(1)}%` :
|
|
56
|
-
const count: HeadlessPaneColumn = { key: "count", header: "Awards", align: "right", textFormat: (value) => typeof value === "number" ? value.toLocaleString("en-US") :
|
|
57
|
-
const scope: HeadlessPaneColumn = { key: "source", header: "Scope", format: (value) => typeof value === "string" ? awardScope(value) :
|
|
58
|
-
const type: HeadlessPaneColumn = { key: "awardType", header: "Type", format: (value) => typeof value === "string" ? awardTypeLabel(value as AwardType) :
|
|
59
|
-
const period = (_value: unknown, row: HeadlessPaneRow) => row.periodStart || row.periodEnd ? `${text(row.periodStart)} / ${text(row.periodEnd)}` :
|
|
56
|
+
const share: HeadlessPaneColumn = { key: "sharePercent", header: "Share %", align: "right", format: (value) => typeof value === "number" ? `${value.toFixed(1)}%` : MISSING_VALUE };
|
|
57
|
+
const count: HeadlessPaneColumn = { key: "count", header: "Awards", align: "right", textFormat: (value) => typeof value === "number" ? value.toLocaleString("en-US") : MISSING_VALUE };
|
|
58
|
+
const scope: HeadlessPaneColumn = { key: "source", header: "Scope", format: (value) => typeof value === "string" ? awardScope(value) : MISSING_VALUE };
|
|
59
|
+
const type: HeadlessPaneColumn = { key: "awardType", header: "Type", format: (value) => typeof value === "string" ? awardTypeLabel(value as AwardType) : MISSING_VALUE };
|
|
60
|
+
const period = (_value: unknown, row: HeadlessPaneRow) => row.periodStart || row.periodEnd ? `${text(row.periodStart)} / ${text(row.periodEnd)}` : MISSING_VALUE;
|
|
60
61
|
const dateBasis = (value: unknown) => value === "period-start" ? "Period start" : value === "publication" ? "Publication" : "Award date";
|
|
61
62
|
const comparison = (row: HeadlessPaneRow) => row.revenueComparison as { awardAmount?: string; annualRevenue?: string; basis?: string; periodEnd?: string } | null;
|
|
62
63
|
const FEED_COLUMNS: HeadlessPaneColumn[] = [
|
|
@@ -66,7 +67,7 @@ const FEED_COLUMNS: HeadlessPaneColumn[] = [
|
|
|
66
67
|
];
|
|
67
68
|
const EVENT_COLUMNS: HeadlessPaneColumn[] = [
|
|
68
69
|
{ key: "date", header: "Date" }, { key: "recipient", header: "Awardee" }, { key: "ticker", header: "Ticker" },
|
|
69
|
-
{ key: "annualRevenuePercent", header: "% revenue", align: "right", format: (value) => typeof value === "number" ? `${value.toFixed(2)}%` :
|
|
70
|
+
{ key: "annualRevenuePercent", header: "% revenue", align: "right", format: (value) => typeof value === "number" ? `${value.toFixed(2)}%` : MISSING_VALUE },
|
|
70
71
|
{ key: "currency", header: "CCY" }, nested((row) => comparison(row)?.awardAmount, "comparedValue", "Compared value"),
|
|
71
72
|
nested((row) => comparison(row)?.annualRevenue, "annualRevenue", "Annual revenue"),
|
|
72
73
|
{ key: "revenueComparison", header: "Value basis", format: (_value, row) => comparison(row)?.basis === "obligated" ? "Obligated" : "Award value" },
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { MISSING_VALUE } from "../../../utils/format";
|
|
1
2
|
import type { AwardAggregate, AwardFilter, AwardHistoryPoint, AwardRow, AwardsPayload, AwardType } from "../../../api-client/awards";
|
|
2
3
|
import { staticSeries } from "../../../components/chart/static/series";
|
|
3
4
|
import type { ResolvedSeries } from "../../../time-series/types";
|
|
@@ -9,15 +10,15 @@ export type AwardTab = typeof AWARD_TABS[number]["value"];
|
|
|
9
10
|
export const awardTab = (value: unknown): AwardTab => AWARD_TABS.find((tab) => tab.value === value)?.value ?? "feed";
|
|
10
11
|
export const awardTypeLabel = (value: AwardType) => ({ prime: "Prime", subaward: "Subaward", modification: "Modification", notice: "Notice" })[value];
|
|
11
12
|
export function money(value: string | number | null | undefined): string {
|
|
12
|
-
if (value == null) return
|
|
13
|
+
if (value == null) return MISSING_VALUE;
|
|
13
14
|
const amount = Number(value), absolute = Math.abs(amount);
|
|
14
15
|
for (const [scale, suffix] of [[1e12, "T"], [1e9, "B"], [1e6, "M"], [1e3, "K"]] as const) {
|
|
15
16
|
if (absolute >= scale) return `${(amount / scale).toFixed(2)}${suffix}`;
|
|
16
17
|
}
|
|
17
18
|
return amount.toLocaleString("en-US", { maximumFractionDigits: 2 });
|
|
18
19
|
}
|
|
19
|
-
export const awardPeriod = (row: AwardRow) => row.periodStart || row.periodEnd ? `${row.periodStart ??
|
|
20
|
-
export const awardPercent = (row: AwardRow) => row.revenueComparison ? `${row.revenueComparison.percent.toFixed(2)}%` :
|
|
20
|
+
export const awardPeriod = (row: AwardRow) => row.periodStart || row.periodEnd ? `${row.periodStart ?? MISSING_VALUE} / ${row.periodEnd ?? MISSING_VALUE}` : MISSING_VALUE;
|
|
21
|
+
export const awardPercent = (row: AwardRow) => row.revenueComparison ? `${row.revenueComparison.percent.toFixed(2)}%` : MISSING_VALUE;
|
|
21
22
|
export const aggregateId = (row: AwardAggregate) => JSON.stringify([row.key, row.source, row.currency, row.awardType]);
|
|
22
23
|
const historyDate = (row: AwardHistoryPoint) => new Date(`${row.month.slice(0, 7)}-01T00:00:00Z`);
|
|
23
24
|
export const awardScope = (source: string) => ({ usaspending: "US federal contracts", "usaspending-subawards": "US federal subcontracts", "usaspending-transactions": "US contract actions", "uk-contracts-finder": "UK contract notices",
|
|
@@ -14,7 +14,7 @@ import type { PaneProps } from "../../../types/plugin";
|
|
|
14
14
|
import { Box, Text, TextAttributes, useRendererHost, useUiCapabilities, type ScrollBoxRenderable } from "../../../ui";
|
|
15
15
|
import { withCountryFlag } from "../../../components/ui/country-flag";
|
|
16
16
|
import { publicTickerKey } from "../../../utils/exchanges";
|
|
17
|
-
import { truncateToDisplayWidth } from "../../../utils/format";
|
|
17
|
+
import { MISSING_VALUE, truncateToDisplayWidth } from "../../../utils/format";
|
|
18
18
|
import { wrapTextLines } from "../../../utils/text-wrap";
|
|
19
19
|
import { SignInWall } from "../cloud/auth-actions";
|
|
20
20
|
import { CLOUD_PLAN_KEY, useCloudUpgradeAction } from "../shared/cloud-upgrade";
|
|
@@ -60,7 +60,7 @@ const COLUMN = {
|
|
|
60
60
|
const FEED_COLUMNS: DataTableColumn[] = [COLUMN.date, COLUMN.recipient, COLUMN.ticker, COLUMN.title, COLUMN.agency, COLUMN.currency,
|
|
61
61
|
COLUMN.value, COLUMN.obligated, COLUMN.ceiling, COLUMN.country, COLUMN.period, COLUMN.dateBasis];
|
|
62
62
|
/** Amounts a source never reports (UK and EU notices have no obligation or ceiling) leave a column of dashes. */
|
|
63
|
-
const QUIET_AMOUNTS = { obligated: [
|
|
63
|
+
const QUIET_AMOUNTS = { obligated: [MISSING_VALUE], ceiling: [MISSING_VALUE] } as const;
|
|
64
64
|
const EVENT_COLUMNS: DataTableColumn[] = [COLUMN.date, COLUMN.recipient, COLUMN.ticker,
|
|
65
65
|
{ id: "ratio", label: "% revenue", width: 11, align: "right" }, COLUMN.currency, { ...COLUMN.value, label: "Compared value" },
|
|
66
66
|
{ id: "revenue", label: "Annual revenue", width: 14, align: "right" }, { id: "basis", label: "Value basis", width: 13, align: "left" },
|
|
@@ -220,7 +220,7 @@ function AwardsView({ width, height, focused, symbol }: PaneProps & { symbol: st
|
|
|
220
220
|
view={tab === "sectors" ? { value: leaderView, options: [{ value: "companies", label: "Companies" }, { value: "sectors", label: "Sectors" }], onChange: setLeaderView } : undefined} />;
|
|
221
221
|
const columns = showLeaders ? LEADER_COLUMNS.filter((column) => column.id !== "scope" && column.id !== "currency")
|
|
222
222
|
: aggregated ? AGG_COLUMNS.filter((column) => column.id !== "scope" && column.id !== "currency").map((column) => column.id === "label" ? { ...column, label: tab === "agencies" ? "Agency" : "Sector" } : column)
|
|
223
|
-
: tab === "events" ? EVENT_COLUMNS : withoutQuietColumns(FEED_COLUMNS, rows, (row, id) => (id === "obligated" ? row.obligatedAmount : row.ceilingAmount) ??
|
|
223
|
+
: tab === "events" ? EVENT_COLUMNS : withoutQuietColumns(FEED_COLUMNS, rows, (row, id) => (id === "obligated" ? row.obligatedAmount : row.ceilingAmount) ?? MISSING_VALUE, QUIET_AMOUNTS);
|
|
224
224
|
const maxShare = Math.max(0, ...items.map((item) => item.kind === "aggregate" || item.kind === "leader" ? item.row.sharePercent ?? 0 : 0));
|
|
225
225
|
// A preview's cohorts are the latest of any company, so they never chart as the ticker's.
|
|
226
226
|
const charted = data?.locked ? [] : series;
|
|
@@ -288,7 +288,7 @@ function AwardsView({ width, height, focused, symbol }: PaneProps & { symbol: st
|
|
|
288
288
|
if (column.id === "ratio") return { text: awardPercent(award), value: award.revenueComparison?.percent ?? null, color: colors.warning, attributes: TextAttributes.BOLD, keepColorWhenSelected: true };
|
|
289
289
|
if (column.id === "revenue") return { text: money(award.revenueComparison?.annualRevenue), value: award.revenueComparison?.annualRevenue ?? null };
|
|
290
290
|
if (column.id === "basis") return { text: award.revenueComparison?.basis === "obligated" ? "Obligated" : "Award value", color: colors.textDim };
|
|
291
|
-
return { text: award.revenueComparison?.periodEnd ??
|
|
291
|
+
return { text: award.revenueComparison?.periodEnd ?? MISSING_VALUE, color: colors.textDim };
|
|
292
292
|
}}
|
|
293
293
|
emptyStateTitle={tab === "company" && !ticker ? "Enter a company ticker." : tab === "events" ? "No revenue-comparable awards in this scope." : "No awards match these filters."}
|
|
294
294
|
rootAfter={attribution ? <Box paddingX={1} height={attributionRows} flexShrink={0}><Notice tone="muted">{attribution}</Notice></Box> : undefined}
|