@snksergio/design-system 0.19.1 → 0.30.2
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/README.md +39 -12
- package/dist-lib/chunks/{app-shell-Cy9be0Zx.mjs → app-shell-78w0pYdP.mjs} +849 -79
- package/dist-lib/chunks/app-shell-78w0pYdP.mjs.map +1 -0
- package/dist-lib/chunks/{app-shell-CPx9X7zP.cjs → app-shell-Cyh8AUJT.cjs} +947 -176
- package/dist-lib/chunks/app-shell-Cyh8AUJT.cjs.map +1 -0
- package/dist-lib/chunks/{clientes-showcase-mocks-ayU1SDOA.mjs → clientes-showcase-mocks-CwWGCCmf.mjs} +1 -27
- package/dist-lib/chunks/clientes-showcase-mocks-CwWGCCmf.mjs.map +1 -0
- package/dist-lib/chunks/{clientes-showcase-mocks-DygUqkkh.cjs → clientes-showcase-mocks-CwhluBTT.cjs} +1 -44
- package/dist-lib/chunks/clientes-showcase-mocks-CwhluBTT.cjs.map +1 -0
- package/dist-lib/chunks/{input-BWevV7up.cjs → input-BjUSWce3.cjs} +24 -4
- package/dist-lib/chunks/input-BjUSWce3.cjs.map +1 -0
- package/dist-lib/chunks/{input-C9eKSSEb.mjs → input-DCDU4i4S.mjs} +23 -3
- package/dist-lib/chunks/input-DCDU4i4S.mjs.map +1 -0
- package/dist-lib/chunks/kpi-delta-C_3V6uG6.cjs +148 -0
- package/dist-lib/chunks/kpi-delta-C_3V6uG6.cjs.map +1 -0
- package/dist-lib/chunks/kpi-delta-DpYuDY4h.mjs +149 -0
- package/dist-lib/chunks/kpi-delta-DpYuDY4h.mjs.map +1 -0
- package/dist-lib/chunks/{page-header-CQbTGWQ8.mjs → page-header-B6XJyIMz.mjs} +2 -2
- package/dist-lib/chunks/{page-header-CQbTGWQ8.mjs.map → page-header-B6XJyIMz.mjs.map} +1 -1
- package/dist-lib/chunks/{page-header-BZ-WrxV2.cjs → page-header-D0rpU0yn.cjs} +4 -4
- package/dist-lib/chunks/{page-header-BZ-WrxV2.cjs.map → page-header-D0rpU0yn.cjs.map} +1 -1
- package/dist-lib/chunks/{panel-pOXMw6a-.cjs → panel-B_SSIEDs.cjs} +1876 -1067
- package/dist-lib/chunks/panel-B_SSIEDs.cjs.map +1 -0
- package/dist-lib/chunks/{panel-BCUixETK.mjs → panel-CEkyoGiO.mjs} +1639 -831
- package/dist-lib/chunks/panel-CEkyoGiO.mjs.map +1 -0
- package/dist-lib/index.cjs +3819 -230
- package/dist-lib/index.cjs.map +1 -1
- package/dist-lib/index.mjs +3898 -313
- package/dist-lib/index.mjs.map +1 -1
- package/dist-lib/preview/chat.cjs +41 -42
- package/dist-lib/preview/chat.cjs.map +1 -1
- package/dist-lib/preview/chat.mjs +2 -3
- package/dist-lib/preview/chat.mjs.map +1 -1
- package/dist-lib/preview/clientes.cjs +22 -24
- package/dist-lib/preview/clientes.cjs.map +1 -1
- package/dist-lib/preview/clientes.mjs +5 -7
- package/dist-lib/preview/clientes.mjs.map +1 -1
- package/dist-lib/preview/dashboard.cjs +232 -28
- package/dist-lib/preview/dashboard.cjs.map +1 -1
- package/dist-lib/preview/dashboard.mjs +215 -11
- package/dist-lib/preview/dashboard.mjs.map +1 -1
- package/dist-lib/preview/mocks.cjs +1 -1
- package/dist-lib/preview/mocks.mjs +1 -1
- package/dist-lib/src/components/index.d.ts +14 -0
- package/dist-lib/src/components/index.d.ts.map +1 -1
- package/dist-lib/src/components/shadcn/command.d.ts.map +1 -1
- package/dist-lib/src/components/shadcn/input.d.ts.map +1 -1
- package/dist-lib/src/components/shadcn/tabs.d.ts +11 -6
- package/dist-lib/src/components/shadcn/tabs.d.ts.map +1 -1
- package/dist-lib/src/components/shadcn/tooltip.d.ts +25 -7
- package/dist-lib/src/components/shadcn/tooltip.d.ts.map +1 -1
- package/dist-lib/src/components/ui/ChoroplethMap/choropleth-map.d.ts +13 -0
- package/dist-lib/src/components/ui/ChoroplethMap/choropleth-map.d.ts.map +1 -0
- package/dist-lib/src/components/ui/ChoroplethMap/choropleth-map.styles.d.ts +95 -0
- package/dist-lib/src/components/ui/ChoroplethMap/choropleth-map.styles.d.ts.map +1 -0
- package/dist-lib/src/components/ui/ChoroplethMap/choropleth-map.types.d.ts +81 -0
- package/dist-lib/src/components/ui/ChoroplethMap/choropleth-map.types.d.ts.map +1 -0
- package/dist-lib/src/components/ui/ChoroplethMap/index.d.ts +3 -0
- package/dist-lib/src/components/ui/ChoroplethMap/index.d.ts.map +1 -0
- package/dist-lib/src/components/ui/ColorPicker/color-picker.d.ts +16 -0
- package/dist-lib/src/components/ui/ColorPicker/color-picker.d.ts.map +1 -0
- package/dist-lib/src/components/ui/ColorPicker/color-picker.presets.d.ts +13 -0
- package/dist-lib/src/components/ui/ColorPicker/color-picker.presets.d.ts.map +1 -0
- package/dist-lib/src/components/ui/ColorPicker/color-picker.styles.d.ts +135 -0
- package/dist-lib/src/components/ui/ColorPicker/color-picker.styles.d.ts.map +1 -0
- package/dist-lib/src/components/ui/ColorPicker/color-picker.types.d.ts +35 -0
- package/dist-lib/src/components/ui/ColorPicker/color-picker.types.d.ts.map +1 -0
- package/dist-lib/src/components/ui/ColorPicker/index.d.ts +6 -0
- package/dist-lib/src/components/ui/ColorPicker/index.d.ts.map +1 -0
- package/dist-lib/src/components/ui/ConversationListItem/conversation-list-item.d.ts +23 -0
- package/dist-lib/src/components/ui/ConversationListItem/conversation-list-item.d.ts.map +1 -0
- package/dist-lib/src/components/ui/ConversationListItem/conversation-list-item.styles.d.ts +173 -0
- package/dist-lib/src/components/ui/ConversationListItem/conversation-list-item.styles.d.ts.map +1 -0
- package/dist-lib/src/components/ui/ConversationListItem/conversation-list-item.types.d.ts +59 -0
- package/dist-lib/src/components/ui/ConversationListItem/conversation-list-item.types.d.ts.map +1 -0
- package/dist-lib/src/components/ui/ConversationListItem/index.d.ts +5 -0
- package/dist-lib/src/components/ui/ConversationListItem/index.d.ts.map +1 -0
- package/dist-lib/src/components/ui/DataTable/data-table.d.ts.map +1 -1
- package/dist-lib/src/components/ui/DataTable/data-table.types.d.ts +14 -1
- package/dist-lib/src/components/ui/DataTable/data-table.types.d.ts.map +1 -1
- package/dist-lib/src/components/ui/DataTable/hooks/use-column-auto-width.d.ts +9 -0
- package/dist-lib/src/components/ui/DataTable/hooks/use-column-auto-width.d.ts.map +1 -1
- package/dist-lib/src/components/ui/DataTable/hooks/use-data-table-controller.d.ts.map +1 -1
- package/dist-lib/src/components/ui/DataTable/services/saved-views.types.d.ts +9 -0
- package/dist-lib/src/components/ui/DataTable/services/saved-views.types.d.ts.map +1 -1
- package/dist-lib/src/components/ui/DataTable/utils/calculate-column-widths.d.ts +16 -0
- package/dist-lib/src/components/ui/DataTable/utils/calculate-column-widths.d.ts.map +1 -1
- package/dist-lib/src/components/ui/DatePicker/datepicker.d.ts +31 -8
- package/dist-lib/src/components/ui/DatePicker/datepicker.d.ts.map +1 -1
- package/dist-lib/src/components/ui/DatePicker/index.d.ts +1 -1
- package/dist-lib/src/components/ui/DatePicker/index.d.ts.map +1 -1
- package/dist-lib/src/components/ui/DateSeparatorChip/date-separator-chip.d.ts +18 -0
- package/dist-lib/src/components/ui/DateSeparatorChip/date-separator-chip.d.ts.map +1 -0
- package/dist-lib/src/components/ui/DateSeparatorChip/date-separator-chip.styles.d.ts +63 -0
- package/dist-lib/src/components/ui/DateSeparatorChip/date-separator-chip.styles.d.ts.map +1 -0
- package/dist-lib/src/components/ui/DateSeparatorChip/date-separator-chip.types.d.ts +21 -0
- package/dist-lib/src/components/ui/DateSeparatorChip/date-separator-chip.types.d.ts.map +1 -0
- package/dist-lib/src/components/ui/DateSeparatorChip/index.d.ts +5 -0
- package/dist-lib/src/components/ui/DateSeparatorChip/index.d.ts.map +1 -0
- package/dist-lib/src/components/ui/EmptyState/empty-state.d.ts +12 -0
- package/dist-lib/src/components/ui/EmptyState/empty-state.d.ts.map +1 -0
- package/dist-lib/src/components/ui/EmptyState/empty-state.styles.d.ts +83 -0
- package/dist-lib/src/components/ui/EmptyState/empty-state.styles.d.ts.map +1 -0
- package/dist-lib/src/components/ui/EmptyState/empty-state.types.d.ts +43 -0
- package/dist-lib/src/components/ui/EmptyState/empty-state.types.d.ts.map +1 -0
- package/dist-lib/src/components/ui/EmptyState/index.d.ts +5 -0
- package/dist-lib/src/components/ui/EmptyState/index.d.ts.map +1 -0
- package/dist-lib/src/components/ui/FileUploadField/file-upload-field.d.ts +15 -0
- package/dist-lib/src/components/ui/FileUploadField/file-upload-field.d.ts.map +1 -0
- package/dist-lib/src/components/ui/FileUploadField/file-upload-field.styles.d.ts +66 -0
- package/dist-lib/src/components/ui/FileUploadField/file-upload-field.styles.d.ts.map +1 -0
- package/dist-lib/src/components/ui/FileUploadField/file-upload-field.types.d.ts +41 -0
- package/dist-lib/src/components/ui/FileUploadField/file-upload-field.types.d.ts.map +1 -0
- package/dist-lib/src/components/ui/FileUploadField/index.d.ts +3 -0
- package/dist-lib/src/components/ui/FileUploadField/index.d.ts.map +1 -0
- package/dist-lib/src/components/ui/Kpi/kpi-delta.d.ts +4 -1
- package/dist-lib/src/components/ui/Kpi/kpi-delta.d.ts.map +1 -1
- package/dist-lib/src/components/ui/Kpi/kpi.d.ts +1 -1
- package/dist-lib/src/components/ui/Kpi/kpi.d.ts.map +1 -1
- package/dist-lib/src/components/ui/Kpi/kpi.styles.d.ts +42 -0
- package/dist-lib/src/components/ui/Kpi/kpi.styles.d.ts.map +1 -1
- package/dist-lib/src/components/ui/Kpi/kpi.types.d.ts +13 -1
- package/dist-lib/src/components/ui/Kpi/kpi.types.d.ts.map +1 -1
- package/dist-lib/src/components/ui/MarkdownText/index.d.ts +5 -0
- package/dist-lib/src/components/ui/MarkdownText/index.d.ts.map +1 -0
- package/dist-lib/src/components/ui/MarkdownText/markdown-text.d.ts +14 -0
- package/dist-lib/src/components/ui/MarkdownText/markdown-text.d.ts.map +1 -0
- package/dist-lib/src/components/ui/MarkdownText/markdown-text.styles.d.ts +72 -0
- package/dist-lib/src/components/ui/MarkdownText/markdown-text.styles.d.ts.map +1 -0
- package/dist-lib/src/components/ui/MarkdownText/markdown-text.types.d.ts +26 -0
- package/dist-lib/src/components/ui/MarkdownText/markdown-text.types.d.ts.map +1 -0
- package/dist-lib/src/components/ui/MenuSidebar/sidebar-section.d.ts.map +1 -1
- package/dist-lib/src/components/ui/MenuSidebar/sidebar.styles.d.ts +1 -0
- package/dist-lib/src/components/ui/MenuSidebar/sidebar.styles.d.ts.map +1 -1
- package/dist-lib/src/components/ui/MenuSidebar/sidebar.types.d.ts +7 -1
- package/dist-lib/src/components/ui/MenuSidebar/sidebar.types.d.ts.map +1 -1
- package/dist-lib/src/components/ui/MessageAck/index.d.ts +5 -0
- package/dist-lib/src/components/ui/MessageAck/index.d.ts.map +1 -0
- package/dist-lib/src/components/ui/MessageAck/message-ack.d.ts +18 -0
- package/dist-lib/src/components/ui/MessageAck/message-ack.d.ts.map +1 -0
- package/dist-lib/src/components/ui/MessageAck/message-ack.styles.d.ts +61 -0
- package/dist-lib/src/components/ui/MessageAck/message-ack.styles.d.ts.map +1 -0
- package/dist-lib/src/components/ui/MessageAck/message-ack.types.d.ts +14 -0
- package/dist-lib/src/components/ui/MessageAck/message-ack.types.d.ts.map +1 -0
- package/dist-lib/src/components/ui/MessageBubble/index.d.ts +5 -0
- package/dist-lib/src/components/ui/MessageBubble/index.d.ts.map +1 -0
- package/dist-lib/src/components/ui/MessageBubble/message-bubble.d.ts +20 -0
- package/dist-lib/src/components/ui/MessageBubble/message-bubble.d.ts.map +1 -0
- package/dist-lib/src/components/ui/MessageBubble/message-bubble.styles.d.ts +180 -0
- package/dist-lib/src/components/ui/MessageBubble/message-bubble.styles.d.ts.map +1 -0
- package/dist-lib/src/components/ui/MessageBubble/message-bubble.types.d.ts +87 -0
- package/dist-lib/src/components/ui/MessageBubble/message-bubble.types.d.ts.map +1 -0
- package/dist-lib/src/components/ui/MessageComposer/index.d.ts +5 -0
- package/dist-lib/src/components/ui/MessageComposer/index.d.ts.map +1 -0
- package/dist-lib/src/components/ui/MessageComposer/message-composer.d.ts +18 -0
- package/dist-lib/src/components/ui/MessageComposer/message-composer.d.ts.map +1 -0
- package/dist-lib/src/components/ui/MessageComposer/message-composer.styles.d.ts +113 -0
- package/dist-lib/src/components/ui/MessageComposer/message-composer.styles.d.ts.map +1 -0
- package/dist-lib/src/components/ui/MessageComposer/message-composer.types.d.ts +49 -0
- package/dist-lib/src/components/ui/MessageComposer/message-composer.types.d.ts.map +1 -0
- package/dist-lib/src/components/ui/MessageVariablesPicker/index.d.ts +6 -0
- package/dist-lib/src/components/ui/MessageVariablesPicker/index.d.ts.map +1 -0
- package/dist-lib/src/components/ui/MessageVariablesPicker/message-variables-picker.d.ts +12 -0
- package/dist-lib/src/components/ui/MessageVariablesPicker/message-variables-picker.d.ts.map +1 -0
- package/dist-lib/src/components/ui/MessageVariablesPicker/message-variables-picker.styles.d.ts +57 -0
- package/dist-lib/src/components/ui/MessageVariablesPicker/message-variables-picker.styles.d.ts.map +1 -0
- package/dist-lib/src/components/ui/MessageVariablesPicker/message-variables-picker.types.d.ts +36 -0
- package/dist-lib/src/components/ui/MessageVariablesPicker/message-variables-picker.types.d.ts.map +1 -0
- package/dist-lib/src/components/ui/Modal/modal.d.ts +3 -1
- package/dist-lib/src/components/ui/Modal/modal.d.ts.map +1 -1
- package/dist-lib/src/components/ui/Modal/modal.styles.d.ts +7 -1
- package/dist-lib/src/components/ui/Modal/modal.styles.d.ts.map +1 -1
- package/dist-lib/src/components/ui/MonthYearPicker/index.d.ts +3 -0
- package/dist-lib/src/components/ui/MonthYearPicker/index.d.ts.map +1 -0
- package/dist-lib/src/components/ui/MonthYearPicker/month-year-picker.d.ts +11 -0
- package/dist-lib/src/components/ui/MonthYearPicker/month-year-picker.d.ts.map +1 -0
- package/dist-lib/src/components/ui/MonthYearPicker/month-year-picker.styles.d.ts +113 -0
- package/dist-lib/src/components/ui/MonthYearPicker/month-year-picker.styles.d.ts.map +1 -0
- package/dist-lib/src/components/ui/MonthYearPicker/month-year-picker.types.d.ts +34 -0
- package/dist-lib/src/components/ui/MonthYearPicker/month-year-picker.types.d.ts.map +1 -0
- package/dist-lib/src/components/ui/SingleMenuSidebar/single-menu-sidebar.styles.d.ts +1 -1
- package/dist-lib/src/components/ui/Spinner/index.d.ts +3 -0
- package/dist-lib/src/components/ui/Spinner/index.d.ts.map +1 -0
- package/dist-lib/src/components/ui/Spinner/spinner.d.ts +11 -0
- package/dist-lib/src/components/ui/Spinner/spinner.d.ts.map +1 -0
- package/dist-lib/src/components/ui/Spinner/spinner.styles.d.ts +55 -0
- package/dist-lib/src/components/ui/Spinner/spinner.styles.d.ts.map +1 -0
- package/dist-lib/src/components/ui/Spinner/spinner.types.d.ts +12 -0
- package/dist-lib/src/components/ui/Spinner/spinner.types.d.ts.map +1 -0
- package/dist-lib/src/components/ui/TableToolbar/parts/table-toolbar-views.d.ts +7 -1
- package/dist-lib/src/components/ui/TableToolbar/parts/table-toolbar-views.d.ts.map +1 -1
- package/dist-lib/src/components/ui/Toast/toast.d.ts +44 -0
- package/dist-lib/src/components/ui/Toast/toast.d.ts.map +1 -0
- package/dist-lib/src/hooks/useBrand.d.ts +31 -0
- package/dist-lib/src/hooks/useBrand.d.ts.map +1 -0
- package/dist-lib/src/preview/pages/ChatV2/components/QueueColumn/queue-column.styles.d.ts +3 -3
- package/dist-lib/src/preview/pages/ClientesShowcase/clientes-showcase-mocks.d.ts +1 -1
- package/dist-lib/src/preview/pages/ClientesShowcase/clientes-showcase-mocks.d.ts.map +1 -1
- package/dist-lib/src/preview/pages/ClientesShowcase/clientes-showcase.types.d.ts +1 -1
- package/dist-lib/src/preview/pages/ClientesShowcase/clientes-showcase.types.d.ts.map +1 -1
- package/dist-lib/src/preview/pages/ClientesShowcase/components/DetailDrawer/detail-drawer.types.d.ts +1 -1
- package/dist-lib/src/preview/pages/ClientesShowcase/components/DetailDrawer/detail-drawer.types.d.ts.map +1 -1
- package/dist-lib/src/preview/pages/DashboardShowcase.d.ts.map +1 -1
- package/dist-lib/src/preview/pages/_table-data.d.ts +51 -0
- package/dist-lib/src/preview/pages/_table-data.d.ts.map +1 -0
- package/dist-lib/src/utils/tv.d.ts.map +1 -1
- package/dist-lib/theme.css +32 -0
- package/dist-lib/tokens/brands/blue/primitives/color-palette.d.ts +266 -0
- package/dist-lib/tokens/brands/blue/primitives/color-palette.d.ts.map +1 -0
- package/dist-lib/tokens/brands/blue/semantic/color-dark.d.ts +200 -0
- package/dist-lib/tokens/brands/blue/semantic/color-dark.d.ts.map +1 -0
- package/dist-lib/tokens/brands/blue/semantic/color-light.d.ts +202 -0
- package/dist-lib/tokens/brands/blue/semantic/color-light.d.ts.map +1 -0
- package/dist-lib/tokens/brands/default/semantic/typography.d.ts +4 -2
- package/dist-lib/tokens/brands/default/semantic/typography.d.ts.map +1 -1
- package/dist-lib/tokens/brands/green/primitives/color-palette.d.ts +267 -0
- package/dist-lib/tokens/brands/green/primitives/color-palette.d.ts.map +1 -0
- package/dist-lib/tokens/brands/green/semantic/color-dark.d.ts +200 -0
- package/dist-lib/tokens/brands/green/semantic/color-dark.d.ts.map +1 -0
- package/dist-lib/tokens/brands/green/semantic/color-light.d.ts +201 -0
- package/dist-lib/tokens/brands/green/semantic/color-light.d.ts.map +1 -0
- package/dist-lib/tokens/brands/pay/primitives/color-palette.d.ts +146 -0
- package/dist-lib/tokens/brands/pay/primitives/color-palette.d.ts.map +1 -0
- package/dist-lib/tokens/brands/pay/semantic/color-dark.d.ts +201 -0
- package/dist-lib/tokens/brands/pay/semantic/color-dark.d.ts.map +1 -0
- package/dist-lib/tokens/brands/pay/semantic/color-light.d.ts +199 -0
- package/dist-lib/tokens/brands/pay/semantic/color-light.d.ts.map +1 -0
- package/dist-lib/tokens.cjs +35 -0
- package/dist-lib/tokens.cjs.map +1 -1
- package/dist-lib/tokens.mjs +35 -0
- package/dist-lib/tokens.mjs.map +1 -1
- package/package.json +21 -7
- package/dist-lib/chunks/app-shell-CPx9X7zP.cjs.map +0 -1
- package/dist-lib/chunks/app-shell-Cy9be0Zx.mjs.map +0 -1
- package/dist-lib/chunks/badge-DBdk74KN.mjs +0 -840
- package/dist-lib/chunks/badge-DBdk74KN.mjs.map +0 -1
- package/dist-lib/chunks/badge-gU2wtxrn.cjs +0 -856
- package/dist-lib/chunks/badge-gU2wtxrn.cjs.map +0 -1
- package/dist-lib/chunks/chip-group-2-f_Yo7Y.cjs +0 -763
- package/dist-lib/chunks/chip-group-2-f_Yo7Y.cjs.map +0 -1
- package/dist-lib/chunks/chip-group-_e-yh1Zq.mjs +0 -747
- package/dist-lib/chunks/chip-group-_e-yh1Zq.mjs.map +0 -1
- package/dist-lib/chunks/clientes-showcase-mocks-DygUqkkh.cjs.map +0 -1
- package/dist-lib/chunks/clientes-showcase-mocks-ayU1SDOA.mjs.map +0 -1
- package/dist-lib/chunks/input-BWevV7up.cjs.map +0 -1
- package/dist-lib/chunks/input-C9eKSSEb.mjs.map +0 -1
- package/dist-lib/chunks/panel-BCUixETK.mjs.map +0 -1
- package/dist-lib/chunks/panel-pOXMw6a-.cjs.map +0 -1
package/dist-lib/index.cjs
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const panel = require("./chunks/panel-
|
|
4
|
-
const appShell = require("./chunks/app-shell-
|
|
5
|
-
const chipGroup = require("./chunks/chip-group-2-f_Yo7Y.cjs");
|
|
3
|
+
const panel = require("./chunks/panel-B_SSIEDs.cjs");
|
|
4
|
+
const appShell = require("./chunks/app-shell-Cyh8AUJT.cjs");
|
|
6
5
|
const jsxRuntime = require("react/jsx-runtime");
|
|
7
6
|
const React = require("react");
|
|
8
|
-
const badge = require("./chunks/badge-gU2wtxrn.cjs");
|
|
9
7
|
const lucideReact = require("lucide-react");
|
|
10
|
-
const
|
|
8
|
+
const SeparatorPrimitive = require("@radix-ui/react-separator");
|
|
9
|
+
const input = require("./chunks/input-BjUSWce3.cjs");
|
|
10
|
+
const kpiDelta = require("./chunks/kpi-delta-C_3V6uG6.cjs");
|
|
11
|
+
const pageHeader = require("./chunks/page-header-D0rpU0yn.cjs");
|
|
11
12
|
const TooltipPrimitive = require("@radix-ui/react-tooltip");
|
|
12
13
|
const CollapsiblePrimitive = require("@radix-ui/react-collapsible");
|
|
13
|
-
const input = require("./chunks/input-BWevV7up.cjs");
|
|
14
14
|
function _interopNamespaceDefault(e) {
|
|
15
15
|
const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
|
|
16
16
|
if (e) {
|
|
@@ -28,9 +28,10 @@ function _interopNamespaceDefault(e) {
|
|
|
28
28
|
return Object.freeze(n);
|
|
29
29
|
}
|
|
30
30
|
const React__namespace = /* @__PURE__ */ _interopNamespaceDefault(React);
|
|
31
|
+
const SeparatorPrimitive__namespace = /* @__PURE__ */ _interopNamespaceDefault(SeparatorPrimitive);
|
|
31
32
|
const TooltipPrimitive__namespace = /* @__PURE__ */ _interopNamespaceDefault(TooltipPrimitive);
|
|
32
33
|
const CollapsiblePrimitive__namespace = /* @__PURE__ */ _interopNamespaceDefault(CollapsiblePrimitive);
|
|
33
|
-
const cardCheckbox =
|
|
34
|
+
const cardCheckbox = appShell.tv({
|
|
34
35
|
slots: {
|
|
35
36
|
root: [
|
|
36
37
|
"flex items-center gap-gp-lg w-full",
|
|
@@ -80,7 +81,7 @@ const CardCheckbox = React.forwardRef(
|
|
|
80
81
|
className: [styles2.root(), className].filter(Boolean).join(" "),
|
|
81
82
|
children: [
|
|
82
83
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
83
|
-
|
|
84
|
+
panel.Checkbox,
|
|
84
85
|
{
|
|
85
86
|
ref,
|
|
86
87
|
id: autoId,
|
|
@@ -100,6 +101,671 @@ const CardCheckbox = React.forwardRef(
|
|
|
100
101
|
}
|
|
101
102
|
);
|
|
102
103
|
CardCheckbox.displayName = "CardCheckbox";
|
|
104
|
+
const Separator = React__namespace.forwardRef(
|
|
105
|
+
({ className, orientation = "horizontal", decorative = true, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
106
|
+
SeparatorPrimitive__namespace.Root,
|
|
107
|
+
{
|
|
108
|
+
ref,
|
|
109
|
+
decorative,
|
|
110
|
+
orientation,
|
|
111
|
+
className: appShell.cn(
|
|
112
|
+
"shrink-0 bg-border",
|
|
113
|
+
orientation === "horizontal" ? "h-[1px] w-full" : "h-full w-[1px]",
|
|
114
|
+
className
|
|
115
|
+
),
|
|
116
|
+
...props
|
|
117
|
+
}
|
|
118
|
+
)
|
|
119
|
+
);
|
|
120
|
+
Separator.displayName = SeparatorPrimitive__namespace.Root.displayName;
|
|
121
|
+
const badgeVariants = appShell.tv({
|
|
122
|
+
base: [
|
|
123
|
+
"inline-flex items-center justify-center",
|
|
124
|
+
"border border-transparent",
|
|
125
|
+
"font-semibold leading-none whitespace-nowrap",
|
|
126
|
+
"transition-colors",
|
|
127
|
+
"focus-visible:outline-none focus-visible:ring-4 focus-visible:ring-ring-secondary",
|
|
128
|
+
"[&_svg]:pointer-events-none [&_svg]:shrink-0"
|
|
129
|
+
],
|
|
130
|
+
variants: {
|
|
131
|
+
color: {
|
|
132
|
+
primary: "",
|
|
133
|
+
secondary: "",
|
|
134
|
+
critical: "",
|
|
135
|
+
success: "",
|
|
136
|
+
warning: "",
|
|
137
|
+
info: ""
|
|
138
|
+
},
|
|
139
|
+
variant: {
|
|
140
|
+
solid: "",
|
|
141
|
+
soft: "",
|
|
142
|
+
outline: "bg-transparent",
|
|
143
|
+
ghost: "bg-transparent border-transparent"
|
|
144
|
+
},
|
|
145
|
+
size: {
|
|
146
|
+
sm: "h-comp-2xs px-pad-sm text-caption-xs gap-gp-2xs [&_svg]:size-3",
|
|
147
|
+
// 20px / 6 / 10
|
|
148
|
+
md: "h-comp-xs px-pad-md text-body-xs gap-gp-xs [&_svg]:size-3.5",
|
|
149
|
+
// 24px / 8 / 12 (default)
|
|
150
|
+
lg: "h-comp-sm px-pad-lg text-body-sm font-normal gap-gp-sm [&_svg]:size-4"
|
|
151
|
+
// 28px / 10 / 13
|
|
152
|
+
},
|
|
153
|
+
shape: {
|
|
154
|
+
default: "rounded-radius-sm",
|
|
155
|
+
// 6px — counter, value tags
|
|
156
|
+
pill: "rounded-radius-full"
|
|
157
|
+
// pill — status chips
|
|
158
|
+
}
|
|
159
|
+
},
|
|
160
|
+
compoundVariants: [
|
|
161
|
+
/* ── Primary (brand) ─────────────────────────────────────────────── */
|
|
162
|
+
{ color: "primary", variant: "solid", class: "bg-bg-brand text-fg-on-brand" },
|
|
163
|
+
{ color: "primary", variant: "soft", class: "bg-bg-brand-subtle text-fg-brand" },
|
|
164
|
+
{ color: "primary", variant: "outline", class: "border-border-brand text-fg-brand" },
|
|
165
|
+
{ color: "primary", variant: "ghost", class: "text-fg-brand" },
|
|
166
|
+
/* ── Secondary (neutral) ─────────────────────────────────────────── */
|
|
167
|
+
{ color: "secondary", variant: "solid", class: "bg-bg-emphasis text-fg-default" },
|
|
168
|
+
{ color: "secondary", variant: "soft", class: "bg-bg-muted text-fg-muted" },
|
|
169
|
+
{ color: "secondary", variant: "outline", class: "border-border-default text-fg-default" },
|
|
170
|
+
{ color: "secondary", variant: "ghost", class: "text-fg-muted" },
|
|
171
|
+
/* ── Critical (danger) ───────────────────────────────────────────── */
|
|
172
|
+
{ color: "critical", variant: "solid", class: "bg-bg-danger text-fg-on-danger" },
|
|
173
|
+
{ color: "critical", variant: "soft", class: "bg-bg-danger-muted text-fg-danger" },
|
|
174
|
+
{ color: "critical", variant: "outline", class: "border-border-danger-muted text-fg-danger" },
|
|
175
|
+
{ color: "critical", variant: "ghost", class: "text-fg-danger" },
|
|
176
|
+
/* ── Success ─────────────────────────────────────────────────────── */
|
|
177
|
+
{ color: "success", variant: "solid", class: "bg-bg-success text-fg-on-success" },
|
|
178
|
+
{ color: "success", variant: "soft", class: "bg-bg-success-muted text-fg-success" },
|
|
179
|
+
{ color: "success", variant: "outline", class: "border-border-success-muted text-fg-success" },
|
|
180
|
+
{ color: "success", variant: "ghost", class: "text-fg-success" },
|
|
181
|
+
/* ── Warning ─────────────────────────────────────────────────────── */
|
|
182
|
+
{ color: "warning", variant: "solid", class: "bg-bg-warning text-fg-on-warning" },
|
|
183
|
+
{ color: "warning", variant: "soft", class: "bg-bg-warning-muted text-fg-warning" },
|
|
184
|
+
{ color: "warning", variant: "outline", class: "border-border-warning-muted text-fg-warning" },
|
|
185
|
+
{ color: "warning", variant: "ghost", class: "text-fg-warning" },
|
|
186
|
+
/* ── Info ────────────────────────────────────────────────────────── */
|
|
187
|
+
{ color: "info", variant: "solid", class: "bg-bg-info text-fg-on-info" },
|
|
188
|
+
{ color: "info", variant: "soft", class: "bg-bg-info-muted text-fg-info" },
|
|
189
|
+
{ color: "info", variant: "outline", class: "border-border-info-muted text-fg-info" },
|
|
190
|
+
{ color: "info", variant: "ghost", class: "text-fg-info" }
|
|
191
|
+
],
|
|
192
|
+
defaultVariants: {
|
|
193
|
+
color: "secondary",
|
|
194
|
+
variant: "soft",
|
|
195
|
+
size: "md",
|
|
196
|
+
shape: "default"
|
|
197
|
+
}
|
|
198
|
+
});
|
|
199
|
+
function Badge({ className, color, variant, size, shape, ...props }) {
|
|
200
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
201
|
+
"span",
|
|
202
|
+
{
|
|
203
|
+
className: badgeVariants({ color, variant, size, shape, className }),
|
|
204
|
+
...props
|
|
205
|
+
}
|
|
206
|
+
);
|
|
207
|
+
}
|
|
208
|
+
const colorPickerStyles = appShell.tv({
|
|
209
|
+
slots: {
|
|
210
|
+
root: "inline-flex w-full items-center gap-gp-md",
|
|
211
|
+
swatch: [
|
|
212
|
+
"relative inline-flex shrink-0 items-center justify-center",
|
|
213
|
+
"rounded-radius-md border",
|
|
214
|
+
"transition-[border-color,box-shadow]",
|
|
215
|
+
"focus-visible:outline-none focus-visible:ring-4 focus-visible:ring-ring-brand",
|
|
216
|
+
// opacity do disabled vem do slot root (cobre tudo uniformemente) — não duplicar aqui
|
|
217
|
+
"disabled:cursor-not-allowed"
|
|
218
|
+
],
|
|
219
|
+
hexInput: "flex-1",
|
|
220
|
+
content: "flex flex-col gap-gp-lg p-sp-md min-w-container-dropdown-lg",
|
|
221
|
+
presetsGrid: "grid grid-cols-10 gap-gp-sm",
|
|
222
|
+
preset: [
|
|
223
|
+
"relative inline-flex items-center justify-center",
|
|
224
|
+
"size-comp-xs rounded-radius-md border border-border-input",
|
|
225
|
+
"transition-[box-shadow,border-color]",
|
|
226
|
+
"hover:border-border-brand",
|
|
227
|
+
"focus-visible:outline-none focus-visible:ring-4 focus-visible:ring-ring-brand"
|
|
228
|
+
],
|
|
229
|
+
presetCheck: "size-icon-sm",
|
|
230
|
+
customRow: "flex flex-col gap-gp-md"
|
|
231
|
+
},
|
|
232
|
+
variants: {
|
|
233
|
+
size: {
|
|
234
|
+
sm: { swatch: "size-form-md" },
|
|
235
|
+
md: { swatch: "size-form-lg" }
|
|
236
|
+
},
|
|
237
|
+
state: {
|
|
238
|
+
default: { swatch: "border-border-input hover:border-border-brand" },
|
|
239
|
+
error: { swatch: "border-border-danger-muted" },
|
|
240
|
+
warning: { swatch: "border-border-warning-muted" },
|
|
241
|
+
success: { swatch: "border-border-success-muted" }
|
|
242
|
+
},
|
|
243
|
+
disabled: {
|
|
244
|
+
true: { root: "pointer-events-none opacity-50" }
|
|
245
|
+
}
|
|
246
|
+
},
|
|
247
|
+
compoundVariants: [
|
|
248
|
+
// disabled SEMPRE por último (L-006)
|
|
249
|
+
{
|
|
250
|
+
disabled: true,
|
|
251
|
+
class: { swatch: "border-border-input hover:border-border-input" }
|
|
252
|
+
}
|
|
253
|
+
],
|
|
254
|
+
defaultVariants: {
|
|
255
|
+
size: "md",
|
|
256
|
+
state: "default",
|
|
257
|
+
disabled: false
|
|
258
|
+
}
|
|
259
|
+
});
|
|
260
|
+
const DEFAULT_COLOR_PRESETS = [
|
|
261
|
+
// Marca iGreen — verdes
|
|
262
|
+
"#0E7C3A",
|
|
263
|
+
"#16A34A",
|
|
264
|
+
"#22C55E",
|
|
265
|
+
"#4ADE80",
|
|
266
|
+
"#86EFAC",
|
|
267
|
+
// Frios
|
|
268
|
+
"#0891B2",
|
|
269
|
+
"#06B6D4",
|
|
270
|
+
"#0EA5E9",
|
|
271
|
+
"#2563EB",
|
|
272
|
+
"#4F46E5",
|
|
273
|
+
// Roxos / rosas
|
|
274
|
+
"#7C3AED",
|
|
275
|
+
"#9333EA",
|
|
276
|
+
"#C026D3",
|
|
277
|
+
"#DB2777",
|
|
278
|
+
"#F43F5E",
|
|
279
|
+
// Quentes
|
|
280
|
+
"#DC2626",
|
|
281
|
+
"#EA580C",
|
|
282
|
+
"#F97316",
|
|
283
|
+
"#F59E0B",
|
|
284
|
+
"#FACC15",
|
|
285
|
+
// Neutras
|
|
286
|
+
"#FFFFFF",
|
|
287
|
+
"#E5E7EB",
|
|
288
|
+
"#9CA3AF",
|
|
289
|
+
"#6B7280",
|
|
290
|
+
"#374151",
|
|
291
|
+
"#111827"
|
|
292
|
+
];
|
|
293
|
+
function normalizeHex(raw) {
|
|
294
|
+
let h = raw.trim().replace(/^#/, "");
|
|
295
|
+
if (/^[0-9a-fA-F]{3}$/.test(h)) {
|
|
296
|
+
h = h.split("").map((c) => c + c).join("");
|
|
297
|
+
}
|
|
298
|
+
if (/^[0-9a-fA-F]{6}$/.test(h)) {
|
|
299
|
+
return `#${h.toUpperCase()}`;
|
|
300
|
+
}
|
|
301
|
+
return null;
|
|
302
|
+
}
|
|
303
|
+
function sameHex(a, b) {
|
|
304
|
+
const na = normalizeHex(a);
|
|
305
|
+
const nb = normalizeHex(b);
|
|
306
|
+
return na !== null && nb !== null && na === nb;
|
|
307
|
+
}
|
|
308
|
+
const ColorPicker = React.forwardRef(
|
|
309
|
+
function ColorPicker2({
|
|
310
|
+
value,
|
|
311
|
+
onValueChange,
|
|
312
|
+
presets = DEFAULT_COLOR_PRESETS,
|
|
313
|
+
id: idProp,
|
|
314
|
+
state = "default",
|
|
315
|
+
size = "md",
|
|
316
|
+
disabled = false,
|
|
317
|
+
allowCustomHex = true,
|
|
318
|
+
placeholder = "#RRGGBB",
|
|
319
|
+
open: openProp,
|
|
320
|
+
onOpenChange,
|
|
321
|
+
className
|
|
322
|
+
}, ref) {
|
|
323
|
+
const autoId = React.useId();
|
|
324
|
+
const id = idProp ?? autoId;
|
|
325
|
+
const [uncontrolledOpen, setUncontrolledOpen] = React.useState(false);
|
|
326
|
+
const isControlled = openProp !== void 0;
|
|
327
|
+
const open = isControlled ? openProp : uncontrolledOpen;
|
|
328
|
+
const setOpen = (next) => {
|
|
329
|
+
if (!isControlled) setUncontrolledOpen(next);
|
|
330
|
+
onOpenChange?.(next);
|
|
331
|
+
};
|
|
332
|
+
const [inlineDraft, setInlineDraft] = React.useState(value);
|
|
333
|
+
const [customDraft, setCustomDraft] = React.useState(value);
|
|
334
|
+
const styles2 = colorPickerStyles({ size, state, disabled });
|
|
335
|
+
const commit = (raw) => {
|
|
336
|
+
const norm = normalizeHex(raw);
|
|
337
|
+
if (!norm) return false;
|
|
338
|
+
onValueChange(norm);
|
|
339
|
+
return true;
|
|
340
|
+
};
|
|
341
|
+
const handleInlineCommit = () => {
|
|
342
|
+
if (!commit(inlineDraft)) {
|
|
343
|
+
setInlineDraft(value);
|
|
344
|
+
}
|
|
345
|
+
};
|
|
346
|
+
const handlePreset = (hex) => {
|
|
347
|
+
const norm = normalizeHex(hex);
|
|
348
|
+
if (!norm) return;
|
|
349
|
+
onValueChange(norm);
|
|
350
|
+
setInlineDraft(norm);
|
|
351
|
+
setCustomDraft(norm);
|
|
352
|
+
setOpen(false);
|
|
353
|
+
};
|
|
354
|
+
const handleCustomConfirm = () => {
|
|
355
|
+
const norm = normalizeHex(customDraft);
|
|
356
|
+
if (!norm) return;
|
|
357
|
+
onValueChange(norm);
|
|
358
|
+
setInlineDraft(norm);
|
|
359
|
+
setOpen(false);
|
|
360
|
+
};
|
|
361
|
+
const swatchBg = normalizeHex(value) ?? "transparent";
|
|
362
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(appShell.Popover, { open, onOpenChange: setOpen, children: [
|
|
363
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles2.root({ className }), children: [
|
|
364
|
+
/* @__PURE__ */ jsxRuntime.jsx(appShell.PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
365
|
+
"button",
|
|
366
|
+
{
|
|
367
|
+
ref,
|
|
368
|
+
type: "button",
|
|
369
|
+
disabled,
|
|
370
|
+
"aria-label": "Selecionar cor",
|
|
371
|
+
"aria-haspopup": "dialog",
|
|
372
|
+
"aria-expanded": open,
|
|
373
|
+
className: styles2.swatch(),
|
|
374
|
+
style: { backgroundColor: swatchBg }
|
|
375
|
+
}
|
|
376
|
+
) }),
|
|
377
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
378
|
+
input.Input,
|
|
379
|
+
{
|
|
380
|
+
id,
|
|
381
|
+
type: "text",
|
|
382
|
+
inputMode: "text",
|
|
383
|
+
size,
|
|
384
|
+
state,
|
|
385
|
+
disabled,
|
|
386
|
+
placeholder,
|
|
387
|
+
"aria-label": "Cor hexadecimal",
|
|
388
|
+
className: styles2.hexInput(),
|
|
389
|
+
value: inlineDraft,
|
|
390
|
+
onChange: (e) => setInlineDraft(e.target.value),
|
|
391
|
+
onBlur: handleInlineCommit,
|
|
392
|
+
onKeyDown: (e) => {
|
|
393
|
+
if (e.key === "Enter") {
|
|
394
|
+
e.preventDefault();
|
|
395
|
+
handleInlineCommit();
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
)
|
|
400
|
+
] }),
|
|
401
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
402
|
+
appShell.PopoverContent,
|
|
403
|
+
{
|
|
404
|
+
align: "start",
|
|
405
|
+
mobileSheet: true,
|
|
406
|
+
role: "dialog",
|
|
407
|
+
"aria-label": "Paleta de cores",
|
|
408
|
+
className: styles2.content(),
|
|
409
|
+
children: [
|
|
410
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
411
|
+
"div",
|
|
412
|
+
{
|
|
413
|
+
className: styles2.presetsGrid(),
|
|
414
|
+
role: "group",
|
|
415
|
+
"aria-label": "Cores predefinidas",
|
|
416
|
+
children: presets.map((hex) => {
|
|
417
|
+
const norm = normalizeHex(hex) ?? hex;
|
|
418
|
+
const selected = sameHex(hex, value);
|
|
419
|
+
const checkColor = panel.getContrastTextColor(hex);
|
|
420
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
421
|
+
"button",
|
|
422
|
+
{
|
|
423
|
+
type: "button",
|
|
424
|
+
"aria-label": norm,
|
|
425
|
+
"aria-pressed": selected,
|
|
426
|
+
className: styles2.preset(),
|
|
427
|
+
style: { backgroundColor: norm },
|
|
428
|
+
onClick: () => handlePreset(hex),
|
|
429
|
+
children: selected && /* @__PURE__ */ jsxRuntime.jsx(
|
|
430
|
+
lucideReact.Check,
|
|
431
|
+
{
|
|
432
|
+
className: styles2.presetCheck(),
|
|
433
|
+
style: { color: checkColor },
|
|
434
|
+
"aria-hidden": "true"
|
|
435
|
+
}
|
|
436
|
+
)
|
|
437
|
+
},
|
|
438
|
+
norm
|
|
439
|
+
);
|
|
440
|
+
})
|
|
441
|
+
}
|
|
442
|
+
),
|
|
443
|
+
allowCustomHex && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
444
|
+
/* @__PURE__ */ jsxRuntime.jsx(Separator, {}),
|
|
445
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles2.customRow(), children: [
|
|
446
|
+
/* @__PURE__ */ jsxRuntime.jsx(panel.FormField, { label: "Cor personalizada", id: `${id}-custom`, children: ({ id: customId }) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
447
|
+
input.Input,
|
|
448
|
+
{
|
|
449
|
+
id: customId,
|
|
450
|
+
type: "text",
|
|
451
|
+
size,
|
|
452
|
+
placeholder,
|
|
453
|
+
"aria-label": "Cor hexadecimal",
|
|
454
|
+
value: customDraft,
|
|
455
|
+
onChange: (e) => setCustomDraft(e.target.value),
|
|
456
|
+
onKeyDown: (e) => {
|
|
457
|
+
if (e.key === "Enter") {
|
|
458
|
+
e.preventDefault();
|
|
459
|
+
handleCustomConfirm();
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
}
|
|
463
|
+
) }),
|
|
464
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
465
|
+
appShell.Button,
|
|
466
|
+
{
|
|
467
|
+
type: "button",
|
|
468
|
+
size: "sm",
|
|
469
|
+
fullWidth: true,
|
|
470
|
+
disabled: normalizeHex(customDraft) === null,
|
|
471
|
+
onClick: handleCustomConfirm,
|
|
472
|
+
children: "Aplicar"
|
|
473
|
+
}
|
|
474
|
+
)
|
|
475
|
+
] })
|
|
476
|
+
] })
|
|
477
|
+
]
|
|
478
|
+
}
|
|
479
|
+
)
|
|
480
|
+
] });
|
|
481
|
+
}
|
|
482
|
+
);
|
|
483
|
+
const markdownTextStyles = appShell.tv({
|
|
484
|
+
slots: {
|
|
485
|
+
root: "text-body-sm text-fg-default break-words",
|
|
486
|
+
strong: "font-semibold",
|
|
487
|
+
em: "italic",
|
|
488
|
+
strike: "line-through",
|
|
489
|
+
code: "font-mono bg-bg-muted rounded-radius-xs px-pad-md text-fg-default",
|
|
490
|
+
link: "text-fg-brand underline underline-offset-2 break-all hover:opacity-80"
|
|
491
|
+
},
|
|
492
|
+
variants: {
|
|
493
|
+
inline: {
|
|
494
|
+
true: { root: "whitespace-normal" },
|
|
495
|
+
false: { root: "whitespace-pre-wrap" }
|
|
496
|
+
}
|
|
497
|
+
},
|
|
498
|
+
defaultVariants: {
|
|
499
|
+
inline: false
|
|
500
|
+
}
|
|
501
|
+
});
|
|
502
|
+
const CODE_RE = /```([\s\S]+?)```|`([^`]+?)`/g;
|
|
503
|
+
const URL_RE = /((?:https?:\/\/|www\.)[^\s<>()]+[^\s<>().,!?;:'"])/g;
|
|
504
|
+
function parseInline(text, s, prefix) {
|
|
505
|
+
const markers = [
|
|
506
|
+
{ re: /\*([^*\n]+?)\*/, slot: "strong", el: "strong" },
|
|
507
|
+
{ re: /_([^_\n]+?)_/, slot: "em", el: "em" },
|
|
508
|
+
{ re: /~([^~\n]+?)~/, slot: "strike", el: "span" }
|
|
509
|
+
];
|
|
510
|
+
for (const { re, slot, el } of markers) {
|
|
511
|
+
const m = re.exec(text);
|
|
512
|
+
if (!m || m.index === void 0) continue;
|
|
513
|
+
const before = text.slice(0, m.index);
|
|
514
|
+
const inner = m[1];
|
|
515
|
+
const after = text.slice(m.index + m[0].length);
|
|
516
|
+
const Tag = el;
|
|
517
|
+
const className = slot === "strong" ? s.strong() : slot === "em" ? s.em() : s.strike();
|
|
518
|
+
return [
|
|
519
|
+
...parseInline(before, s, `${prefix}-b`),
|
|
520
|
+
/* @__PURE__ */ jsxRuntime.jsx(Tag, { className, children: parseInline(inner, s, `${prefix}-i`) }, `${prefix}-${slot}`),
|
|
521
|
+
...parseInline(after, s, `${prefix}-a`)
|
|
522
|
+
];
|
|
523
|
+
}
|
|
524
|
+
return text ? [text] : [];
|
|
525
|
+
}
|
|
526
|
+
function parseLinksAndInline(text, s, prefix) {
|
|
527
|
+
const out = [];
|
|
528
|
+
let last = 0;
|
|
529
|
+
let i = 0;
|
|
530
|
+
URL_RE.lastIndex = 0;
|
|
531
|
+
let m;
|
|
532
|
+
while ((m = URL_RE.exec(text)) !== null) {
|
|
533
|
+
if (m.index > last) {
|
|
534
|
+
out.push(...parseInline(text.slice(last, m.index), s, `${prefix}-${i}t`));
|
|
535
|
+
}
|
|
536
|
+
const raw = m[0];
|
|
537
|
+
const href = raw.startsWith("www.") ? `https://${raw}` : raw;
|
|
538
|
+
out.push(
|
|
539
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
540
|
+
"a",
|
|
541
|
+
{
|
|
542
|
+
href,
|
|
543
|
+
target: "_blank",
|
|
544
|
+
rel: "noopener noreferrer",
|
|
545
|
+
className: s.link(),
|
|
546
|
+
children: raw
|
|
547
|
+
},
|
|
548
|
+
`${prefix}-${i}link`
|
|
549
|
+
)
|
|
550
|
+
);
|
|
551
|
+
last = m.index + raw.length;
|
|
552
|
+
i += 1;
|
|
553
|
+
}
|
|
554
|
+
if (last < text.length) {
|
|
555
|
+
out.push(...parseInline(text.slice(last), s, `${prefix}-${i}t`));
|
|
556
|
+
}
|
|
557
|
+
return out;
|
|
558
|
+
}
|
|
559
|
+
function parseMarkdown(source, s) {
|
|
560
|
+
const out = [];
|
|
561
|
+
let last = 0;
|
|
562
|
+
let i = 0;
|
|
563
|
+
CODE_RE.lastIndex = 0;
|
|
564
|
+
let m;
|
|
565
|
+
while ((m = CODE_RE.exec(source)) !== null) {
|
|
566
|
+
if (m.index > last) {
|
|
567
|
+
out.push(...parseLinksAndInline(source.slice(last, m.index), s, `${i}t`));
|
|
568
|
+
}
|
|
569
|
+
const codeContent = m[1] ?? m[2] ?? "";
|
|
570
|
+
out.push(
|
|
571
|
+
/* @__PURE__ */ jsxRuntime.jsx("code", { className: s.code(), children: codeContent }, `${i}code`)
|
|
572
|
+
);
|
|
573
|
+
last = m.index + m[0].length;
|
|
574
|
+
i += 1;
|
|
575
|
+
}
|
|
576
|
+
if (last < source.length) {
|
|
577
|
+
out.push(...parseLinksAndInline(source.slice(last), s, `${i}t`));
|
|
578
|
+
}
|
|
579
|
+
return out;
|
|
580
|
+
}
|
|
581
|
+
function MarkdownText({
|
|
582
|
+
children,
|
|
583
|
+
inline = false,
|
|
584
|
+
className
|
|
585
|
+
}) {
|
|
586
|
+
const styles2 = markdownTextStyles({ inline });
|
|
587
|
+
const source = inline ? children.replace(/\s+/g, " ").trim() : children;
|
|
588
|
+
const nodes = parseMarkdown(source, styles2);
|
|
589
|
+
const content = nodes.map((node, i) => /* @__PURE__ */ jsxRuntime.jsx(React.Fragment, { children: node }, i));
|
|
590
|
+
if (inline) {
|
|
591
|
+
return /* @__PURE__ */ jsxRuntime.jsx("span", { className: styles2.root({ className }), children: content });
|
|
592
|
+
}
|
|
593
|
+
return /* @__PURE__ */ jsxRuntime.jsx("p", { className: styles2.root({ className }), children: content });
|
|
594
|
+
}
|
|
595
|
+
const conversationListItemStyles = appShell.tv({
|
|
596
|
+
slots: {
|
|
597
|
+
root: [
|
|
598
|
+
"group/cli relative w-full text-left",
|
|
599
|
+
"grid grid-cols-[auto_minmax(0,1fr)_auto] items-start",
|
|
600
|
+
"gap-gp-lg px-pad-2xl",
|
|
601
|
+
"rounded-radius-md border border-transparent",
|
|
602
|
+
"transition-[background-color,box-shadow] duration-150",
|
|
603
|
+
// stripe de seleção (oculto por padrão)
|
|
604
|
+
"before:content-[''] before:absolute before:left-0 before:top-0 before:bottom-0",
|
|
605
|
+
"before:w-[3px] before:rounded-r-radius-xs before:bg-transparent",
|
|
606
|
+
"before:transition-colors before:pointer-events-none",
|
|
607
|
+
// hover
|
|
608
|
+
"hover:bg-bg-muted",
|
|
609
|
+
// foco (Padrão 1)
|
|
610
|
+
"focus-visible:outline-none focus-visible:ring-4 focus-visible:ring-ring-brand"
|
|
611
|
+
],
|
|
612
|
+
media: "flex shrink-0 items-center",
|
|
613
|
+
body: "flex min-w-0 flex-col gap-gp-xs",
|
|
614
|
+
topRow: "flex min-w-0 items-center gap-gp-md",
|
|
615
|
+
title: "min-w-0 flex-1 truncate text-body-sm font-semibold text-fg-default",
|
|
616
|
+
time: "shrink-0 text-caption-sm text-fg-muted [font-variant-numeric:tabular-nums]",
|
|
617
|
+
preview: "min-w-0 text-body-xs text-fg-muted [&_*]:line-clamp-1 line-clamp-1",
|
|
618
|
+
badges: "flex flex-wrap items-center gap-gp-xs",
|
|
619
|
+
trailing: "flex shrink-0 flex-col items-end gap-gp-xs",
|
|
620
|
+
unread: [
|
|
621
|
+
// count-badge: dimensões finas alinhadas ao padrão de contadores do DS
|
|
622
|
+
// (Chip/Table usam min-w-[18px] h-[18px] px-[5px] — exceção posicional fina)
|
|
623
|
+
"inline-flex items-center justify-center",
|
|
624
|
+
"min-w-[18px] h-[18px] px-[5px]",
|
|
625
|
+
"rounded-radius-full",
|
|
626
|
+
"bg-bg-danger text-fg-on-danger",
|
|
627
|
+
"text-caption-xs font-semibold [font-variant-numeric:tabular-nums]"
|
|
628
|
+
],
|
|
629
|
+
actions: [
|
|
630
|
+
"flex items-center gap-gp-xs",
|
|
631
|
+
// revelado no hover/focus-within da linha
|
|
632
|
+
"opacity-0 transition-opacity duration-150",
|
|
633
|
+
"group-hover/cli:opacity-100 group-focus-within/cli:opacity-100"
|
|
634
|
+
]
|
|
635
|
+
},
|
|
636
|
+
variants: {
|
|
637
|
+
variant: {
|
|
638
|
+
// ticket: layout completo (badges + ações), default
|
|
639
|
+
ticket: {},
|
|
640
|
+
// chat: lista mais simples (DM-style) — body um pouco mais apertado
|
|
641
|
+
chat: { body: "gap-gp-2xs" }
|
|
642
|
+
},
|
|
643
|
+
density: {
|
|
644
|
+
comfortable: { root: "py-pad-lg", media: "py-[2px]" },
|
|
645
|
+
compact: { root: "py-pad-md" }
|
|
646
|
+
},
|
|
647
|
+
selected: {
|
|
648
|
+
true: { root: "bg-bg-muted before:bg-bg-brand" },
|
|
649
|
+
false: {}
|
|
650
|
+
},
|
|
651
|
+
unread: {
|
|
652
|
+
true: { title: "font-bold text-fg-default", preview: "text-fg-default font-medium" },
|
|
653
|
+
false: {}
|
|
654
|
+
},
|
|
655
|
+
disabled: {
|
|
656
|
+
true: { root: "pointer-events-none opacity-50 cursor-not-allowed" },
|
|
657
|
+
false: {}
|
|
658
|
+
}
|
|
659
|
+
},
|
|
660
|
+
compoundVariants: [
|
|
661
|
+
// disabled SEMPRE por último (L-006)
|
|
662
|
+
{
|
|
663
|
+
disabled: true,
|
|
664
|
+
class: {
|
|
665
|
+
root: "hover:bg-transparent before:bg-transparent",
|
|
666
|
+
actions: "opacity-0"
|
|
667
|
+
}
|
|
668
|
+
}
|
|
669
|
+
],
|
|
670
|
+
defaultVariants: {
|
|
671
|
+
variant: "ticket",
|
|
672
|
+
density: "comfortable",
|
|
673
|
+
selected: false,
|
|
674
|
+
unread: false,
|
|
675
|
+
disabled: false
|
|
676
|
+
}
|
|
677
|
+
});
|
|
678
|
+
function initialsFromName(name) {
|
|
679
|
+
if (!name) return "";
|
|
680
|
+
const parts = name.trim().split(/\s+/).filter(Boolean);
|
|
681
|
+
if (parts.length === 0) return "";
|
|
682
|
+
if (parts.length === 1) return parts[0].slice(0, 2).toUpperCase();
|
|
683
|
+
return (parts[0][0] + parts[parts.length - 1][0]).toUpperCase();
|
|
684
|
+
}
|
|
685
|
+
function isAvatarData(value) {
|
|
686
|
+
return typeof value === "object" && value !== null && !React.isValidElement(value) && ("src" in value || "name" in value || "colorHex" in value);
|
|
687
|
+
}
|
|
688
|
+
const ConversationListItem = React.forwardRef(function ConversationListItem2({
|
|
689
|
+
title: title2,
|
|
690
|
+
avatar,
|
|
691
|
+
preview,
|
|
692
|
+
time,
|
|
693
|
+
badges,
|
|
694
|
+
unread,
|
|
695
|
+
variant = "ticket",
|
|
696
|
+
density = "comfortable",
|
|
697
|
+
selected = false,
|
|
698
|
+
disabled = false,
|
|
699
|
+
actions,
|
|
700
|
+
onClick,
|
|
701
|
+
className
|
|
702
|
+
}, ref) {
|
|
703
|
+
const hasUnread = typeof unread === "number" && unread > 0;
|
|
704
|
+
const styles2 = conversationListItemStyles({
|
|
705
|
+
variant,
|
|
706
|
+
density,
|
|
707
|
+
selected,
|
|
708
|
+
unread: hasUnread,
|
|
709
|
+
disabled
|
|
710
|
+
});
|
|
711
|
+
const interactive = !disabled && typeof onClick === "function";
|
|
712
|
+
const handleKeyDown = (e) => {
|
|
713
|
+
if (!interactive) return;
|
|
714
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
715
|
+
e.preventDefault();
|
|
716
|
+
onClick?.();
|
|
717
|
+
}
|
|
718
|
+
};
|
|
719
|
+
const stopActions = (e) => e.stopPropagation();
|
|
720
|
+
let avatarNode = null;
|
|
721
|
+
if (avatar != null) {
|
|
722
|
+
if (isAvatarData(avatar)) {
|
|
723
|
+
const { src, name, colorHex } = avatar;
|
|
724
|
+
const label = name ?? title2;
|
|
725
|
+
avatarNode = /* @__PURE__ */ jsxRuntime.jsx(panel.Avatar, { size: "lg", colorHex, "aria-label": label, children: src ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
726
|
+
"img",
|
|
727
|
+
{
|
|
728
|
+
src,
|
|
729
|
+
alt: "",
|
|
730
|
+
className: "size-full object-cover",
|
|
731
|
+
"aria-hidden": "true"
|
|
732
|
+
}
|
|
733
|
+
) : initialsFromName(name ?? title2) });
|
|
734
|
+
} else {
|
|
735
|
+
avatarNode = avatar;
|
|
736
|
+
}
|
|
737
|
+
}
|
|
738
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
739
|
+
"div",
|
|
740
|
+
{
|
|
741
|
+
ref,
|
|
742
|
+
className: styles2.root({
|
|
743
|
+
className: [interactive && "cursor-pointer", className].filter(Boolean).join(" ")
|
|
744
|
+
}),
|
|
745
|
+
onClick: interactive ? onClick : void 0,
|
|
746
|
+
onKeyDown: interactive ? handleKeyDown : void 0,
|
|
747
|
+
...interactive ? { role: "button", tabIndex: 0 } : {},
|
|
748
|
+
"aria-disabled": disabled || void 0,
|
|
749
|
+
"aria-current": selected ? "true" : void 0,
|
|
750
|
+
children: [
|
|
751
|
+
avatarNode && /* @__PURE__ */ jsxRuntime.jsx("span", { className: styles2.media(), children: avatarNode }),
|
|
752
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: styles2.body(), children: [
|
|
753
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: styles2.topRow(), children: [
|
|
754
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: styles2.title(), children: title2 }),
|
|
755
|
+
time && /* @__PURE__ */ jsxRuntime.jsx("span", { className: styles2.time(), children: time })
|
|
756
|
+
] }),
|
|
757
|
+
preview && /* @__PURE__ */ jsxRuntime.jsx(MarkdownText, { inline: true, className: styles2.preview(), children: preview }),
|
|
758
|
+
badges && /* @__PURE__ */ jsxRuntime.jsx("span", { className: styles2.badges(), children: badges })
|
|
759
|
+
] }),
|
|
760
|
+
(hasUnread || actions) && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: styles2.trailing(), children: [
|
|
761
|
+
hasUnread && /* @__PURE__ */ jsxRuntime.jsx("span", { className: styles2.unread(), "aria-label": `${unread} não lidas`, children: unread > 99 ? "99+" : unread }),
|
|
762
|
+
actions && /* @__PURE__ */ jsxRuntime.jsx("span", { className: styles2.actions(), onClick: stopActions, children: actions })
|
|
763
|
+
] })
|
|
764
|
+
]
|
|
765
|
+
}
|
|
766
|
+
);
|
|
767
|
+
});
|
|
768
|
+
ConversationListItem.displayName = "ConversationListItem";
|
|
103
769
|
const HIDDEN_AT = {
|
|
104
770
|
md: "md:hidden",
|
|
105
771
|
lg: "lg:hidden",
|
|
@@ -121,13 +787,13 @@ function ToolbarMobileDialog({
|
|
|
121
787
|
const setOpen = onOpenChange ?? setInternalOpen;
|
|
122
788
|
return /* @__PURE__ */ jsxRuntime.jsxs(appShell.Dialog, { open, onOpenChange: setOpen, children: [
|
|
123
789
|
/* @__PURE__ */ jsxRuntime.jsx(appShell.DialogTrigger, { asChild: true, children: trigger ?? /* @__PURE__ */ jsxRuntime.jsx(
|
|
124
|
-
|
|
790
|
+
appShell.Button,
|
|
125
791
|
{
|
|
126
792
|
color: "secondary",
|
|
127
793
|
variant: "outline",
|
|
128
794
|
size: "icon-md",
|
|
129
795
|
"aria-label": "Mais opções",
|
|
130
|
-
className:
|
|
796
|
+
className: appShell.cn(HIDDEN_AT[desktopBreakpoint], className),
|
|
131
797
|
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.MoreHorizontal, {})
|
|
132
798
|
}
|
|
133
799
|
) }),
|
|
@@ -136,7 +802,7 @@ function ToolbarMobileDialog({
|
|
|
136
802
|
{
|
|
137
803
|
hideClose: true,
|
|
138
804
|
"aria-describedby": void 0,
|
|
139
|
-
className:
|
|
805
|
+
className: appShell.cn(
|
|
140
806
|
// Visual alinhado com CommandDialog
|
|
141
807
|
"overflow-hidden p-0 gap-0 sm:max-w-[384px]",
|
|
142
808
|
"rounded-[12px] border border-border-default outline-float",
|
|
@@ -156,7 +822,7 @@ function ToolbarMobileSection({
|
|
|
156
822
|
children,
|
|
157
823
|
className
|
|
158
824
|
}) {
|
|
159
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("section", { className:
|
|
825
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("section", { className: appShell.cn("flex flex-col gap-gp-md", className), children: [
|
|
160
826
|
title2 && /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "text-body-xs font-medium text-fg-muted", children: title2 }),
|
|
161
827
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-col gap-gp-md", children })
|
|
162
828
|
] });
|
|
@@ -426,6 +1092,109 @@ function actionColumn(opts) {
|
|
|
426
1092
|
function customColumn(field, headerName, render, overrides) {
|
|
427
1093
|
return { field, headerName, render, ...overrides };
|
|
428
1094
|
}
|
|
1095
|
+
const formatFull = (date) => date.toLocaleDateString("pt-BR", {
|
|
1096
|
+
day: "2-digit",
|
|
1097
|
+
month: "long",
|
|
1098
|
+
year: "numeric"
|
|
1099
|
+
});
|
|
1100
|
+
const formatShort = (date) => date.toLocaleDateString("pt-BR", {
|
|
1101
|
+
day: "2-digit",
|
|
1102
|
+
month: "short",
|
|
1103
|
+
year: "numeric"
|
|
1104
|
+
});
|
|
1105
|
+
const DatePicker = React__namespace.forwardRef(
|
|
1106
|
+
(props, ref) => {
|
|
1107
|
+
const { placeholder, disabled, align = "start", className } = props;
|
|
1108
|
+
const [open, setOpen] = React__namespace.useState(false);
|
|
1109
|
+
let label = null;
|
|
1110
|
+
let calendar;
|
|
1111
|
+
if (props.mode === "range") {
|
|
1112
|
+
const v = props.value;
|
|
1113
|
+
label = v?.from ? v.to ? `${formatShort(v.from)} – ${formatShort(v.to)}` : formatShort(v.from) : null;
|
|
1114
|
+
calendar = /* @__PURE__ */ jsxRuntime.jsx(
|
|
1115
|
+
panel.Calendar,
|
|
1116
|
+
{
|
|
1117
|
+
mode: "range",
|
|
1118
|
+
min: 1,
|
|
1119
|
+
numberOfMonths: props.numberOfMonths ?? 2,
|
|
1120
|
+
selected: v,
|
|
1121
|
+
onSelect: (range) => {
|
|
1122
|
+
props.onValueChange?.(range);
|
|
1123
|
+
if (range?.from && range?.to) setOpen(false);
|
|
1124
|
+
},
|
|
1125
|
+
autoFocus: true
|
|
1126
|
+
}
|
|
1127
|
+
);
|
|
1128
|
+
} else if (props.mode === "multiple") {
|
|
1129
|
+
const v = props.value;
|
|
1130
|
+
label = v && v.length > 0 ? v.length === 1 ? "1 data selecionada" : `${v.length} datas selecionadas` : null;
|
|
1131
|
+
calendar = /* @__PURE__ */ jsxRuntime.jsx(
|
|
1132
|
+
panel.Calendar,
|
|
1133
|
+
{
|
|
1134
|
+
mode: "multiple",
|
|
1135
|
+
numberOfMonths: props.numberOfMonths,
|
|
1136
|
+
selected: v,
|
|
1137
|
+
onSelect: (dates) => props.onValueChange?.(dates),
|
|
1138
|
+
autoFocus: true
|
|
1139
|
+
}
|
|
1140
|
+
);
|
|
1141
|
+
} else {
|
|
1142
|
+
const v = props.value;
|
|
1143
|
+
label = v ? formatFull(v) : null;
|
|
1144
|
+
calendar = /* @__PURE__ */ jsxRuntime.jsx(
|
|
1145
|
+
panel.Calendar,
|
|
1146
|
+
{
|
|
1147
|
+
mode: "single",
|
|
1148
|
+
numberOfMonths: props.numberOfMonths,
|
|
1149
|
+
selected: v,
|
|
1150
|
+
onSelect: (date) => {
|
|
1151
|
+
props.onValueChange?.(date);
|
|
1152
|
+
setOpen(false);
|
|
1153
|
+
}
|
|
1154
|
+
}
|
|
1155
|
+
);
|
|
1156
|
+
}
|
|
1157
|
+
const text = label ?? placeholder ?? (props.mode === "range" ? "Selecione o período" : "Selecione a data");
|
|
1158
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(appShell.Popover, { open, onOpenChange: setOpen, children: [
|
|
1159
|
+
/* @__PURE__ */ jsxRuntime.jsx(appShell.PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1160
|
+
"button",
|
|
1161
|
+
{
|
|
1162
|
+
ref,
|
|
1163
|
+
type: "button",
|
|
1164
|
+
disabled,
|
|
1165
|
+
"data-placeholder": label ? void 0 : "",
|
|
1166
|
+
className: appShell.cn(
|
|
1167
|
+
// Trigger espelha o SelectTrigger (`shadcn/select.tsx`), que é o
|
|
1168
|
+
// precedente do DS pra "botão que tem que parecer input": mesmos
|
|
1169
|
+
// tokens de bg/border/radius/padding/gap e o mesmo tratamento de
|
|
1170
|
+
// foco (borda + shadow-sh-ring), em vez de `ring-4` de botão.
|
|
1171
|
+
// Antes divergia em 6 pontos — bg-surface (opaco) no lugar de
|
|
1172
|
+
// bg-input (translúcido), border-default, radius-md, pad-lg,
|
|
1173
|
+
// gp-sm e sem hover — e por isso não lia como campo de formulário.
|
|
1174
|
+
"flex min-h-form-lg w-full items-center gap-gp-md",
|
|
1175
|
+
"rounded-radius-lg px-pad-xl",
|
|
1176
|
+
"bg-bg-input dark:bg-bg-muted",
|
|
1177
|
+
"hover:bg-bg-input-hover dark:hover:bg-bg-muted-hover",
|
|
1178
|
+
"border border-border-input",
|
|
1179
|
+
"text-body-sm font-normal text-fg-default",
|
|
1180
|
+
"transition-[border-color,box-shadow,background-color] outline-none",
|
|
1181
|
+
"focus-visible:border-border-brand focus-visible:shadow-sh-ring",
|
|
1182
|
+
"data-[state=open]:border-border-brand data-[state=open]:shadow-sh-ring",
|
|
1183
|
+
"disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:bg-bg-input dark:disabled:hover:bg-bg-muted",
|
|
1184
|
+
"data-[placeholder]:text-fg-muted",
|
|
1185
|
+
className
|
|
1186
|
+
),
|
|
1187
|
+
children: [
|
|
1188
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Calendar, { className: "size-icon-sm shrink-0 text-fg-muted", strokeWidth: 1.8 }),
|
|
1189
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate", children: text })
|
|
1190
|
+
]
|
|
1191
|
+
}
|
|
1192
|
+
) }),
|
|
1193
|
+
/* @__PURE__ */ jsxRuntime.jsx(appShell.PopoverContent, { align, className: "w-auto p-pad-xl", children: calendar })
|
|
1194
|
+
] });
|
|
1195
|
+
}
|
|
1196
|
+
);
|
|
1197
|
+
DatePicker.displayName = "DatePicker";
|
|
429
1198
|
const icons = {
|
|
430
1199
|
"line-outline": "M14 9C14 6.23858 11.7614 4 9 4C6.23858 4 4 6.23858 4 9C4 11.7614 6.23858 14 9 14C11.7614 14 14 11.7614 14 9ZM18 9C18 13.9706 13.9706 18 9 18C4.02944 18 0 13.9706 0 9C0 4.02944 4.02944 0 9 0C13.9706 0 18 4.02944 18 9Z",
|
|
431
1200
|
"line-close": "M13.7237 4.27627C14.0362 4.58869 14.0362 5.09529 13.7237 5.40771L10.1315 9L13.7237 12.5923C14.0362 12.9047 14.0362 13.4113 13.7237 13.7237C13.4113 14.0362 12.9047 14.0362 12.5923 13.7237L9 10.1315L5.40771 13.7237C5.09529 14.0362 4.58869 14.0362 4.27627 13.7237C3.96386 13.4113 3.96386 12.9047 4.27627 12.5923L7.86852 9L4.27627 5.40771C3.96386 5.09529 3.96386 4.58869 4.27627 4.27627C4.58869 3.96386 5.09529 3.96386 5.40771 4.27627L9 7.86852L12.5923 4.27627C12.9047 3.96386 13.4113 3.96386 13.7237 4.27627Z",
|
|
@@ -2834,7 +3603,7 @@ const icons = {
|
|
|
2834
3603
|
"igreen-seguro": "M11.4639 1.25702C14.085 1.19572 16.6411 1.6447 19.0066 2.80744C19.3755 2.98873 19.8048 3.19906 20.142 3.4273C20.9286 3.95325 21.4689 4.77503 21.64 5.70561C21.7473 6.26792 21.7481 6.87869 21.75 7.45017L21.7514 8.83666C21.7516 9.87475 21.7887 11.1941 21.7047 12.2121C21.5436 14.0305 20.9125 15.7758 19.8734 17.2767C18.5209 19.2611 16.5655 20.8084 14.4652 21.9442C13.8002 22.3039 13.3077 22.5769 12.5623 22.7178C11.4536 22.8767 10.7471 22.5794 9.79046 22.0794C8.44126 21.3884 7.18846 20.5236 6.06411 19.5069C3.84267 17.4616 2.38475 14.8198 2.26307 11.7606C2.22718 10.8583 2.25004 9.84503 2.25011 8.93645L2.25126 7.48091C2.25539 6.12739 2.2747 4.98567 3.24579 3.9393C3.71646 3.43213 4.19253 3.20858 4.79776 2.89964C6.88626 1.83361 9.13195 1.34875 11.4639 1.25702ZM12.2478 21.2347C12.7949 21.1598 13.2274 20.8973 13.7073 20.643C16.9795 18.9081 19.9055 15.9692 20.208 12.0955C20.2867 11.0876 20.2506 10.0186 20.2508 8.99972L20.2497 7.49477C20.2462 6.34402 20.3047 5.23981 19.1555 4.57861C16.8945 3.27767 14.3404 2.72419 11.7463 2.75784C9.58278 2.77438 7.45059 3.27663 5.50717 4.22755C5.10873 4.42741 4.69854 4.61347 4.37701 4.93105C3.74856 5.55175 3.75436 6.41214 3.75218 7.23411C3.74851 8.62352 3.74971 10.0193 3.75311 11.4093C3.77103 15.6466 6.86057 18.8792 10.425 20.718C10.9812 21.0048 11.3782 21.2548 12.0336 21.2458C12.1051 21.2442 12.1766 21.2406 12.2478 21.2347Z",
|
|
2835
3604
|
"igreen-clientes": "M21.25 11.5996C21.25 9.90753 21.2495 8.68345 21.1709 7.7207C21.0929 6.76657 20.9419 6.1346 20.6777 5.61621C20.1744 4.62859 19.3714 3.82556 18.3838 3.32227C17.8654 3.05814 17.2334 2.90706 16.2793 2.8291C15.3165 2.75047 14.0925 2.75 12.4004 2.75H11.5996C9.90753 2.75 8.68345 2.75047 7.7207 2.8291C6.76657 2.90706 6.1346 3.05814 5.61621 3.32227C4.62859 3.82556 3.82556 4.62859 3.32227 5.61621C3.05814 6.1346 2.90706 6.76657 2.8291 7.7207C2.75047 8.68345 2.75 9.90753 2.75 11.5996V12.4004C2.75 14.0925 2.75047 15.3165 2.8291 16.2793C2.90706 17.2334 3.05814 17.8654 3.32227 18.3838C3.82556 19.3714 4.62859 20.1744 5.61621 20.6777C6.1346 20.9419 6.76657 21.0929 7.7207 21.1709C8.68345 21.2495 9.90753 21.25 11.5996 21.25H12.4004C14.0925 21.25 15.3165 21.2495 16.2793 21.1709C17.2334 21.0929 17.8654 20.9419 18.3838 20.6777C19.3714 20.1744 20.1744 19.3714 20.6777 18.3838C20.9419 17.8654 21.0929 17.2334 21.1709 16.2793C21.2495 15.3165 21.25 14.0925 21.25 12.4004V11.5996ZM15.25 15.667C15.25 14.6084 14.3916 13.75 13.333 13.75H10.667C9.60845 13.75 8.75 14.6084 8.75 15.667C8.75018 15.9889 9.0111 16.2498 9.33301 16.25H14.667C14.9889 16.2498 15.2498 15.9889 15.25 15.667ZM13.25 8C13.25 7.30964 12.6904 6.75 12 6.75C11.3096 6.75 10.75 7.30964 10.75 8C10.75 8.69036 11.3096 9.25 12 9.25C12.6904 9.25 13.25 8.69036 13.25 8ZM16.75 15.667C16.7498 16.8173 15.8173 17.7498 14.667 17.75H9.33301C8.18267 17.7498 7.25018 16.8173 7.25 15.667C7.25 13.78 8.78002 12.25 10.667 12.25H13.333C15.22 12.25 16.75 13.78 16.75 15.667ZM22.75 12.4004C22.75 14.068 22.7508 15.3643 22.666 16.4023C22.5805 17.449 22.4044 18.2995 22.0146 19.0645C21.3675 20.3345 20.3345 21.3675 19.0645 22.0146C18.2995 22.4044 17.449 22.5805 16.4023 22.666C15.3643 22.7508 14.068 22.75 12.4004 22.75H11.5996C9.93202 22.75 8.63571 22.7508 7.59766 22.666C6.55103 22.5805 5.70049 22.4044 4.93555 22.0146C3.66545 21.3675 2.6325 20.3345 1.98535 19.0645C1.59562 18.2995 1.41953 17.449 1.33398 16.4023C1.24917 15.3643 1.25 14.068 1.25 12.4004V11.5996C1.25 9.93202 1.24917 8.63571 1.33398 7.59766C1.41953 6.55103 1.59562 5.70049 1.98535 4.93555C2.6325 3.66545 3.66545 2.6325 4.93555 1.98535C5.70049 1.59562 6.55103 1.41953 7.59766 1.33398C8.63571 1.24917 9.93202 1.25 11.5996 1.25H12.4004C14.068 1.25 15.3643 1.24917 16.4023 1.33398C17.449 1.41953 18.2995 1.59562 19.0645 1.98535C20.3345 2.6325 21.3675 3.66545 22.0146 4.93555C22.4044 5.70049 22.5805 6.55103 22.666 7.59766C22.7508 8.63571 22.75 9.93202 22.75 11.5996V12.4004ZM14.75 8C14.75 9.51878 13.5188 10.75 12 10.75C10.4812 10.75 9.25 9.51878 9.25 8C9.25 6.48122 10.4812 5.25 12 5.25C13.5188 5.25 14.75 6.48122 14.75 8Z"
|
|
2836
3605
|
};
|
|
2837
|
-
const iconStyles =
|
|
3606
|
+
const iconStyles = appShell.tv({
|
|
2838
3607
|
base: "inline-block shrink-0 transition-colors",
|
|
2839
3608
|
variants: {
|
|
2840
3609
|
size: {
|
|
@@ -2908,7 +3677,7 @@ const Icon = React.forwardRef(
|
|
|
2908
3677
|
clipRule: "evenodd",
|
|
2909
3678
|
role: decorative ? void 0 : "img",
|
|
2910
3679
|
"aria-hidden": decorative ? true : void 0,
|
|
2911
|
-
className:
|
|
3680
|
+
className: appShell.cn(iconStyles({ size: preset ? size : void 0, tone }), className),
|
|
2912
3681
|
style: { ...sizeStyle, ...color ? { color } : void 0, ...style },
|
|
2913
3682
|
...props,
|
|
2914
3683
|
children: [
|
|
@@ -2920,150 +3689,955 @@ const Icon = React.forwardRef(
|
|
|
2920
3689
|
}
|
|
2921
3690
|
);
|
|
2922
3691
|
Icon.displayName = "Icon";
|
|
2923
|
-
const
|
|
3692
|
+
const dateSeparatorChipStyles = appShell.tv({
|
|
2924
3693
|
slots: {
|
|
2925
|
-
root: "flex
|
|
2926
|
-
|
|
2927
|
-
|
|
2928
|
-
iconBox: "grid size-form-lg shrink-0 place-items-center rounded-radius-lg [&>svg]:size-icon-md",
|
|
2929
|
-
main: "flex flex-col gap-gp-xs",
|
|
2930
|
-
valueRow: "flex flex-wrap items-center gap-gp-md",
|
|
2931
|
-
value: "text-body-2xl font-bold leading-none text-fg-default [font-variant-numeric:tabular-nums]",
|
|
2932
|
-
hint: "text-caption-sm text-fg-subtle",
|
|
2933
|
-
chart: "mt-gp-xs",
|
|
2934
|
-
footnote: "mt-pad-md border-t border-border-subtle pt-pad-lg text-caption-md text-fg-muted"
|
|
3694
|
+
root: "flex w-full items-center justify-center",
|
|
3695
|
+
rule: "flex-1",
|
|
3696
|
+
chip: "mx-auto shrink-0"
|
|
2935
3697
|
},
|
|
2936
3698
|
variants: {
|
|
2937
|
-
|
|
2938
|
-
|
|
2939
|
-
|
|
3699
|
+
variant: {
|
|
3700
|
+
date: {
|
|
3701
|
+
// sem réguas — só o chip centralizado
|
|
3702
|
+
root: "py-pad-2xs"
|
|
2940
3703
|
},
|
|
2941
|
-
|
|
2942
|
-
|
|
2943
|
-
|
|
2944
|
-
|
|
2945
|
-
success: { iconBox: "bg-bg-success-muted text-fg-success" },
|
|
2946
|
-
warning: { iconBox: "bg-bg-warning-muted text-fg-warning" },
|
|
2947
|
-
info: { iconBox: "bg-bg-info-muted text-fg-info" },
|
|
2948
|
-
danger: { iconBox: "bg-bg-danger-muted text-fg-danger" },
|
|
2949
|
-
neutral: { iconBox: "bg-bg-muted text-fg-muted" }
|
|
3704
|
+
boundary: {
|
|
3705
|
+
// chip ladeado por 2 réguas finas, com respiro lateral
|
|
3706
|
+
root: "gap-gp-md py-pad-md"
|
|
3707
|
+
}
|
|
2950
3708
|
}
|
|
2951
3709
|
},
|
|
2952
3710
|
defaultVariants: {
|
|
2953
|
-
|
|
2954
|
-
tone: "neutral"
|
|
3711
|
+
variant: "date"
|
|
2955
3712
|
}
|
|
2956
3713
|
});
|
|
2957
|
-
|
|
2958
|
-
|
|
3714
|
+
function DateSeparatorChip({
|
|
3715
|
+
label,
|
|
3716
|
+
variant = "date",
|
|
3717
|
+
icon,
|
|
3718
|
+
className
|
|
3719
|
+
}) {
|
|
3720
|
+
const styles2 = dateSeparatorChipStyles({ variant });
|
|
3721
|
+
const isBoundary = variant === "boundary";
|
|
3722
|
+
const chip = /* @__PURE__ */ jsxRuntime.jsxs(appShell.Chip, { color: "neutral", variant: "soft", size: "sm", className: styles2.chip(), children: [
|
|
3723
|
+
icon ? /* @__PURE__ */ jsxRuntime.jsx(Icon, { name: icon, size: "xs" }) : null,
|
|
3724
|
+
label
|
|
3725
|
+
] });
|
|
3726
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { role: "separator", "aria-label": label, className: appShell.cn(styles2.root(), className), children: isBoundary ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
3727
|
+
/* @__PURE__ */ jsxRuntime.jsx(Separator, { decorative: true, className: styles2.rule() }),
|
|
3728
|
+
chip,
|
|
3729
|
+
/* @__PURE__ */ jsxRuntime.jsx(Separator, { decorative: true, className: styles2.rule() })
|
|
3730
|
+
] }) : chip });
|
|
3731
|
+
}
|
|
3732
|
+
const emptyStateStyles = appShell.tv({
|
|
3733
|
+
slots: {
|
|
3734
|
+
root: "flex flex-col items-center justify-center gap-gp-md text-center",
|
|
3735
|
+
icon: "inline-flex shrink-0 items-center justify-center text-fg-subtle [&_svg]:size-full",
|
|
3736
|
+
title: "text-fg-strong",
|
|
3737
|
+
description: "text-body-sm text-fg-muted max-w-[360px]",
|
|
3738
|
+
action: "mt-gp-xs"
|
|
3739
|
+
},
|
|
2959
3740
|
variants: {
|
|
2960
|
-
|
|
2961
|
-
|
|
2962
|
-
|
|
2963
|
-
|
|
2964
|
-
|
|
2965
|
-
|
|
2966
|
-
|
|
2967
|
-
|
|
2968
|
-
|
|
2969
|
-
|
|
2970
|
-
|
|
3741
|
+
size: {
|
|
3742
|
+
sm: {
|
|
3743
|
+
icon: "size-icon-xl",
|
|
3744
|
+
title: "text-title-sm"
|
|
3745
|
+
},
|
|
3746
|
+
md: {
|
|
3747
|
+
icon: "size-icon-2xl",
|
|
3748
|
+
title: "text-title-sm"
|
|
3749
|
+
},
|
|
3750
|
+
lg: {
|
|
3751
|
+
icon: "size-icon-2xl",
|
|
3752
|
+
title: "text-title-md"
|
|
3753
|
+
}
|
|
2971
3754
|
}
|
|
2972
3755
|
},
|
|
2973
3756
|
defaultVariants: {
|
|
2974
|
-
|
|
2975
|
-
divided: false
|
|
3757
|
+
size: "md"
|
|
2976
3758
|
}
|
|
2977
3759
|
});
|
|
2978
|
-
const
|
|
2979
|
-
|
|
2980
|
-
|
|
2981
|
-
|
|
2982
|
-
|
|
2983
|
-
|
|
2984
|
-
|
|
2985
|
-
return /* @__PURE__ */ jsxRuntime.jsx(KpiSurfaceContext.Provider, { value: divided ? "plain" : "card", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: chipGroup.cn(kpiGroup({ columns, divided }), className), children }) });
|
|
3760
|
+
const ACTION_BUTTON_SIZE = {
|
|
3761
|
+
sm: "sm",
|
|
3762
|
+
md: "md",
|
|
3763
|
+
lg: "lg"
|
|
3764
|
+
};
|
|
3765
|
+
function isActionConfig(action) {
|
|
3766
|
+
return !React.isValidElement(action) && typeof action === "object" && action !== null && "label" in action && "onClick" in action;
|
|
2986
3767
|
}
|
|
2987
|
-
|
|
2988
|
-
|
|
2989
|
-
|
|
2990
|
-
|
|
2991
|
-
|
|
2992
|
-
|
|
3768
|
+
function renderIcon(icon) {
|
|
3769
|
+
if (icon == null || React.isValidElement(icon)) return icon;
|
|
3770
|
+
if (typeof icon === "function" || typeof icon === "object" && "$$typeof" in icon) {
|
|
3771
|
+
return React.createElement(
|
|
3772
|
+
icon,
|
|
3773
|
+
{ "aria-hidden": true }
|
|
3774
|
+
);
|
|
3775
|
+
}
|
|
3776
|
+
return icon;
|
|
3777
|
+
}
|
|
3778
|
+
function EmptyState({
|
|
2993
3779
|
icon,
|
|
2994
|
-
|
|
2995
|
-
|
|
2996
|
-
|
|
2997
|
-
|
|
3780
|
+
title: title2,
|
|
3781
|
+
description: description2,
|
|
3782
|
+
action,
|
|
3783
|
+
size = "md",
|
|
2998
3784
|
className
|
|
2999
3785
|
}) {
|
|
3000
|
-
const
|
|
3001
|
-
|
|
3002
|
-
|
|
3003
|
-
/* @__PURE__ */ jsxRuntime.
|
|
3004
|
-
|
|
3005
|
-
|
|
3006
|
-
|
|
3007
|
-
|
|
3008
|
-
|
|
3009
|
-
|
|
3010
|
-
|
|
3011
|
-
|
|
3012
|
-
|
|
3013
|
-
|
|
3014
|
-
|
|
3015
|
-
|
|
3786
|
+
const styles2 = emptyStateStyles({ size });
|
|
3787
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles2.root({ className }), children: [
|
|
3788
|
+
icon != null && /* @__PURE__ */ jsxRuntime.jsx("span", { className: styles2.icon(), "aria-hidden": "true", children: renderIcon(icon) }),
|
|
3789
|
+
/* @__PURE__ */ jsxRuntime.jsx("h3", { className: styles2.title(), children: title2 }),
|
|
3790
|
+
description2 && /* @__PURE__ */ jsxRuntime.jsx("p", { className: styles2.description(), children: description2 }),
|
|
3791
|
+
action != null && (isActionConfig(action) ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles2.action(), children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3792
|
+
appShell.Button,
|
|
3793
|
+
{
|
|
3794
|
+
type: "button",
|
|
3795
|
+
size: ACTION_BUTTON_SIZE[size],
|
|
3796
|
+
color: action.color,
|
|
3797
|
+
variant: action.variant,
|
|
3798
|
+
onClick: action.onClick,
|
|
3799
|
+
children: action.label
|
|
3800
|
+
}
|
|
3801
|
+
) }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles2.action(), children: action }))
|
|
3016
3802
|
] });
|
|
3017
3803
|
}
|
|
3018
|
-
|
|
3019
|
-
|
|
3804
|
+
const fileUploadFieldStyles = appShell.tv({
|
|
3805
|
+
slots: {
|
|
3806
|
+
dropzone: [
|
|
3807
|
+
"flex w-full flex-col items-center justify-center text-center",
|
|
3808
|
+
"min-h-form-xl gap-gp-xs px-pad-2xl py-pad-lg",
|
|
3809
|
+
"rounded-radius-xl bg-bg-muted",
|
|
3810
|
+
"border border-dashed border-border-default",
|
|
3811
|
+
"transition-[color,box-shadow,background-color,border-color] duration-200 ease-out",
|
|
3812
|
+
"cursor-pointer hover:border-border-brand",
|
|
3813
|
+
// Padrão 1 — focus estático
|
|
3814
|
+
"focus-visible:outline-none focus-visible:ring-4 focus-visible:ring-ring-brand"
|
|
3815
|
+
],
|
|
3816
|
+
dropIcon: "text-fg-subtle",
|
|
3817
|
+
dropText: "text-body-sm text-fg-muted",
|
|
3818
|
+
dropHint: "text-caption-md text-fg-subtle",
|
|
3819
|
+
fileRow: [
|
|
3820
|
+
"flex w-full items-center gap-gp-sm",
|
|
3821
|
+
"min-h-form-xl px-pad-xl py-pad-md",
|
|
3822
|
+
"rounded-radius-xl bg-bg-muted border border-border-subtle"
|
|
3823
|
+
],
|
|
3824
|
+
thumb: [
|
|
3825
|
+
"size-icon-2xl shrink-0 rounded-radius-md object-cover",
|
|
3826
|
+
"border border-border-subtle"
|
|
3827
|
+
],
|
|
3828
|
+
fileChipWrap: "flex min-w-0 flex-1 items-center",
|
|
3829
|
+
fileName: "min-w-0 truncate",
|
|
3830
|
+
removeWrap: "ml-auto shrink-0"
|
|
3831
|
+
},
|
|
3832
|
+
variants: {
|
|
3833
|
+
disabled: {
|
|
3834
|
+
// DS v3 não tem token bg-disabled/border-disabled → padrão Button = opacity-50 (L-006)
|
|
3835
|
+
true: {
|
|
3836
|
+
dropzone: "pointer-events-none opacity-50",
|
|
3837
|
+
fileRow: "opacity-50"
|
|
3838
|
+
}
|
|
3839
|
+
}
|
|
3840
|
+
},
|
|
3841
|
+
defaultVariants: { disabled: false }
|
|
3842
|
+
});
|
|
3843
|
+
function resolveIsImage(value, preview, accept) {
|
|
3844
|
+
if (preview === "image") return true;
|
|
3845
|
+
if (preview === "file") return false;
|
|
3846
|
+
if (value instanceof File) return value.type.startsWith("image/");
|
|
3847
|
+
if (accept) return /image\//.test(accept) || /\.(png|jpe?g|gif|webp|svg|avif)/i.test(accept);
|
|
3848
|
+
return /\.(png|jpe?g|gif|webp|svg|avif)(\?|$)/i.test(value);
|
|
3849
|
+
}
|
|
3850
|
+
function matchesAccept(file, accept) {
|
|
3851
|
+
if (!accept) return true;
|
|
3852
|
+
const tokens = accept.split(",").map((t) => t.trim().toLowerCase());
|
|
3853
|
+
const name = file.name.toLowerCase();
|
|
3854
|
+
const mime = file.type.toLowerCase();
|
|
3855
|
+
return tokens.some((token) => {
|
|
3856
|
+
if (!token) return false;
|
|
3857
|
+
if (token.startsWith(".")) return name.endsWith(token);
|
|
3858
|
+
if (token.endsWith("/*")) return mime.startsWith(token.slice(0, token.length - 1));
|
|
3859
|
+
return mime === token;
|
|
3860
|
+
});
|
|
3861
|
+
}
|
|
3862
|
+
function FileUploadField({
|
|
3020
3863
|
value,
|
|
3021
|
-
|
|
3022
|
-
|
|
3864
|
+
onChange,
|
|
3865
|
+
accept,
|
|
3866
|
+
maxSizeMB,
|
|
3867
|
+
preview = "auto",
|
|
3868
|
+
fileName,
|
|
3869
|
+
label,
|
|
3870
|
+
required,
|
|
3871
|
+
state,
|
|
3872
|
+
errorMessage,
|
|
3873
|
+
helperText,
|
|
3874
|
+
onError,
|
|
3875
|
+
disabled,
|
|
3876
|
+
id,
|
|
3023
3877
|
className
|
|
3024
3878
|
}) {
|
|
3025
|
-
|
|
3026
|
-
|
|
3879
|
+
const inputRef = React.useRef(null);
|
|
3880
|
+
const styles2 = fileUploadFieldStyles({ disabled });
|
|
3881
|
+
const [objectUrl, setObjectUrl] = React.useState(null);
|
|
3882
|
+
React.useEffect(() => {
|
|
3883
|
+
if (value instanceof File) {
|
|
3884
|
+
const url = URL.createObjectURL(value);
|
|
3885
|
+
setObjectUrl(url);
|
|
3886
|
+
return () => URL.revokeObjectURL(url);
|
|
3887
|
+
}
|
|
3888
|
+
setObjectUrl(null);
|
|
3889
|
+
return void 0;
|
|
3890
|
+
}, [value]);
|
|
3891
|
+
const openPicker = () => {
|
|
3892
|
+
if (disabled) return;
|
|
3893
|
+
inputRef.current?.click();
|
|
3894
|
+
};
|
|
3895
|
+
const handleFiles = (file) => {
|
|
3896
|
+
if (!file) return;
|
|
3897
|
+
if (!matchesAccept(file, accept)) {
|
|
3898
|
+
onError?.("type");
|
|
3899
|
+
resetInput();
|
|
3900
|
+
return;
|
|
3901
|
+
}
|
|
3902
|
+
if (maxSizeMB != null && file.size > maxSizeMB * 1024 * 1024) {
|
|
3903
|
+
onError?.("size");
|
|
3904
|
+
resetInput();
|
|
3905
|
+
return;
|
|
3906
|
+
}
|
|
3907
|
+
onChange(file);
|
|
3908
|
+
};
|
|
3909
|
+
const resetInput = () => {
|
|
3910
|
+
if (inputRef.current) inputRef.current.value = "";
|
|
3911
|
+
};
|
|
3912
|
+
const handleRemove = () => {
|
|
3913
|
+
onChange(null);
|
|
3914
|
+
resetInput();
|
|
3915
|
+
};
|
|
3916
|
+
const hint = [
|
|
3917
|
+
accept ? accept : null,
|
|
3918
|
+
maxSizeMB != null ? `máx. ${maxSizeMB}MB` : null
|
|
3919
|
+
].filter(Boolean).join(" · ");
|
|
3920
|
+
const displayName = value instanceof File ? value.name : fileName ?? "Arquivo";
|
|
3921
|
+
const isImage = value != null && resolveIsImage(value, preview, accept);
|
|
3922
|
+
const imageSrc = value instanceof File ? objectUrl : value;
|
|
3923
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3924
|
+
panel.FormField,
|
|
3027
3925
|
{
|
|
3028
|
-
|
|
3029
|
-
|
|
3030
|
-
|
|
3031
|
-
|
|
3926
|
+
label,
|
|
3927
|
+
required,
|
|
3928
|
+
state,
|
|
3929
|
+
errorMessage,
|
|
3930
|
+
helperText,
|
|
3032
3931
|
className,
|
|
3033
|
-
|
|
3034
|
-
|
|
3035
|
-
|
|
3932
|
+
id,
|
|
3933
|
+
disabled,
|
|
3934
|
+
children: ({ id: fieldId }) => /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
3935
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3936
|
+
"input",
|
|
3036
3937
|
{
|
|
3037
|
-
|
|
3038
|
-
|
|
3938
|
+
ref: inputRef,
|
|
3939
|
+
id: fieldId,
|
|
3940
|
+
type: "file",
|
|
3941
|
+
accept,
|
|
3942
|
+
disabled,
|
|
3943
|
+
className: "hidden",
|
|
3944
|
+
onChange: (e) => handleFiles(e.target.files?.[0])
|
|
3039
3945
|
}
|
|
3040
3946
|
),
|
|
3041
|
-
value
|
|
3042
|
-
|
|
3947
|
+
value == null ? /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3948
|
+
"button",
|
|
3949
|
+
{
|
|
3950
|
+
type: "button",
|
|
3951
|
+
onClick: openPicker,
|
|
3952
|
+
disabled,
|
|
3953
|
+
"aria-label": label ? `${label}: clique para anexar` : "Clique para anexar",
|
|
3954
|
+
className: styles2.dropzone(),
|
|
3955
|
+
children: [
|
|
3956
|
+
/* @__PURE__ */ jsxRuntime.jsx(Icon, { name: "line-cloud-upload", size: "lg", className: styles2.dropIcon() }),
|
|
3957
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: styles2.dropText(), children: "Clique para anexar" }),
|
|
3958
|
+
hint && /* @__PURE__ */ jsxRuntime.jsx("span", { className: styles2.dropHint(), children: hint })
|
|
3959
|
+
]
|
|
3960
|
+
}
|
|
3961
|
+
) : /* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles2.fileRow(), children: [
|
|
3962
|
+
isImage && imageSrc ? /* @__PURE__ */ jsxRuntime.jsx("img", { src: imageSrc, alt: displayName, className: styles2.thumb() }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles2.fileChipWrap(), children: /* @__PURE__ */ jsxRuntime.jsxs(appShell.Chip, { color: "neutral", variant: "soft", size: "lg", className: "max-w-full", children: [
|
|
3963
|
+
/* @__PURE__ */ jsxRuntime.jsx(Icon, { name: "line-file", size: "sm" }),
|
|
3964
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: styles2.fileName(), children: displayName })
|
|
3965
|
+
] }) }),
|
|
3966
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: styles2.removeWrap(), children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3967
|
+
appShell.Button,
|
|
3968
|
+
{
|
|
3969
|
+
type: "button",
|
|
3970
|
+
color: "critical",
|
|
3971
|
+
variant: "ghost",
|
|
3972
|
+
size: "icon-sm",
|
|
3973
|
+
disabled,
|
|
3974
|
+
"aria-label": "Remover arquivo",
|
|
3975
|
+
onClick: handleRemove,
|
|
3976
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(Icon, { name: "line-bin", size: "sm" })
|
|
3977
|
+
}
|
|
3978
|
+
) })
|
|
3979
|
+
] })
|
|
3980
|
+
] })
|
|
3043
3981
|
}
|
|
3044
3982
|
);
|
|
3045
3983
|
}
|
|
3046
|
-
|
|
3047
|
-
|
|
3048
|
-
|
|
3049
|
-
|
|
3050
|
-
"!gap-0 !p-0",
|
|
3051
|
-
"border border-border-default",
|
|
3052
|
-
"!rounded-radius-2xl !shadow-sh-2xl",
|
|
3053
|
-
"outline-float",
|
|
3054
|
-
"flex flex-col overflow-hidden",
|
|
3055
|
-
"w-[calc(100%-32px)]"
|
|
3056
|
-
],
|
|
3984
|
+
const messageAckStyles = appShell.tv({
|
|
3985
|
+
slots: {
|
|
3986
|
+
icon: "inline-block shrink-0 align-middle size-icon-xs"
|
|
3987
|
+
},
|
|
3057
3988
|
variants: {
|
|
3058
|
-
|
|
3059
|
-
|
|
3989
|
+
tone: {
|
|
3990
|
+
muted: { icon: "text-fg-muted" },
|
|
3991
|
+
success: { icon: "text-fg-success" },
|
|
3992
|
+
danger: { icon: "text-fg-danger" }
|
|
3993
|
+
}
|
|
3994
|
+
},
|
|
3995
|
+
defaultVariants: { tone: "muted" }
|
|
3996
|
+
});
|
|
3997
|
+
const MessageAck = ({ ack, error = false, className }) => {
|
|
3998
|
+
if (error) {
|
|
3999
|
+
const styles22 = messageAckStyles({ tone: "danger" });
|
|
4000
|
+
return /* @__PURE__ */ jsxRuntime.jsx(lucideReact.AlertCircle, { "aria-hidden": true, className: appShell.cn(styles22.icon(), className) });
|
|
4001
|
+
}
|
|
4002
|
+
const tone = ack >= 4 ? "success" : "muted";
|
|
4003
|
+
const styles2 = messageAckStyles({ tone });
|
|
4004
|
+
const iconClassName = appShell.cn(styles2.icon(), className);
|
|
4005
|
+
if (ack >= 4) return /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CheckCheck, { "aria-hidden": true, className: iconClassName });
|
|
4006
|
+
if (ack === 3) return /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CheckCheck, { "aria-hidden": true, className: iconClassName });
|
|
4007
|
+
if (ack === 2) return /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Check, { "aria-hidden": true, className: iconClassName });
|
|
4008
|
+
return /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Clock, { "aria-hidden": true, className: iconClassName });
|
|
4009
|
+
};
|
|
4010
|
+
MessageAck.displayName = "MessageAck";
|
|
4011
|
+
const messageBubbleStyles = appShell.tv({
|
|
4012
|
+
slots: {
|
|
4013
|
+
row: "group/bubble flex w-full items-end gap-gp-sm",
|
|
4014
|
+
avatarSlot: "shrink-0 self-end",
|
|
4015
|
+
/* coluna da bolha — limita a 70% da largura da linha (exceção documentada) */
|
|
4016
|
+
column: "relative flex min-w-0 max-w-[70%] flex-col",
|
|
4017
|
+
bubble: [
|
|
4018
|
+
"relative flex min-w-0 flex-col gap-gp-xs",
|
|
4019
|
+
"px-pad-2xl py-pad-lg",
|
|
4020
|
+
"rounded-radius-md shadow-sh-sm",
|
|
4021
|
+
"border border-transparent"
|
|
4022
|
+
],
|
|
4023
|
+
author: "text-caption-md font-semibold text-fg-brand",
|
|
4024
|
+
/* citação (reply) */
|
|
4025
|
+
quoted: [
|
|
4026
|
+
"mb-gp-xs flex min-w-0 flex-col gap-gp-xs",
|
|
4027
|
+
"border-l-2 border-border-brand-subtle",
|
|
4028
|
+
"rounded-radius-xs bg-bg-muted",
|
|
4029
|
+
"px-pad-lg py-pad-md"
|
|
4030
|
+
],
|
|
4031
|
+
quotedAuthor: "truncate text-caption-sm font-semibold text-fg-brand",
|
|
4032
|
+
quotedPreview: "flex min-w-0 items-center gap-gp-xs",
|
|
4033
|
+
quotedPreviewText: "truncate text-caption-sm text-fg-muted",
|
|
4034
|
+
quotedThumb: "size-icon-xl shrink-0 rounded-radius-xs object-cover",
|
|
4035
|
+
/* mídia */
|
|
4036
|
+
media: "flex min-w-0 flex-col gap-gp-xs",
|
|
4037
|
+
mediaImage: "max-w-full cursor-pointer rounded-radius-sm object-cover transition-opacity hover:opacity-90 focus-visible:outline-none focus-visible:ring-4 focus-visible:ring-ring-brand",
|
|
4038
|
+
mediaVideo: "max-w-full rounded-radius-sm focus-visible:outline-none focus-visible:ring-4 focus-visible:ring-ring-brand",
|
|
4039
|
+
mediaAudio: "w-full",
|
|
4040
|
+
mediaDoc: [
|
|
4041
|
+
"flex items-center gap-gp-md",
|
|
4042
|
+
"rounded-radius-sm bg-bg-muted",
|
|
4043
|
+
"px-pad-lg py-pad-md"
|
|
4044
|
+
],
|
|
4045
|
+
mediaDocIcon: "shrink-0 text-fg-brand",
|
|
4046
|
+
mediaDocInfo: "flex min-w-0 flex-col",
|
|
4047
|
+
mediaDocName: "truncate text-body-sm font-semibold text-fg-default",
|
|
4048
|
+
mediaDocHint: "text-caption-sm text-fg-muted",
|
|
4049
|
+
mediaLocation: [
|
|
4050
|
+
"flex items-center gap-gp-md",
|
|
4051
|
+
"rounded-radius-sm bg-bg-muted",
|
|
4052
|
+
"px-pad-lg py-pad-md",
|
|
4053
|
+
"text-body-sm text-fg-default",
|
|
4054
|
+
"transition-colors hover:bg-bg-muted-hover"
|
|
4055
|
+
],
|
|
4056
|
+
mediaLocationIcon: "shrink-0 text-fg-brand",
|
|
4057
|
+
mediaContact: [
|
|
4058
|
+
"flex items-center gap-gp-md",
|
|
4059
|
+
"rounded-radius-sm bg-bg-muted",
|
|
4060
|
+
"px-pad-lg py-pad-md"
|
|
4061
|
+
],
|
|
4062
|
+
mediaContactInfo: "flex min-w-0 flex-col",
|
|
4063
|
+
mediaContactName: "truncate text-body-sm font-semibold text-fg-default",
|
|
4064
|
+
mediaContactHint: "text-caption-sm text-fg-muted",
|
|
4065
|
+
/* corpo */
|
|
4066
|
+
body: "min-w-0 text-body-sm text-fg-default",
|
|
4067
|
+
/* corpo de mensagem apagada */
|
|
4068
|
+
deleted: [
|
|
4069
|
+
"flex items-center gap-gp-xs",
|
|
4070
|
+
"text-body-sm italic text-fg-muted"
|
|
4071
|
+
],
|
|
4072
|
+
deletedIcon: "shrink-0",
|
|
4073
|
+
/* rodapé */
|
|
4074
|
+
meta: "mt-gp-xs flex items-center justify-end gap-gp-xs self-end",
|
|
4075
|
+
metaTime: "text-caption-sm text-fg-muted tabular-nums",
|
|
4076
|
+
metaEdited: "text-caption-sm italic text-fg-muted",
|
|
4077
|
+
/* ações (hover) */
|
|
4078
|
+
actionsTrigger: [
|
|
4079
|
+
"absolute right-pad-md top-pad-md",
|
|
4080
|
+
"opacity-0 transition-opacity",
|
|
4081
|
+
"group-hover/bubble:opacity-100 focus-visible:opacity-100"
|
|
4082
|
+
],
|
|
4083
|
+
actionsContent: "flex min-w-0 flex-col gap-gp-xs"
|
|
4084
|
+
},
|
|
4085
|
+
variants: {
|
|
4086
|
+
side: {
|
|
4087
|
+
sent: {
|
|
4088
|
+
row: "flex-row-reverse",
|
|
4089
|
+
column: "items-end",
|
|
4090
|
+
bubble: "bg-bg-success-muted"
|
|
4091
|
+
},
|
|
4092
|
+
received: {
|
|
4093
|
+
row: "flex-row",
|
|
4094
|
+
column: "items-start",
|
|
4095
|
+
bubble: "bg-bg-surface"
|
|
4096
|
+
}
|
|
4097
|
+
},
|
|
4098
|
+
tail: {
|
|
4099
|
+
true: {},
|
|
4100
|
+
false: {}
|
|
4101
|
+
}
|
|
4102
|
+
},
|
|
4103
|
+
compoundVariants: [
|
|
4104
|
+
/* rabeta = canto reto no lado de quem enviou */
|
|
4105
|
+
{ side: "sent", tail: true, class: { bubble: "rounded-br-none" } },
|
|
4106
|
+
{ side: "received", tail: true, class: { bubble: "rounded-bl-none" } }
|
|
4107
|
+
],
|
|
4108
|
+
defaultVariants: {
|
|
4109
|
+
side: "received",
|
|
4110
|
+
tail: true
|
|
4111
|
+
}
|
|
4112
|
+
});
|
|
4113
|
+
const styles$1 = messageBubbleStyles();
|
|
4114
|
+
function handleMediaKeyDown(event, onMediaClick) {
|
|
4115
|
+
if (!onMediaClick) return;
|
|
4116
|
+
if (event.key === "Enter" || event.key === " ") {
|
|
4117
|
+
event.preventDefault();
|
|
4118
|
+
onMediaClick();
|
|
4119
|
+
}
|
|
4120
|
+
}
|
|
4121
|
+
function formatTime(value) {
|
|
4122
|
+
const date = value instanceof Date ? value : new Date(value);
|
|
4123
|
+
if (Number.isNaN(date.getTime())) return "";
|
|
4124
|
+
return date.toLocaleTimeString("pt-BR", {
|
|
4125
|
+
hour: "2-digit",
|
|
4126
|
+
minute: "2-digit",
|
|
4127
|
+
hour12: false
|
|
4128
|
+
});
|
|
4129
|
+
}
|
|
4130
|
+
const MEDIA_LABEL = {
|
|
4131
|
+
text: "",
|
|
4132
|
+
image: "Imagem",
|
|
4133
|
+
audio: "Áudio",
|
|
4134
|
+
video: "Vídeo",
|
|
4135
|
+
document: "Documento",
|
|
4136
|
+
location: "Localização",
|
|
4137
|
+
vcard: "Contato",
|
|
4138
|
+
contact: "Contato"
|
|
4139
|
+
};
|
|
4140
|
+
function MessageMediaRenderer({
|
|
4141
|
+
mediaType,
|
|
4142
|
+
mediaUrl,
|
|
4143
|
+
body: body2,
|
|
4144
|
+
onMediaClick
|
|
4145
|
+
}) {
|
|
4146
|
+
switch (mediaType) {
|
|
4147
|
+
case "image":
|
|
4148
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles$1.media(), children: mediaUrl ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
4149
|
+
"img",
|
|
4150
|
+
{
|
|
4151
|
+
src: mediaUrl,
|
|
4152
|
+
alt: body2 || "Imagem",
|
|
4153
|
+
className: styles$1.mediaImage(),
|
|
4154
|
+
role: onMediaClick ? "button" : void 0,
|
|
4155
|
+
tabIndex: onMediaClick ? 0 : void 0,
|
|
4156
|
+
onClick: onMediaClick,
|
|
4157
|
+
onKeyDown: (e) => handleMediaKeyDown(e, onMediaClick)
|
|
4158
|
+
}
|
|
4159
|
+
) : null });
|
|
4160
|
+
case "audio":
|
|
4161
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles$1.media(), children: mediaUrl ? (
|
|
4162
|
+
// eslint-disable-next-line jsx-a11y/media-has-caption
|
|
4163
|
+
/* @__PURE__ */ jsxRuntime.jsx("audio", { controls: true, src: mediaUrl, className: styles$1.mediaAudio() })
|
|
4164
|
+
) : null });
|
|
4165
|
+
case "video":
|
|
4166
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles$1.media(), children: mediaUrl ? (
|
|
4167
|
+
// eslint-disable-next-line jsx-a11y/media-has-caption
|
|
4168
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4169
|
+
"video",
|
|
4170
|
+
{
|
|
4171
|
+
controls: true,
|
|
4172
|
+
src: mediaUrl,
|
|
4173
|
+
className: styles$1.mediaVideo(),
|
|
4174
|
+
role: onMediaClick ? "button" : void 0,
|
|
4175
|
+
tabIndex: onMediaClick ? 0 : void 0,
|
|
4176
|
+
onClick: onMediaClick,
|
|
4177
|
+
onKeyDown: (e) => handleMediaKeyDown(e, onMediaClick)
|
|
4178
|
+
}
|
|
4179
|
+
)
|
|
4180
|
+
) : null });
|
|
4181
|
+
case "document":
|
|
4182
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles$1.mediaDoc(), children: [
|
|
4183
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4184
|
+
Icon,
|
|
4185
|
+
{
|
|
4186
|
+
name: "line-file",
|
|
4187
|
+
size: "lg",
|
|
4188
|
+
className: styles$1.mediaDocIcon()
|
|
4189
|
+
}
|
|
4190
|
+
),
|
|
4191
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles$1.mediaDocInfo(), children: [
|
|
4192
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: styles$1.mediaDocName(), children: body2 || "Documento" }),
|
|
4193
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: styles$1.mediaDocHint(), children: "Toque para baixar" })
|
|
4194
|
+
] }),
|
|
4195
|
+
mediaUrl ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
4196
|
+
appShell.Button,
|
|
4197
|
+
{
|
|
4198
|
+
type: "button",
|
|
4199
|
+
size: "xs",
|
|
4200
|
+
variant: "ghost",
|
|
4201
|
+
color: "primary",
|
|
4202
|
+
"aria-label": "Baixar documento",
|
|
4203
|
+
onClick: onMediaClick,
|
|
4204
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(Icon, { name: "line-download-01", size: "sm" })
|
|
4205
|
+
}
|
|
4206
|
+
) : null
|
|
4207
|
+
] });
|
|
4208
|
+
case "location":
|
|
4209
|
+
return mediaUrl ? /* @__PURE__ */ jsxRuntime.jsxs(
|
|
4210
|
+
"a",
|
|
4211
|
+
{
|
|
4212
|
+
href: mediaUrl,
|
|
4213
|
+
target: "_blank",
|
|
4214
|
+
rel: "noopener noreferrer",
|
|
4215
|
+
className: styles$1.mediaLocation(),
|
|
4216
|
+
onClick: onMediaClick,
|
|
4217
|
+
children: [
|
|
4218
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4219
|
+
Icon,
|
|
4220
|
+
{
|
|
4221
|
+
name: "line-pin",
|
|
4222
|
+
size: "md",
|
|
4223
|
+
className: styles$1.mediaLocationIcon()
|
|
4224
|
+
}
|
|
4225
|
+
),
|
|
4226
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: body2 || "Ver localização" })
|
|
4227
|
+
]
|
|
4228
|
+
}
|
|
4229
|
+
) : /* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles$1.mediaLocation(), children: [
|
|
4230
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4231
|
+
Icon,
|
|
4232
|
+
{
|
|
4233
|
+
name: "line-pin",
|
|
4234
|
+
size: "md",
|
|
4235
|
+
className: styles$1.mediaLocationIcon()
|
|
4236
|
+
}
|
|
4237
|
+
),
|
|
4238
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: body2 || "Localização" })
|
|
4239
|
+
] });
|
|
4240
|
+
case "vcard":
|
|
4241
|
+
case "contact":
|
|
4242
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles$1.mediaContact(), children: [
|
|
4243
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4244
|
+
Icon,
|
|
4245
|
+
{
|
|
4246
|
+
name: "line-user",
|
|
4247
|
+
size: "lg",
|
|
4248
|
+
className: styles$1.mediaDocIcon()
|
|
4249
|
+
}
|
|
4250
|
+
),
|
|
4251
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles$1.mediaContactInfo(), children: [
|
|
4252
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: styles$1.mediaContactName(), children: body2 || "Contato" }),
|
|
4253
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: styles$1.mediaContactHint(), children: "Cartão de contato" })
|
|
4254
|
+
] })
|
|
4255
|
+
] });
|
|
4256
|
+
case "text":
|
|
4257
|
+
default:
|
|
4258
|
+
return null;
|
|
4259
|
+
}
|
|
4260
|
+
}
|
|
4261
|
+
function MessageBubble({
|
|
4262
|
+
side,
|
|
4263
|
+
body: body2,
|
|
4264
|
+
createdAt,
|
|
4265
|
+
ack,
|
|
4266
|
+
ackError,
|
|
4267
|
+
mediaType = "text",
|
|
4268
|
+
mediaUrl,
|
|
4269
|
+
media,
|
|
4270
|
+
quotedMessage,
|
|
4271
|
+
isEdited = false,
|
|
4272
|
+
isDeleted = false,
|
|
4273
|
+
tail = true,
|
|
4274
|
+
authorName,
|
|
4275
|
+
avatar,
|
|
4276
|
+
actions,
|
|
4277
|
+
onMediaClick,
|
|
4278
|
+
className
|
|
4279
|
+
}) {
|
|
4280
|
+
const [actionsOpen, setActionsOpen] = React.useState(false);
|
|
4281
|
+
const s = messageBubbleStyles({ side, tail });
|
|
4282
|
+
const time = formatTime(createdAt);
|
|
4283
|
+
const hasMedia = !isDeleted && mediaType !== "text";
|
|
4284
|
+
const showAck = side === "sent" && ack !== void 0 && !isDeleted;
|
|
4285
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: s.row({ className }), children: [
|
|
4286
|
+
avatar ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: s.avatarSlot(), children: avatar }) : null,
|
|
4287
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: s.column(), children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: s.bubble(), children: [
|
|
4288
|
+
actions && !isDeleted ? /* @__PURE__ */ jsxRuntime.jsxs(
|
|
4289
|
+
appShell.Popover,
|
|
4290
|
+
{
|
|
4291
|
+
open: actionsOpen,
|
|
4292
|
+
onOpenChange: setActionsOpen,
|
|
4293
|
+
modal: false,
|
|
4294
|
+
children: [
|
|
4295
|
+
/* @__PURE__ */ jsxRuntime.jsx(appShell.PopoverAnchor, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4296
|
+
appShell.Button,
|
|
4297
|
+
{
|
|
4298
|
+
type: "button",
|
|
4299
|
+
size: "2xs",
|
|
4300
|
+
variant: "ghost",
|
|
4301
|
+
color: "secondary",
|
|
4302
|
+
"aria-label": "Ações da mensagem",
|
|
4303
|
+
"aria-haspopup": "menu",
|
|
4304
|
+
"aria-expanded": actionsOpen,
|
|
4305
|
+
className: s.actionsTrigger(),
|
|
4306
|
+
onClick: () => setActionsOpen((o) => !o),
|
|
4307
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.MoreVertical, { "aria-hidden": "true" })
|
|
4308
|
+
}
|
|
4309
|
+
) }),
|
|
4310
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4311
|
+
appShell.PopoverContent,
|
|
4312
|
+
{
|
|
4313
|
+
align: side === "sent" ? "end" : "start",
|
|
4314
|
+
role: "menu",
|
|
4315
|
+
className: s.actionsContent(),
|
|
4316
|
+
children: actions
|
|
4317
|
+
}
|
|
4318
|
+
)
|
|
4319
|
+
]
|
|
4320
|
+
}
|
|
4321
|
+
) : null,
|
|
4322
|
+
authorName && !isDeleted ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: s.author(), children: authorName }) : null,
|
|
4323
|
+
quotedMessage && !isDeleted ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: s.quoted(), children: [
|
|
4324
|
+
quotedMessage.authorName ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: s.quotedAuthor(), children: quotedMessage.fromMe ? "Você" : quotedMessage.authorName }) : null,
|
|
4325
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: s.quotedPreview(), children: [
|
|
4326
|
+
quotedMessage.mediaType === "image" && quotedMessage.mediaUrl ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
4327
|
+
"img",
|
|
4328
|
+
{
|
|
4329
|
+
src: quotedMessage.mediaUrl,
|
|
4330
|
+
alt: "",
|
|
4331
|
+
className: s.quotedThumb()
|
|
4332
|
+
}
|
|
4333
|
+
) : null,
|
|
4334
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: s.quotedPreviewText(), children: quotedMessage.body ? /* @__PURE__ */ jsxRuntime.jsx(MarkdownText, { inline: true, children: quotedMessage.body }) : MEDIA_LABEL[quotedMessage.mediaType ?? "text"] || "Mensagem" })
|
|
4335
|
+
] })
|
|
4336
|
+
] }) : null,
|
|
4337
|
+
isDeleted ? /* @__PURE__ */ jsxRuntime.jsxs("span", { className: s.deleted(), children: [
|
|
4338
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Ban, { className: s.deletedIcon(), "aria-hidden": "true" }),
|
|
4339
|
+
"Mensagem apagada"
|
|
4340
|
+
] }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
4341
|
+
hasMedia ? media ?? /* @__PURE__ */ jsxRuntime.jsx(
|
|
4342
|
+
MessageMediaRenderer,
|
|
4343
|
+
{
|
|
4344
|
+
mediaType,
|
|
4345
|
+
mediaUrl,
|
|
4346
|
+
body: body2,
|
|
4347
|
+
onMediaClick
|
|
4348
|
+
}
|
|
4349
|
+
) : null,
|
|
4350
|
+
body2 && (mediaType === "text" || !hasMedia) ? /* @__PURE__ */ jsxRuntime.jsx(MarkdownText, { className: s.body(), children: body2 }) : null
|
|
4351
|
+
] }),
|
|
4352
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: s.meta(), children: [
|
|
4353
|
+
isEdited && !isDeleted ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: s.metaEdited(), children: "editada" }) : null,
|
|
4354
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: s.metaTime(), children: time }),
|
|
4355
|
+
showAck ? /* @__PURE__ */ jsxRuntime.jsx(MessageAck, { ack, error: ackError }) : null
|
|
4356
|
+
] })
|
|
4357
|
+
] }) })
|
|
4358
|
+
] });
|
|
4359
|
+
}
|
|
4360
|
+
MessageBubble.displayName = "MessageBubble";
|
|
4361
|
+
const messageComposerStyles = appShell.tv({
|
|
4362
|
+
slots: {
|
|
4363
|
+
root: [
|
|
4364
|
+
"flex w-full flex-col",
|
|
4365
|
+
"rounded-radius-lg border border-border-subtle",
|
|
4366
|
+
"bg-bg-surface dark:bg-bg-muted",
|
|
4367
|
+
"shadow-sh-sm",
|
|
4368
|
+
"transition-[border-color,box-shadow,background-color]",
|
|
4369
|
+
"focus-within:border-border-brand focus-within:shadow-sh-ring"
|
|
4370
|
+
],
|
|
4371
|
+
replyPreview: "border-b border-border-subtle px-pad-2xl py-pad-lg",
|
|
4372
|
+
banner: [
|
|
4373
|
+
"border-b border-border-subtle px-pad-2xl py-pad-lg",
|
|
4374
|
+
"text-body-sm text-fg-muted"
|
|
4375
|
+
],
|
|
4376
|
+
field: "flex w-full items-end gap-gp-md",
|
|
4377
|
+
toolbarStart: "flex shrink-0 items-center gap-gp-xs",
|
|
4378
|
+
toolbarEnd: "flex shrink-0 items-center gap-gp-xs",
|
|
4379
|
+
inputArea: "flex min-w-0 flex-1 items-end",
|
|
4380
|
+
recording: "flex min-w-0 flex-1 items-center",
|
|
4381
|
+
textarea: [
|
|
4382
|
+
// funde a textarea na moldura externa: sem borda/ring/bg/shadow próprios
|
|
4383
|
+
"min-h-form-lg w-full resize-none",
|
|
4384
|
+
"border-none bg-transparent shadow-none",
|
|
4385
|
+
"px-pad-md py-pad-md",
|
|
4386
|
+
"focus-visible:shadow-none focus-visible:border-none",
|
|
4387
|
+
"hover:bg-transparent dark:hover:bg-transparent",
|
|
4388
|
+
"disabled:hover:bg-transparent dark:disabled:hover:bg-transparent"
|
|
4389
|
+
],
|
|
4390
|
+
send: "shrink-0"
|
|
4391
|
+
},
|
|
4392
|
+
variants: {
|
|
4393
|
+
size: {
|
|
4394
|
+
sm: {
|
|
4395
|
+
field: "px-pad-md py-pad-sm",
|
|
4396
|
+
textarea: "min-h-form-md max-h-[160px] text-body-sm"
|
|
4397
|
+
},
|
|
4398
|
+
md: {
|
|
4399
|
+
field: "px-pad-lg py-pad-md",
|
|
4400
|
+
textarea: "min-h-form-lg max-h-[200px] text-body-sm"
|
|
4401
|
+
}
|
|
4402
|
+
},
|
|
4403
|
+
state: {
|
|
4404
|
+
open: {},
|
|
4405
|
+
disabled: { root: "opacity-60" },
|
|
4406
|
+
"read-only": {}
|
|
4407
|
+
}
|
|
4408
|
+
},
|
|
4409
|
+
compoundVariants: [
|
|
4410
|
+
// disabled SEMPRE por último (L-006)
|
|
4411
|
+
{
|
|
4412
|
+
state: "disabled",
|
|
4413
|
+
class: { root: "pointer-events-none" }
|
|
4414
|
+
}
|
|
4415
|
+
],
|
|
4416
|
+
defaultVariants: {
|
|
4417
|
+
size: "md",
|
|
4418
|
+
state: "open"
|
|
4419
|
+
}
|
|
4420
|
+
});
|
|
4421
|
+
const MessageComposer = React.forwardRef(function MessageComposer2({
|
|
4422
|
+
value,
|
|
4423
|
+
onChange,
|
|
4424
|
+
onSend,
|
|
4425
|
+
onKeyDown,
|
|
4426
|
+
placeholder,
|
|
4427
|
+
state = "open",
|
|
4428
|
+
size = "md",
|
|
4429
|
+
toolbarStart,
|
|
4430
|
+
toolbarEnd,
|
|
4431
|
+
replyPreview,
|
|
4432
|
+
banner,
|
|
4433
|
+
sending = false,
|
|
4434
|
+
recording,
|
|
4435
|
+
className
|
|
4436
|
+
}, ref) {
|
|
4437
|
+
const innerRef = React.useRef(null);
|
|
4438
|
+
const setRefs = React.useCallback(
|
|
4439
|
+
(node) => {
|
|
4440
|
+
innerRef.current = node;
|
|
4441
|
+
if (typeof ref === "function") ref(node);
|
|
4442
|
+
else if (ref) ref.current = node;
|
|
4443
|
+
},
|
|
4444
|
+
[ref]
|
|
4445
|
+
);
|
|
4446
|
+
React.useLayoutEffect(() => {
|
|
4447
|
+
const el = innerRef.current;
|
|
4448
|
+
if (!el) return;
|
|
4449
|
+
el.style.height = "auto";
|
|
4450
|
+
el.style.height = `${el.scrollHeight}px`;
|
|
4451
|
+
}, [value]);
|
|
4452
|
+
const isDisabled = state === "disabled";
|
|
4453
|
+
const isReadOnly = state === "read-only";
|
|
4454
|
+
const canSend = value.trim().length > 0 && !isDisabled && !sending;
|
|
4455
|
+
const styles2 = messageComposerStyles({ size, state });
|
|
4456
|
+
const handleKeyDown = (event) => {
|
|
4457
|
+
onKeyDown?.(event);
|
|
4458
|
+
if (event.defaultPrevented) return;
|
|
4459
|
+
if (event.key === "Enter" && !event.shiftKey) {
|
|
4460
|
+
event.preventDefault();
|
|
4461
|
+
if (canSend) onSend();
|
|
4462
|
+
}
|
|
4463
|
+
};
|
|
4464
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles2.root({ className }), children: [
|
|
4465
|
+
replyPreview ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles2.replyPreview(), children: replyPreview }) : null,
|
|
4466
|
+
banner ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles2.banner(), children: banner }) : null,
|
|
4467
|
+
!isReadOnly && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
4468
|
+
(replyPreview || banner) && /* @__PURE__ */ jsxRuntime.jsx(Separator, {}),
|
|
4469
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles2.field(), children: [
|
|
4470
|
+
toolbarStart ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles2.toolbarStart(), children: toolbarStart }) : null,
|
|
4471
|
+
recording ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles2.recording(), children: recording }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles2.inputArea(), children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4472
|
+
panel.Textarea,
|
|
4473
|
+
{
|
|
4474
|
+
ref: setRefs,
|
|
4475
|
+
rows: 1,
|
|
4476
|
+
value,
|
|
4477
|
+
disabled: isDisabled,
|
|
4478
|
+
placeholder,
|
|
4479
|
+
"aria-label": placeholder ?? "Mensagem",
|
|
4480
|
+
className: styles2.textarea(),
|
|
4481
|
+
onChange: (e) => onChange(e.target.value),
|
|
4482
|
+
onKeyDown: handleKeyDown
|
|
4483
|
+
}
|
|
4484
|
+
) }),
|
|
4485
|
+
toolbarEnd ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles2.toolbarEnd(), children: toolbarEnd }) : null,
|
|
4486
|
+
!recording && /* @__PURE__ */ jsxRuntime.jsx(
|
|
4487
|
+
appShell.Button,
|
|
4488
|
+
{
|
|
4489
|
+
type: "button",
|
|
4490
|
+
size: size === "sm" ? "icon-sm" : "icon-md",
|
|
4491
|
+
color: "primary",
|
|
4492
|
+
variant: "filled",
|
|
4493
|
+
loading: sending,
|
|
4494
|
+
disabled: !canSend,
|
|
4495
|
+
"aria-label": "Enviar mensagem",
|
|
4496
|
+
className: styles2.send(),
|
|
4497
|
+
onClick: () => {
|
|
4498
|
+
if (canSend) onSend();
|
|
4499
|
+
},
|
|
4500
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(Icon, { name: "line-telegram" })
|
|
4501
|
+
}
|
|
4502
|
+
)
|
|
4503
|
+
] })
|
|
4504
|
+
] })
|
|
4505
|
+
] });
|
|
4506
|
+
});
|
|
4507
|
+
const messageVariablesPickerStyles = appShell.tv({
|
|
4508
|
+
slots: {
|
|
4509
|
+
/** Container interno do PopoverContent. */
|
|
4510
|
+
content: "flex flex-col gap-gp-md p-sp-sm min-w-[200px]",
|
|
4511
|
+
/** Header opcional ("Variáveis disponíveis"). */
|
|
4512
|
+
header: "text-caption-md text-fg-muted px-pad-md",
|
|
4513
|
+
/** Lista de chips. */
|
|
4514
|
+
list: "flex flex-wrap gap-gp-xs",
|
|
4515
|
+
/** Estado vazio. */
|
|
4516
|
+
empty: "text-caption-md text-fg-subtle px-pad-md"
|
|
4517
|
+
},
|
|
4518
|
+
variants: {
|
|
4519
|
+
size: {
|
|
4520
|
+
sm: {},
|
|
4521
|
+
md: { content: "min-w-[240px]" }
|
|
4522
|
+
}
|
|
4523
|
+
},
|
|
4524
|
+
defaultVariants: { size: "sm" }
|
|
4525
|
+
});
|
|
4526
|
+
const DEFAULT_MESSAGE_VARIABLES = [
|
|
4527
|
+
{ token: "{{firstName}}", label: "Primeiro Nome" },
|
|
4528
|
+
{ token: "{{name}} ", label: "Nome" },
|
|
4529
|
+
{ token: "{{ms}} ", label: "Saudação" },
|
|
4530
|
+
{ token: "{{protocol}} ", label: "Protocolo" },
|
|
4531
|
+
{ token: "{{hora}} ", label: "Hora" }
|
|
4532
|
+
];
|
|
4533
|
+
function MessageVariablesPicker({
|
|
4534
|
+
onSelect,
|
|
4535
|
+
variables = DEFAULT_MESSAGE_VARIABLES,
|
|
4536
|
+
label = "Variáveis",
|
|
4537
|
+
triggerVariant = "icon",
|
|
4538
|
+
open: openProp,
|
|
4539
|
+
onOpenChange,
|
|
4540
|
+
closeOnSelect = true,
|
|
4541
|
+
size = "sm",
|
|
4542
|
+
className,
|
|
4543
|
+
disabled
|
|
4544
|
+
}) {
|
|
4545
|
+
const styles2 = messageVariablesPickerStyles({ size });
|
|
4546
|
+
const [openState, setOpenState] = React.useState(false);
|
|
4547
|
+
const isControlled = openProp !== void 0;
|
|
4548
|
+
const open = isControlled ? openProp : openState;
|
|
4549
|
+
const setOpen = (next) => {
|
|
4550
|
+
if (!isControlled) setOpenState(next);
|
|
4551
|
+
onOpenChange?.(next);
|
|
4552
|
+
};
|
|
4553
|
+
const handleSelect = (token) => {
|
|
4554
|
+
onSelect(token);
|
|
4555
|
+
if (closeOnSelect) setOpen(false);
|
|
4556
|
+
};
|
|
4557
|
+
const buttonSize = triggerVariant === "icon" ? size === "md" ? "icon-md" : "icon-sm" : size;
|
|
4558
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(appShell.Popover, { open, onOpenChange: setOpen, children: [
|
|
4559
|
+
/* @__PURE__ */ jsxRuntime.jsx(appShell.PopoverTrigger, { asChild: true, children: triggerVariant === "icon" ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
4560
|
+
appShell.Button,
|
|
4561
|
+
{
|
|
4562
|
+
type: "button",
|
|
4563
|
+
color: "primary",
|
|
4564
|
+
variant: "ghost",
|
|
4565
|
+
size: buttonSize,
|
|
4566
|
+
disabled,
|
|
4567
|
+
className,
|
|
4568
|
+
"aria-label": "Inserir variável",
|
|
4569
|
+
"aria-haspopup": "dialog",
|
|
4570
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(Icon, { name: "line-code" })
|
|
4571
|
+
}
|
|
4572
|
+
) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
4573
|
+
appShell.Button,
|
|
4574
|
+
{
|
|
4575
|
+
type: "button",
|
|
4576
|
+
color: "primary",
|
|
4577
|
+
variant: "ghost",
|
|
4578
|
+
size: buttonSize,
|
|
4579
|
+
disabled,
|
|
4580
|
+
className,
|
|
4581
|
+
"aria-haspopup": "dialog",
|
|
4582
|
+
iconLeft: /* @__PURE__ */ jsxRuntime.jsx(Icon, { name: "line-code" }),
|
|
4583
|
+
children: label
|
|
4584
|
+
}
|
|
4585
|
+
) }),
|
|
4586
|
+
/* @__PURE__ */ jsxRuntime.jsx(appShell.PopoverContent, { align: "start", sideOffset: 6, mobileSheet: true, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles2.content(), children: [
|
|
4587
|
+
variables.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
4588
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: styles2.header(), children: "Variáveis disponíveis" }),
|
|
4589
|
+
/* @__PURE__ */ jsxRuntime.jsx(Separator, {})
|
|
4590
|
+
] }),
|
|
4591
|
+
variables.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: styles2.empty(), children: "Nenhuma variável disponível" }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles2.list(), children: variables.map((variable) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
4592
|
+
appShell.Chip,
|
|
4593
|
+
{
|
|
4594
|
+
color: "primary",
|
|
4595
|
+
variant: "soft",
|
|
4596
|
+
size: "sm",
|
|
4597
|
+
asButton: true,
|
|
4598
|
+
"aria-label": `Inserir ${variable.label}`,
|
|
4599
|
+
onMouseDown: (e) => e.preventDefault(),
|
|
4600
|
+
onClick: () => handleSelect(variable.token),
|
|
4601
|
+
children: variable.label
|
|
4602
|
+
},
|
|
4603
|
+
variable.token
|
|
4604
|
+
)) })
|
|
4605
|
+
] }) })
|
|
4606
|
+
] });
|
|
4607
|
+
}
|
|
4608
|
+
const dialog = appShell.tv({
|
|
4609
|
+
base: [
|
|
4610
|
+
// Override do DialogContent default (grid + p-pad-4xl + rounded-radius-base + shadow-sh-xl)
|
|
4611
|
+
"!gap-0 !p-0",
|
|
4612
|
+
"border border-border-default",
|
|
4613
|
+
"!rounded-radius-2xl !shadow-sh-2xl",
|
|
4614
|
+
"outline-float",
|
|
4615
|
+
"flex flex-col overflow-hidden",
|
|
4616
|
+
"w-[calc(100%-32px)]",
|
|
4617
|
+
// Teto de altura + body rolável (ver `body` abaixo).
|
|
4618
|
+
//
|
|
4619
|
+
// Sem isto, modal com conteúdo alto CRESCE ALÉM DA TELA e o
|
|
4620
|
+
// `overflow-hidden` acima corta o resto — sem barra de rolagem, sem chegar
|
|
4621
|
+
// no rodapé, sem alcançar os botões. Vale para todo modal do sistema; foi
|
|
4622
|
+
// reportado num formulário longo e reproduz em qualquer um.
|
|
4623
|
+
// Mesma convenção de unidade do `w-[calc(...)]` da linha acima. `dvh` em
|
|
4624
|
+
// vez de `vh` por causa da barra do navegador no celular.
|
|
4625
|
+
"max-h-[calc(100dvh-32px)]"
|
|
4626
|
+
],
|
|
4627
|
+
variants: {
|
|
4628
|
+
size: {
|
|
4629
|
+
sm: "!max-w-[440px]",
|
|
3060
4630
|
md: "!max-w-[540px]",
|
|
3061
|
-
lg: "!max-w-[720px]"
|
|
4631
|
+
lg: "!max-w-[720px]",
|
|
4632
|
+
// Modais de dados (grades com muitas colunas). `full` escala com a viewport
|
|
4633
|
+
// mas mantém margens (não vira tela cheia) e limita em telas ultrawide.
|
|
4634
|
+
xl: "!max-w-[1100px]",
|
|
4635
|
+
full: "!max-w-[min(1400px,92vw)]"
|
|
3062
4636
|
}
|
|
3063
4637
|
},
|
|
3064
4638
|
defaultVariants: { size: "md" }
|
|
3065
4639
|
});
|
|
3066
|
-
const closeBtn =
|
|
4640
|
+
const closeBtn = appShell.tv({
|
|
3067
4641
|
base: [
|
|
3068
4642
|
"absolute top-[14px] right-[14px] z-[1]",
|
|
3069
4643
|
"grid place-items-center size-[28px]",
|
|
@@ -3075,7 +4649,7 @@ const closeBtn = chipGroup.tv({
|
|
|
3075
4649
|
"dark:hover:bg-bg-muted-hover"
|
|
3076
4650
|
]
|
|
3077
4651
|
});
|
|
3078
|
-
const head =
|
|
4652
|
+
const head = appShell.tv({
|
|
3079
4653
|
base: [
|
|
3080
4654
|
"flex items-center gap-[14px]",
|
|
3081
4655
|
"px-pad-4xl pt-pad-4xl pb-pad-3xl",
|
|
@@ -3087,7 +4661,7 @@ const head = chipGroup.tv({
|
|
|
3087
4661
|
withIcon: { false: "", true: "" }
|
|
3088
4662
|
}
|
|
3089
4663
|
});
|
|
3090
|
-
const headIcon =
|
|
4664
|
+
const headIcon = appShell.tv({
|
|
3091
4665
|
base: [
|
|
3092
4666
|
"shrink-0 grid place-items-center size-form-lg",
|
|
3093
4667
|
// 40×40
|
|
@@ -3097,7 +4671,7 @@ const headIcon = chipGroup.tv({
|
|
|
3097
4671
|
"dark:bg-bg-accent dark:border-border-subtle"
|
|
3098
4672
|
]
|
|
3099
4673
|
});
|
|
3100
|
-
const headTitleWrap =
|
|
4674
|
+
const headTitleWrap = appShell.tv({
|
|
3101
4675
|
base: [
|
|
3102
4676
|
"flex-1 min-w-0",
|
|
3103
4677
|
"flex flex-col justify-center",
|
|
@@ -3106,7 +4680,7 @@ const headTitleWrap = chipGroup.tv({
|
|
|
3106
4680
|
// reserva espaço pro X close (right-14 + 28px) — evita overlap
|
|
3107
4681
|
]
|
|
3108
4682
|
});
|
|
3109
|
-
const title =
|
|
4683
|
+
const title = appShell.tv({
|
|
3110
4684
|
base: [
|
|
3111
4685
|
"m-0 mb-[2px]",
|
|
3112
4686
|
"text-body-lg font-bold leading-[1.3]",
|
|
@@ -3114,13 +4688,19 @@ const title = chipGroup.tv({
|
|
|
3114
4688
|
"tracking-[-0.01em]"
|
|
3115
4689
|
]
|
|
3116
4690
|
});
|
|
3117
|
-
const description =
|
|
4691
|
+
const description = appShell.tv({
|
|
3118
4692
|
base: "m-0 text-body-xs font-normal text-fg-muted leading-[1.45]"
|
|
3119
4693
|
});
|
|
3120
|
-
const body =
|
|
3121
|
-
|
|
4694
|
+
const body = appShell.tv({
|
|
4695
|
+
// `min-h-0` é o que permite o flex item encolher e a rolagem acontecer aqui,
|
|
4696
|
+
// em vez de o conteúdo empurrar o container para fora da tela. Sem ele,
|
|
4697
|
+
// `overflow-y-auto` não tem efeito nenhum dentro de um flex column.
|
|
4698
|
+
base: [
|
|
4699
|
+
"flex flex-col gap-[18px] px-pad-4xl py-[22px]",
|
|
4700
|
+
"min-h-0 flex-1 overflow-y-auto"
|
|
4701
|
+
]
|
|
3122
4702
|
});
|
|
3123
|
-
const foot =
|
|
4703
|
+
const foot = appShell.tv({
|
|
3124
4704
|
base: [
|
|
3125
4705
|
"flex items-center gap-gp-lg",
|
|
3126
4706
|
// gap 10px
|
|
@@ -3135,7 +4715,7 @@ const foot = chipGroup.tv({
|
|
|
3135
4715
|
},
|
|
3136
4716
|
defaultVariants: { layout: "end" }
|
|
3137
4717
|
});
|
|
3138
|
-
const footRight =
|
|
4718
|
+
const footRight = appShell.tv({
|
|
3139
4719
|
base: "flex items-center gap-gp-lg"
|
|
3140
4720
|
});
|
|
3141
4721
|
function Modal({
|
|
@@ -3167,15 +4747,15 @@ function Modal({
|
|
|
3167
4747
|
{
|
|
3168
4748
|
className: dialog({ size, className }),
|
|
3169
4749
|
hideClose: true,
|
|
3170
|
-
|
|
3171
|
-
"aria-describedby": description$1 ? "modal-description" : void 0,
|
|
4750
|
+
...description$1 ? {} : { "aria-describedby": void 0 },
|
|
3172
4751
|
children: [
|
|
4752
|
+
!title$1 && /* @__PURE__ */ jsxRuntime.jsx(appShell.DialogTitle, { className: "sr-only", children: "Diálogo" }),
|
|
3173
4753
|
!hideClose && /* @__PURE__ */ jsxRuntime.jsx(appShell.DialogClose, { className: closeBtn(), "aria-label": "Fechar", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "size-icon-sm" }) }),
|
|
3174
4754
|
hasHeader && /* @__PURE__ */ jsxRuntime.jsxs("header", { className: head(), children: [
|
|
3175
4755
|
icon && /* @__PURE__ */ jsxRuntime.jsx("span", { className: headIcon(), "aria-hidden": "true", children: icon }),
|
|
3176
4756
|
(title$1 || description$1) && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: headTitleWrap(), children: [
|
|
3177
|
-
title$1 && /* @__PURE__ */ jsxRuntime.jsx(
|
|
3178
|
-
description$1 && /* @__PURE__ */ jsxRuntime.jsx(
|
|
4757
|
+
title$1 && /* @__PURE__ */ jsxRuntime.jsx(appShell.DialogTitle, { className: title(), children: title$1 }),
|
|
4758
|
+
description$1 && /* @__PURE__ */ jsxRuntime.jsx(appShell.DialogDescription, { className: description(), children: description$1 })
|
|
3179
4759
|
] })
|
|
3180
4760
|
] }),
|
|
3181
4761
|
children !== void 0 && children !== null && /* @__PURE__ */ jsxRuntime.jsx("div", { className: body(), children }),
|
|
@@ -3207,7 +4787,7 @@ function StructuredActions({
|
|
|
3207
4787
|
onClose
|
|
3208
4788
|
}) {
|
|
3209
4789
|
const renderTertiary = tertiary && /* @__PURE__ */ jsxRuntime.jsx(
|
|
3210
|
-
|
|
4790
|
+
appShell.Button,
|
|
3211
4791
|
{
|
|
3212
4792
|
color: tertiary.danger ? "critical" : "secondary",
|
|
3213
4793
|
variant: "ghost",
|
|
@@ -3219,7 +4799,7 @@ function StructuredActions({
|
|
|
3219
4799
|
}
|
|
3220
4800
|
);
|
|
3221
4801
|
const renderSecondary = secondary && /* @__PURE__ */ jsxRuntime.jsx(
|
|
3222
|
-
|
|
4802
|
+
appShell.Button,
|
|
3223
4803
|
{
|
|
3224
4804
|
color: "secondary",
|
|
3225
4805
|
variant: "outline",
|
|
@@ -3231,7 +4811,7 @@ function StructuredActions({
|
|
|
3231
4811
|
}
|
|
3232
4812
|
);
|
|
3233
4813
|
const renderPrimary = primary && /* @__PURE__ */ jsxRuntime.jsx(
|
|
3234
|
-
|
|
4814
|
+
appShell.Button,
|
|
3235
4815
|
{
|
|
3236
4816
|
color: primary.danger ? "critical" : "primary",
|
|
3237
4817
|
variant: "filled",
|
|
@@ -3256,25 +4836,253 @@ function StructuredActions({
|
|
|
3256
4836
|
renderPrimary
|
|
3257
4837
|
] });
|
|
3258
4838
|
}
|
|
3259
|
-
const
|
|
3260
|
-
|
|
3261
|
-
|
|
3262
|
-
|
|
3263
|
-
|
|
4839
|
+
const monthYearStyles = appShell.tv({
|
|
4840
|
+
slots: {
|
|
4841
|
+
trigger: [
|
|
4842
|
+
"flex min-h-form-lg w-full items-center justify-between gap-gp-md",
|
|
4843
|
+
"rounded-radius-lg px-pad-xl",
|
|
4844
|
+
"bg-bg-input dark:bg-bg-muted",
|
|
4845
|
+
"hover:bg-bg-input-hover dark:hover:bg-bg-muted-hover",
|
|
4846
|
+
"border border-border-input",
|
|
4847
|
+
"text-body-sm font-normal text-fg-default text-left",
|
|
4848
|
+
"transition-[color,box-shadow,background-color,border-color]",
|
|
4849
|
+
"focus-visible:outline-none",
|
|
4850
|
+
"data-[placeholder]:text-fg-muted data-[placeholder]:opacity-70",
|
|
4851
|
+
"focus-visible:border-border-brand data-[state=open]:border-border-brand",
|
|
4852
|
+
"focus-visible:shadow-sh-ring data-[state=open]:shadow-sh-ring",
|
|
4853
|
+
"disabled:cursor-not-allowed disabled:opacity-50",
|
|
4854
|
+
"disabled:hover:bg-bg-input dark:disabled:hover:bg-bg-muted"
|
|
4855
|
+
],
|
|
4856
|
+
triggerLeadingIcon: "size-icon-sm shrink-0 text-fg-muted",
|
|
4857
|
+
value: "min-w-0 flex-1 truncate",
|
|
4858
|
+
triggerIcon: "size-icon-sm shrink-0 text-fg-muted",
|
|
4859
|
+
// Dropdown compacto — largura própria (não amarra na do trigger, a grade
|
|
4860
|
+
// 3×4 tem largura natural).
|
|
4861
|
+
content: "w-[16rem] p-pad-md",
|
|
4862
|
+
header: "flex items-center justify-between gap-gp-md pb-pad-md",
|
|
4863
|
+
navButton: [
|
|
4864
|
+
"inline-flex size-form-sm items-center justify-center shrink-0",
|
|
4865
|
+
"rounded-radius-base text-fg-muted",
|
|
4866
|
+
"hover:bg-bg-muted hover:text-fg-default",
|
|
4867
|
+
"focus-visible:outline-none focus-visible:ring-4 focus-visible:ring-ring-brand",
|
|
4868
|
+
"disabled:pointer-events-none disabled:opacity-40"
|
|
4869
|
+
],
|
|
4870
|
+
yearLabel: "text-body-sm font-semibold text-fg-default tabular-nums",
|
|
4871
|
+
grid: "grid grid-cols-3 gap-gp-sm"
|
|
4872
|
+
}
|
|
4873
|
+
});
|
|
4874
|
+
const monthYearMonthButton = appShell.tv({
|
|
4875
|
+
base: [
|
|
4876
|
+
"flex items-center justify-center min-h-form-md px-pad-md",
|
|
4877
|
+
"rounded-radius-base text-body-sm font-medium",
|
|
4878
|
+
"transition-[background-color,color]",
|
|
4879
|
+
"focus-visible:outline-none focus-visible:ring-4 focus-visible:ring-ring-brand"
|
|
4880
|
+
],
|
|
4881
|
+
variants: {
|
|
4882
|
+
selected: {
|
|
4883
|
+
true: "bg-bg-brand text-fg-on-brand hover:bg-bg-brand-hover",
|
|
4884
|
+
false: "text-fg-default hover:bg-bg-muted"
|
|
4885
|
+
},
|
|
4886
|
+
disabled: {
|
|
4887
|
+
true: "pointer-events-none opacity-40"
|
|
4888
|
+
}
|
|
4889
|
+
},
|
|
4890
|
+
defaultVariants: {
|
|
4891
|
+
selected: false
|
|
4892
|
+
}
|
|
4893
|
+
});
|
|
4894
|
+
function parseValue(value) {
|
|
4895
|
+
if (!value) return null;
|
|
4896
|
+
const match = /^(\d{4})-(\d{2})$/.exec(value);
|
|
4897
|
+
if (!match) return null;
|
|
4898
|
+
const year = Number(match[1]);
|
|
4899
|
+
const month = Number(match[2]);
|
|
4900
|
+
if (month < 1 || month > 12) return null;
|
|
4901
|
+
return { year, month };
|
|
4902
|
+
}
|
|
4903
|
+
function toOrdinal(year, monthIndex) {
|
|
4904
|
+
return year * 12 + monthIndex;
|
|
4905
|
+
}
|
|
4906
|
+
function capitalizeFirst(text) {
|
|
4907
|
+
return text.charAt(0).toUpperCase() + text.slice(1);
|
|
4908
|
+
}
|
|
4909
|
+
const MonthYearPicker = React.forwardRef(function MonthYearPicker2({
|
|
4910
|
+
value,
|
|
4911
|
+
onValueChange,
|
|
4912
|
+
placeholder = "Selecione o mês",
|
|
4913
|
+
min,
|
|
4914
|
+
max,
|
|
4915
|
+
locale = "pt-BR",
|
|
4916
|
+
disabled,
|
|
4917
|
+
open: openProp,
|
|
4918
|
+
defaultOpen,
|
|
4919
|
+
onOpenChange,
|
|
4920
|
+
align = "start",
|
|
4921
|
+
className,
|
|
4922
|
+
contentClassName,
|
|
4923
|
+
"aria-label": ariaLabel
|
|
4924
|
+
}, ref) {
|
|
4925
|
+
const parsed = parseValue(value);
|
|
4926
|
+
const now = /* @__PURE__ */ new Date();
|
|
4927
|
+
const [uncontrolledOpen, setUncontrolledOpen] = React.useState(defaultOpen ?? false);
|
|
4928
|
+
const isControlled = openProp !== void 0;
|
|
4929
|
+
const open = isControlled ? openProp : uncontrolledOpen;
|
|
4930
|
+
const setOpen = (next) => {
|
|
4931
|
+
if (!isControlled) setUncontrolledOpen(next);
|
|
4932
|
+
onOpenChange?.(next);
|
|
4933
|
+
};
|
|
4934
|
+
const [viewYear, setViewYear] = React.useState(
|
|
4935
|
+
parsed?.year ?? now.getFullYear()
|
|
4936
|
+
);
|
|
4937
|
+
const monthLabels = React.useMemo(() => {
|
|
4938
|
+
const fmt = new Intl.DateTimeFormat(locale, { month: "short" });
|
|
4939
|
+
return Array.from(
|
|
4940
|
+
{ length: 12 },
|
|
4941
|
+
(_, i) => capitalizeFirst(fmt.format(new Date(2020, i, 1)).replace(/\.$/, ""))
|
|
4942
|
+
);
|
|
4943
|
+
}, [locale]);
|
|
4944
|
+
const triggerLabel = React.useMemo(() => {
|
|
4945
|
+
if (!parsed) return null;
|
|
4946
|
+
const fmt = new Intl.DateTimeFormat(locale, {
|
|
4947
|
+
month: "long",
|
|
4948
|
+
year: "numeric"
|
|
4949
|
+
});
|
|
4950
|
+
return capitalizeFirst(fmt.format(new Date(parsed.year, parsed.month - 1, 1)));
|
|
4951
|
+
}, [parsed, locale]);
|
|
4952
|
+
const styles2 = monthYearStyles();
|
|
4953
|
+
const minParsed = parseValue(min);
|
|
4954
|
+
const maxParsed = parseValue(max);
|
|
4955
|
+
const minOrdinal = minParsed ? toOrdinal(minParsed.year, minParsed.month - 1) : -Infinity;
|
|
4956
|
+
const maxOrdinal = maxParsed ? toOrdinal(maxParsed.year, maxParsed.month - 1) : Infinity;
|
|
4957
|
+
const isMonthDisabled = (monthIndex) => {
|
|
4958
|
+
const ord = toOrdinal(viewYear, monthIndex);
|
|
4959
|
+
return ord < minOrdinal || ord > maxOrdinal;
|
|
4960
|
+
};
|
|
4961
|
+
const prevYearDisabled = toOrdinal(viewYear - 1, 11) < minOrdinal;
|
|
4962
|
+
const nextYearDisabled = toOrdinal(viewYear + 1, 0) > maxOrdinal;
|
|
4963
|
+
const selectMonth = (monthIndex) => {
|
|
4964
|
+
const next = `${viewYear}-${String(monthIndex + 1).padStart(2, "0")}`;
|
|
4965
|
+
onValueChange?.(next);
|
|
4966
|
+
setOpen(false);
|
|
4967
|
+
};
|
|
4968
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(appShell.Popover, { open, onOpenChange: setOpen, children: [
|
|
4969
|
+
/* @__PURE__ */ jsxRuntime.jsx(appShell.PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
4970
|
+
"button",
|
|
4971
|
+
{
|
|
4972
|
+
ref,
|
|
4973
|
+
type: "button",
|
|
4974
|
+
"aria-label": ariaLabel,
|
|
4975
|
+
"aria-haspopup": "dialog",
|
|
4976
|
+
disabled,
|
|
4977
|
+
"data-placeholder": parsed ? void 0 : "",
|
|
4978
|
+
className: styles2.trigger({ className }),
|
|
4979
|
+
children: [
|
|
4980
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4981
|
+
lucideReact.CalendarDays,
|
|
4982
|
+
{
|
|
4983
|
+
className: styles2.triggerLeadingIcon(),
|
|
4984
|
+
"aria-hidden": "true"
|
|
4985
|
+
}
|
|
4986
|
+
),
|
|
4987
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: styles2.value(), children: triggerLabel ?? placeholder }),
|
|
4988
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronDown, { className: styles2.triggerIcon(), "aria-hidden": "true" })
|
|
4989
|
+
]
|
|
4990
|
+
}
|
|
4991
|
+
) }),
|
|
4992
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
4993
|
+
appShell.PopoverContent,
|
|
4994
|
+
{
|
|
4995
|
+
align,
|
|
4996
|
+
className: styles2.content({ className: contentClassName }),
|
|
4997
|
+
children: [
|
|
4998
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles2.header(), children: [
|
|
4999
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5000
|
+
"button",
|
|
5001
|
+
{
|
|
5002
|
+
type: "button",
|
|
5003
|
+
className: styles2.navButton(),
|
|
5004
|
+
onClick: () => setViewYear((y) => y - 1),
|
|
5005
|
+
disabled: prevYearDisabled,
|
|
5006
|
+
"aria-label": "Ano anterior",
|
|
5007
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronLeft, { className: "size-icon-sm", "aria-hidden": "true" })
|
|
5008
|
+
}
|
|
5009
|
+
),
|
|
5010
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: styles2.yearLabel(), "aria-live": "polite", children: viewYear }),
|
|
5011
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5012
|
+
"button",
|
|
5013
|
+
{
|
|
5014
|
+
type: "button",
|
|
5015
|
+
className: styles2.navButton(),
|
|
5016
|
+
onClick: () => setViewYear((y) => y + 1),
|
|
5017
|
+
disabled: nextYearDisabled,
|
|
5018
|
+
"aria-label": "Próximo ano",
|
|
5019
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronRight, { className: "size-icon-sm", "aria-hidden": "true" })
|
|
5020
|
+
}
|
|
5021
|
+
)
|
|
5022
|
+
] }),
|
|
5023
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: styles2.grid(), role: "grid", children: monthLabels.map((label, i) => {
|
|
5024
|
+
const monthDisabled = isMonthDisabled(i);
|
|
5025
|
+
const isSelected = parsed?.year === viewYear && parsed?.month === i + 1;
|
|
5026
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
5027
|
+
"button",
|
|
5028
|
+
{
|
|
5029
|
+
type: "button",
|
|
5030
|
+
role: "gridcell",
|
|
5031
|
+
"aria-pressed": isSelected,
|
|
5032
|
+
disabled: monthDisabled,
|
|
5033
|
+
onClick: () => selectMonth(i),
|
|
5034
|
+
className: monthYearMonthButton({
|
|
5035
|
+
selected: isSelected,
|
|
5036
|
+
disabled: monthDisabled
|
|
5037
|
+
}),
|
|
5038
|
+
children: label
|
|
5039
|
+
},
|
|
5040
|
+
label
|
|
5041
|
+
);
|
|
5042
|
+
}) })
|
|
5043
|
+
]
|
|
5044
|
+
}
|
|
5045
|
+
)
|
|
5046
|
+
] });
|
|
5047
|
+
});
|
|
5048
|
+
MonthYearPicker.displayName = "MonthYearPicker";
|
|
5049
|
+
const TooltipProvider = TooltipPrimitive__namespace.Provider;
|
|
3264
5050
|
const TooltipTrigger = TooltipPrimitive__namespace.Trigger;
|
|
3265
|
-
const
|
|
5051
|
+
const Tooltip = ({ children, ...props }) => /* @__PURE__ */ jsxRuntime.jsx(TooltipProvider, { children: /* @__PURE__ */ jsxRuntime.jsx(TooltipPrimitive__namespace.Root, { ...props, children }) });
|
|
5052
|
+
Tooltip.displayName = "Tooltip";
|
|
5053
|
+
const TooltipContent = React__namespace.forwardRef(({ className, sideOffset = 6, showArrow = true, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(TooltipPrimitive__namespace.Portal, { children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3266
5054
|
TooltipPrimitive__namespace.Content,
|
|
3267
5055
|
{
|
|
3268
5056
|
ref,
|
|
3269
5057
|
sideOffset,
|
|
3270
|
-
className:
|
|
3271
|
-
"z-50
|
|
3272
|
-
"
|
|
5058
|
+
className: appShell.cn(
|
|
5059
|
+
"z-50 max-w-[16rem] select-none",
|
|
5060
|
+
"bg-bg-emphasis text-fg-default",
|
|
5061
|
+
"rounded-radius-md px-pad-lg py-pad-xs",
|
|
5062
|
+
"text-caption-sm",
|
|
5063
|
+
"shadow-sh-md",
|
|
5064
|
+
"origin-[--radix-tooltip-content-transform-origin]",
|
|
5065
|
+
"data-[state=delayed-open]:animate-in data-[state=instant-open]:animate-in data-[state=closed]:animate-out",
|
|
5066
|
+
"data-[state=closed]:fade-out-0 data-[state=delayed-open]:fade-in-0 data-[state=instant-open]:fade-in-0",
|
|
5067
|
+
"data-[state=closed]:zoom-out-95 data-[state=delayed-open]:zoom-in-95 data-[state=instant-open]:zoom-in-95",
|
|
5068
|
+
"data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2",
|
|
5069
|
+
"data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
3273
5070
|
className
|
|
3274
5071
|
),
|
|
3275
|
-
...props
|
|
5072
|
+
...props,
|
|
5073
|
+
children: [
|
|
5074
|
+
children,
|
|
5075
|
+
showArrow && /* @__PURE__ */ jsxRuntime.jsx(
|
|
5076
|
+
TooltipPrimitive__namespace.Arrow,
|
|
5077
|
+
{
|
|
5078
|
+
width: 11,
|
|
5079
|
+
height: 5,
|
|
5080
|
+
className: "fill-bg-emphasis"
|
|
5081
|
+
}
|
|
5082
|
+
)
|
|
5083
|
+
]
|
|
3276
5084
|
}
|
|
3277
|
-
));
|
|
5085
|
+
) }));
|
|
3278
5086
|
TooltipContent.displayName = TooltipPrimitive__namespace.Content.displayName;
|
|
3279
5087
|
const SingleMenuSidebarContext = React.createContext({
|
|
3280
5088
|
expanded: true,
|
|
@@ -3352,7 +5160,7 @@ function useSingleMenuSidebarState(defaultExpanded, controlledExpanded, onExpand
|
|
|
3352
5160
|
setOpenCategoryId
|
|
3353
5161
|
};
|
|
3354
5162
|
}
|
|
3355
|
-
const sidebarRoot =
|
|
5163
|
+
const sidebarRoot = appShell.tv({
|
|
3356
5164
|
base: [
|
|
3357
5165
|
"relative flex h-full flex-col overflow-x-hidden",
|
|
3358
5166
|
"border-r border-border-sidebar bg-bg-sidebar",
|
|
@@ -3370,7 +5178,7 @@ const sidebarRoot = chipGroup.tv({
|
|
|
3370
5178
|
expanded: true
|
|
3371
5179
|
}
|
|
3372
5180
|
});
|
|
3373
|
-
const category =
|
|
5181
|
+
const category = appShell.tv({
|
|
3374
5182
|
slots: {
|
|
3375
5183
|
root: "flex items-center rounded-radius-lg cursor-pointer transition-all",
|
|
3376
5184
|
text: "flex-1 text-left text-body-sm whitespace-nowrap overflow-hidden text-ellipsis",
|
|
@@ -3405,7 +5213,7 @@ const category = chipGroup.tv({
|
|
|
3405
5213
|
collapsed: false
|
|
3406
5214
|
}
|
|
3407
5215
|
});
|
|
3408
|
-
const menuItem =
|
|
5216
|
+
const menuItem = appShell.tv({
|
|
3409
5217
|
slots: {
|
|
3410
5218
|
root: "flex h-[38px] items-center gap-[18px] pl-[18px] pr-pad-2xl cursor-pointer transition-colors hover:bg-bg-sidebar-accent",
|
|
3411
5219
|
border: "h-full w-0 shrink-0",
|
|
@@ -3430,7 +5238,7 @@ const menuItem = chipGroup.tv({
|
|
|
3430
5238
|
const styles = {
|
|
3431
5239
|
// Header
|
|
3432
5240
|
header: {
|
|
3433
|
-
wrapper: "flex h-
|
|
5241
|
+
wrapper: "flex h-layout-navbar items-center overflow-hidden px-pad-4xl py-pad-md shrink-0",
|
|
3434
5242
|
wrapperCollapsed: "justify-center px-0",
|
|
3435
5243
|
inner: "flex items-center gap-gp-md",
|
|
3436
5244
|
logo: "shrink-0",
|
|
@@ -3503,14 +5311,14 @@ function SingleMenuHeader({
|
|
|
3503
5311
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3504
5312
|
"div",
|
|
3505
5313
|
{
|
|
3506
|
-
className:
|
|
5314
|
+
className: appShell.cn(
|
|
3507
5315
|
styles.header.wrapper,
|
|
3508
5316
|
!expanded && styles.header.wrapperCollapsed
|
|
3509
5317
|
),
|
|
3510
5318
|
children: [
|
|
3511
5319
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles.header.inner, children: [
|
|
3512
5320
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: styles.header.logo, children: logo }),
|
|
3513
|
-
expanded && /* @__PURE__ */ jsxRuntime.jsx("span", { className:
|
|
5321
|
+
expanded && /* @__PURE__ */ jsxRuntime.jsx("span", { className: appShell.cn(styles.header.title, styles.textFadeIn), children: title2 })
|
|
3514
5322
|
] }),
|
|
3515
5323
|
expanded ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
3516
5324
|
"button",
|
|
@@ -3522,7 +5330,7 @@ function SingleMenuHeader({
|
|
|
3522
5330
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3523
5331
|
lucideReact.PanelLeftClose,
|
|
3524
5332
|
{
|
|
3525
|
-
className:
|
|
5333
|
+
className: appShell.cn(
|
|
3526
5334
|
"size-icon-sm transition-transform duration-300",
|
|
3527
5335
|
isFlipped && "rotate-180"
|
|
3528
5336
|
)
|
|
@@ -3539,7 +5347,7 @@ function SingleMenuHeader({
|
|
|
3539
5347
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3540
5348
|
lucideReact.PanelLeftClose,
|
|
3541
5349
|
{
|
|
3542
|
-
className:
|
|
5350
|
+
className: appShell.cn(
|
|
3543
5351
|
styles.header.expandBtnIcon,
|
|
3544
5352
|
"transition-transform duration-300 rotate-180"
|
|
3545
5353
|
)
|
|
@@ -3578,7 +5386,7 @@ function SingleMenuModuleSelector({
|
|
|
3578
5386
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3579
5387
|
appShell.DropdownMenuItem,
|
|
3580
5388
|
{
|
|
3581
|
-
className:
|
|
5389
|
+
className: appShell.cn(
|
|
3582
5390
|
s.dropdownItem,
|
|
3583
5391
|
isSelected && s.dropdownItemSelected
|
|
3584
5392
|
),
|
|
@@ -3721,7 +5529,7 @@ function SingleMenuCategory({
|
|
|
3721
5529
|
if (!hasItems) {
|
|
3722
5530
|
return /* @__PURE__ */ jsxRuntime.jsxs("button", { type: "button", onClick: handleToggle, className: s.root(), children: [
|
|
3723
5531
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: s.icon(), children: icon }),
|
|
3724
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className:
|
|
5532
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: appShell.cn(s.text(), styles.textFadeIn), children: label })
|
|
3725
5533
|
] });
|
|
3726
5534
|
}
|
|
3727
5535
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -3735,8 +5543,8 @@ function SingleMenuCategory({
|
|
|
3735
5543
|
children: [
|
|
3736
5544
|
/* @__PURE__ */ jsxRuntime.jsxs(CollapsibleTrigger, { className: s.root(), children: [
|
|
3737
5545
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: s.icon(), children: icon }),
|
|
3738
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className:
|
|
3739
|
-
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronDown, { className:
|
|
5546
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: appShell.cn(s.text(), styles.textFadeIn), children: label }),
|
|
5547
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronDown, { className: appShell.cn(s.chevron(), isOpen && "rotate-180") })
|
|
3740
5548
|
] }),
|
|
3741
5549
|
/* @__PURE__ */ jsxRuntime.jsx(CollapsibleContent, { children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles.subItemList, children: items.map((item) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
3742
5550
|
SingleMenuItem,
|
|
@@ -3772,13 +5580,13 @@ function SingleMenuFooter({
|
|
|
3772
5580
|
] })
|
|
3773
5581
|
] });
|
|
3774
5582
|
if (!actions || actions.length === 0) {
|
|
3775
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: s.wrapper, children: /* @__PURE__ */ jsxRuntime.jsx("div", { className:
|
|
5583
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: s.wrapper, children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: appShell.cn(s.button, !expanded && "justify-center px-0"), children: triggerContent }) });
|
|
3776
5584
|
}
|
|
3777
5585
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: s.wrapper, children: /* @__PURE__ */ jsxRuntime.jsxs(appShell.DropdownMenu, { children: [
|
|
3778
5586
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3779
5587
|
appShell.DropdownMenuTrigger,
|
|
3780
5588
|
{
|
|
3781
|
-
className:
|
|
5589
|
+
className: appShell.cn(s.button, !expanded && "justify-center px-0"),
|
|
3782
5590
|
children: triggerContent
|
|
3783
5591
|
}
|
|
3784
5592
|
),
|
|
@@ -3910,7 +5718,7 @@ function SingleMenuSidebar({
|
|
|
3910
5718
|
"aside",
|
|
3911
5719
|
{
|
|
3912
5720
|
"aria-label": "Navegação lateral",
|
|
3913
|
-
className:
|
|
5721
|
+
className: appShell.cn(sidebarRoot({ expanded }), className),
|
|
3914
5722
|
onMouseEnter,
|
|
3915
5723
|
onMouseLeave,
|
|
3916
5724
|
...props,
|
|
@@ -3924,7 +5732,7 @@ function SingleMenuSidebar({
|
|
|
3924
5732
|
}
|
|
3925
5733
|
),
|
|
3926
5734
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: styles.divider }),
|
|
3927
|
-
expanded && (moduleDisplay || showSearch) && /* @__PURE__ */ jsxRuntime.jsxs("div", { className:
|
|
5735
|
+
expanded && (moduleDisplay || showSearch) && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: appShell.cn(styles.sectionPadding, styles.textFadeIn), children: [
|
|
3928
5736
|
moduleDisplay && /* @__PURE__ */ jsxRuntime.jsx(SingleMenuModuleSelector, { ...moduleDisplay }),
|
|
3929
5737
|
showSearch && /* @__PURE__ */ jsxRuntime.jsx(
|
|
3930
5738
|
SingleMenuSearch,
|
|
@@ -3938,7 +5746,7 @@ function SingleMenuSidebar({
|
|
|
3938
5746
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3939
5747
|
"nav",
|
|
3940
5748
|
{
|
|
3941
|
-
className:
|
|
5749
|
+
className: appShell.cn(
|
|
3942
5750
|
styles.navContainer,
|
|
3943
5751
|
expanded ? styles.navContainerExpanded : styles.navContainerCollapsed
|
|
3944
5752
|
),
|
|
@@ -3971,52 +5779,1811 @@ function SingleMenuSidebar({
|
|
|
3971
5779
|
] });
|
|
3972
5780
|
}
|
|
3973
5781
|
SingleMenuSidebar.displayName = "SingleMenuSidebar";
|
|
3974
|
-
|
|
3975
|
-
|
|
3976
|
-
|
|
3977
|
-
|
|
3978
|
-
|
|
3979
|
-
|
|
3980
|
-
|
|
3981
|
-
|
|
3982
|
-
|
|
3983
|
-
|
|
3984
|
-
|
|
3985
|
-
|
|
3986
|
-
|
|
3987
|
-
|
|
3988
|
-
|
|
3989
|
-
|
|
3990
|
-
|
|
3991
|
-
|
|
3992
|
-
|
|
3993
|
-
|
|
3994
|
-
|
|
3995
|
-
|
|
3996
|
-
|
|
3997
|
-
|
|
3998
|
-
|
|
3999
|
-
|
|
4000
|
-
|
|
4001
|
-
|
|
4002
|
-
|
|
4003
|
-
|
|
4004
|
-
|
|
4005
|
-
|
|
4006
|
-
|
|
4007
|
-
|
|
4008
|
-
|
|
4009
|
-
|
|
4010
|
-
|
|
4011
|
-
|
|
4012
|
-
|
|
4013
|
-
|
|
4014
|
-
|
|
4015
|
-
|
|
4016
|
-
|
|
4017
|
-
|
|
5782
|
+
const spinnerStyles = appShell.tv({
|
|
5783
|
+
base: ["inline-block shrink-0", "animate-spin motion-reduce:animate-none"],
|
|
5784
|
+
variants: {
|
|
5785
|
+
size: {
|
|
5786
|
+
sm: "size-icon-sm",
|
|
5787
|
+
md: "size-icon-md",
|
|
5788
|
+
lg: "size-icon-lg"
|
|
5789
|
+
},
|
|
5790
|
+
color: {
|
|
5791
|
+
current: "text-current",
|
|
5792
|
+
default: "text-fg-default",
|
|
5793
|
+
muted: "text-fg-muted",
|
|
5794
|
+
brand: "text-fg-brand",
|
|
5795
|
+
"on-brand": "text-fg-on-brand"
|
|
5796
|
+
}
|
|
5797
|
+
},
|
|
5798
|
+
defaultVariants: {
|
|
5799
|
+
size: "md",
|
|
5800
|
+
color: "muted"
|
|
5801
|
+
}
|
|
5802
|
+
});
|
|
5803
|
+
const Spinner = React.forwardRef(function Spinner2({ size, color, label = "Carregando", className, ...rest }, ref) {
|
|
5804
|
+
const decorative = rest["aria-hidden"] === true || rest["aria-hidden"] === "true";
|
|
5805
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5806
|
+
"svg",
|
|
5807
|
+
{
|
|
5808
|
+
ref,
|
|
5809
|
+
viewBox: "0 0 24 24",
|
|
5810
|
+
fill: "none",
|
|
5811
|
+
role: decorative ? void 0 : "status",
|
|
5812
|
+
"aria-label": decorative ? void 0 : label,
|
|
5813
|
+
className: spinnerStyles({ size, color, className }),
|
|
5814
|
+
...rest,
|
|
5815
|
+
children: [
|
|
5816
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5817
|
+
"circle",
|
|
5818
|
+
{
|
|
5819
|
+
cx: "12",
|
|
5820
|
+
cy: "12",
|
|
5821
|
+
r: "9",
|
|
5822
|
+
stroke: "currentColor",
|
|
5823
|
+
strokeWidth: "3",
|
|
5824
|
+
className: "opacity-20"
|
|
5825
|
+
}
|
|
5826
|
+
),
|
|
5827
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5828
|
+
"path",
|
|
5829
|
+
{
|
|
5830
|
+
d: "M21 12a9 9 0 0 0-9-9",
|
|
5831
|
+
stroke: "currentColor",
|
|
5832
|
+
strokeWidth: "3",
|
|
5833
|
+
strokeLinecap: "round"
|
|
5834
|
+
}
|
|
5835
|
+
)
|
|
5836
|
+
]
|
|
5837
|
+
}
|
|
5838
|
+
);
|
|
5839
|
+
});
|
|
5840
|
+
Spinner.displayName = "Spinner";
|
|
5841
|
+
class Adder {
|
|
5842
|
+
constructor() {
|
|
5843
|
+
this._partials = new Float64Array(32);
|
|
5844
|
+
this._n = 0;
|
|
5845
|
+
}
|
|
5846
|
+
add(x) {
|
|
5847
|
+
const p = this._partials;
|
|
5848
|
+
let i = 0;
|
|
5849
|
+
for (let j = 0; j < this._n && j < 32; j++) {
|
|
5850
|
+
const y = p[j], hi = x + y, lo = Math.abs(x) < Math.abs(y) ? x - (hi - y) : y - (hi - x);
|
|
5851
|
+
if (lo) p[i++] = lo;
|
|
5852
|
+
x = hi;
|
|
5853
|
+
}
|
|
5854
|
+
p[i] = x;
|
|
5855
|
+
this._n = i + 1;
|
|
5856
|
+
return this;
|
|
5857
|
+
}
|
|
5858
|
+
valueOf() {
|
|
5859
|
+
const p = this._partials;
|
|
5860
|
+
let n = this._n, x, y, lo, hi = 0;
|
|
5861
|
+
if (n > 0) {
|
|
5862
|
+
hi = p[--n];
|
|
5863
|
+
while (n > 0) {
|
|
5864
|
+
x = hi;
|
|
5865
|
+
y = p[--n];
|
|
5866
|
+
hi = x + y;
|
|
5867
|
+
lo = y - (hi - x);
|
|
5868
|
+
if (lo) break;
|
|
5869
|
+
}
|
|
5870
|
+
if (n > 0 && (lo < 0 && p[n - 1] < 0 || lo > 0 && p[n - 1] > 0)) {
|
|
5871
|
+
y = lo * 2;
|
|
5872
|
+
x = hi + y;
|
|
5873
|
+
if (y == x - hi) hi = x;
|
|
5874
|
+
}
|
|
5875
|
+
}
|
|
5876
|
+
return hi;
|
|
5877
|
+
}
|
|
5878
|
+
}
|
|
5879
|
+
function* flatten(arrays) {
|
|
5880
|
+
for (const array of arrays) {
|
|
5881
|
+
yield* array;
|
|
5882
|
+
}
|
|
5883
|
+
}
|
|
5884
|
+
function merge(arrays) {
|
|
5885
|
+
return Array.from(flatten(arrays));
|
|
5886
|
+
}
|
|
5887
|
+
var epsilon = 1e-6;
|
|
5888
|
+
var pi = Math.PI;
|
|
5889
|
+
var halfPi = pi / 2;
|
|
5890
|
+
var quarterPi = pi / 4;
|
|
5891
|
+
var tau = pi * 2;
|
|
5892
|
+
var degrees = 180 / pi;
|
|
5893
|
+
var radians = pi / 180;
|
|
5894
|
+
var abs = Math.abs;
|
|
5895
|
+
var atan = Math.atan;
|
|
5896
|
+
var atan2 = Math.atan2;
|
|
5897
|
+
var cos = Math.cos;
|
|
5898
|
+
var exp = Math.exp;
|
|
5899
|
+
var log = Math.log;
|
|
5900
|
+
var sin = Math.sin;
|
|
5901
|
+
var sign = Math.sign || function(x) {
|
|
5902
|
+
return x > 0 ? 1 : x < 0 ? -1 : 0;
|
|
5903
|
+
};
|
|
5904
|
+
var sqrt = Math.sqrt;
|
|
5905
|
+
var tan = Math.tan;
|
|
5906
|
+
function acos(x) {
|
|
5907
|
+
return x > 1 ? 0 : x < -1 ? pi : Math.acos(x);
|
|
5908
|
+
}
|
|
5909
|
+
function asin(x) {
|
|
5910
|
+
return x > 1 ? halfPi : x < -1 ? -halfPi : Math.asin(x);
|
|
5911
|
+
}
|
|
5912
|
+
function noop() {
|
|
5913
|
+
}
|
|
5914
|
+
function streamGeometry(geometry, stream) {
|
|
5915
|
+
if (geometry && streamGeometryType.hasOwnProperty(geometry.type)) {
|
|
5916
|
+
streamGeometryType[geometry.type](geometry, stream);
|
|
5917
|
+
}
|
|
5918
|
+
}
|
|
5919
|
+
var streamObjectType = {
|
|
5920
|
+
Feature: function(object2, stream) {
|
|
5921
|
+
streamGeometry(object2.geometry, stream);
|
|
5922
|
+
},
|
|
5923
|
+
FeatureCollection: function(object2, stream) {
|
|
5924
|
+
var features = object2.features, i = -1, n = features.length;
|
|
5925
|
+
while (++i < n) streamGeometry(features[i].geometry, stream);
|
|
5926
|
+
}
|
|
5927
|
+
};
|
|
5928
|
+
var streamGeometryType = {
|
|
5929
|
+
Sphere: function(object2, stream) {
|
|
5930
|
+
stream.sphere();
|
|
5931
|
+
},
|
|
5932
|
+
Point: function(object2, stream) {
|
|
5933
|
+
object2 = object2.coordinates;
|
|
5934
|
+
stream.point(object2[0], object2[1], object2[2]);
|
|
5935
|
+
},
|
|
5936
|
+
MultiPoint: function(object2, stream) {
|
|
5937
|
+
var coordinates = object2.coordinates, i = -1, n = coordinates.length;
|
|
5938
|
+
while (++i < n) object2 = coordinates[i], stream.point(object2[0], object2[1], object2[2]);
|
|
5939
|
+
},
|
|
5940
|
+
LineString: function(object2, stream) {
|
|
5941
|
+
streamLine(object2.coordinates, stream, 0);
|
|
5942
|
+
},
|
|
5943
|
+
MultiLineString: function(object2, stream) {
|
|
5944
|
+
var coordinates = object2.coordinates, i = -1, n = coordinates.length;
|
|
5945
|
+
while (++i < n) streamLine(coordinates[i], stream, 0);
|
|
5946
|
+
},
|
|
5947
|
+
Polygon: function(object2, stream) {
|
|
5948
|
+
streamPolygon(object2.coordinates, stream);
|
|
5949
|
+
},
|
|
5950
|
+
MultiPolygon: function(object2, stream) {
|
|
5951
|
+
var coordinates = object2.coordinates, i = -1, n = coordinates.length;
|
|
5952
|
+
while (++i < n) streamPolygon(coordinates[i], stream);
|
|
5953
|
+
},
|
|
5954
|
+
GeometryCollection: function(object2, stream) {
|
|
5955
|
+
var geometries = object2.geometries, i = -1, n = geometries.length;
|
|
5956
|
+
while (++i < n) streamGeometry(geometries[i], stream);
|
|
5957
|
+
}
|
|
5958
|
+
};
|
|
5959
|
+
function streamLine(coordinates, stream, closed) {
|
|
5960
|
+
var i = -1, n = coordinates.length - closed, coordinate;
|
|
5961
|
+
stream.lineStart();
|
|
5962
|
+
while (++i < n) coordinate = coordinates[i], stream.point(coordinate[0], coordinate[1], coordinate[2]);
|
|
5963
|
+
stream.lineEnd();
|
|
5964
|
+
}
|
|
5965
|
+
function streamPolygon(coordinates, stream) {
|
|
5966
|
+
var i = -1, n = coordinates.length;
|
|
5967
|
+
stream.polygonStart();
|
|
5968
|
+
while (++i < n) streamLine(coordinates[i], stream, 1);
|
|
5969
|
+
stream.polygonEnd();
|
|
5970
|
+
}
|
|
5971
|
+
function geoStream(object2, stream) {
|
|
5972
|
+
if (object2 && streamObjectType.hasOwnProperty(object2.type)) {
|
|
5973
|
+
streamObjectType[object2.type](object2, stream);
|
|
5974
|
+
} else {
|
|
5975
|
+
streamGeometry(object2, stream);
|
|
5976
|
+
}
|
|
5977
|
+
}
|
|
5978
|
+
function spherical(cartesian2) {
|
|
5979
|
+
return [atan2(cartesian2[1], cartesian2[0]), asin(cartesian2[2])];
|
|
5980
|
+
}
|
|
5981
|
+
function cartesian(spherical2) {
|
|
5982
|
+
var lambda = spherical2[0], phi = spherical2[1], cosPhi = cos(phi);
|
|
5983
|
+
return [cosPhi * cos(lambda), cosPhi * sin(lambda), sin(phi)];
|
|
5984
|
+
}
|
|
5985
|
+
function cartesianDot(a, b) {
|
|
5986
|
+
return a[0] * b[0] + a[1] * b[1] + a[2] * b[2];
|
|
5987
|
+
}
|
|
5988
|
+
function cartesianCross(a, b) {
|
|
5989
|
+
return [a[1] * b[2] - a[2] * b[1], a[2] * b[0] - a[0] * b[2], a[0] * b[1] - a[1] * b[0]];
|
|
5990
|
+
}
|
|
5991
|
+
function cartesianAddInPlace(a, b) {
|
|
5992
|
+
a[0] += b[0], a[1] += b[1], a[2] += b[2];
|
|
5993
|
+
}
|
|
5994
|
+
function cartesianScale(vector, k) {
|
|
5995
|
+
return [vector[0] * k, vector[1] * k, vector[2] * k];
|
|
5996
|
+
}
|
|
5997
|
+
function cartesianNormalizeInPlace(d) {
|
|
5998
|
+
var l = sqrt(d[0] * d[0] + d[1] * d[1] + d[2] * d[2]);
|
|
5999
|
+
d[0] /= l, d[1] /= l, d[2] /= l;
|
|
6000
|
+
}
|
|
6001
|
+
function compose(a, b) {
|
|
6002
|
+
function compose2(x, y) {
|
|
6003
|
+
return x = a(x, y), b(x[0], x[1]);
|
|
6004
|
+
}
|
|
6005
|
+
if (a.invert && b.invert) compose2.invert = function(x, y) {
|
|
6006
|
+
return x = b.invert(x, y), x && a.invert(x[0], x[1]);
|
|
6007
|
+
};
|
|
6008
|
+
return compose2;
|
|
6009
|
+
}
|
|
6010
|
+
function rotationIdentity(lambda, phi) {
|
|
6011
|
+
if (abs(lambda) > pi) lambda -= Math.round(lambda / tau) * tau;
|
|
6012
|
+
return [lambda, phi];
|
|
6013
|
+
}
|
|
6014
|
+
rotationIdentity.invert = rotationIdentity;
|
|
6015
|
+
function rotateRadians(deltaLambda, deltaPhi, deltaGamma) {
|
|
6016
|
+
return (deltaLambda %= tau) ? deltaPhi || deltaGamma ? compose(rotationLambda(deltaLambda), rotationPhiGamma(deltaPhi, deltaGamma)) : rotationLambda(deltaLambda) : deltaPhi || deltaGamma ? rotationPhiGamma(deltaPhi, deltaGamma) : rotationIdentity;
|
|
6017
|
+
}
|
|
6018
|
+
function forwardRotationLambda(deltaLambda) {
|
|
6019
|
+
return function(lambda, phi) {
|
|
6020
|
+
lambda += deltaLambda;
|
|
6021
|
+
if (abs(lambda) > pi) lambda -= Math.round(lambda / tau) * tau;
|
|
6022
|
+
return [lambda, phi];
|
|
6023
|
+
};
|
|
6024
|
+
}
|
|
6025
|
+
function rotationLambda(deltaLambda) {
|
|
6026
|
+
var rotation2 = forwardRotationLambda(deltaLambda);
|
|
6027
|
+
rotation2.invert = forwardRotationLambda(-deltaLambda);
|
|
6028
|
+
return rotation2;
|
|
6029
|
+
}
|
|
6030
|
+
function rotationPhiGamma(deltaPhi, deltaGamma) {
|
|
6031
|
+
var cosDeltaPhi = cos(deltaPhi), sinDeltaPhi = sin(deltaPhi), cosDeltaGamma = cos(deltaGamma), sinDeltaGamma = sin(deltaGamma);
|
|
6032
|
+
function rotation2(lambda, phi) {
|
|
6033
|
+
var cosPhi = cos(phi), x = cos(lambda) * cosPhi, y = sin(lambda) * cosPhi, z = sin(phi), k = z * cosDeltaPhi + x * sinDeltaPhi;
|
|
6034
|
+
return [
|
|
6035
|
+
atan2(y * cosDeltaGamma - k * sinDeltaGamma, x * cosDeltaPhi - z * sinDeltaPhi),
|
|
6036
|
+
asin(k * cosDeltaGamma + y * sinDeltaGamma)
|
|
6037
|
+
];
|
|
6038
|
+
}
|
|
6039
|
+
rotation2.invert = function(lambda, phi) {
|
|
6040
|
+
var cosPhi = cos(phi), x = cos(lambda) * cosPhi, y = sin(lambda) * cosPhi, z = sin(phi), k = z * cosDeltaGamma - y * sinDeltaGamma;
|
|
6041
|
+
return [
|
|
6042
|
+
atan2(y * cosDeltaGamma + z * sinDeltaGamma, x * cosDeltaPhi + k * sinDeltaPhi),
|
|
6043
|
+
asin(k * cosDeltaPhi - x * sinDeltaPhi)
|
|
6044
|
+
];
|
|
6045
|
+
};
|
|
6046
|
+
return rotation2;
|
|
6047
|
+
}
|
|
6048
|
+
function rotation(rotate) {
|
|
6049
|
+
rotate = rotateRadians(rotate[0] * radians, rotate[1] * radians, rotate.length > 2 ? rotate[2] * radians : 0);
|
|
6050
|
+
function forward(coordinates) {
|
|
6051
|
+
coordinates = rotate(coordinates[0] * radians, coordinates[1] * radians);
|
|
6052
|
+
return coordinates[0] *= degrees, coordinates[1] *= degrees, coordinates;
|
|
6053
|
+
}
|
|
6054
|
+
forward.invert = function(coordinates) {
|
|
6055
|
+
coordinates = rotate.invert(coordinates[0] * radians, coordinates[1] * radians);
|
|
6056
|
+
return coordinates[0] *= degrees, coordinates[1] *= degrees, coordinates;
|
|
6057
|
+
};
|
|
6058
|
+
return forward;
|
|
6059
|
+
}
|
|
6060
|
+
function circleStream(stream, radius, delta, direction, t0, t1) {
|
|
6061
|
+
if (!delta) return;
|
|
6062
|
+
var cosRadius = cos(radius), sinRadius = sin(radius), step = direction * delta;
|
|
6063
|
+
if (t0 == null) {
|
|
6064
|
+
t0 = radius + direction * tau;
|
|
6065
|
+
t1 = radius - step / 2;
|
|
6066
|
+
} else {
|
|
6067
|
+
t0 = circleRadius(cosRadius, t0);
|
|
6068
|
+
t1 = circleRadius(cosRadius, t1);
|
|
6069
|
+
if (direction > 0 ? t0 < t1 : t0 > t1) t0 += direction * tau;
|
|
6070
|
+
}
|
|
6071
|
+
for (var point, t = t0; direction > 0 ? t > t1 : t < t1; t -= step) {
|
|
6072
|
+
point = spherical([cosRadius, -sinRadius * cos(t), -sinRadius * sin(t)]);
|
|
6073
|
+
stream.point(point[0], point[1]);
|
|
6074
|
+
}
|
|
6075
|
+
}
|
|
6076
|
+
function circleRadius(cosRadius, point) {
|
|
6077
|
+
point = cartesian(point), point[0] -= cosRadius;
|
|
6078
|
+
cartesianNormalizeInPlace(point);
|
|
6079
|
+
var radius = acos(-point[1]);
|
|
6080
|
+
return ((-point[2] < 0 ? -radius : radius) + tau - epsilon) % tau;
|
|
6081
|
+
}
|
|
6082
|
+
function clipBuffer() {
|
|
6083
|
+
var lines = [], line;
|
|
6084
|
+
return {
|
|
6085
|
+
point: function(x, y, m) {
|
|
6086
|
+
line.push([x, y, m]);
|
|
6087
|
+
},
|
|
6088
|
+
lineStart: function() {
|
|
6089
|
+
lines.push(line = []);
|
|
6090
|
+
},
|
|
6091
|
+
lineEnd: noop,
|
|
6092
|
+
rejoin: function() {
|
|
6093
|
+
if (lines.length > 1) lines.push(lines.pop().concat(lines.shift()));
|
|
6094
|
+
},
|
|
6095
|
+
result: function() {
|
|
6096
|
+
var result = lines;
|
|
6097
|
+
lines = [];
|
|
6098
|
+
line = null;
|
|
6099
|
+
return result;
|
|
6100
|
+
}
|
|
6101
|
+
};
|
|
6102
|
+
}
|
|
6103
|
+
function pointEqual(a, b) {
|
|
6104
|
+
return abs(a[0] - b[0]) < epsilon && abs(a[1] - b[1]) < epsilon;
|
|
6105
|
+
}
|
|
6106
|
+
function Intersection(point, points, other, entry) {
|
|
6107
|
+
this.x = point;
|
|
6108
|
+
this.z = points;
|
|
6109
|
+
this.o = other;
|
|
6110
|
+
this.e = entry;
|
|
6111
|
+
this.v = false;
|
|
6112
|
+
this.n = this.p = null;
|
|
6113
|
+
}
|
|
6114
|
+
function clipRejoin(segments, compareIntersection2, startInside, interpolate, stream) {
|
|
6115
|
+
var subject = [], clip2 = [], i, n;
|
|
6116
|
+
segments.forEach(function(segment) {
|
|
6117
|
+
if ((n2 = segment.length - 1) <= 0) return;
|
|
6118
|
+
var n2, p0 = segment[0], p1 = segment[n2], x;
|
|
6119
|
+
if (pointEqual(p0, p1)) {
|
|
6120
|
+
if (!p0[2] && !p1[2]) {
|
|
6121
|
+
stream.lineStart();
|
|
6122
|
+
for (i = 0; i < n2; ++i) stream.point((p0 = segment[i])[0], p0[1]);
|
|
6123
|
+
stream.lineEnd();
|
|
6124
|
+
return;
|
|
6125
|
+
}
|
|
6126
|
+
p1[0] += 2 * epsilon;
|
|
6127
|
+
}
|
|
6128
|
+
subject.push(x = new Intersection(p0, segment, null, true));
|
|
6129
|
+
clip2.push(x.o = new Intersection(p0, null, x, false));
|
|
6130
|
+
subject.push(x = new Intersection(p1, segment, null, false));
|
|
6131
|
+
clip2.push(x.o = new Intersection(p1, null, x, true));
|
|
6132
|
+
});
|
|
6133
|
+
if (!subject.length) return;
|
|
6134
|
+
clip2.sort(compareIntersection2);
|
|
6135
|
+
link(subject);
|
|
6136
|
+
link(clip2);
|
|
6137
|
+
for (i = 0, n = clip2.length; i < n; ++i) {
|
|
6138
|
+
clip2[i].e = startInside = !startInside;
|
|
6139
|
+
}
|
|
6140
|
+
var start = subject[0], points, point;
|
|
6141
|
+
while (1) {
|
|
6142
|
+
var current = start, isSubject = true;
|
|
6143
|
+
while (current.v) if ((current = current.n) === start) return;
|
|
6144
|
+
points = current.z;
|
|
6145
|
+
stream.lineStart();
|
|
6146
|
+
do {
|
|
6147
|
+
current.v = current.o.v = true;
|
|
6148
|
+
if (current.e) {
|
|
6149
|
+
if (isSubject) {
|
|
6150
|
+
for (i = 0, n = points.length; i < n; ++i) stream.point((point = points[i])[0], point[1]);
|
|
6151
|
+
} else {
|
|
6152
|
+
interpolate(current.x, current.n.x, 1, stream);
|
|
6153
|
+
}
|
|
6154
|
+
current = current.n;
|
|
6155
|
+
} else {
|
|
6156
|
+
if (isSubject) {
|
|
6157
|
+
points = current.p.z;
|
|
6158
|
+
for (i = points.length - 1; i >= 0; --i) stream.point((point = points[i])[0], point[1]);
|
|
6159
|
+
} else {
|
|
6160
|
+
interpolate(current.x, current.p.x, -1, stream);
|
|
6161
|
+
}
|
|
6162
|
+
current = current.p;
|
|
6163
|
+
}
|
|
6164
|
+
current = current.o;
|
|
6165
|
+
points = current.z;
|
|
6166
|
+
isSubject = !isSubject;
|
|
6167
|
+
} while (!current.v);
|
|
6168
|
+
stream.lineEnd();
|
|
6169
|
+
}
|
|
6170
|
+
}
|
|
6171
|
+
function link(array) {
|
|
6172
|
+
if (!(n = array.length)) return;
|
|
6173
|
+
var n, i = 0, a = array[0], b;
|
|
6174
|
+
while (++i < n) {
|
|
6175
|
+
a.n = b = array[i];
|
|
6176
|
+
b.p = a;
|
|
6177
|
+
a = b;
|
|
6178
|
+
}
|
|
6179
|
+
a.n = b = array[0];
|
|
6180
|
+
b.p = a;
|
|
6181
|
+
}
|
|
6182
|
+
function longitude(point) {
|
|
6183
|
+
return abs(point[0]) <= pi ? point[0] : sign(point[0]) * ((abs(point[0]) + pi) % tau - pi);
|
|
6184
|
+
}
|
|
6185
|
+
function polygonContains(polygon, point) {
|
|
6186
|
+
var lambda = longitude(point), phi = point[1], sinPhi = sin(phi), normal = [sin(lambda), -cos(lambda), 0], angle = 0, winding = 0;
|
|
6187
|
+
var sum = new Adder();
|
|
6188
|
+
if (sinPhi === 1) phi = halfPi + epsilon;
|
|
6189
|
+
else if (sinPhi === -1) phi = -halfPi - epsilon;
|
|
6190
|
+
for (var i = 0, n = polygon.length; i < n; ++i) {
|
|
6191
|
+
if (!(m = (ring = polygon[i]).length)) continue;
|
|
6192
|
+
var ring, m, point0 = ring[m - 1], lambda0 = longitude(point0), phi0 = point0[1] / 2 + quarterPi, sinPhi0 = sin(phi0), cosPhi0 = cos(phi0);
|
|
6193
|
+
for (var j = 0; j < m; ++j, lambda0 = lambda1, sinPhi0 = sinPhi1, cosPhi0 = cosPhi1, point0 = point1) {
|
|
6194
|
+
var point1 = ring[j], lambda1 = longitude(point1), phi1 = point1[1] / 2 + quarterPi, sinPhi1 = sin(phi1), cosPhi1 = cos(phi1), delta = lambda1 - lambda0, sign2 = delta >= 0 ? 1 : -1, absDelta = sign2 * delta, antimeridian = absDelta > pi, k = sinPhi0 * sinPhi1;
|
|
6195
|
+
sum.add(atan2(k * sign2 * sin(absDelta), cosPhi0 * cosPhi1 + k * cos(absDelta)));
|
|
6196
|
+
angle += antimeridian ? delta + sign2 * tau : delta;
|
|
6197
|
+
if (antimeridian ^ lambda0 >= lambda ^ lambda1 >= lambda) {
|
|
6198
|
+
var arc = cartesianCross(cartesian(point0), cartesian(point1));
|
|
6199
|
+
cartesianNormalizeInPlace(arc);
|
|
6200
|
+
var intersection = cartesianCross(normal, arc);
|
|
6201
|
+
cartesianNormalizeInPlace(intersection);
|
|
6202
|
+
var phiArc = (antimeridian ^ delta >= 0 ? -1 : 1) * asin(intersection[2]);
|
|
6203
|
+
if (phi > phiArc || phi === phiArc && (arc[0] || arc[1])) {
|
|
6204
|
+
winding += antimeridian ^ delta >= 0 ? 1 : -1;
|
|
6205
|
+
}
|
|
6206
|
+
}
|
|
6207
|
+
}
|
|
6208
|
+
}
|
|
6209
|
+
return (angle < -epsilon || angle < epsilon && sum < -1e-12) ^ winding & 1;
|
|
6210
|
+
}
|
|
6211
|
+
function clip(pointVisible, clipLine2, interpolate, start) {
|
|
6212
|
+
return function(sink) {
|
|
6213
|
+
var line = clipLine2(sink), ringBuffer = clipBuffer(), ringSink = clipLine2(ringBuffer), polygonStarted = false, polygon, segments, ring;
|
|
6214
|
+
var clip2 = {
|
|
6215
|
+
point,
|
|
6216
|
+
lineStart,
|
|
6217
|
+
lineEnd,
|
|
6218
|
+
polygonStart: function() {
|
|
6219
|
+
clip2.point = pointRing;
|
|
6220
|
+
clip2.lineStart = ringStart;
|
|
6221
|
+
clip2.lineEnd = ringEnd;
|
|
6222
|
+
segments = [];
|
|
6223
|
+
polygon = [];
|
|
6224
|
+
},
|
|
6225
|
+
polygonEnd: function() {
|
|
6226
|
+
clip2.point = point;
|
|
6227
|
+
clip2.lineStart = lineStart;
|
|
6228
|
+
clip2.lineEnd = lineEnd;
|
|
6229
|
+
segments = merge(segments);
|
|
6230
|
+
var startInside = polygonContains(polygon, start);
|
|
6231
|
+
if (segments.length) {
|
|
6232
|
+
if (!polygonStarted) sink.polygonStart(), polygonStarted = true;
|
|
6233
|
+
clipRejoin(segments, compareIntersection, startInside, interpolate, sink);
|
|
6234
|
+
} else if (startInside) {
|
|
6235
|
+
if (!polygonStarted) sink.polygonStart(), polygonStarted = true;
|
|
6236
|
+
sink.lineStart();
|
|
6237
|
+
interpolate(null, null, 1, sink);
|
|
6238
|
+
sink.lineEnd();
|
|
6239
|
+
}
|
|
6240
|
+
if (polygonStarted) sink.polygonEnd(), polygonStarted = false;
|
|
6241
|
+
segments = polygon = null;
|
|
6242
|
+
},
|
|
6243
|
+
sphere: function() {
|
|
6244
|
+
sink.polygonStart();
|
|
6245
|
+
sink.lineStart();
|
|
6246
|
+
interpolate(null, null, 1, sink);
|
|
6247
|
+
sink.lineEnd();
|
|
6248
|
+
sink.polygonEnd();
|
|
6249
|
+
}
|
|
6250
|
+
};
|
|
6251
|
+
function point(lambda, phi) {
|
|
6252
|
+
if (pointVisible(lambda, phi)) sink.point(lambda, phi);
|
|
6253
|
+
}
|
|
6254
|
+
function pointLine(lambda, phi) {
|
|
6255
|
+
line.point(lambda, phi);
|
|
6256
|
+
}
|
|
6257
|
+
function lineStart() {
|
|
6258
|
+
clip2.point = pointLine;
|
|
6259
|
+
line.lineStart();
|
|
6260
|
+
}
|
|
6261
|
+
function lineEnd() {
|
|
6262
|
+
clip2.point = point;
|
|
6263
|
+
line.lineEnd();
|
|
6264
|
+
}
|
|
6265
|
+
function pointRing(lambda, phi) {
|
|
6266
|
+
ring.push([lambda, phi]);
|
|
6267
|
+
ringSink.point(lambda, phi);
|
|
6268
|
+
}
|
|
6269
|
+
function ringStart() {
|
|
6270
|
+
ringSink.lineStart();
|
|
6271
|
+
ring = [];
|
|
6272
|
+
}
|
|
6273
|
+
function ringEnd() {
|
|
6274
|
+
pointRing(ring[0][0], ring[0][1]);
|
|
6275
|
+
ringSink.lineEnd();
|
|
6276
|
+
var clean = ringSink.clean(), ringSegments = ringBuffer.result(), i, n = ringSegments.length, m, segment, point2;
|
|
6277
|
+
ring.pop();
|
|
6278
|
+
polygon.push(ring);
|
|
6279
|
+
ring = null;
|
|
6280
|
+
if (!n) return;
|
|
6281
|
+
if (clean & 1) {
|
|
6282
|
+
segment = ringSegments[0];
|
|
6283
|
+
if ((m = segment.length - 1) > 0) {
|
|
6284
|
+
if (!polygonStarted) sink.polygonStart(), polygonStarted = true;
|
|
6285
|
+
sink.lineStart();
|
|
6286
|
+
for (i = 0; i < m; ++i) sink.point((point2 = segment[i])[0], point2[1]);
|
|
6287
|
+
sink.lineEnd();
|
|
6288
|
+
}
|
|
6289
|
+
return;
|
|
6290
|
+
}
|
|
6291
|
+
if (n > 1 && clean & 2) ringSegments.push(ringSegments.pop().concat(ringSegments.shift()));
|
|
6292
|
+
segments.push(ringSegments.filter(validSegment));
|
|
6293
|
+
}
|
|
6294
|
+
return clip2;
|
|
6295
|
+
};
|
|
6296
|
+
}
|
|
6297
|
+
function validSegment(segment) {
|
|
6298
|
+
return segment.length > 1;
|
|
6299
|
+
}
|
|
6300
|
+
function compareIntersection(a, b) {
|
|
6301
|
+
return ((a = a.x)[0] < 0 ? a[1] - halfPi - epsilon : halfPi - a[1]) - ((b = b.x)[0] < 0 ? b[1] - halfPi - epsilon : halfPi - b[1]);
|
|
6302
|
+
}
|
|
6303
|
+
const clipAntimeridian = clip(
|
|
6304
|
+
function() {
|
|
6305
|
+
return true;
|
|
6306
|
+
},
|
|
6307
|
+
clipAntimeridianLine,
|
|
6308
|
+
clipAntimeridianInterpolate,
|
|
6309
|
+
[-pi, -halfPi]
|
|
6310
|
+
);
|
|
6311
|
+
function clipAntimeridianLine(stream) {
|
|
6312
|
+
var lambda0 = NaN, phi0 = NaN, sign0 = NaN, clean;
|
|
6313
|
+
return {
|
|
6314
|
+
lineStart: function() {
|
|
6315
|
+
stream.lineStart();
|
|
6316
|
+
clean = 1;
|
|
6317
|
+
},
|
|
6318
|
+
point: function(lambda1, phi1) {
|
|
6319
|
+
var sign1 = lambda1 > 0 ? pi : -pi, delta = abs(lambda1 - lambda0);
|
|
6320
|
+
if (abs(delta - pi) < epsilon) {
|
|
6321
|
+
stream.point(lambda0, phi0 = (phi0 + phi1) / 2 > 0 ? halfPi : -halfPi);
|
|
6322
|
+
stream.point(sign0, phi0);
|
|
6323
|
+
stream.lineEnd();
|
|
6324
|
+
stream.lineStart();
|
|
6325
|
+
stream.point(sign1, phi0);
|
|
6326
|
+
stream.point(lambda1, phi0);
|
|
6327
|
+
clean = 0;
|
|
6328
|
+
} else if (sign0 !== sign1 && delta >= pi) {
|
|
6329
|
+
if (abs(lambda0 - sign0) < epsilon) lambda0 -= sign0 * epsilon;
|
|
6330
|
+
if (abs(lambda1 - sign1) < epsilon) lambda1 -= sign1 * epsilon;
|
|
6331
|
+
phi0 = clipAntimeridianIntersect(lambda0, phi0, lambda1, phi1);
|
|
6332
|
+
stream.point(sign0, phi0);
|
|
6333
|
+
stream.lineEnd();
|
|
6334
|
+
stream.lineStart();
|
|
6335
|
+
stream.point(sign1, phi0);
|
|
6336
|
+
clean = 0;
|
|
6337
|
+
}
|
|
6338
|
+
stream.point(lambda0 = lambda1, phi0 = phi1);
|
|
6339
|
+
sign0 = sign1;
|
|
6340
|
+
},
|
|
6341
|
+
lineEnd: function() {
|
|
6342
|
+
stream.lineEnd();
|
|
6343
|
+
lambda0 = phi0 = NaN;
|
|
6344
|
+
},
|
|
6345
|
+
clean: function() {
|
|
6346
|
+
return 2 - clean;
|
|
6347
|
+
}
|
|
6348
|
+
};
|
|
6349
|
+
}
|
|
6350
|
+
function clipAntimeridianIntersect(lambda0, phi0, lambda1, phi1) {
|
|
6351
|
+
var cosPhi0, cosPhi1, sinLambda0Lambda1 = sin(lambda0 - lambda1);
|
|
6352
|
+
return abs(sinLambda0Lambda1) > epsilon ? atan((sin(phi0) * (cosPhi1 = cos(phi1)) * sin(lambda1) - sin(phi1) * (cosPhi0 = cos(phi0)) * sin(lambda0)) / (cosPhi0 * cosPhi1 * sinLambda0Lambda1)) : (phi0 + phi1) / 2;
|
|
6353
|
+
}
|
|
6354
|
+
function clipAntimeridianInterpolate(from, to, direction, stream) {
|
|
6355
|
+
var phi;
|
|
6356
|
+
if (from == null) {
|
|
6357
|
+
phi = direction * halfPi;
|
|
6358
|
+
stream.point(-pi, phi);
|
|
6359
|
+
stream.point(0, phi);
|
|
6360
|
+
stream.point(pi, phi);
|
|
6361
|
+
stream.point(pi, 0);
|
|
6362
|
+
stream.point(pi, -phi);
|
|
6363
|
+
stream.point(0, -phi);
|
|
6364
|
+
stream.point(-pi, -phi);
|
|
6365
|
+
stream.point(-pi, 0);
|
|
6366
|
+
stream.point(-pi, phi);
|
|
6367
|
+
} else if (abs(from[0] - to[0]) > epsilon) {
|
|
6368
|
+
var lambda = from[0] < to[0] ? pi : -pi;
|
|
6369
|
+
phi = direction * lambda / 2;
|
|
6370
|
+
stream.point(-lambda, phi);
|
|
6371
|
+
stream.point(0, phi);
|
|
6372
|
+
stream.point(lambda, phi);
|
|
6373
|
+
} else {
|
|
6374
|
+
stream.point(to[0], to[1]);
|
|
6375
|
+
}
|
|
6376
|
+
}
|
|
6377
|
+
function clipCircle(radius) {
|
|
6378
|
+
var cr = cos(radius), delta = 2 * radians, smallRadius = cr > 0, notHemisphere = abs(cr) > epsilon;
|
|
6379
|
+
function interpolate(from, to, direction, stream) {
|
|
6380
|
+
circleStream(stream, radius, delta, direction, from, to);
|
|
6381
|
+
}
|
|
6382
|
+
function visible(lambda, phi) {
|
|
6383
|
+
return cos(lambda) * cos(phi) > cr;
|
|
6384
|
+
}
|
|
6385
|
+
function clipLine2(stream) {
|
|
6386
|
+
var point0, c0, v0, v00, clean;
|
|
6387
|
+
return {
|
|
6388
|
+
lineStart: function() {
|
|
6389
|
+
v00 = v0 = false;
|
|
6390
|
+
clean = 1;
|
|
6391
|
+
},
|
|
6392
|
+
point: function(lambda, phi) {
|
|
6393
|
+
var point1 = [lambda, phi], point2, v = visible(lambda, phi), c = smallRadius ? v ? 0 : code(lambda, phi) : v ? code(lambda + (lambda < 0 ? pi : -pi), phi) : 0;
|
|
6394
|
+
if (!point0 && (v00 = v0 = v)) stream.lineStart();
|
|
6395
|
+
if (v !== v0) {
|
|
6396
|
+
point2 = intersect(point0, point1);
|
|
6397
|
+
if (!point2 || pointEqual(point0, point2) || pointEqual(point1, point2))
|
|
6398
|
+
point1[2] = 1;
|
|
6399
|
+
}
|
|
6400
|
+
if (v !== v0) {
|
|
6401
|
+
clean = 0;
|
|
6402
|
+
if (v) {
|
|
6403
|
+
stream.lineStart();
|
|
6404
|
+
point2 = intersect(point1, point0);
|
|
6405
|
+
stream.point(point2[0], point2[1]);
|
|
6406
|
+
} else {
|
|
6407
|
+
point2 = intersect(point0, point1);
|
|
6408
|
+
stream.point(point2[0], point2[1], 2);
|
|
6409
|
+
stream.lineEnd();
|
|
6410
|
+
}
|
|
6411
|
+
point0 = point2;
|
|
6412
|
+
} else if (notHemisphere && point0 && smallRadius ^ v) {
|
|
6413
|
+
var t;
|
|
6414
|
+
if (!(c & c0) && (t = intersect(point1, point0, true))) {
|
|
6415
|
+
clean = 0;
|
|
6416
|
+
if (smallRadius) {
|
|
6417
|
+
stream.lineStart();
|
|
6418
|
+
stream.point(t[0][0], t[0][1]);
|
|
6419
|
+
stream.point(t[1][0], t[1][1]);
|
|
6420
|
+
stream.lineEnd();
|
|
6421
|
+
} else {
|
|
6422
|
+
stream.point(t[1][0], t[1][1]);
|
|
6423
|
+
stream.lineEnd();
|
|
6424
|
+
stream.lineStart();
|
|
6425
|
+
stream.point(t[0][0], t[0][1], 3);
|
|
6426
|
+
}
|
|
6427
|
+
}
|
|
6428
|
+
}
|
|
6429
|
+
if (v && (!point0 || !pointEqual(point0, point1))) {
|
|
6430
|
+
stream.point(point1[0], point1[1]);
|
|
6431
|
+
}
|
|
6432
|
+
point0 = point1, v0 = v, c0 = c;
|
|
6433
|
+
},
|
|
6434
|
+
lineEnd: function() {
|
|
6435
|
+
if (v0) stream.lineEnd();
|
|
6436
|
+
point0 = null;
|
|
6437
|
+
},
|
|
6438
|
+
// Rejoin first and last segments if there were intersections and the first
|
|
6439
|
+
// and last points were visible.
|
|
6440
|
+
clean: function() {
|
|
6441
|
+
return clean | (v00 && v0) << 1;
|
|
6442
|
+
}
|
|
6443
|
+
};
|
|
6444
|
+
}
|
|
6445
|
+
function intersect(a, b, two) {
|
|
6446
|
+
var pa = cartesian(a), pb = cartesian(b);
|
|
6447
|
+
var n1 = [1, 0, 0], n2 = cartesianCross(pa, pb), n2n2 = cartesianDot(n2, n2), n1n2 = n2[0], determinant = n2n2 - n1n2 * n1n2;
|
|
6448
|
+
if (!determinant) return !two && a;
|
|
6449
|
+
var c1 = cr * n2n2 / determinant, c2 = -cr * n1n2 / determinant, n1xn2 = cartesianCross(n1, n2), A = cartesianScale(n1, c1), B = cartesianScale(n2, c2);
|
|
6450
|
+
cartesianAddInPlace(A, B);
|
|
6451
|
+
var u = n1xn2, w = cartesianDot(A, u), uu = cartesianDot(u, u), t2 = w * w - uu * (cartesianDot(A, A) - 1);
|
|
6452
|
+
if (t2 < 0) return;
|
|
6453
|
+
var t = sqrt(t2), q = cartesianScale(u, (-w - t) / uu);
|
|
6454
|
+
cartesianAddInPlace(q, A);
|
|
6455
|
+
q = spherical(q);
|
|
6456
|
+
if (!two) return q;
|
|
6457
|
+
var lambda0 = a[0], lambda1 = b[0], phi0 = a[1], phi1 = b[1], z;
|
|
6458
|
+
if (lambda1 < lambda0) z = lambda0, lambda0 = lambda1, lambda1 = z;
|
|
6459
|
+
var delta2 = lambda1 - lambda0, polar = abs(delta2 - pi) < epsilon, meridian = polar || delta2 < epsilon;
|
|
6460
|
+
if (!polar && phi1 < phi0) z = phi0, phi0 = phi1, phi1 = z;
|
|
6461
|
+
if (meridian ? polar ? phi0 + phi1 > 0 ^ q[1] < (abs(q[0] - lambda0) < epsilon ? phi0 : phi1) : phi0 <= q[1] && q[1] <= phi1 : delta2 > pi ^ (lambda0 <= q[0] && q[0] <= lambda1)) {
|
|
6462
|
+
var q1 = cartesianScale(u, (-w + t) / uu);
|
|
6463
|
+
cartesianAddInPlace(q1, A);
|
|
6464
|
+
return [q, spherical(q1)];
|
|
6465
|
+
}
|
|
6466
|
+
}
|
|
6467
|
+
function code(lambda, phi) {
|
|
6468
|
+
var r = smallRadius ? radius : pi - radius, code2 = 0;
|
|
6469
|
+
if (lambda < -r) code2 |= 1;
|
|
6470
|
+
else if (lambda > r) code2 |= 2;
|
|
6471
|
+
if (phi < -r) code2 |= 4;
|
|
6472
|
+
else if (phi > r) code2 |= 8;
|
|
6473
|
+
return code2;
|
|
6474
|
+
}
|
|
6475
|
+
return clip(visible, clipLine2, interpolate, smallRadius ? [0, -radius] : [-pi, radius - pi]);
|
|
6476
|
+
}
|
|
6477
|
+
function clipLine(a, b, x02, y02, x12, y12) {
|
|
6478
|
+
var ax = a[0], ay = a[1], bx = b[0], by = b[1], t0 = 0, t1 = 1, dx = bx - ax, dy = by - ay, r;
|
|
6479
|
+
r = x02 - ax;
|
|
6480
|
+
if (!dx && r > 0) return;
|
|
6481
|
+
r /= dx;
|
|
6482
|
+
if (dx < 0) {
|
|
6483
|
+
if (r < t0) return;
|
|
6484
|
+
if (r < t1) t1 = r;
|
|
6485
|
+
} else if (dx > 0) {
|
|
6486
|
+
if (r > t1) return;
|
|
6487
|
+
if (r > t0) t0 = r;
|
|
6488
|
+
}
|
|
6489
|
+
r = x12 - ax;
|
|
6490
|
+
if (!dx && r < 0) return;
|
|
6491
|
+
r /= dx;
|
|
6492
|
+
if (dx < 0) {
|
|
6493
|
+
if (r > t1) return;
|
|
6494
|
+
if (r > t0) t0 = r;
|
|
6495
|
+
} else if (dx > 0) {
|
|
6496
|
+
if (r < t0) return;
|
|
6497
|
+
if (r < t1) t1 = r;
|
|
6498
|
+
}
|
|
6499
|
+
r = y02 - ay;
|
|
6500
|
+
if (!dy && r > 0) return;
|
|
6501
|
+
r /= dy;
|
|
6502
|
+
if (dy < 0) {
|
|
6503
|
+
if (r < t0) return;
|
|
6504
|
+
if (r < t1) t1 = r;
|
|
6505
|
+
} else if (dy > 0) {
|
|
6506
|
+
if (r > t1) return;
|
|
6507
|
+
if (r > t0) t0 = r;
|
|
6508
|
+
}
|
|
6509
|
+
r = y12 - ay;
|
|
6510
|
+
if (!dy && r < 0) return;
|
|
6511
|
+
r /= dy;
|
|
6512
|
+
if (dy < 0) {
|
|
6513
|
+
if (r > t1) return;
|
|
6514
|
+
if (r > t0) t0 = r;
|
|
6515
|
+
} else if (dy > 0) {
|
|
6516
|
+
if (r < t0) return;
|
|
6517
|
+
if (r < t1) t1 = r;
|
|
6518
|
+
}
|
|
6519
|
+
if (t0 > 0) a[0] = ax + t0 * dx, a[1] = ay + t0 * dy;
|
|
6520
|
+
if (t1 < 1) b[0] = ax + t1 * dx, b[1] = ay + t1 * dy;
|
|
6521
|
+
return true;
|
|
6522
|
+
}
|
|
6523
|
+
var clipMax = 1e9, clipMin = -clipMax;
|
|
6524
|
+
function clipRectangle(x02, y02, x12, y12) {
|
|
6525
|
+
function visible(x, y) {
|
|
6526
|
+
return x02 <= x && x <= x12 && y02 <= y && y <= y12;
|
|
6527
|
+
}
|
|
6528
|
+
function interpolate(from, to, direction, stream) {
|
|
6529
|
+
var a = 0, a1 = 0;
|
|
6530
|
+
if (from == null || (a = corner(from, direction)) !== (a1 = corner(to, direction)) || comparePoint(from, to) < 0 ^ direction > 0) {
|
|
6531
|
+
do
|
|
6532
|
+
stream.point(a === 0 || a === 3 ? x02 : x12, a > 1 ? y12 : y02);
|
|
6533
|
+
while ((a = (a + direction + 4) % 4) !== a1);
|
|
6534
|
+
} else {
|
|
6535
|
+
stream.point(to[0], to[1]);
|
|
6536
|
+
}
|
|
6537
|
+
}
|
|
6538
|
+
function corner(p, direction) {
|
|
6539
|
+
return abs(p[0] - x02) < epsilon ? direction > 0 ? 0 : 3 : abs(p[0] - x12) < epsilon ? direction > 0 ? 2 : 1 : abs(p[1] - y02) < epsilon ? direction > 0 ? 1 : 0 : direction > 0 ? 3 : 2;
|
|
6540
|
+
}
|
|
6541
|
+
function compareIntersection2(a, b) {
|
|
6542
|
+
return comparePoint(a.x, b.x);
|
|
6543
|
+
}
|
|
6544
|
+
function comparePoint(a, b) {
|
|
6545
|
+
var ca = corner(a, 1), cb = corner(b, 1);
|
|
6546
|
+
return ca !== cb ? ca - cb : ca === 0 ? b[1] - a[1] : ca === 1 ? a[0] - b[0] : ca === 2 ? a[1] - b[1] : b[0] - a[0];
|
|
6547
|
+
}
|
|
6548
|
+
return function(stream) {
|
|
6549
|
+
var activeStream = stream, bufferStream = clipBuffer(), segments, polygon, ring, x__, y__, v__, x_, y_, v_, first, clean;
|
|
6550
|
+
var clipStream = {
|
|
6551
|
+
point,
|
|
6552
|
+
lineStart,
|
|
6553
|
+
lineEnd,
|
|
6554
|
+
polygonStart,
|
|
6555
|
+
polygonEnd
|
|
6556
|
+
};
|
|
6557
|
+
function point(x, y) {
|
|
6558
|
+
if (visible(x, y)) activeStream.point(x, y);
|
|
6559
|
+
}
|
|
6560
|
+
function polygonInside() {
|
|
6561
|
+
var winding = 0;
|
|
6562
|
+
for (var i = 0, n = polygon.length; i < n; ++i) {
|
|
6563
|
+
for (var ring2 = polygon[i], j = 1, m = ring2.length, point2 = ring2[0], a0, a1, b0 = point2[0], b1 = point2[1]; j < m; ++j) {
|
|
6564
|
+
a0 = b0, a1 = b1, point2 = ring2[j], b0 = point2[0], b1 = point2[1];
|
|
6565
|
+
if (a1 <= y12) {
|
|
6566
|
+
if (b1 > y12 && (b0 - a0) * (y12 - a1) > (b1 - a1) * (x02 - a0)) ++winding;
|
|
6567
|
+
} else {
|
|
6568
|
+
if (b1 <= y12 && (b0 - a0) * (y12 - a1) < (b1 - a1) * (x02 - a0)) --winding;
|
|
6569
|
+
}
|
|
6570
|
+
}
|
|
6571
|
+
}
|
|
6572
|
+
return winding;
|
|
6573
|
+
}
|
|
6574
|
+
function polygonStart() {
|
|
6575
|
+
activeStream = bufferStream, segments = [], polygon = [], clean = true;
|
|
6576
|
+
}
|
|
6577
|
+
function polygonEnd() {
|
|
6578
|
+
var startInside = polygonInside(), cleanInside = clean && startInside, visible2 = (segments = merge(segments)).length;
|
|
6579
|
+
if (cleanInside || visible2) {
|
|
6580
|
+
stream.polygonStart();
|
|
6581
|
+
if (cleanInside) {
|
|
6582
|
+
stream.lineStart();
|
|
6583
|
+
interpolate(null, null, 1, stream);
|
|
6584
|
+
stream.lineEnd();
|
|
6585
|
+
}
|
|
6586
|
+
if (visible2) {
|
|
6587
|
+
clipRejoin(segments, compareIntersection2, startInside, interpolate, stream);
|
|
6588
|
+
}
|
|
6589
|
+
stream.polygonEnd();
|
|
6590
|
+
}
|
|
6591
|
+
activeStream = stream, segments = polygon = ring = null;
|
|
6592
|
+
}
|
|
6593
|
+
function lineStart() {
|
|
6594
|
+
clipStream.point = linePoint;
|
|
6595
|
+
if (polygon) polygon.push(ring = []);
|
|
6596
|
+
first = true;
|
|
6597
|
+
v_ = false;
|
|
6598
|
+
x_ = y_ = NaN;
|
|
6599
|
+
}
|
|
6600
|
+
function lineEnd() {
|
|
6601
|
+
if (segments) {
|
|
6602
|
+
linePoint(x__, y__);
|
|
6603
|
+
if (v__ && v_) bufferStream.rejoin();
|
|
6604
|
+
segments.push(bufferStream.result());
|
|
6605
|
+
}
|
|
6606
|
+
clipStream.point = point;
|
|
6607
|
+
if (v_) activeStream.lineEnd();
|
|
6608
|
+
}
|
|
6609
|
+
function linePoint(x, y) {
|
|
6610
|
+
var v = visible(x, y);
|
|
6611
|
+
if (polygon) ring.push([x, y]);
|
|
6612
|
+
if (first) {
|
|
6613
|
+
x__ = x, y__ = y, v__ = v;
|
|
6614
|
+
first = false;
|
|
6615
|
+
if (v) {
|
|
6616
|
+
activeStream.lineStart();
|
|
6617
|
+
activeStream.point(x, y);
|
|
6618
|
+
}
|
|
6619
|
+
} else {
|
|
6620
|
+
if (v && v_) activeStream.point(x, y);
|
|
6621
|
+
else {
|
|
6622
|
+
var a = [x_ = Math.max(clipMin, Math.min(clipMax, x_)), y_ = Math.max(clipMin, Math.min(clipMax, y_))], b = [x = Math.max(clipMin, Math.min(clipMax, x)), y = Math.max(clipMin, Math.min(clipMax, y))];
|
|
6623
|
+
if (clipLine(a, b, x02, y02, x12, y12)) {
|
|
6624
|
+
if (!v_) {
|
|
6625
|
+
activeStream.lineStart();
|
|
6626
|
+
activeStream.point(a[0], a[1]);
|
|
6627
|
+
}
|
|
6628
|
+
activeStream.point(b[0], b[1]);
|
|
6629
|
+
if (!v) activeStream.lineEnd();
|
|
6630
|
+
clean = false;
|
|
6631
|
+
} else if (v) {
|
|
6632
|
+
activeStream.lineStart();
|
|
6633
|
+
activeStream.point(x, y);
|
|
6634
|
+
clean = false;
|
|
6635
|
+
}
|
|
6636
|
+
}
|
|
6637
|
+
}
|
|
6638
|
+
x_ = x, y_ = y, v_ = v;
|
|
6639
|
+
}
|
|
6640
|
+
return clipStream;
|
|
6641
|
+
};
|
|
6642
|
+
}
|
|
6643
|
+
const identity$1 = (x) => x;
|
|
6644
|
+
var areaSum = new Adder(), areaRingSum = new Adder(), x00$2, y00$2, x0$3, y0$3;
|
|
6645
|
+
var areaStream = {
|
|
6646
|
+
point: noop,
|
|
6647
|
+
lineStart: noop,
|
|
6648
|
+
lineEnd: noop,
|
|
6649
|
+
polygonStart: function() {
|
|
6650
|
+
areaStream.lineStart = areaRingStart;
|
|
6651
|
+
areaStream.lineEnd = areaRingEnd;
|
|
6652
|
+
},
|
|
6653
|
+
polygonEnd: function() {
|
|
6654
|
+
areaStream.lineStart = areaStream.lineEnd = areaStream.point = noop;
|
|
6655
|
+
areaSum.add(abs(areaRingSum));
|
|
6656
|
+
areaRingSum = new Adder();
|
|
6657
|
+
},
|
|
6658
|
+
result: function() {
|
|
6659
|
+
var area = areaSum / 2;
|
|
6660
|
+
areaSum = new Adder();
|
|
6661
|
+
return area;
|
|
6662
|
+
}
|
|
6663
|
+
};
|
|
6664
|
+
function areaRingStart() {
|
|
6665
|
+
areaStream.point = areaPointFirst;
|
|
6666
|
+
}
|
|
6667
|
+
function areaPointFirst(x, y) {
|
|
6668
|
+
areaStream.point = areaPoint;
|
|
6669
|
+
x00$2 = x0$3 = x, y00$2 = y0$3 = y;
|
|
6670
|
+
}
|
|
6671
|
+
function areaPoint(x, y) {
|
|
6672
|
+
areaRingSum.add(y0$3 * x - x0$3 * y);
|
|
6673
|
+
x0$3 = x, y0$3 = y;
|
|
6674
|
+
}
|
|
6675
|
+
function areaRingEnd() {
|
|
6676
|
+
areaPoint(x00$2, y00$2);
|
|
6677
|
+
}
|
|
6678
|
+
var x0$2 = Infinity, y0$2 = x0$2, x1 = -x0$2, y1 = x1;
|
|
6679
|
+
var boundsStream = {
|
|
6680
|
+
point: boundsPoint,
|
|
6681
|
+
lineStart: noop,
|
|
6682
|
+
lineEnd: noop,
|
|
6683
|
+
polygonStart: noop,
|
|
6684
|
+
polygonEnd: noop,
|
|
6685
|
+
result: function() {
|
|
6686
|
+
var bounds = [[x0$2, y0$2], [x1, y1]];
|
|
6687
|
+
x1 = y1 = -(y0$2 = x0$2 = Infinity);
|
|
6688
|
+
return bounds;
|
|
6689
|
+
}
|
|
6690
|
+
};
|
|
6691
|
+
function boundsPoint(x, y) {
|
|
6692
|
+
if (x < x0$2) x0$2 = x;
|
|
6693
|
+
if (x > x1) x1 = x;
|
|
6694
|
+
if (y < y0$2) y0$2 = y;
|
|
6695
|
+
if (y > y1) y1 = y;
|
|
6696
|
+
}
|
|
6697
|
+
var X0 = 0, Y0 = 0, Z0 = 0, X1 = 0, Y1 = 0, Z1 = 0, X2 = 0, Y2 = 0, Z2 = 0, x00$1, y00$1, x0$1, y0$1;
|
|
6698
|
+
var centroidStream = {
|
|
6699
|
+
point: centroidPoint,
|
|
6700
|
+
lineStart: centroidLineStart,
|
|
6701
|
+
lineEnd: centroidLineEnd,
|
|
6702
|
+
polygonStart: function() {
|
|
6703
|
+
centroidStream.lineStart = centroidRingStart;
|
|
6704
|
+
centroidStream.lineEnd = centroidRingEnd;
|
|
6705
|
+
},
|
|
6706
|
+
polygonEnd: function() {
|
|
6707
|
+
centroidStream.point = centroidPoint;
|
|
6708
|
+
centroidStream.lineStart = centroidLineStart;
|
|
6709
|
+
centroidStream.lineEnd = centroidLineEnd;
|
|
6710
|
+
},
|
|
6711
|
+
result: function() {
|
|
6712
|
+
var centroid = Z2 ? [X2 / Z2, Y2 / Z2] : Z1 ? [X1 / Z1, Y1 / Z1] : Z0 ? [X0 / Z0, Y0 / Z0] : [NaN, NaN];
|
|
6713
|
+
X0 = Y0 = Z0 = X1 = Y1 = Z1 = X2 = Y2 = Z2 = 0;
|
|
6714
|
+
return centroid;
|
|
6715
|
+
}
|
|
6716
|
+
};
|
|
6717
|
+
function centroidPoint(x, y) {
|
|
6718
|
+
X0 += x;
|
|
6719
|
+
Y0 += y;
|
|
6720
|
+
++Z0;
|
|
6721
|
+
}
|
|
6722
|
+
function centroidLineStart() {
|
|
6723
|
+
centroidStream.point = centroidPointFirstLine;
|
|
6724
|
+
}
|
|
6725
|
+
function centroidPointFirstLine(x, y) {
|
|
6726
|
+
centroidStream.point = centroidPointLine;
|
|
6727
|
+
centroidPoint(x0$1 = x, y0$1 = y);
|
|
6728
|
+
}
|
|
6729
|
+
function centroidPointLine(x, y) {
|
|
6730
|
+
var dx = x - x0$1, dy = y - y0$1, z = sqrt(dx * dx + dy * dy);
|
|
6731
|
+
X1 += z * (x0$1 + x) / 2;
|
|
6732
|
+
Y1 += z * (y0$1 + y) / 2;
|
|
6733
|
+
Z1 += z;
|
|
6734
|
+
centroidPoint(x0$1 = x, y0$1 = y);
|
|
6735
|
+
}
|
|
6736
|
+
function centroidLineEnd() {
|
|
6737
|
+
centroidStream.point = centroidPoint;
|
|
6738
|
+
}
|
|
6739
|
+
function centroidRingStart() {
|
|
6740
|
+
centroidStream.point = centroidPointFirstRing;
|
|
6741
|
+
}
|
|
6742
|
+
function centroidRingEnd() {
|
|
6743
|
+
centroidPointRing(x00$1, y00$1);
|
|
6744
|
+
}
|
|
6745
|
+
function centroidPointFirstRing(x, y) {
|
|
6746
|
+
centroidStream.point = centroidPointRing;
|
|
6747
|
+
centroidPoint(x00$1 = x0$1 = x, y00$1 = y0$1 = y);
|
|
6748
|
+
}
|
|
6749
|
+
function centroidPointRing(x, y) {
|
|
6750
|
+
var dx = x - x0$1, dy = y - y0$1, z = sqrt(dx * dx + dy * dy);
|
|
6751
|
+
X1 += z * (x0$1 + x) / 2;
|
|
6752
|
+
Y1 += z * (y0$1 + y) / 2;
|
|
6753
|
+
Z1 += z;
|
|
6754
|
+
z = y0$1 * x - x0$1 * y;
|
|
6755
|
+
X2 += z * (x0$1 + x);
|
|
6756
|
+
Y2 += z * (y0$1 + y);
|
|
6757
|
+
Z2 += z * 3;
|
|
6758
|
+
centroidPoint(x0$1 = x, y0$1 = y);
|
|
6759
|
+
}
|
|
6760
|
+
function PathContext(context) {
|
|
6761
|
+
this._context = context;
|
|
6762
|
+
}
|
|
6763
|
+
PathContext.prototype = {
|
|
6764
|
+
_radius: 4.5,
|
|
6765
|
+
pointRadius: function(_) {
|
|
6766
|
+
return this._radius = _, this;
|
|
6767
|
+
},
|
|
6768
|
+
polygonStart: function() {
|
|
6769
|
+
this._line = 0;
|
|
6770
|
+
},
|
|
6771
|
+
polygonEnd: function() {
|
|
6772
|
+
this._line = NaN;
|
|
6773
|
+
},
|
|
6774
|
+
lineStart: function() {
|
|
6775
|
+
this._point = 0;
|
|
6776
|
+
},
|
|
6777
|
+
lineEnd: function() {
|
|
6778
|
+
if (this._line === 0) this._context.closePath();
|
|
6779
|
+
this._point = NaN;
|
|
6780
|
+
},
|
|
6781
|
+
point: function(x, y) {
|
|
6782
|
+
switch (this._point) {
|
|
6783
|
+
case 0: {
|
|
6784
|
+
this._context.moveTo(x, y);
|
|
6785
|
+
this._point = 1;
|
|
6786
|
+
break;
|
|
6787
|
+
}
|
|
6788
|
+
case 1: {
|
|
6789
|
+
this._context.lineTo(x, y);
|
|
6790
|
+
break;
|
|
6791
|
+
}
|
|
6792
|
+
default: {
|
|
6793
|
+
this._context.moveTo(x + this._radius, y);
|
|
6794
|
+
this._context.arc(x, y, this._radius, 0, tau);
|
|
6795
|
+
break;
|
|
6796
|
+
}
|
|
6797
|
+
}
|
|
6798
|
+
},
|
|
6799
|
+
result: noop
|
|
6800
|
+
};
|
|
6801
|
+
var lengthSum = new Adder(), lengthRing, x00, y00, x0, y0;
|
|
6802
|
+
var lengthStream = {
|
|
6803
|
+
point: noop,
|
|
6804
|
+
lineStart: function() {
|
|
6805
|
+
lengthStream.point = lengthPointFirst;
|
|
6806
|
+
},
|
|
6807
|
+
lineEnd: function() {
|
|
6808
|
+
if (lengthRing) lengthPoint(x00, y00);
|
|
6809
|
+
lengthStream.point = noop;
|
|
6810
|
+
},
|
|
6811
|
+
polygonStart: function() {
|
|
6812
|
+
lengthRing = true;
|
|
6813
|
+
},
|
|
6814
|
+
polygonEnd: function() {
|
|
6815
|
+
lengthRing = null;
|
|
6816
|
+
},
|
|
6817
|
+
result: function() {
|
|
6818
|
+
var length = +lengthSum;
|
|
6819
|
+
lengthSum = new Adder();
|
|
6820
|
+
return length;
|
|
6821
|
+
}
|
|
6822
|
+
};
|
|
6823
|
+
function lengthPointFirst(x, y) {
|
|
6824
|
+
lengthStream.point = lengthPoint;
|
|
6825
|
+
x00 = x0 = x, y00 = y0 = y;
|
|
6826
|
+
}
|
|
6827
|
+
function lengthPoint(x, y) {
|
|
6828
|
+
x0 -= x, y0 -= y;
|
|
6829
|
+
lengthSum.add(sqrt(x0 * x0 + y0 * y0));
|
|
6830
|
+
x0 = x, y0 = y;
|
|
6831
|
+
}
|
|
6832
|
+
let cacheDigits, cacheAppend, cacheRadius, cacheCircle;
|
|
6833
|
+
class PathString {
|
|
6834
|
+
constructor(digits) {
|
|
6835
|
+
this._append = digits == null ? append : appendRound(digits);
|
|
6836
|
+
this._radius = 4.5;
|
|
6837
|
+
this._ = "";
|
|
6838
|
+
}
|
|
6839
|
+
pointRadius(_) {
|
|
6840
|
+
this._radius = +_;
|
|
6841
|
+
return this;
|
|
6842
|
+
}
|
|
6843
|
+
polygonStart() {
|
|
6844
|
+
this._line = 0;
|
|
6845
|
+
}
|
|
6846
|
+
polygonEnd() {
|
|
6847
|
+
this._line = NaN;
|
|
6848
|
+
}
|
|
6849
|
+
lineStart() {
|
|
6850
|
+
this._point = 0;
|
|
6851
|
+
}
|
|
6852
|
+
lineEnd() {
|
|
6853
|
+
if (this._line === 0) this._ += "Z";
|
|
6854
|
+
this._point = NaN;
|
|
6855
|
+
}
|
|
6856
|
+
point(x, y) {
|
|
6857
|
+
switch (this._point) {
|
|
6858
|
+
case 0: {
|
|
6859
|
+
this._append`M${x},${y}`;
|
|
6860
|
+
this._point = 1;
|
|
6861
|
+
break;
|
|
6862
|
+
}
|
|
6863
|
+
case 1: {
|
|
6864
|
+
this._append`L${x},${y}`;
|
|
6865
|
+
break;
|
|
6866
|
+
}
|
|
6867
|
+
default: {
|
|
6868
|
+
this._append`M${x},${y}`;
|
|
6869
|
+
if (this._radius !== cacheRadius || this._append !== cacheAppend) {
|
|
6870
|
+
const r = this._radius;
|
|
6871
|
+
const s = this._;
|
|
6872
|
+
this._ = "";
|
|
6873
|
+
this._append`m0,${r}a${r},${r} 0 1,1 0,${-2 * r}a${r},${r} 0 1,1 0,${2 * r}z`;
|
|
6874
|
+
cacheRadius = r;
|
|
6875
|
+
cacheAppend = this._append;
|
|
6876
|
+
cacheCircle = this._;
|
|
6877
|
+
this._ = s;
|
|
6878
|
+
}
|
|
6879
|
+
this._ += cacheCircle;
|
|
6880
|
+
break;
|
|
6881
|
+
}
|
|
6882
|
+
}
|
|
6883
|
+
}
|
|
6884
|
+
result() {
|
|
6885
|
+
const result = this._;
|
|
6886
|
+
this._ = "";
|
|
6887
|
+
return result.length ? result : null;
|
|
6888
|
+
}
|
|
6889
|
+
}
|
|
6890
|
+
function append(strings) {
|
|
6891
|
+
let i = 1;
|
|
6892
|
+
this._ += strings[0];
|
|
6893
|
+
for (const j = strings.length; i < j; ++i) {
|
|
6894
|
+
this._ += arguments[i] + strings[i];
|
|
6895
|
+
}
|
|
6896
|
+
}
|
|
6897
|
+
function appendRound(digits) {
|
|
6898
|
+
const d = Math.floor(digits);
|
|
6899
|
+
if (!(d >= 0)) throw new RangeError(`invalid digits: ${digits}`);
|
|
6900
|
+
if (d > 15) return append;
|
|
6901
|
+
if (d !== cacheDigits) {
|
|
6902
|
+
const k = 10 ** d;
|
|
6903
|
+
cacheDigits = d;
|
|
6904
|
+
cacheAppend = function append2(strings) {
|
|
6905
|
+
let i = 1;
|
|
6906
|
+
this._ += strings[0];
|
|
6907
|
+
for (const j = strings.length; i < j; ++i) {
|
|
6908
|
+
this._ += Math.round(arguments[i] * k) / k + strings[i];
|
|
6909
|
+
}
|
|
6910
|
+
};
|
|
6911
|
+
}
|
|
6912
|
+
return cacheAppend;
|
|
6913
|
+
}
|
|
6914
|
+
function geoPath(projection2, context) {
|
|
6915
|
+
let digits = 3, pointRadius = 4.5, projectionStream, contextStream;
|
|
6916
|
+
function path(object2) {
|
|
6917
|
+
if (object2) {
|
|
6918
|
+
if (typeof pointRadius === "function") contextStream.pointRadius(+pointRadius.apply(this, arguments));
|
|
6919
|
+
geoStream(object2, projectionStream(contextStream));
|
|
6920
|
+
}
|
|
6921
|
+
return contextStream.result();
|
|
6922
|
+
}
|
|
6923
|
+
path.area = function(object2) {
|
|
6924
|
+
geoStream(object2, projectionStream(areaStream));
|
|
6925
|
+
return areaStream.result();
|
|
6926
|
+
};
|
|
6927
|
+
path.measure = function(object2) {
|
|
6928
|
+
geoStream(object2, projectionStream(lengthStream));
|
|
6929
|
+
return lengthStream.result();
|
|
6930
|
+
};
|
|
6931
|
+
path.bounds = function(object2) {
|
|
6932
|
+
geoStream(object2, projectionStream(boundsStream));
|
|
6933
|
+
return boundsStream.result();
|
|
6934
|
+
};
|
|
6935
|
+
path.centroid = function(object2) {
|
|
6936
|
+
geoStream(object2, projectionStream(centroidStream));
|
|
6937
|
+
return centroidStream.result();
|
|
6938
|
+
};
|
|
6939
|
+
path.projection = function(_) {
|
|
6940
|
+
if (!arguments.length) return projection2;
|
|
6941
|
+
projectionStream = _ == null ? (projection2 = null, identity$1) : (projection2 = _).stream;
|
|
6942
|
+
return path;
|
|
6943
|
+
};
|
|
6944
|
+
path.context = function(_) {
|
|
6945
|
+
if (!arguments.length) return context;
|
|
6946
|
+
contextStream = _ == null ? (context = null, new PathString(digits)) : new PathContext(context = _);
|
|
6947
|
+
if (typeof pointRadius !== "function") contextStream.pointRadius(pointRadius);
|
|
6948
|
+
return path;
|
|
6949
|
+
};
|
|
6950
|
+
path.pointRadius = function(_) {
|
|
6951
|
+
if (!arguments.length) return pointRadius;
|
|
6952
|
+
pointRadius = typeof _ === "function" ? _ : (contextStream.pointRadius(+_), +_);
|
|
6953
|
+
return path;
|
|
6954
|
+
};
|
|
6955
|
+
path.digits = function(_) {
|
|
6956
|
+
if (!arguments.length) return digits;
|
|
6957
|
+
if (_ == null) digits = null;
|
|
6958
|
+
else {
|
|
6959
|
+
const d = Math.floor(_);
|
|
6960
|
+
if (!(d >= 0)) throw new RangeError(`invalid digits: ${_}`);
|
|
6961
|
+
digits = d;
|
|
6962
|
+
}
|
|
6963
|
+
if (context === null) contextStream = new PathString(digits);
|
|
6964
|
+
return path;
|
|
6965
|
+
};
|
|
6966
|
+
return path.projection(projection2).digits(digits).context(context);
|
|
6967
|
+
}
|
|
6968
|
+
function transformer(methods) {
|
|
6969
|
+
return function(stream) {
|
|
6970
|
+
var s = new TransformStream();
|
|
6971
|
+
for (var key in methods) s[key] = methods[key];
|
|
6972
|
+
s.stream = stream;
|
|
6973
|
+
return s;
|
|
6974
|
+
};
|
|
6975
|
+
}
|
|
6976
|
+
function TransformStream() {
|
|
6977
|
+
}
|
|
6978
|
+
TransformStream.prototype = {
|
|
6979
|
+
constructor: TransformStream,
|
|
6980
|
+
point: function(x, y) {
|
|
6981
|
+
this.stream.point(x, y);
|
|
6982
|
+
},
|
|
6983
|
+
sphere: function() {
|
|
6984
|
+
this.stream.sphere();
|
|
6985
|
+
},
|
|
6986
|
+
lineStart: function() {
|
|
6987
|
+
this.stream.lineStart();
|
|
6988
|
+
},
|
|
6989
|
+
lineEnd: function() {
|
|
6990
|
+
this.stream.lineEnd();
|
|
6991
|
+
},
|
|
6992
|
+
polygonStart: function() {
|
|
6993
|
+
this.stream.polygonStart();
|
|
6994
|
+
},
|
|
6995
|
+
polygonEnd: function() {
|
|
6996
|
+
this.stream.polygonEnd();
|
|
6997
|
+
}
|
|
6998
|
+
};
|
|
6999
|
+
function fit(projection2, fitBounds, object2) {
|
|
7000
|
+
var clip2 = projection2.clipExtent && projection2.clipExtent();
|
|
7001
|
+
projection2.scale(150).translate([0, 0]);
|
|
7002
|
+
if (clip2 != null) projection2.clipExtent(null);
|
|
7003
|
+
geoStream(object2, projection2.stream(boundsStream));
|
|
7004
|
+
fitBounds(boundsStream.result());
|
|
7005
|
+
if (clip2 != null) projection2.clipExtent(clip2);
|
|
7006
|
+
return projection2;
|
|
7007
|
+
}
|
|
7008
|
+
function fitExtent(projection2, extent, object2) {
|
|
7009
|
+
return fit(projection2, function(b) {
|
|
7010
|
+
var w = extent[1][0] - extent[0][0], h = extent[1][1] - extent[0][1], k = Math.min(w / (b[1][0] - b[0][0]), h / (b[1][1] - b[0][1])), x = +extent[0][0] + (w - k * (b[1][0] + b[0][0])) / 2, y = +extent[0][1] + (h - k * (b[1][1] + b[0][1])) / 2;
|
|
7011
|
+
projection2.scale(150 * k).translate([x, y]);
|
|
7012
|
+
}, object2);
|
|
7013
|
+
}
|
|
7014
|
+
function fitSize(projection2, size, object2) {
|
|
7015
|
+
return fitExtent(projection2, [[0, 0], size], object2);
|
|
7016
|
+
}
|
|
7017
|
+
function fitWidth(projection2, width, object2) {
|
|
7018
|
+
return fit(projection2, function(b) {
|
|
7019
|
+
var w = +width, k = w / (b[1][0] - b[0][0]), x = (w - k * (b[1][0] + b[0][0])) / 2, y = -k * b[0][1];
|
|
7020
|
+
projection2.scale(150 * k).translate([x, y]);
|
|
7021
|
+
}, object2);
|
|
7022
|
+
}
|
|
7023
|
+
function fitHeight(projection2, height, object2) {
|
|
7024
|
+
return fit(projection2, function(b) {
|
|
7025
|
+
var h = +height, k = h / (b[1][1] - b[0][1]), x = -k * b[0][0], y = (h - k * (b[1][1] + b[0][1])) / 2;
|
|
7026
|
+
projection2.scale(150 * k).translate([x, y]);
|
|
7027
|
+
}, object2);
|
|
7028
|
+
}
|
|
7029
|
+
var maxDepth = 16, cosMinDistance = cos(30 * radians);
|
|
7030
|
+
function resample$1(project, delta2) {
|
|
7031
|
+
return +delta2 ? resample(project, delta2) : resampleNone(project);
|
|
7032
|
+
}
|
|
7033
|
+
function resampleNone(project) {
|
|
7034
|
+
return transformer({
|
|
7035
|
+
point: function(x, y) {
|
|
7036
|
+
x = project(x, y);
|
|
7037
|
+
this.stream.point(x[0], x[1]);
|
|
7038
|
+
}
|
|
7039
|
+
});
|
|
7040
|
+
}
|
|
7041
|
+
function resample(project, delta2) {
|
|
7042
|
+
function resampleLineTo(x02, y02, lambda0, a0, b0, c0, x12, y12, lambda1, a1, b1, c1, depth, stream) {
|
|
7043
|
+
var dx = x12 - x02, dy = y12 - y02, d2 = dx * dx + dy * dy;
|
|
7044
|
+
if (d2 > 4 * delta2 && depth--) {
|
|
7045
|
+
var a = a0 + a1, b = b0 + b1, c = c0 + c1, m = sqrt(a * a + b * b + c * c), phi2 = asin(c /= m), lambda2 = abs(abs(c) - 1) < epsilon || abs(lambda0 - lambda1) < epsilon ? (lambda0 + lambda1) / 2 : atan2(b, a), p = project(lambda2, phi2), x2 = p[0], y2 = p[1], dx2 = x2 - x02, dy2 = y2 - y02, dz = dy * dx2 - dx * dy2;
|
|
7046
|
+
if (dz * dz / d2 > delta2 || abs((dx * dx2 + dy * dy2) / d2 - 0.5) > 0.3 || a0 * a1 + b0 * b1 + c0 * c1 < cosMinDistance) {
|
|
7047
|
+
resampleLineTo(x02, y02, lambda0, a0, b0, c0, x2, y2, lambda2, a /= m, b /= m, c, depth, stream);
|
|
7048
|
+
stream.point(x2, y2);
|
|
7049
|
+
resampleLineTo(x2, y2, lambda2, a, b, c, x12, y12, lambda1, a1, b1, c1, depth, stream);
|
|
7050
|
+
}
|
|
7051
|
+
}
|
|
7052
|
+
}
|
|
7053
|
+
return function(stream) {
|
|
7054
|
+
var lambda00, x002, y002, a00, b00, c00, lambda0, x02, y02, a0, b0, c0;
|
|
7055
|
+
var resampleStream = {
|
|
7056
|
+
point,
|
|
7057
|
+
lineStart,
|
|
7058
|
+
lineEnd,
|
|
7059
|
+
polygonStart: function() {
|
|
7060
|
+
stream.polygonStart();
|
|
7061
|
+
resampleStream.lineStart = ringStart;
|
|
7062
|
+
},
|
|
7063
|
+
polygonEnd: function() {
|
|
7064
|
+
stream.polygonEnd();
|
|
7065
|
+
resampleStream.lineStart = lineStart;
|
|
7066
|
+
}
|
|
7067
|
+
};
|
|
7068
|
+
function point(x, y) {
|
|
7069
|
+
x = project(x, y);
|
|
7070
|
+
stream.point(x[0], x[1]);
|
|
7071
|
+
}
|
|
7072
|
+
function lineStart() {
|
|
7073
|
+
x02 = NaN;
|
|
7074
|
+
resampleStream.point = linePoint;
|
|
7075
|
+
stream.lineStart();
|
|
7076
|
+
}
|
|
7077
|
+
function linePoint(lambda, phi) {
|
|
7078
|
+
var c = cartesian([lambda, phi]), p = project(lambda, phi);
|
|
7079
|
+
resampleLineTo(x02, y02, lambda0, a0, b0, c0, x02 = p[0], y02 = p[1], lambda0 = lambda, a0 = c[0], b0 = c[1], c0 = c[2], maxDepth, stream);
|
|
7080
|
+
stream.point(x02, y02);
|
|
7081
|
+
}
|
|
7082
|
+
function lineEnd() {
|
|
7083
|
+
resampleStream.point = point;
|
|
7084
|
+
stream.lineEnd();
|
|
7085
|
+
}
|
|
7086
|
+
function ringStart() {
|
|
7087
|
+
lineStart();
|
|
7088
|
+
resampleStream.point = ringPoint;
|
|
7089
|
+
resampleStream.lineEnd = ringEnd;
|
|
7090
|
+
}
|
|
7091
|
+
function ringPoint(lambda, phi) {
|
|
7092
|
+
linePoint(lambda00 = lambda, phi), x002 = x02, y002 = y02, a00 = a0, b00 = b0, c00 = c0;
|
|
7093
|
+
resampleStream.point = linePoint;
|
|
7094
|
+
}
|
|
7095
|
+
function ringEnd() {
|
|
7096
|
+
resampleLineTo(x02, y02, lambda0, a0, b0, c0, x002, y002, lambda00, a00, b00, c00, maxDepth, stream);
|
|
7097
|
+
resampleStream.lineEnd = lineEnd;
|
|
7098
|
+
lineEnd();
|
|
7099
|
+
}
|
|
7100
|
+
return resampleStream;
|
|
7101
|
+
};
|
|
7102
|
+
}
|
|
7103
|
+
var transformRadians = transformer({
|
|
7104
|
+
point: function(x, y) {
|
|
7105
|
+
this.stream.point(x * radians, y * radians);
|
|
7106
|
+
}
|
|
7107
|
+
});
|
|
7108
|
+
function transformRotate(rotate) {
|
|
7109
|
+
return transformer({
|
|
7110
|
+
point: function(x, y) {
|
|
7111
|
+
var r = rotate(x, y);
|
|
7112
|
+
return this.stream.point(r[0], r[1]);
|
|
7113
|
+
}
|
|
7114
|
+
});
|
|
7115
|
+
}
|
|
7116
|
+
function scaleTranslate(k, dx, dy, sx, sy) {
|
|
7117
|
+
function transform2(x, y) {
|
|
7118
|
+
x *= sx;
|
|
7119
|
+
y *= sy;
|
|
7120
|
+
return [dx + k * x, dy - k * y];
|
|
7121
|
+
}
|
|
7122
|
+
transform2.invert = function(x, y) {
|
|
7123
|
+
return [(x - dx) / k * sx, (dy - y) / k * sy];
|
|
7124
|
+
};
|
|
7125
|
+
return transform2;
|
|
7126
|
+
}
|
|
7127
|
+
function scaleTranslateRotate(k, dx, dy, sx, sy, alpha) {
|
|
7128
|
+
if (!alpha) return scaleTranslate(k, dx, dy, sx, sy);
|
|
7129
|
+
var cosAlpha = cos(alpha), sinAlpha = sin(alpha), a = cosAlpha * k, b = sinAlpha * k, ai = cosAlpha / k, bi = sinAlpha / k, ci = (sinAlpha * dy - cosAlpha * dx) / k, fi = (sinAlpha * dx + cosAlpha * dy) / k;
|
|
7130
|
+
function transform2(x, y) {
|
|
7131
|
+
x *= sx;
|
|
7132
|
+
y *= sy;
|
|
7133
|
+
return [a * x - b * y + dx, dy - b * x - a * y];
|
|
7134
|
+
}
|
|
7135
|
+
transform2.invert = function(x, y) {
|
|
7136
|
+
return [sx * (ai * x - bi * y + ci), sy * (fi - bi * x - ai * y)];
|
|
7137
|
+
};
|
|
7138
|
+
return transform2;
|
|
7139
|
+
}
|
|
7140
|
+
function projection(project) {
|
|
7141
|
+
return projectionMutator(function() {
|
|
7142
|
+
return project;
|
|
7143
|
+
})();
|
|
7144
|
+
}
|
|
7145
|
+
function projectionMutator(projectAt) {
|
|
7146
|
+
var project, k = 150, x = 480, y = 250, lambda = 0, phi = 0, deltaLambda = 0, deltaPhi = 0, deltaGamma = 0, rotate, alpha = 0, sx = 1, sy = 1, theta = null, preclip = clipAntimeridian, x02 = null, y02, x12, y12, postclip = identity$1, delta2 = 0.5, projectResample, projectTransform, projectRotateTransform, cache, cacheStream;
|
|
7147
|
+
function projection2(point) {
|
|
7148
|
+
return projectRotateTransform(point[0] * radians, point[1] * radians);
|
|
7149
|
+
}
|
|
7150
|
+
function invert(point) {
|
|
7151
|
+
point = projectRotateTransform.invert(point[0], point[1]);
|
|
7152
|
+
return point && [point[0] * degrees, point[1] * degrees];
|
|
7153
|
+
}
|
|
7154
|
+
projection2.stream = function(stream) {
|
|
7155
|
+
return cache && cacheStream === stream ? cache : cache = transformRadians(transformRotate(rotate)(preclip(projectResample(postclip(cacheStream = stream)))));
|
|
7156
|
+
};
|
|
7157
|
+
projection2.preclip = function(_) {
|
|
7158
|
+
return arguments.length ? (preclip = _, theta = void 0, reset()) : preclip;
|
|
7159
|
+
};
|
|
7160
|
+
projection2.postclip = function(_) {
|
|
7161
|
+
return arguments.length ? (postclip = _, x02 = y02 = x12 = y12 = null, reset()) : postclip;
|
|
7162
|
+
};
|
|
7163
|
+
projection2.clipAngle = function(_) {
|
|
7164
|
+
return arguments.length ? (preclip = +_ ? clipCircle(theta = _ * radians) : (theta = null, clipAntimeridian), reset()) : theta * degrees;
|
|
7165
|
+
};
|
|
7166
|
+
projection2.clipExtent = function(_) {
|
|
7167
|
+
return arguments.length ? (postclip = _ == null ? (x02 = y02 = x12 = y12 = null, identity$1) : clipRectangle(x02 = +_[0][0], y02 = +_[0][1], x12 = +_[1][0], y12 = +_[1][1]), reset()) : x02 == null ? null : [[x02, y02], [x12, y12]];
|
|
7168
|
+
};
|
|
7169
|
+
projection2.scale = function(_) {
|
|
7170
|
+
return arguments.length ? (k = +_, recenter()) : k;
|
|
7171
|
+
};
|
|
7172
|
+
projection2.translate = function(_) {
|
|
7173
|
+
return arguments.length ? (x = +_[0], y = +_[1], recenter()) : [x, y];
|
|
7174
|
+
};
|
|
7175
|
+
projection2.center = function(_) {
|
|
7176
|
+
return arguments.length ? (lambda = _[0] % 360 * radians, phi = _[1] % 360 * radians, recenter()) : [lambda * degrees, phi * degrees];
|
|
7177
|
+
};
|
|
7178
|
+
projection2.rotate = function(_) {
|
|
7179
|
+
return arguments.length ? (deltaLambda = _[0] % 360 * radians, deltaPhi = _[1] % 360 * radians, deltaGamma = _.length > 2 ? _[2] % 360 * radians : 0, recenter()) : [deltaLambda * degrees, deltaPhi * degrees, deltaGamma * degrees];
|
|
7180
|
+
};
|
|
7181
|
+
projection2.angle = function(_) {
|
|
7182
|
+
return arguments.length ? (alpha = _ % 360 * radians, recenter()) : alpha * degrees;
|
|
7183
|
+
};
|
|
7184
|
+
projection2.reflectX = function(_) {
|
|
7185
|
+
return arguments.length ? (sx = _ ? -1 : 1, recenter()) : sx < 0;
|
|
7186
|
+
};
|
|
7187
|
+
projection2.reflectY = function(_) {
|
|
7188
|
+
return arguments.length ? (sy = _ ? -1 : 1, recenter()) : sy < 0;
|
|
7189
|
+
};
|
|
7190
|
+
projection2.precision = function(_) {
|
|
7191
|
+
return arguments.length ? (projectResample = resample$1(projectTransform, delta2 = _ * _), reset()) : sqrt(delta2);
|
|
7192
|
+
};
|
|
7193
|
+
projection2.fitExtent = function(extent, object2) {
|
|
7194
|
+
return fitExtent(projection2, extent, object2);
|
|
7195
|
+
};
|
|
7196
|
+
projection2.fitSize = function(size, object2) {
|
|
7197
|
+
return fitSize(projection2, size, object2);
|
|
7198
|
+
};
|
|
7199
|
+
projection2.fitWidth = function(width, object2) {
|
|
7200
|
+
return fitWidth(projection2, width, object2);
|
|
7201
|
+
};
|
|
7202
|
+
projection2.fitHeight = function(height, object2) {
|
|
7203
|
+
return fitHeight(projection2, height, object2);
|
|
7204
|
+
};
|
|
7205
|
+
function recenter() {
|
|
7206
|
+
var center = scaleTranslateRotate(k, 0, 0, sx, sy, alpha).apply(null, project(lambda, phi)), transform2 = scaleTranslateRotate(k, x - center[0], y - center[1], sx, sy, alpha);
|
|
7207
|
+
rotate = rotateRadians(deltaLambda, deltaPhi, deltaGamma);
|
|
7208
|
+
projectTransform = compose(project, transform2);
|
|
7209
|
+
projectRotateTransform = compose(rotate, projectTransform);
|
|
7210
|
+
projectResample = resample$1(projectTransform, delta2);
|
|
7211
|
+
return reset();
|
|
7212
|
+
}
|
|
7213
|
+
function reset() {
|
|
7214
|
+
cache = cacheStream = null;
|
|
7215
|
+
return projection2;
|
|
7216
|
+
}
|
|
7217
|
+
return function() {
|
|
7218
|
+
project = projectAt.apply(this, arguments);
|
|
7219
|
+
projection2.invert = project.invert && invert;
|
|
7220
|
+
return recenter();
|
|
7221
|
+
};
|
|
7222
|
+
}
|
|
7223
|
+
function mercatorRaw(lambda, phi) {
|
|
7224
|
+
return [lambda, log(tan((halfPi + phi) / 2))];
|
|
7225
|
+
}
|
|
7226
|
+
mercatorRaw.invert = function(x, y) {
|
|
7227
|
+
return [x, 2 * atan(exp(y)) - halfPi];
|
|
7228
|
+
};
|
|
7229
|
+
function geoMercator() {
|
|
7230
|
+
return mercatorProjection(mercatorRaw).scale(961 / tau);
|
|
7231
|
+
}
|
|
7232
|
+
function mercatorProjection(project) {
|
|
7233
|
+
var m = projection(project), center = m.center, scale = m.scale, translate = m.translate, clipExtent = m.clipExtent, x02 = null, y02, x12, y12;
|
|
7234
|
+
m.scale = function(_) {
|
|
7235
|
+
return arguments.length ? (scale(_), reclip()) : scale();
|
|
7236
|
+
};
|
|
7237
|
+
m.translate = function(_) {
|
|
7238
|
+
return arguments.length ? (translate(_), reclip()) : translate();
|
|
7239
|
+
};
|
|
7240
|
+
m.center = function(_) {
|
|
7241
|
+
return arguments.length ? (center(_), reclip()) : center();
|
|
7242
|
+
};
|
|
7243
|
+
m.clipExtent = function(_) {
|
|
7244
|
+
return arguments.length ? (_ == null ? x02 = y02 = x12 = y12 = null : (x02 = +_[0][0], y02 = +_[0][1], x12 = +_[1][0], y12 = +_[1][1]), reclip()) : x02 == null ? null : [[x02, y02], [x12, y12]];
|
|
7245
|
+
};
|
|
7246
|
+
function reclip() {
|
|
7247
|
+
var k = pi * scale(), t = m(rotation(m.rotate()).invert([0, 0]));
|
|
7248
|
+
return clipExtent(x02 == null ? [[t[0] - k, t[1] - k], [t[0] + k, t[1] + k]] : project === mercatorRaw ? [[Math.max(t[0] - k, x02), y02], [Math.min(t[0] + k, x12), y12]] : [[x02, Math.max(t[1] - k, y02)], [x12, Math.min(t[1] + k, y12)]]);
|
|
7249
|
+
}
|
|
7250
|
+
return reclip();
|
|
7251
|
+
}
|
|
7252
|
+
function identity(x) {
|
|
7253
|
+
return x;
|
|
7254
|
+
}
|
|
7255
|
+
function transform(transform2) {
|
|
7256
|
+
if (transform2 == null) return identity;
|
|
7257
|
+
var x02, y02, kx = transform2.scale[0], ky = transform2.scale[1], dx = transform2.translate[0], dy = transform2.translate[1];
|
|
7258
|
+
return function(input2, i) {
|
|
7259
|
+
if (!i) x02 = y02 = 0;
|
|
7260
|
+
var j = 2, n = input2.length, output = new Array(n);
|
|
7261
|
+
output[0] = (x02 += input2[0]) * kx + dx;
|
|
7262
|
+
output[1] = (y02 += input2[1]) * ky + dy;
|
|
7263
|
+
while (j < n) output[j] = input2[j], ++j;
|
|
7264
|
+
return output;
|
|
7265
|
+
};
|
|
7266
|
+
}
|
|
7267
|
+
function reverse(array, n) {
|
|
7268
|
+
var t, j = array.length, i = j - n;
|
|
7269
|
+
while (i < --j) t = array[i], array[i++] = array[j], array[j] = t;
|
|
7270
|
+
}
|
|
7271
|
+
function topojsonFeature(topology, o) {
|
|
7272
|
+
if (typeof o === "string") o = topology.objects[o];
|
|
7273
|
+
return o.type === "GeometryCollection" ? { type: "FeatureCollection", features: o.geometries.map(function(o2) {
|
|
7274
|
+
return feature(topology, o2);
|
|
7275
|
+
}) } : feature(topology, o);
|
|
7276
|
+
}
|
|
7277
|
+
function feature(topology, o) {
|
|
7278
|
+
var id = o.id, bbox = o.bbox, properties = o.properties == null ? {} : o.properties, geometry = object(topology, o);
|
|
7279
|
+
return id == null && bbox == null ? { type: "Feature", properties, geometry } : bbox == null ? { type: "Feature", id, properties, geometry } : { type: "Feature", id, bbox, properties, geometry };
|
|
7280
|
+
}
|
|
7281
|
+
function object(topology, o) {
|
|
7282
|
+
var transformPoint = transform(topology.transform), arcs = topology.arcs;
|
|
7283
|
+
function arc(i, points) {
|
|
7284
|
+
if (points.length) points.pop();
|
|
7285
|
+
for (var a = arcs[i < 0 ? ~i : i], k = 0, n = a.length; k < n; ++k) {
|
|
7286
|
+
points.push(transformPoint(a[k], k));
|
|
7287
|
+
}
|
|
7288
|
+
if (i < 0) reverse(points, n);
|
|
7289
|
+
}
|
|
7290
|
+
function point(p) {
|
|
7291
|
+
return transformPoint(p);
|
|
7292
|
+
}
|
|
7293
|
+
function line(arcs2) {
|
|
7294
|
+
var points = [];
|
|
7295
|
+
for (var i = 0, n = arcs2.length; i < n; ++i) arc(arcs2[i], points);
|
|
7296
|
+
if (points.length < 2) points.push(points[0]);
|
|
7297
|
+
return points;
|
|
7298
|
+
}
|
|
7299
|
+
function ring(arcs2) {
|
|
7300
|
+
var points = line(arcs2);
|
|
7301
|
+
while (points.length < 4) points.push(points[0]);
|
|
7302
|
+
return points;
|
|
7303
|
+
}
|
|
7304
|
+
function polygon(arcs2) {
|
|
7305
|
+
return arcs2.map(ring);
|
|
7306
|
+
}
|
|
7307
|
+
function geometry(o2) {
|
|
7308
|
+
var type = o2.type, coordinates;
|
|
7309
|
+
switch (type) {
|
|
7310
|
+
case "GeometryCollection":
|
|
7311
|
+
return { type, geometries: o2.geometries.map(geometry) };
|
|
7312
|
+
case "Point":
|
|
7313
|
+
coordinates = point(o2.coordinates);
|
|
7314
|
+
break;
|
|
7315
|
+
case "MultiPoint":
|
|
7316
|
+
coordinates = o2.coordinates.map(point);
|
|
7317
|
+
break;
|
|
7318
|
+
case "LineString":
|
|
7319
|
+
coordinates = line(o2.arcs);
|
|
7320
|
+
break;
|
|
7321
|
+
case "MultiLineString":
|
|
7322
|
+
coordinates = o2.arcs.map(line);
|
|
7323
|
+
break;
|
|
7324
|
+
case "Polygon":
|
|
7325
|
+
coordinates = polygon(o2.arcs);
|
|
7326
|
+
break;
|
|
7327
|
+
case "MultiPolygon":
|
|
7328
|
+
coordinates = o2.arcs.map(polygon);
|
|
7329
|
+
break;
|
|
7330
|
+
default:
|
|
7331
|
+
return null;
|
|
7332
|
+
}
|
|
7333
|
+
return { type, coordinates };
|
|
7334
|
+
}
|
|
7335
|
+
return geometry(o);
|
|
7336
|
+
}
|
|
7337
|
+
const choroplethStyles = appShell.tv({
|
|
7338
|
+
slots: {
|
|
7339
|
+
root: "relative w-full",
|
|
7340
|
+
svg: "block h-auto w-full",
|
|
7341
|
+
// Traço das divisas — `fg-muted` (mid-gray VISÍVEL nos DOIS temas: L≈0.50
|
|
7342
|
+
// no light, L≈0.70 no dark). `border-default` era L≈0.91 no light → as
|
|
7343
|
+
// divisas sumiam no fundo branco e só estados de alta penetração apareciam
|
|
7344
|
+
// ("só 2 pontos"). hover reforça no próprio path (inline).
|
|
7345
|
+
path: [
|
|
7346
|
+
"stroke-fg-muted",
|
|
7347
|
+
"transition-[fill,stroke] duration-150",
|
|
7348
|
+
"hover:stroke-fg-brand"
|
|
7349
|
+
],
|
|
7350
|
+
// Camada de ancoragem do tooltip (não intercepta o mouse).
|
|
7351
|
+
tooltipLayer: "pointer-events-none absolute inset-0",
|
|
7352
|
+
tooltipAnchor: "absolute",
|
|
7353
|
+
tooltipName: "font-semibold text-fg-default",
|
|
7354
|
+
tooltipValue: "text-fg-muted",
|
|
7355
|
+
legend: "mt-gp-md flex flex-col gap-gp-xs",
|
|
7356
|
+
legendTitle: "text-caption-sm font-semibold text-fg-muted",
|
|
7357
|
+
legendBar: "h-gp-md w-full rounded-radius-full",
|
|
7358
|
+
legendScale: "flex items-center justify-between text-caption-xs text-fg-muted tabular-nums"
|
|
7359
|
+
}
|
|
7360
|
+
});
|
|
7361
|
+
function isTopology(g) {
|
|
7362
|
+
return !Array.isArray(g) && g.type === "Topology";
|
|
7363
|
+
}
|
|
7364
|
+
function isFeatureCollection(g) {
|
|
7365
|
+
return !Array.isArray(g) && g.type === "FeatureCollection";
|
|
7366
|
+
}
|
|
7367
|
+
function normalizeFeatures(geography, topologyObject) {
|
|
7368
|
+
if (Array.isArray(geography)) return geography;
|
|
7369
|
+
if (isTopology(geography)) {
|
|
7370
|
+
if (!topologyObject) return [];
|
|
7371
|
+
const obj = geography.objects[topologyObject];
|
|
7372
|
+
if (!obj) return [];
|
|
7373
|
+
const out = topojsonFeature(geography, obj);
|
|
7374
|
+
if (out.type === "FeatureCollection") return out.features;
|
|
7375
|
+
return [out];
|
|
7376
|
+
}
|
|
7377
|
+
if (isFeatureCollection(geography)) return geography.features;
|
|
7378
|
+
return [];
|
|
7379
|
+
}
|
|
7380
|
+
const ChoroplethMap = React.forwardRef(
|
|
7381
|
+
function ChoroplethMap2({
|
|
7382
|
+
geography,
|
|
7383
|
+
topologyObject,
|
|
7384
|
+
values,
|
|
7385
|
+
getFeatureId,
|
|
7386
|
+
getFeatureName,
|
|
7387
|
+
colorScale,
|
|
7388
|
+
scaleToken = "brand",
|
|
7389
|
+
domain,
|
|
7390
|
+
projection: projection2,
|
|
7391
|
+
width = 800,
|
|
7392
|
+
height = 600,
|
|
7393
|
+
strokeWidth = 0.5,
|
|
7394
|
+
showLegend = true,
|
|
7395
|
+
legendTitle,
|
|
7396
|
+
formatValue,
|
|
7397
|
+
renderTooltip,
|
|
7398
|
+
onFeatureClick,
|
|
7399
|
+
ariaLabel = "Mapa",
|
|
7400
|
+
className
|
|
7401
|
+
}, ref) {
|
|
7402
|
+
const styles2 = choroplethStyles();
|
|
7403
|
+
const features = React.useMemo(
|
|
7404
|
+
() => normalizeFeatures(geography, topologyObject),
|
|
7405
|
+
[geography, topologyObject]
|
|
7406
|
+
);
|
|
7407
|
+
const geometry = React.useMemo(() => {
|
|
7408
|
+
const proj = projection2 ?? geoMercator().fitSize(
|
|
7409
|
+
[width, height],
|
|
7410
|
+
{
|
|
7411
|
+
type: "FeatureCollection",
|
|
7412
|
+
features
|
|
7413
|
+
}
|
|
7414
|
+
);
|
|
7415
|
+
const pathGen = geoPath(proj);
|
|
7416
|
+
return features.map((f) => ({
|
|
7417
|
+
feature: f,
|
|
7418
|
+
d: pathGen(f) ?? "",
|
|
7419
|
+
centroid: pathGen.centroid(f)
|
|
7420
|
+
}));
|
|
7421
|
+
}, [features, projection2, width, height]);
|
|
7422
|
+
const getId = (f) => {
|
|
7423
|
+
if (getFeatureId) return getFeatureId(f);
|
|
7424
|
+
if (f.id != null) return f.id;
|
|
7425
|
+
const p = f.properties ?? {};
|
|
7426
|
+
return p.id ?? p.ID ?? "";
|
|
7427
|
+
};
|
|
7428
|
+
const getName = (f) => {
|
|
7429
|
+
if (getFeatureName) return getFeatureName(f);
|
|
7430
|
+
const p = f.properties ?? {};
|
|
7431
|
+
return String(p.name ?? p.nome ?? p.NOME ?? p.Name ?? getId(f));
|
|
7432
|
+
};
|
|
7433
|
+
const numeric = Object.values(values).filter(
|
|
7434
|
+
(v) => typeof v === "number" && Number.isFinite(v)
|
|
7435
|
+
);
|
|
7436
|
+
const min = domain ? domain[0] : numeric.length ? Math.min(...numeric) : 0;
|
|
7437
|
+
const max = domain ? domain[1] : numeric.length ? Math.max(...numeric) : 0;
|
|
7438
|
+
const scaleVar = `var(--color-bg-${scaleToken})`;
|
|
7439
|
+
const surfaceVar = "var(--color-bg-surface)";
|
|
7440
|
+
const noDataVar = "var(--color-bg-muted)";
|
|
7441
|
+
const fillFor = (value) => {
|
|
7442
|
+
if (value === void 0 || !Number.isFinite(value)) return noDataVar;
|
|
7443
|
+
if (colorScale) return colorScale(value, { min, max });
|
|
7444
|
+
const range = max - min;
|
|
7445
|
+
const t = range > 0 ? (value - min) / range : 1;
|
|
7446
|
+
const clamped = Math.max(0, Math.min(1, t));
|
|
7447
|
+
const pct = 12 + clamped * 88;
|
|
7448
|
+
return `color-mix(in srgb, ${scaleVar} ${pct}%, ${surfaceVar})`;
|
|
7449
|
+
};
|
|
7450
|
+
const fmt = formatValue ?? ((v) => new Intl.NumberFormat("pt-BR").format(v));
|
|
7451
|
+
const [hover, setHover] = React.useState(null);
|
|
7452
|
+
const legendGradient = `linear-gradient(to right, ${surfaceVar}, ${scaleVar})`;
|
|
7453
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { ref, className: styles2.root({ className }), children: [
|
|
7454
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7455
|
+
"svg",
|
|
7456
|
+
{
|
|
7457
|
+
viewBox: `0 0 ${width} ${height}`,
|
|
7458
|
+
className: styles2.svg(),
|
|
7459
|
+
role: "img",
|
|
7460
|
+
"aria-label": ariaLabel,
|
|
7461
|
+
onMouseLeave: () => setHover(null),
|
|
7462
|
+
children: geometry.map(({ feature: feature2, d, centroid }, index) => {
|
|
7463
|
+
const id = getId(feature2);
|
|
7464
|
+
const value = values[id];
|
|
7465
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
7466
|
+
"path",
|
|
7467
|
+
{
|
|
7468
|
+
d,
|
|
7469
|
+
fill: fillFor(value),
|
|
7470
|
+
strokeWidth,
|
|
7471
|
+
className: styles2.path(),
|
|
7472
|
+
style: onFeatureClick ? { cursor: "pointer" } : void 0,
|
|
7473
|
+
onMouseEnter: () => setHover({
|
|
7474
|
+
id,
|
|
7475
|
+
name: getName(feature2),
|
|
7476
|
+
value,
|
|
7477
|
+
feature: feature2,
|
|
7478
|
+
ax: centroid[0] / width * 100,
|
|
7479
|
+
ay: centroid[1] / height * 100
|
|
7480
|
+
}),
|
|
7481
|
+
onClick: onFeatureClick ? () => onFeatureClick({
|
|
7482
|
+
id,
|
|
7483
|
+
name: getName(feature2),
|
|
7484
|
+
value,
|
|
7485
|
+
feature: feature2
|
|
7486
|
+
}) : void 0
|
|
7487
|
+
},
|
|
7488
|
+
`${id}-${index}`
|
|
7489
|
+
);
|
|
7490
|
+
})
|
|
7491
|
+
}
|
|
7492
|
+
),
|
|
7493
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: styles2.tooltipLayer(), children: /* @__PURE__ */ jsxRuntime.jsxs(Tooltip, { open: hover != null, onOpenChange: () => {
|
|
7494
|
+
}, disableHoverableContent: true, children: [
|
|
7495
|
+
/* @__PURE__ */ jsxRuntime.jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
7496
|
+
"span",
|
|
7497
|
+
{
|
|
7498
|
+
"aria-hidden": "true",
|
|
7499
|
+
className: styles2.tooltipAnchor(),
|
|
7500
|
+
style: { left: `${hover?.ax ?? 0}%`, top: `${hover?.ay ?? 0}%` }
|
|
7501
|
+
}
|
|
7502
|
+
) }),
|
|
7503
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7504
|
+
TooltipContent,
|
|
7505
|
+
{
|
|
7506
|
+
showArrow: false,
|
|
7507
|
+
className: "border border-border-default bg-bg-surface-elevated shadow-sh-lg",
|
|
7508
|
+
children: hover && (renderTooltip ? renderTooltip(hover) : /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
7509
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: styles2.tooltipName(), children: hover.name }),
|
|
7510
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: styles2.tooltipValue(), children: hover.value != null && Number.isFinite(hover.value) ? fmt(hover.value) : "Sem dados" })
|
|
7511
|
+
] }))
|
|
7512
|
+
}
|
|
7513
|
+
)
|
|
7514
|
+
] }) }),
|
|
7515
|
+
showLegend && numeric.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles2.legend(), children: [
|
|
7516
|
+
legendTitle && /* @__PURE__ */ jsxRuntime.jsx("span", { className: styles2.legendTitle(), children: legendTitle }),
|
|
7517
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7518
|
+
"div",
|
|
7519
|
+
{
|
|
7520
|
+
className: styles2.legendBar(),
|
|
7521
|
+
style: { background: legendGradient },
|
|
7522
|
+
"aria-hidden": "true"
|
|
7523
|
+
}
|
|
7524
|
+
),
|
|
7525
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles2.legendScale(), children: [
|
|
7526
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: fmt(min) }),
|
|
7527
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: fmt(max) })
|
|
7528
|
+
] })
|
|
7529
|
+
] })
|
|
7530
|
+
] });
|
|
7531
|
+
}
|
|
7532
|
+
);
|
|
7533
|
+
ChoroplethMap.displayName = "ChoroplethMap";
|
|
7534
|
+
exports.AddViewModal = panel.AddViewModal;
|
|
7535
|
+
exports.AlertModal = panel.AlertModal;
|
|
7536
|
+
exports.Avatar = panel.Avatar;
|
|
7537
|
+
exports.BulkActionButton = panel.BulkActionButton;
|
|
7538
|
+
exports.BulkActionsBar = panel.BulkActionsBar;
|
|
7539
|
+
exports.ButtonGroup = panel.ButtonGroup;
|
|
7540
|
+
exports.ColsPanel = panel.ColsPanel;
|
|
7541
|
+
exports.ColsPopover = panel.ColsPopover;
|
|
7542
|
+
exports.Combobox = panel.Combobox;
|
|
7543
|
+
exports.DEFAULT_FILTER_OPERATORS = panel.DEFAULT_FILTER_OPERATORS;
|
|
7544
|
+
exports.DataTable = panel.DataTable;
|
|
7545
|
+
exports.DataTableActionsCell = panel.DataTableActionsCell;
|
|
7546
|
+
exports.DataTableEditCell = panel.DataTableEditCell;
|
|
7547
|
+
exports.DataTableEmpty = panel.DataTableEmpty;
|
|
7548
|
+
exports.DataTableFloatingBulkBar = panel.DataTableFloatingBulkBar;
|
|
7549
|
+
exports.DataTableLoading = panel.DataTableLoading;
|
|
7550
|
+
exports.DataTableNoResults = panel.DataTableNoResults;
|
|
7551
|
+
exports.DataTableTotalizerRow = panel.DataTableTotalizerRow;
|
|
7552
|
+
exports.FLOATING_PANEL_SIZE_PX = panel.FLOATING_PANEL_SIZE_PX;
|
|
7553
|
+
exports.FilterPanel = panel.FilterPanel;
|
|
7554
|
+
exports.FilterPopover = panel.FilterPopover;
|
|
7555
|
+
exports.FloatingPanel = panel.FloatingPanel;
|
|
7556
|
+
exports.FloatingPanelField = panel.FloatingPanelField;
|
|
7557
|
+
exports.FloatingPanelSection = panel.FloatingPanelSection;
|
|
7558
|
+
exports.FooterTable = panel.FooterTable;
|
|
7559
|
+
exports.FooterTableSkeleton = panel.FooterTableSkeleton;
|
|
7560
|
+
exports.FormField = panel.FormField;
|
|
7561
|
+
exports.FormFieldCheckbox = panel.FormFieldCheckbox;
|
|
7562
|
+
exports.FormFieldInput = panel.FormFieldInput;
|
|
7563
|
+
exports.FormFieldSelect = panel.FormFieldSelect;
|
|
7564
|
+
exports.FormFieldSwitch = panel.FormFieldSwitch;
|
|
7565
|
+
exports.FormFieldTextarea = panel.FormFieldTextarea;
|
|
7566
|
+
exports.Kanban = panel.Kanban;
|
|
7567
|
+
exports.MoreMenu = panel.MoreMenu;
|
|
7568
|
+
exports.Panel = panel.Panel;
|
|
7569
|
+
exports.PanelBody = panel.PanelBody;
|
|
7570
|
+
exports.PanelCloseAction = panel.SheetClose;
|
|
7571
|
+
exports.PanelContent = panel.SheetContent;
|
|
7572
|
+
exports.PanelFooter = panel.PanelFooter;
|
|
7573
|
+
exports.PanelHeader = panel.PanelHeader;
|
|
7574
|
+
exports.PanelRoot = panel.Sheet;
|
|
7575
|
+
exports.PanelTrigger = panel.SheetTrigger;
|
|
7576
|
+
exports.SELECTION_COLUMN_WIDTH = panel.SELECTION_COLUMN_WIDTH;
|
|
7577
|
+
exports.SortPanel = panel.SortPanel;
|
|
4018
7578
|
exports.SortPopover = panel.SortPopover;
|
|
4019
7579
|
exports.TABLE_HEADER_HEIGHT = panel.TABLE_HEADER_HEIGHT;
|
|
7580
|
+
exports.Table = panel.Table;
|
|
7581
|
+
exports.TableBody = panel.TableBody;
|
|
7582
|
+
exports.TableCardRow = panel.TableCardRow;
|
|
7583
|
+
exports.TableCell = panel.TableCell;
|
|
7584
|
+
exports.TableHead = panel.TableHead;
|
|
7585
|
+
exports.TableHeadCell = panel.TableHeadCell;
|
|
7586
|
+
exports.TableRow = panel.TableRow;
|
|
4020
7587
|
exports.TableToolbar = panel.TableToolbar;
|
|
4021
7588
|
exports.TableToolbarViews = panel.TableToolbarViews;
|
|
4022
7589
|
exports.ToolbarApplied = panel.ToolbarApplied;
|
|
@@ -4036,10 +7603,15 @@ exports.isFilterEntryActive = panel.isFilterEntryActive;
|
|
|
4036
7603
|
exports.panelContainer = panel.panelContainer;
|
|
4037
7604
|
exports.presetView = panel.presetView;
|
|
4038
7605
|
exports.savedViewsMockService = panel.savedViewsMockService;
|
|
7606
|
+
exports.useColumnResize = panel.useColumnResize;
|
|
4039
7607
|
exports.useColumnWidths = panel.useColumnWidths;
|
|
4040
7608
|
exports.useDataTableContext = panel.useDataTableContext;
|
|
4041
7609
|
exports.useFloatingPanelResize = panel.useFloatingPanelResize;
|
|
4042
7610
|
exports.AppShell = appShell.AppShell;
|
|
7611
|
+
exports.Button = appShell.Button;
|
|
7612
|
+
exports.Chip = appShell.Chip;
|
|
7613
|
+
exports.ChipGroup = appShell.ChipGroup;
|
|
7614
|
+
exports.ChipGroupItem = appShell.ChipGroupItem;
|
|
4043
7615
|
exports.Header = appShell.Header;
|
|
4044
7616
|
exports.HeaderBreadcrumb = appShell.HeaderBreadcrumb;
|
|
4045
7617
|
exports.HeaderMessages = appShell.HeaderMessages;
|
|
@@ -4067,49 +7639,66 @@ exports.SidebarRail = appShell.SidebarRail;
|
|
|
4067
7639
|
exports.SidebarSection = appShell.SidebarSection;
|
|
4068
7640
|
exports.SidebarSubgroup = appShell.SidebarSubgroup;
|
|
4069
7641
|
exports.UserMenu = appShell.UserMenu;
|
|
7642
|
+
exports.buttonVariants = appShell.buttonVariants;
|
|
7643
|
+
exports.chipCount = appShell.chipCount;
|
|
7644
|
+
exports.chipVariants = appShell.chipVariants;
|
|
4070
7645
|
exports.inputGroupVariants = appShell.inputGroupVariants;
|
|
4071
7646
|
exports.useControllable = appShell.useControllable;
|
|
4072
7647
|
exports.useMediaQuery = appShell.useMediaQuery;
|
|
4073
|
-
exports
|
|
4074
|
-
|
|
4075
|
-
|
|
4076
|
-
|
|
4077
|
-
exports.buttonVariants = chipGroup.buttonVariants;
|
|
4078
|
-
exports.chipCount = chipGroup.chipCount;
|
|
4079
|
-
exports.chipVariants = chipGroup.chipVariants;
|
|
4080
|
-
exports.Badge = badge.Badge;
|
|
4081
|
-
exports.Table = badge.Table;
|
|
4082
|
-
exports.TableBody = badge.TableBody;
|
|
4083
|
-
exports.TableCardRow = badge.TableCardRow;
|
|
4084
|
-
exports.TableCell = badge.TableCell;
|
|
4085
|
-
exports.TableHead = badge.TableHead;
|
|
4086
|
-
exports.TableHeadCell = badge.TableHeadCell;
|
|
4087
|
-
exports.TableRow = badge.TableRow;
|
|
4088
|
-
exports.badgeVariants = badge.badgeVariants;
|
|
4089
|
-
exports.useColumnResize = badge.useColumnResize;
|
|
4090
|
-
exports.PageHeader = pageHeader.PageHeader;
|
|
4091
|
-
exports.pageHeaderStyles = pageHeader.pageHeaderStyles;
|
|
7648
|
+
Object.defineProperty(exports, "MessageReplyIcon", {
|
|
7649
|
+
enumerable: true,
|
|
7650
|
+
get: () => lucideReact.Reply
|
|
7651
|
+
});
|
|
4092
7652
|
exports.Input = input.Input;
|
|
4093
7653
|
exports.inputVariants = input.inputVariants;
|
|
7654
|
+
exports.Kpi = kpiDelta.Kpi;
|
|
7655
|
+
exports.KpiDelta = kpiDelta.KpiDelta;
|
|
7656
|
+
exports.KpiGroup = kpiDelta.KpiGroup;
|
|
7657
|
+
exports.PageHeader = pageHeader.PageHeader;
|
|
7658
|
+
exports.pageHeaderStyles = pageHeader.pageHeaderStyles;
|
|
7659
|
+
exports.Badge = Badge;
|
|
4094
7660
|
exports.CardCheckbox = CardCheckbox;
|
|
7661
|
+
exports.ChoroplethMap = ChoroplethMap;
|
|
7662
|
+
exports.ColorPicker = ColorPicker;
|
|
7663
|
+
exports.ConversationListItem = ConversationListItem;
|
|
7664
|
+
exports.DEFAULT_COLOR_PRESETS = DEFAULT_COLOR_PRESETS;
|
|
7665
|
+
exports.DEFAULT_MESSAGE_VARIABLES = DEFAULT_MESSAGE_VARIABLES;
|
|
7666
|
+
exports.DatePicker = DatePicker;
|
|
7667
|
+
exports.DateSeparatorChip = DateSeparatorChip;
|
|
7668
|
+
exports.EmptyState = EmptyState;
|
|
7669
|
+
exports.FileUploadField = FileUploadField;
|
|
4095
7670
|
exports.Icon = Icon;
|
|
4096
|
-
exports.
|
|
4097
|
-
exports.
|
|
4098
|
-
exports.
|
|
7671
|
+
exports.MarkdownText = MarkdownText;
|
|
7672
|
+
exports.MessageAck = MessageAck;
|
|
7673
|
+
exports.MessageBubble = MessageBubble;
|
|
7674
|
+
exports.MessageComposer = MessageComposer;
|
|
7675
|
+
exports.MessageVariablesPicker = MessageVariablesPicker;
|
|
4099
7676
|
exports.Modal = Modal;
|
|
7677
|
+
exports.MonthYearPicker = MonthYearPicker;
|
|
4100
7678
|
exports.SingleMenuSidebar = SingleMenuSidebar;
|
|
7679
|
+
exports.Spinner = Spinner;
|
|
4101
7680
|
exports.ToolbarFilterControl = ToolbarFilterControl;
|
|
4102
7681
|
exports.ToolbarMobileDialog = ToolbarMobileDialog;
|
|
4103
7682
|
exports.ToolbarMobileSection = ToolbarMobileSection;
|
|
4104
7683
|
exports.ToolbarMobileSheet = ToolbarMobileSheet;
|
|
4105
7684
|
exports.actionColumn = actionColumn;
|
|
7685
|
+
exports.badgeVariants = badgeVariants;
|
|
4106
7686
|
exports.cardCheckbox = cardCheckbox;
|
|
7687
|
+
exports.colorPickerStyles = colorPickerStyles;
|
|
7688
|
+
exports.conversationListItemStyles = conversationListItemStyles;
|
|
4107
7689
|
exports.currencyColumn = currencyColumn;
|
|
4108
7690
|
exports.customColumn = customColumn;
|
|
4109
7691
|
exports.dateColumn = dateColumn;
|
|
7692
|
+
exports.dateSeparatorChipStyles = dateSeparatorChipStyles;
|
|
4110
7693
|
exports.emailColumn = emailColumn;
|
|
7694
|
+
exports.emptyStateStyles = emptyStateStyles;
|
|
4111
7695
|
exports.iconStyles = iconStyles;
|
|
4112
7696
|
exports.icons = icons;
|
|
7697
|
+
exports.markdownTextStyles = markdownTextStyles;
|
|
7698
|
+
exports.messageAckStyles = messageAckStyles;
|
|
7699
|
+
exports.messageBubbleStyles = messageBubbleStyles;
|
|
7700
|
+
exports.messageComposerStyles = messageComposerStyles;
|
|
7701
|
+
exports.messageVariablesPickerStyles = messageVariablesPickerStyles;
|
|
4113
7702
|
exports.numberColumn = numberColumn;
|
|
4114
7703
|
exports.phoneColumn = phoneColumn;
|
|
4115
7704
|
exports.statusColumn = statusColumn;
|