@elevasis/ui 2.31.0 → 2.33.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{CoreAuthKitInner-KSEGSB67.js → CoreAuthKitInner-QC62UHTZ.js} +1 -1
- package/dist/api/index.js +3 -3
- package/dist/app/index.css +38 -0
- package/dist/app/index.d.ts +69 -9
- package/dist/app/index.js +7 -6
- package/dist/auth/context.js +1 -1
- package/dist/auth/index.js +1 -1
- package/dist/charts/index.js +5 -6
- package/dist/{chunk-JKSUN5GN.js → chunk-2GMF5IRF.js} +81 -746
- package/dist/{chunk-XQHZBA65.js → chunk-2RJMVWFJ.js} +1 -6
- package/dist/{chunk-CW3UNAF2.js → chunk-4DYOXEH6.js} +410 -5
- package/dist/{chunk-HQGF4ATG.js → chunk-52NLZN6Z.js} +118 -141
- package/dist/chunk-AHCKOU2M.js +13 -0
- package/dist/chunk-CLDCYJQT.js +1 -0
- package/dist/chunk-DWXDNT7P.js +145 -0
- package/dist/chunk-E4T2N7P7.js +124 -0
- package/dist/{chunk-HYNYEBHM.js → chunk-E7C4XEWH.js} +3 -3
- package/dist/{chunk-L3BVJWML.js → chunk-EPTHX4VZ.js} +1 -1
- package/dist/{chunk-QDEETKYT.js → chunk-FFPHJBJC.js} +9 -9
- package/dist/chunk-GNRMB6DC.js +5126 -0
- package/dist/{chunk-DZTG5IAC.js → chunk-I2KLQ2HA.js} +1 -7
- package/dist/{chunk-Q6OYNEGR.js → chunk-IUKFNASA.js} +5 -6
- package/dist/{chunk-QHEWXU7I.js → chunk-JFL3GRD4.js} +1 -1
- package/dist/{chunk-T3IPHEYJ.js → chunk-JHT5JIJ3.js} +4410 -566
- package/dist/{chunk-L2NVFLXU.js → chunk-MHLZ4F4N.js} +4 -4
- package/dist/{chunk-XQQEKWTL.js → chunk-N55DVMAG.js} +6 -2
- package/dist/{chunk-TOIXUWR6.js → chunk-ND5TDV2J.js} +1 -1
- package/dist/{chunk-5LJAEZMA.js → chunk-NOIRGGW2.js} +5 -6
- package/dist/{chunk-7KC4P3AU.js → chunk-QNOVUCSV.js} +2 -12
- package/dist/{chunk-3BAPR3KA.js → chunk-RQA2EVN3.js} +5 -15
- package/dist/{chunk-ND42LPY4.js → chunk-TKF5S4XP.js} +6 -6
- package/dist/{chunk-DWK2QIAK.js → chunk-TYRUKGGD.js} +1 -1
- package/dist/{chunk-Y4FWCG7Y.js → chunk-UVFOURXR.js} +8 -7
- package/dist/chunk-UW7IV2Y3.js +447 -0
- package/dist/{chunk-P55BJZZW.js → chunk-V6SZ4ECN.js} +20 -5
- package/dist/{chunk-6YT4IKJ7.js → chunk-VNAZTCHA.js} +15 -0
- package/dist/chunk-XG57WXOL.js +85 -0
- package/dist/{chunk-SHQXMW4F.js → chunk-XOFSMJLF.js} +46 -28
- package/dist/{chunk-7HMCB26R.js → chunk-XZGSCABI.js} +1 -1
- package/dist/chunk-YAQ25UNM.js +2126 -0
- package/dist/chunk-ZGTDKH3P.js +467 -0
- package/dist/components/chat/index.js +1 -1
- package/dist/components/index.css +38 -0
- package/dist/components/index.d.ts +262 -51
- package/dist/components/index.js +37 -39
- package/dist/components/navigation/index.css +38 -0
- package/dist/components/navigation/index.js +5 -3
- package/dist/execution/index.d.ts +11 -2
- package/dist/execution/index.js +1 -1
- package/dist/features/auth/index.css +38 -0
- package/dist/features/auth/index.d.ts +91 -14
- package/dist/features/auth/index.js +42 -10
- package/dist/features/clients/index.css +38 -0
- package/dist/features/clients/index.d.ts +1 -1
- package/dist/features/clients/index.js +17 -15
- package/dist/features/crm/index.css +38 -0
- package/dist/features/crm/index.d.ts +80 -18
- package/dist/features/crm/index.js +17 -15
- package/dist/features/dashboard/index.css +38 -0
- package/dist/features/dashboard/index.d.ts +174 -25
- package/dist/features/dashboard/index.js +17 -16
- package/dist/features/delivery/index.css +38 -0
- package/dist/features/delivery/index.d.ts +80 -18
- package/dist/features/delivery/index.js +16 -15
- package/dist/features/knowledge/index.css +38 -0
- package/dist/features/knowledge/index.d.ts +20 -18
- package/dist/features/knowledge/index.js +114 -609
- package/dist/features/lead-gen/index.css +38 -0
- package/dist/features/lead-gen/index.d.ts +45 -43
- package/dist/features/lead-gen/index.js +17 -16
- package/dist/features/monitoring/index.css +38 -0
- package/dist/features/monitoring/index.d.ts +20 -18
- package/dist/features/monitoring/index.js +18 -17
- package/dist/features/monitoring/requests/index.css +38 -0
- package/dist/features/monitoring/requests/index.d.ts +23 -21
- package/dist/features/monitoring/requests/index.js +16 -14
- package/dist/features/operations/index.css +38 -0
- package/dist/features/operations/index.d.ts +1299 -66
- package/dist/features/operations/index.js +22 -24
- package/dist/features/seo/index.d.ts +20 -18
- package/dist/features/seo/index.js +2 -2
- package/dist/features/settings/index.css +38 -0
- package/dist/features/settings/index.d.ts +80 -18
- package/dist/features/settings/index.js +17 -15
- package/dist/graph/index.js +1 -1
- package/dist/hooks/delivery/index.css +38 -0
- package/dist/hooks/delivery/index.d.ts +60 -0
- package/dist/hooks/delivery/index.js +3 -3
- package/dist/hooks/index.css +38 -0
- package/dist/hooks/index.d.ts +492 -89
- package/dist/hooks/index.js +15 -13
- package/dist/hooks/operations/command-view/utils/transformCommandViewData.d.ts +332 -33
- package/dist/hooks/operations/command-view/utils/transformCommandViewData.js +1 -1
- package/dist/hooks/published.css +38 -0
- package/dist/hooks/published.d.ts +492 -89
- package/dist/hooks/published.js +15 -13
- package/dist/index.css +38 -0
- package/dist/index.d.ts +1353 -1349
- package/dist/index.js +16 -14
- package/dist/initialization/index.d.ts +60 -0
- package/dist/initialization/index.js +1 -1
- package/dist/knowledge/index.d.ts +1217 -1292
- package/dist/knowledge/index.js +6538 -2198
- package/dist/knowledge-search-index-P7PR626V.js +1514 -0
- package/dist/layout/index.js +3 -4
- package/dist/organization/index.css +38 -0
- package/dist/organization/index.js +1 -1
- package/dist/profile/index.d.ts +60 -0
- package/dist/profile/index.js +1 -1
- package/dist/provider/ElevasisServiceContext.js +1 -1
- package/dist/provider/index.css +38 -0
- package/dist/provider/index.d.ts +1068 -1246
- package/dist/provider/index.js +12 -10
- package/dist/provider/published.css +38 -0
- package/dist/provider/published.d.ts +1065 -1243
- package/dist/provider/published.js +9 -7
- package/dist/router/context.js +1 -1
- package/dist/router/index.js +1 -1
- package/dist/sse/index.js +1 -1
- package/dist/supabase/index.d.ts +117 -0
- package/dist/supabase/index.js +1 -1
- package/dist/test-utils/index.d.ts +16 -9
- package/dist/test-utils/index.js +40 -33
- package/dist/test-utils/setup-integration.js +1 -1
- package/dist/test-utils/setup.js +1 -1
- package/dist/theme/index.js +3 -3
- package/dist/theme/presets/index.js +1 -1
- package/dist/typeform/index.js +1 -1
- package/dist/typeform/schemas.js +1 -1
- package/dist/types/index.d.ts +394 -35
- package/dist/utils/index.d.ts +174 -25
- package/dist/utils/index.js +2 -2
- package/dist/vite/index.js +1 -1
- package/dist/vite-plugin-knowledge/index.js +1 -1
- package/dist/zustand/index.js +1 -1
- package/package.json +10 -9
- package/src/README.md +29 -29
- package/src/api/README.md +18 -18
- package/src/app/README.md +24 -24
- package/src/auth/README.md +18 -18
- package/src/components/README.md +24 -24
- package/src/execution/README.md +16 -16
- package/src/features/README.md +28 -28
- package/src/graph/README.md +16 -16
- package/src/hooks/README.md +23 -23
- package/src/initialization/README.md +19 -19
- package/src/knowledge/README.md +31 -31
- package/src/organization/README.md +18 -18
- package/src/profile/README.md +19 -19
- package/src/provider/README.md +32 -32
- package/src/router/README.md +18 -18
- package/src/sse/README.md +13 -13
- package/src/test-utils/README.md +7 -7
- package/src/theme/README.md +23 -23
- package/src/theme/presets/README.md +19 -19
- package/src/types/README.md +16 -16
- package/src/utils/README.md +18 -18
- package/src/zustand/README.md +18 -18
- package/dist/chunk-542WPQU2.js +0 -413
- package/dist/chunk-6IXOKUBC.js +0 -347
- package/dist/chunk-CQZ3DNQY.js +0 -740
- package/dist/chunk-ECNNI3NT.js +0 -6
- package/dist/chunk-GRDLB6LM.js +0 -160
- package/dist/chunk-JDNEWB5F.js +0 -10
- package/dist/chunk-MVFCLZSK.js +0 -4337
- package/dist/chunk-O2QOPJI5.js +0 -2235
- package/dist/chunk-OAVTMITG.js +0 -13
- package/dist/chunk-TVRQ6AQI.js +0 -476
- package/dist/chunk-WF227UBV.js +0 -48
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { useCyberColors, CyberLegendItem, CyberAreaChart } from './chunk-
|
|
2
|
-
import { useResourcesHealth } from './chunk-
|
|
3
|
-
import { CardHeader, EmptyState } from './chunk-
|
|
4
|
-
import { getTimeRangeDates, formatBucketTime } from './chunk-
|
|
1
|
+
import { useCyberColors, CyberLegendItem, CyberAreaChart } from './chunk-4DYOXEH6.js';
|
|
2
|
+
import { useResourcesHealth } from './chunk-2GMF5IRF.js';
|
|
3
|
+
import { CardHeader, EmptyState } from './chunk-EPTHX4VZ.js';
|
|
4
|
+
import { getTimeRangeDates, formatBucketTime } from './chunk-2RJMVWFJ.js';
|
|
5
5
|
import { Paper, Center, Loader, Group } from '@mantine/core';
|
|
6
6
|
import { IconActivity, IconChartBar } from '@tabler/icons-react';
|
|
7
7
|
import { useMemo } from 'react';
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
import { useAppearance } from './chunk-E565XMTQ.js';
|
|
2
|
-
import {
|
|
2
|
+
import { Center, Box } from '@mantine/core';
|
|
3
3
|
import { jsx } from 'react/jsx-runtime';
|
|
4
4
|
|
|
5
|
+
function SubshellLoader() {
|
|
6
|
+
const { loader } = useAppearance();
|
|
7
|
+
return /* @__PURE__ */ jsx(Center, { mih: "calc(100vh - 70px)", children: loader });
|
|
8
|
+
}
|
|
5
9
|
function SubshellSidebarLoader({ padding = "sm" }) {
|
|
6
10
|
const { loader } = useAppearance();
|
|
7
11
|
return /* @__PURE__ */ jsx(Box, { style: { flex: 1, minHeight: 0, display: "flex" }, children: /* @__PURE__ */ jsx(Center, { p: padding, style: { flex: 1, minHeight: 0 }, children: loader }) });
|
|
8
12
|
}
|
|
9
13
|
|
|
10
|
-
export { SubshellSidebarLoader };
|
|
14
|
+
export { SubshellLoader, SubshellSidebarLoader };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { APIClientError } from './chunk-
|
|
1
|
+
import { APIClientError } from './chunk-2RJMVWFJ.js';
|
|
2
2
|
import { OrganizationContext } from './chunk-DD3CCMCZ.js';
|
|
3
3
|
import { createContext, useContext, useMemo, useCallback } from 'react';
|
|
4
4
|
import { jsx } from 'react/jsx-runtime';
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import { CostTrendChart, ActivityTrendChart } from './chunk-
|
|
2
|
-
import { CyberAreaChart } from './chunk-CW3UNAF2.js';
|
|
1
|
+
import { CyberAreaChart, CostTrendChart, ActivityTrendChart } from './chunk-4DYOXEH6.js';
|
|
3
2
|
import { AppShellLoader } from './chunk-RYTEQBAO.js';
|
|
4
3
|
import { FilterBar } from './chunk-PDHTXPSF.js';
|
|
5
4
|
import { CustomModal } from './chunk-R66W5UDG.js';
|
|
6
5
|
import { formatDuration } from './chunk-E4WQGJNS.js';
|
|
7
|
-
import { useResolveError, useResolveAllErrors, usePaginationState, useErrorDetails, useMarkAsRead, useExecutionLogsFilters, useExecutionLogs, useExecutionHealth, useErrorAnalysis, useTimeRangeDates, useErrorDetail, useResolveErrorsByExecution, useResources, useCostTrends, useCostSummary, useCostByModel, useCostBreakdown, useActivityFilters, useActivityTrend, useActivities, useNotifications, useMarkAllAsRead } from './chunk-
|
|
8
|
-
import { CenteredErrorState, CardHeader, StatsCardSkeleton, TrendIndicator, DetailCardSkeleton, EmptyState, PageTitleCaption, JsonViewer } from './chunk-
|
|
6
|
+
import { useResolveError, useResolveAllErrors, usePaginationState, useErrorDetails, useMarkAsRead, useExecutionLogsFilters, useExecutionLogs, useExecutionHealth, useErrorAnalysis, useTimeRangeDates, useErrorDetail, useResolveErrorsByExecution, useResources, useCostTrends, useCostSummary, useCostByModel, useCostBreakdown, useActivityFilters, useActivityTrend, useActivities, useNotifications, useMarkAllAsRead } from './chunk-2GMF5IRF.js';
|
|
7
|
+
import { CenteredErrorState, CardHeader, StatsCardSkeleton, TrendIndicator, DetailCardSkeleton, EmptyState, PageTitleCaption, JsonViewer } from './chunk-EPTHX4VZ.js';
|
|
9
8
|
import { useRouterContext } from './chunk-Q7DJKLEN.js';
|
|
10
|
-
import { formatBucketTime, PAGE_SIZE_DEFAULT, getTimeRangeDates } from './chunk-
|
|
9
|
+
import { formatBucketTime, PAGE_SIZE_DEFAULT, getTimeRangeDates } from './chunk-2RJMVWFJ.js';
|
|
11
10
|
import { useState, useMemo, useCallback } from 'react';
|
|
12
11
|
import { Table, Text, Badge, Tooltip, Card, Group, Select, SegmentedControl, Button, TextInput, Stack, Paper, Center, Loader, ActionIcon, NumberFormatter, Box, Alert, Switch, Pagination, UnstyledButton, Title, Divider, Code, CopyButton, Accordion } from '@mantine/core';
|
|
13
12
|
import { IconActivity, IconFilterOff, IconCircleCheck, IconThumbDown, IconThumbUp, IconClock, IconCircleX, IconSearch, IconArrowUpRight, IconAlertTriangle, IconAlertCircle, IconExternalLink, IconChartPie, IconHeartbeat, IconDownload, IconCpu, IconTrendingUp, IconChartBar, IconCash, IconInfoCircle, IconExclamationCircle, IconBug, IconChecks, IconCircle, IconCircleFilled, IconCheck, IconCopy, IconCircleDashed, IconArrowUp, IconArrowDown, IconFileOff, IconRobot, IconKey, IconUser } from '@tabler/icons-react';
|
|
@@ -1772,7 +1771,7 @@ function NotificationCenter({ pageSize = 20 }) {
|
|
|
1772
1771
|
}
|
|
1773
1772
|
var monitoringManifest = {
|
|
1774
1773
|
key: "monitoring",
|
|
1775
|
-
|
|
1774
|
+
routePrefixes: ["/monitoring"],
|
|
1776
1775
|
icon: IconActivity
|
|
1777
1776
|
};
|
|
1778
1777
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { SubshellNavItem } from './chunk-X4WBGKJQ.js';
|
|
2
2
|
import { SubshellSidebarSection } from './chunk-IIMU5YAJ.js';
|
|
3
|
-
import { useDealsLookup, useCreateDealTask, useDealTasksDue } from './chunk-
|
|
3
|
+
import { useDealsLookup, useCreateDealTask, useDealTasksDue } from './chunk-2GMF5IRF.js';
|
|
4
4
|
import { useRouterContext } from './chunk-Q7DJKLEN.js';
|
|
5
5
|
import { Box, Stack, Text, UnstyledButton, Group, Button, Modal, Title, Select, TextInput, Textarea, Badge, Center, Loader } from '@mantine/core';
|
|
6
6
|
import { IconLayoutGrid, IconColumns, IconFileInvoice, IconList, IconBuilding, IconAddressBook, IconTrophy, IconClockExclamation, IconUser, IconPlus, IconChecklist, IconTarget, IconCheckbox, IconCalendar, IconMail, IconPhone } from '@tabler/icons-react';
|
|
@@ -265,17 +265,7 @@ var SalesSidebar = () => {
|
|
|
265
265
|
/* @__PURE__ */ jsx(SubshellSidebarSection, { icon: IconTarget, label: "Lead Gen" }),
|
|
266
266
|
/* @__PURE__ */ jsx(Stack, { gap: 0, p: "sm", children: renderItems(LEAD_GEN_ITEMS, currentPath, navigate) }),
|
|
267
267
|
/* @__PURE__ */ jsx(SubshellSidebarSection, { icon: IconAddressBook, label: "CRM", withTopBorder: true }),
|
|
268
|
-
/* @__PURE__ */ jsx(Stack, { gap: 0, p: "sm", children: renderItems(CRM_ITEMS, currentPath, navigate) })
|
|
269
|
-
/* @__PURE__ */ jsx(SubshellSidebarSection, { icon: IconChecklist, label: "My Tasks", withTopBorder: true }),
|
|
270
|
-
/* @__PURE__ */ jsx(Stack, { gap: 0, p: "sm", children: /* @__PURE__ */ jsx(
|
|
271
|
-
MyTasksPanel,
|
|
272
|
-
{
|
|
273
|
-
onTaskClick: (dealId) => navigate(`/crm/deals/${dealId}`),
|
|
274
|
-
onSeeAll: () => navigate("/crm/deals"),
|
|
275
|
-
showSectionLabel: false,
|
|
276
|
-
footer: /* @__PURE__ */ jsx(QuickCreateActions, { showSectionLabel: false })
|
|
277
|
-
}
|
|
278
|
-
) })
|
|
268
|
+
/* @__PURE__ */ jsx(Stack, { gap: 0, p: "sm", children: renderItems(CRM_ITEMS, currentPath, navigate) })
|
|
279
269
|
] }) });
|
|
280
270
|
};
|
|
281
271
|
var KIND_ICONS = {
|
|
@@ -367,6 +367,9 @@ var componentThemes = {
|
|
|
367
367
|
}
|
|
368
368
|
}
|
|
369
369
|
}),
|
|
370
|
+
// Tree pseudo-class/attribute state selectors (&:focus-visible, &[data-hovered],
|
|
371
|
+
// &[data-selected]) are in custom.css -- Mantine's styles object applies these
|
|
372
|
+
// as inline styles and React rejects selector keys.
|
|
370
373
|
Tree: Tree.extend({
|
|
371
374
|
defaultProps: {
|
|
372
375
|
levelOffset: DEFAULT_SIZE
|
|
@@ -380,11 +383,7 @@ var componentThemes = {
|
|
|
380
383
|
},
|
|
381
384
|
node: {
|
|
382
385
|
listStyle: "none",
|
|
383
|
-
outline: "none"
|
|
384
|
-
"&:focus-visible > [data-value]": {
|
|
385
|
-
outline: "2px solid color-mix(in srgb, var(--color-primary) 55%, transparent)",
|
|
386
|
-
outlineOffset: "2px"
|
|
387
|
-
}
|
|
386
|
+
outline: "none"
|
|
388
387
|
},
|
|
389
388
|
subtree: {
|
|
390
389
|
listStyle: "none",
|
|
@@ -402,16 +401,7 @@ var componentThemes = {
|
|
|
402
401
|
border: "1px solid transparent",
|
|
403
402
|
borderRadius: "var(--mantine-radius-sm)",
|
|
404
403
|
color: "var(--color-text)",
|
|
405
|
-
transition: `background-color var(--duration-fast) var(--easing), border-color var(--duration-fast) var(--easing), color var(--duration-fast) var(--easing)
|
|
406
|
-
"&[data-hovered]": {
|
|
407
|
-
backgroundColor: "var(--color-surface-hover)",
|
|
408
|
-
borderColor: "var(--color-border)"
|
|
409
|
-
},
|
|
410
|
-
"&[data-selected]": {
|
|
411
|
-
backgroundColor: "color-mix(in srgb, var(--color-primary) 12%, transparent)",
|
|
412
|
-
borderColor: "color-mix(in srgb, var(--color-primary) 38%, var(--color-border))",
|
|
413
|
-
color: "var(--color-primary)"
|
|
414
|
-
}
|
|
404
|
+
transition: `background-color var(--duration-fast) var(--easing), border-color var(--duration-fast) var(--easing), color var(--duration-fast) var(--easing)`
|
|
415
405
|
}
|
|
416
406
|
}
|
|
417
407
|
}),
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { AppShellLoader } from './chunk-RYTEQBAO.js';
|
|
2
2
|
import { FilterBar } from './chunk-PDHTXPSF.js';
|
|
3
3
|
import { CustomModal } from './chunk-R66W5UDG.js';
|
|
4
|
-
import { useAvailablePresets } from './chunk-
|
|
5
|
-
import { useDeleteCredential, useCreateCredential, useCredentials, MEMBERSHIP_STATUS_COLORS, transformMembershipToTableRow, useUserMemberships, useUpdateWebhookEndpoint, useResources, useDeleteWebhookEndpoint, useCreateWebhookEndpoint, useListWebhookEndpoints, useOrgRoles, useAssignRole, useRevokeRole, useHasPermission, useUpdateMemberConfig, useOrganizationMembers, useUpdateCredential, CredentialSchemas } from './chunk-
|
|
6
|
-
import { showApiErrorNotification, showErrorNotification, showSuccessNotification } from './chunk-
|
|
7
|
-
import { ListSkeleton, EmptyState, PageTitleCaption, CardHeader, APIErrorAlert, StatCard } from './chunk-
|
|
4
|
+
import { useAvailablePresets } from './chunk-JFL3GRD4.js';
|
|
5
|
+
import { useDeleteCredential, useCreateCredential, useCredentials, MEMBERSHIP_STATUS_COLORS, transformMembershipToTableRow, useUserMemberships, useUpdateWebhookEndpoint, useResources, useDeleteWebhookEndpoint, useCreateWebhookEndpoint, useListWebhookEndpoints, useOrgRoles, useAssignRole, useRevokeRole, useHasPermission, useUpdateMemberConfig, useOrganizationMembers, useUpdateCredential, CredentialSchemas } from './chunk-2GMF5IRF.js';
|
|
6
|
+
import { showApiErrorNotification, showErrorNotification, showSuccessNotification } from './chunk-XZGSCABI.js';
|
|
7
|
+
import { ListSkeleton, EmptyState, PageTitleCaption, CardHeader, APIErrorAlert, StatCard } from './chunk-EPTHX4VZ.js';
|
|
8
8
|
import { RoleBadge } from './chunk-JA5ECJJB.js';
|
|
9
|
-
import { isAPIClientError, formatDateTime, OAUTH_FLOW_TIMEOUT } from './chunk-
|
|
9
|
+
import { isAPIClientError, formatDateTime, OAUTH_FLOW_TIMEOUT } from './chunk-2RJMVWFJ.js';
|
|
10
10
|
import { useInitialization } from './chunk-533DUEQY.js';
|
|
11
11
|
import { useOrganization } from './chunk-DD3CCMCZ.js';
|
|
12
12
|
import { useElevasisServices } from './chunk-KJ3QUBNU.js';
|
|
@@ -2274,7 +2274,7 @@ function OAuthIntegrationsCard({ apiUrl }) {
|
|
|
2274
2274
|
}
|
|
2275
2275
|
var settingsManifest = {
|
|
2276
2276
|
key: "settings",
|
|
2277
|
-
|
|
2277
|
+
routePrefixes: ["/settings"],
|
|
2278
2278
|
icon: IconSettings
|
|
2279
2279
|
};
|
|
2280
2280
|
|
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
import { SalesSidebar, CrmSidebarMiddle } from './chunk-
|
|
1
|
+
import { SalesSidebar, CrmSidebarMiddle } from './chunk-QNOVUCSV.js';
|
|
2
2
|
import { SubshellSidebarSection } from './chunk-IIMU5YAJ.js';
|
|
3
3
|
import { PageContainer } from './chunk-BZZCNLT6.js';
|
|
4
4
|
import { TableSelectionToolbar, SortableHeader } from './chunk-TUMSNGTX.js';
|
|
5
5
|
import { FilterBar } from './chunk-PDHTXPSF.js';
|
|
6
6
|
import { CustomModal } from './chunk-R66W5UDG.js';
|
|
7
|
-
import { useDealsSummary, useDeleteDeal, usePaginationState, useDeals, useTableSort, sortData, useTableSelection, useDealDetail, useCompany, dealKeys, useContact, useExecuteAction } from './chunk-
|
|
8
|
-
import { showApiErrorNotification, showSuccessNotification } from './chunk-
|
|
9
|
-
import { CenteredErrorState, CardHeader, StatCard, PageTitleCaption, EmptyState, ActivityTimeline } from './chunk-
|
|
10
|
-
import {
|
|
7
|
+
import { useDealsSummary, useDeleteDeal, usePaginationState, useDeals, useTableSort, sortData, useTableSelection, useDealDetail, useCompany, dealKeys, useContact, useExecuteAction } from './chunk-2GMF5IRF.js';
|
|
8
|
+
import { showApiErrorNotification, showSuccessNotification } from './chunk-XZGSCABI.js';
|
|
9
|
+
import { CenteredErrorState, CardHeader, StatCard, PageTitleCaption, EmptyState, ActivityTimeline } from './chunk-EPTHX4VZ.js';
|
|
10
|
+
import { useCrmActions, deriveActions } from './chunk-UW7IV2Y3.js';
|
|
11
11
|
import { SubshellContentContainer } from './chunk-TKAYX2SP.js';
|
|
12
|
-
import {
|
|
12
|
+
import { CRM_PIPELINE_DEFINITION, DEFAULT_CRM_PRIORITY_RULE_CONFIG, CRM_PRIORITY_BUCKETS } from './chunk-GNRMB6DC.js';
|
|
13
|
+
import { PAGE_SIZE_DEFAULT, formatTimeAgo } from './chunk-2RJMVWFJ.js';
|
|
13
14
|
import { useElevasisServices } from './chunk-KJ3QUBNU.js';
|
|
14
15
|
import { Stack, Paper, Center, Loader, Group, Box, Text, Alert, Table, SimpleGrid, Button, Select, TextInput, Tabs, Checkbox, Badge, Tooltip, Pagination, Title, Code, Card, Switch, NumberInput, ColorSwatch, Popover, ActionIcon, Anchor, CopyButton, Divider, Textarea } from '@mantine/core';
|
|
15
16
|
import { IconAddressBook, IconColumns, IconHistory, IconAlertCircle, IconCurrencyDollar, IconChartBar, IconBriefcase, IconTrophy, IconSearch, IconTargetArrow, IconAlertTriangle, IconMessages, IconArrowLeft, IconFileText, IconInbox, IconUser, IconBolt, IconBuilding, IconSettings, IconRestore, IconInfoCircle, IconMailForward, IconPlus, IconArrowRight, IconNote, IconCheck, IconCopy } from '@tabler/icons-react';
|
|
@@ -400,7 +401,7 @@ function CrmOverview({
|
|
|
400
401
|
}
|
|
401
402
|
var crmManifest = {
|
|
402
403
|
key: "crm",
|
|
403
|
-
|
|
404
|
+
systemId: "sales.crm",
|
|
404
405
|
capabilityIds: ["crm.pipeline.manage"],
|
|
405
406
|
icon: IconAddressBook,
|
|
406
407
|
sidebar: SalesSidebar
|
|
@@ -0,0 +1,447 @@
|
|
|
1
|
+
import { formatOntologyId, DEFAULT_ORGANIZATION_MODEL, CRM_DISCOVERY_NUDGING_STATE, compileOrganizationOntology, CRM_DISCOVERY_REPLIED_STATE, CRM_DISCOVERY_LINK_SENT_STATE, CRM_DISCOVERY_BOOKING_CANCELLED_STATE, CRM_PIPELINE_DEFINITION, LEAD_GEN_STAGE_CATALOG } from './chunk-GNRMB6DC.js';
|
|
2
|
+
import { ApiClientProvider, useApiClient } from './chunk-ND5TDV2J.js';
|
|
3
|
+
import { OrganizationProvider } from './chunk-HUJCU55S.js';
|
|
4
|
+
import { getErrorInfo, getErrorTitle, formatErrorMessage } from './chunk-2RJMVWFJ.js';
|
|
5
|
+
import { InitializationProvider } from './chunk-533DUEQY.js';
|
|
6
|
+
import { useOrganization } from './chunk-DD3CCMCZ.js';
|
|
7
|
+
import { ProfileProvider } from './chunk-2Q2JQSQO.js';
|
|
8
|
+
import { ElevasisServiceProvider } from './chunk-KJ3QUBNU.js';
|
|
9
|
+
import { useAuthContext } from './chunk-BRJ3QZ4E.js';
|
|
10
|
+
import { createContext, lazy, useContext, Suspense, useRef } from 'react';
|
|
11
|
+
import { jsx } from 'react/jsx-runtime';
|
|
12
|
+
import { z } from 'zod';
|
|
13
|
+
import { QueryClientProvider, QueryClient } from '@tanstack/react-query';
|
|
14
|
+
|
|
15
|
+
var consoleAdapter = {
|
|
16
|
+
success(title, message) {
|
|
17
|
+
console.log(`[Notification][Success] ${title}: ${message}`);
|
|
18
|
+
},
|
|
19
|
+
error(title, message) {
|
|
20
|
+
console.warn(`[Notification][Error] ${title}: ${message}`);
|
|
21
|
+
},
|
|
22
|
+
info(title, message) {
|
|
23
|
+
console.log(`[Notification][Info] ${title}: ${message}`);
|
|
24
|
+
},
|
|
25
|
+
warning(title, message) {
|
|
26
|
+
console.warn(`[Notification][Warning] ${title}: ${message}`);
|
|
27
|
+
},
|
|
28
|
+
apiError(error) {
|
|
29
|
+
const { message, code, requestId, fields, retryAfter } = getErrorInfo(error);
|
|
30
|
+
const title = getErrorTitle(code);
|
|
31
|
+
const formatted = formatErrorMessage(message, requestId, fields, retryAfter);
|
|
32
|
+
console.warn(`[Notification][API Error] ${title}: ${formatted}`);
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
var NotificationContext = createContext(consoleAdapter);
|
|
36
|
+
function NotificationProvider({ adapter, children }) {
|
|
37
|
+
return /* @__PURE__ */ jsx(NotificationContext.Provider, { value: adapter, children });
|
|
38
|
+
}
|
|
39
|
+
function useNotificationAdapter() {
|
|
40
|
+
return useContext(NotificationContext);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
// ../core/src/business/acquisition/ontology-validation.ts
|
|
44
|
+
var CRM_PIPELINE_CATALOG_ONTOLOGY_ID = formatOntologyId({
|
|
45
|
+
scope: "sales.crm",
|
|
46
|
+
kind: "catalog",
|
|
47
|
+
localId: "crm.pipeline"
|
|
48
|
+
});
|
|
49
|
+
var LEAD_GEN_STAGE_CATALOG_ONTOLOGY_ID = formatOntologyId({
|
|
50
|
+
scope: "sales.lead-gen",
|
|
51
|
+
kind: "catalog",
|
|
52
|
+
localId: "lead-gen.stage-catalog"
|
|
53
|
+
});
|
|
54
|
+
var CRM_DEAL_OBJECT_ONTOLOGY_ID = formatOntologyId({
|
|
55
|
+
scope: "sales.crm",
|
|
56
|
+
kind: "object",
|
|
57
|
+
localId: "crm.deal"
|
|
58
|
+
});
|
|
59
|
+
function createCrmPipelineCatalog() {
|
|
60
|
+
return {
|
|
61
|
+
id: CRM_PIPELINE_CATALOG_ONTOLOGY_ID,
|
|
62
|
+
label: CRM_PIPELINE_DEFINITION.label,
|
|
63
|
+
ownerSystemId: "sales.crm",
|
|
64
|
+
kind: "pipeline",
|
|
65
|
+
appliesTo: CRM_DEAL_OBJECT_ONTOLOGY_ID,
|
|
66
|
+
entries: Object.fromEntries(
|
|
67
|
+
CRM_PIPELINE_DEFINITION.stages.map((stage, index) => [
|
|
68
|
+
stage.stageKey,
|
|
69
|
+
{
|
|
70
|
+
key: stage.stageKey,
|
|
71
|
+
label: stage.label,
|
|
72
|
+
order: (index + 1) * 10,
|
|
73
|
+
...stage.color !== void 0 ? { color: stage.color } : {},
|
|
74
|
+
states: stage.states.map((state) => ({ ...state }))
|
|
75
|
+
}
|
|
76
|
+
])
|
|
77
|
+
),
|
|
78
|
+
legacyPipelineKey: CRM_PIPELINE_DEFINITION.pipelineKey,
|
|
79
|
+
legacyEntityKey: CRM_PIPELINE_DEFINITION.entityKey
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
function createLeadGenStageCatalog() {
|
|
83
|
+
return {
|
|
84
|
+
id: LEAD_GEN_STAGE_CATALOG_ONTOLOGY_ID,
|
|
85
|
+
label: "Lead Gen Processing Stages",
|
|
86
|
+
ownerSystemId: "sales.lead-gen",
|
|
87
|
+
kind: "processing-stage-catalog",
|
|
88
|
+
entries: Object.fromEntries(
|
|
89
|
+
Object.entries(LEAD_GEN_STAGE_CATALOG).map(([key, entry]) => [
|
|
90
|
+
key,
|
|
91
|
+
{
|
|
92
|
+
...entry
|
|
93
|
+
}
|
|
94
|
+
])
|
|
95
|
+
),
|
|
96
|
+
legacyCatalogKey: "LEAD_GEN_STAGE_CATALOG"
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
function isPlainRecord(value) {
|
|
100
|
+
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
101
|
+
}
|
|
102
|
+
function mergeBridgeCatalogs(model) {
|
|
103
|
+
const baseCatalogTypes = model.ontology?.catalogTypes ?? {};
|
|
104
|
+
const bridgeCatalogTypes = {};
|
|
105
|
+
if (baseCatalogTypes[CRM_PIPELINE_CATALOG_ONTOLOGY_ID] === void 0) {
|
|
106
|
+
bridgeCatalogTypes[CRM_PIPELINE_CATALOG_ONTOLOGY_ID] = createCrmPipelineCatalog();
|
|
107
|
+
}
|
|
108
|
+
if (baseCatalogTypes[LEAD_GEN_STAGE_CATALOG_ONTOLOGY_ID] === void 0) {
|
|
109
|
+
bridgeCatalogTypes[LEAD_GEN_STAGE_CATALOG_ONTOLOGY_ID] = createLeadGenStageCatalog();
|
|
110
|
+
}
|
|
111
|
+
if (Object.keys(bridgeCatalogTypes).length === 0) return model;
|
|
112
|
+
return {
|
|
113
|
+
...model,
|
|
114
|
+
ontology: {
|
|
115
|
+
...model.ontology ?? {},
|
|
116
|
+
catalogTypes: {
|
|
117
|
+
...baseCatalogTypes,
|
|
118
|
+
...bridgeCatalogTypes
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
function compileBusinessOntologyValidationIndex(model = DEFAULT_ORGANIZATION_MODEL) {
|
|
124
|
+
const compilation = compileOrganizationOntology(mergeBridgeCatalogs(model));
|
|
125
|
+
if (compilation.diagnostics.length > 0) {
|
|
126
|
+
const summary = compilation.diagnostics.map((diagnostic) => diagnostic.message).join("; ");
|
|
127
|
+
throw new Error(`Business ontology validation index failed to compile: ${summary}`);
|
|
128
|
+
}
|
|
129
|
+
const crmPipelineCatalog = compilation.ontology.catalogTypes[CRM_PIPELINE_CATALOG_ONTOLOGY_ID];
|
|
130
|
+
const leadGenStageCatalog = compilation.ontology.catalogTypes[LEAD_GEN_STAGE_CATALOG_ONTOLOGY_ID];
|
|
131
|
+
if (crmPipelineCatalog === void 0 || leadGenStageCatalog === void 0) {
|
|
132
|
+
throw new Error("Business ontology validation index is missing CRM or lead-gen catalog bridge records");
|
|
133
|
+
}
|
|
134
|
+
return {
|
|
135
|
+
ontology: compilation.ontology,
|
|
136
|
+
crmPipelineCatalog,
|
|
137
|
+
leadGenStageCatalog,
|
|
138
|
+
actionTypesByLegacyId: indexActionTypesByLegacyId(compilation.ontology.actionTypes)
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
function indexActionTypesByLegacyId(actionTypes) {
|
|
142
|
+
const byLegacyId = {};
|
|
143
|
+
for (const actionType of Object.values(actionTypes)) {
|
|
144
|
+
const legacyActionId = actionType["legacyActionId"];
|
|
145
|
+
if (typeof legacyActionId === "string") {
|
|
146
|
+
byLegacyId[legacyActionId] = actionType;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
return byLegacyId;
|
|
150
|
+
}
|
|
151
|
+
var BUSINESS_ONTOLOGY_VALIDATION_INDEX = compileBusinessOntologyValidationIndex();
|
|
152
|
+
function getCatalogEntries(catalog) {
|
|
153
|
+
return isPlainRecord(catalog.entries) ? catalog.entries : {};
|
|
154
|
+
}
|
|
155
|
+
function asCrmStageEntry(key, value) {
|
|
156
|
+
const record = isPlainRecord(value) ? value : {};
|
|
157
|
+
const label = typeof record.label === "string" ? record.label : key;
|
|
158
|
+
const order = typeof record.order === "number" ? record.order : 0;
|
|
159
|
+
const color = typeof record.color === "string" ? record.color : void 0;
|
|
160
|
+
const rawStates = Array.isArray(record.states) ? record.states : [];
|
|
161
|
+
const states = rawStates.flatMap((state) => {
|
|
162
|
+
if (!isPlainRecord(state) || typeof state.stateKey !== "string") return [];
|
|
163
|
+
return [
|
|
164
|
+
{
|
|
165
|
+
stateKey: state.stateKey,
|
|
166
|
+
label: typeof state.label === "string" ? state.label : state.stateKey
|
|
167
|
+
}
|
|
168
|
+
];
|
|
169
|
+
});
|
|
170
|
+
return {
|
|
171
|
+
key,
|
|
172
|
+
label,
|
|
173
|
+
order,
|
|
174
|
+
...color !== void 0 ? { color } : {},
|
|
175
|
+
states
|
|
176
|
+
};
|
|
177
|
+
}
|
|
178
|
+
var CRM_STAGE_KEYS_FROM_ONTOLOGY = Object.keys(
|
|
179
|
+
getCatalogEntries(BUSINESS_ONTOLOGY_VALIDATION_INDEX.crmPipelineCatalog)
|
|
180
|
+
);
|
|
181
|
+
Object.values(
|
|
182
|
+
getCatalogEntries(BUSINESS_ONTOLOGY_VALIDATION_INDEX.crmPipelineCatalog)
|
|
183
|
+
).flatMap((entry, index) => {
|
|
184
|
+
const stageKey = CRM_STAGE_KEYS_FROM_ONTOLOGY[index];
|
|
185
|
+
if (stageKey === void 0) return [];
|
|
186
|
+
return asCrmStageEntry(stageKey, entry).states.map((state) => state.stateKey);
|
|
187
|
+
});
|
|
188
|
+
Object.keys(
|
|
189
|
+
getCatalogEntries(BUSINESS_ONTOLOGY_VALIDATION_INDEX.leadGenStageCatalog)
|
|
190
|
+
);
|
|
191
|
+
function getActionMetadata(actionKey) {
|
|
192
|
+
const actionType = BUSINESS_ONTOLOGY_VALIDATION_INDEX.actionTypesByLegacyId[actionKey];
|
|
193
|
+
if (actionType === void 0) return void 0;
|
|
194
|
+
const resourceId = actionType["resourceId"];
|
|
195
|
+
return {
|
|
196
|
+
id: actionKey,
|
|
197
|
+
label: actionType.label ?? actionKey,
|
|
198
|
+
...typeof resourceId === "string" ? { resourceId } : {}
|
|
199
|
+
};
|
|
200
|
+
}
|
|
201
|
+
function getCrmActionMetadata(actionKey) {
|
|
202
|
+
const actionType = BUSINESS_ONTOLOGY_VALIDATION_INDEX.actionTypesByLegacyId[actionKey];
|
|
203
|
+
return actionType?.ownerSystemId === "sales.crm" ? getActionMetadata(actionKey) : void 0;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
// ../core/src/business/acquisition/deal-ownership.ts
|
|
207
|
+
var INBOUND_EVENT_TYPES = ["reply_received"];
|
|
208
|
+
var OUTBOUND_EVENT_TYPES = [
|
|
209
|
+
"reply_sent_to_lead",
|
|
210
|
+
"booking_nudge_sent",
|
|
211
|
+
"reminder_sent",
|
|
212
|
+
"rebook_sent",
|
|
213
|
+
"followup_email_sent",
|
|
214
|
+
"reply_followup_sent",
|
|
215
|
+
"lead_deferred_next_step"
|
|
216
|
+
];
|
|
217
|
+
var INBOUND_SET = new Set(INBOUND_EVENT_TYPES);
|
|
218
|
+
var OUTBOUND_SET = new Set(OUTBOUND_EVENT_TYPES);
|
|
219
|
+
function getDealOwnership(deal) {
|
|
220
|
+
if (deal.state_key === "closed_won" || deal.state_key === "closed_lost") {
|
|
221
|
+
return null;
|
|
222
|
+
}
|
|
223
|
+
if (!Array.isArray(deal.activity_log)) return null;
|
|
224
|
+
let latestInboundMs = null;
|
|
225
|
+
let latestOutboundMs = null;
|
|
226
|
+
for (const entry of deal.activity_log) {
|
|
227
|
+
if (!entry || typeof entry !== "object" || Array.isArray(entry)) continue;
|
|
228
|
+
const record = entry;
|
|
229
|
+
const type = typeof record.type === "string" ? record.type : null;
|
|
230
|
+
if (!type) continue;
|
|
231
|
+
const isInbound = INBOUND_SET.has(type);
|
|
232
|
+
const isOutbound = OUTBOUND_SET.has(type);
|
|
233
|
+
if (!isInbound && !isOutbound) continue;
|
|
234
|
+
const occurredAt = resolveTimestamp(record);
|
|
235
|
+
if (occurredAt === null) continue;
|
|
236
|
+
if (isInbound && (latestInboundMs === null || occurredAt > latestInboundMs)) {
|
|
237
|
+
latestInboundMs = occurredAt;
|
|
238
|
+
}
|
|
239
|
+
if (isOutbound && (latestOutboundMs === null || occurredAt > latestOutboundMs)) {
|
|
240
|
+
latestOutboundMs = occurredAt;
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
if (latestInboundMs === null && latestOutboundMs === null) return null;
|
|
244
|
+
if (latestOutboundMs !== null && (latestInboundMs === null || latestOutboundMs >= latestInboundMs)) {
|
|
245
|
+
return "them";
|
|
246
|
+
}
|
|
247
|
+
return "us";
|
|
248
|
+
}
|
|
249
|
+
function resolveTimestamp(record) {
|
|
250
|
+
return parseMs(record.timestamp) ?? parseMs(record.occurredAt) ?? parseMs(record.createdAt) ?? parseMs(record.updatedAt) ?? parseMs(record.sentAt) ?? null;
|
|
251
|
+
}
|
|
252
|
+
function parseMs(value) {
|
|
253
|
+
if (value instanceof Date) {
|
|
254
|
+
const ms2 = value.getTime();
|
|
255
|
+
return Number.isNaN(ms2) ? null : ms2;
|
|
256
|
+
}
|
|
257
|
+
if (typeof value !== "string") return null;
|
|
258
|
+
const ms = new Date(value).getTime();
|
|
259
|
+
return Number.isNaN(ms) ? null : ms;
|
|
260
|
+
}
|
|
261
|
+
var SendReplyActionPayloadSchema = z.object({
|
|
262
|
+
replyBody: z.string().trim().min(1).max(1e4)
|
|
263
|
+
}).strict();
|
|
264
|
+
function crmAction(actionId, runtime) {
|
|
265
|
+
const metadata = getCrmActionMetadata(actionId);
|
|
266
|
+
if (!metadata?.resourceId) {
|
|
267
|
+
throw new Error(`CRM action metadata for "${actionId}" must define resourceId`);
|
|
268
|
+
}
|
|
269
|
+
return {
|
|
270
|
+
key: metadata.id,
|
|
271
|
+
label: metadata.label,
|
|
272
|
+
workflowId: metadata.resourceId,
|
|
273
|
+
...runtime
|
|
274
|
+
};
|
|
275
|
+
}
|
|
276
|
+
var DEFAULT_CRM_ACTIONS = [
|
|
277
|
+
crmAction("move_to_proposal", {
|
|
278
|
+
isAvailableFor: (deal) => deal.stage_key === "interested"
|
|
279
|
+
}),
|
|
280
|
+
crmAction("move_to_closing", {
|
|
281
|
+
isAvailableFor: (deal) => deal.stage_key === "proposal"
|
|
282
|
+
}),
|
|
283
|
+
crmAction("move_to_closed_won", {
|
|
284
|
+
isAvailableFor: (deal) => deal.stage_key === "closing"
|
|
285
|
+
}),
|
|
286
|
+
crmAction("move_to_closed_lost", {
|
|
287
|
+
isAvailableFor: (deal) => deal.stage_key === "interested" || deal.stage_key === "proposal" || deal.stage_key === "closing"
|
|
288
|
+
}),
|
|
289
|
+
crmAction("move_to_nurturing", {
|
|
290
|
+
isAvailableFor: (deal) => deal.stage_key === "interested" || deal.stage_key === "proposal" || deal.stage_key === "closing"
|
|
291
|
+
}),
|
|
292
|
+
crmAction("send_reply", {
|
|
293
|
+
isAvailableFor: (deal) => deal.stage_key === "interested" && isOurReplyAction(deal) && (deal.state_key === CRM_DISCOVERY_REPLIED_STATE.stateKey || deal.state_key === CRM_DISCOVERY_LINK_SENT_STATE.stateKey || deal.state_key === CRM_DISCOVERY_NUDGING_STATE.stateKey),
|
|
294
|
+
payloadSchema: SendReplyActionPayloadSchema
|
|
295
|
+
}),
|
|
296
|
+
crmAction("send_link", {
|
|
297
|
+
isAvailableFor: (deal) => deal.stage_key === "interested" && deal.state_key === CRM_DISCOVERY_REPLIED_STATE.stateKey
|
|
298
|
+
}),
|
|
299
|
+
crmAction("send_nudge", {
|
|
300
|
+
isAvailableFor: (deal) => deal.stage_key === "interested" && (deal.state_key === CRM_DISCOVERY_LINK_SENT_STATE.stateKey || deal.state_key === CRM_DISCOVERY_NUDGING_STATE.stateKey)
|
|
301
|
+
}),
|
|
302
|
+
{
|
|
303
|
+
key: "mark_no_show",
|
|
304
|
+
label: "Mark No-Show",
|
|
305
|
+
isAvailableFor: (deal) => deal.stage_key === "interested" && deal.state_key === CRM_DISCOVERY_NUDGING_STATE.stateKey,
|
|
306
|
+
// Mirrors the auto-timeout precedent in operations/sales/crm/pipeline/timeout-actions.ts:
|
|
307
|
+
// both manual-click and timeout move the deal to closed_lost. The action_taken activity
|
|
308
|
+
// event captures operator intent and distinguishes the manual variant from the timed one.
|
|
309
|
+
workflowId: "mark_no_show-workflow"
|
|
310
|
+
},
|
|
311
|
+
crmAction("rebook", {
|
|
312
|
+
isAvailableFor: (deal) => deal.stage_key === "interested" && deal.state_key === CRM_DISCOVERY_BOOKING_CANCELLED_STATE.stateKey
|
|
313
|
+
})
|
|
314
|
+
];
|
|
315
|
+
function deriveActions(deal, actions = DEFAULT_CRM_ACTIONS) {
|
|
316
|
+
return actions.filter((a) => a.isAvailableFor(deal)).map(({ key, label, payloadSchema }) => ({ key, label, payloadSchema }));
|
|
317
|
+
}
|
|
318
|
+
function isOurReplyAction(deal) {
|
|
319
|
+
if (Object.prototype.hasOwnProperty.call(deal, "nextAction")) {
|
|
320
|
+
return deal.nextAction === "send_reply";
|
|
321
|
+
}
|
|
322
|
+
return (deal.ownership ?? getDealOwnership(deal)) === "us";
|
|
323
|
+
}
|
|
324
|
+
var CrmActionsContext = createContext(DEFAULT_CRM_ACTIONS);
|
|
325
|
+
function CrmActionsProvider({ actions, children }) {
|
|
326
|
+
return /* @__PURE__ */ jsx(CrmActionsContext.Provider, { value: actions, children });
|
|
327
|
+
}
|
|
328
|
+
function useCrmActions() {
|
|
329
|
+
return useContext(CrmActionsContext);
|
|
330
|
+
}
|
|
331
|
+
var EMPTY_LIST_ACTIONS = Object.freeze([]);
|
|
332
|
+
var ListActionsContext = createContext(EMPTY_LIST_ACTIONS);
|
|
333
|
+
function ListActionsProvider({
|
|
334
|
+
registry = EMPTY_LIST_ACTIONS,
|
|
335
|
+
children
|
|
336
|
+
}) {
|
|
337
|
+
return /* @__PURE__ */ jsx(ListActionsContext.Provider, { value: registry, children });
|
|
338
|
+
}
|
|
339
|
+
function useListActions() {
|
|
340
|
+
return useContext(ListActionsContext);
|
|
341
|
+
}
|
|
342
|
+
function findListActionByAction(registry, actionKey) {
|
|
343
|
+
return registry.find((action) => action.actionKey === actionKey);
|
|
344
|
+
}
|
|
345
|
+
function getListActionWorkflowId(action) {
|
|
346
|
+
return action.workflowId ?? action.resourceId;
|
|
347
|
+
}
|
|
348
|
+
var LazyCoreAuthKitInner = lazy(() => import('./CoreAuthKitInner-QC62UHTZ.js').then((m) => ({ default: m.CoreAuthKitInner })));
|
|
349
|
+
var defaultQueryClient = null;
|
|
350
|
+
function getDefaultQueryClient() {
|
|
351
|
+
if (!defaultQueryClient) {
|
|
352
|
+
defaultQueryClient = new QueryClient({
|
|
353
|
+
defaultOptions: { queries: { retry: 1 } }
|
|
354
|
+
});
|
|
355
|
+
}
|
|
356
|
+
return defaultQueryClient;
|
|
357
|
+
}
|
|
358
|
+
var consoleNotificationAdapter = {
|
|
359
|
+
success(title, message) {
|
|
360
|
+
console.log(`[Notification][Success] ${title}: ${message}`);
|
|
361
|
+
},
|
|
362
|
+
error(title, message) {
|
|
363
|
+
console.warn(`[Notification][Error] ${title}: ${message}`);
|
|
364
|
+
},
|
|
365
|
+
info(title, message) {
|
|
366
|
+
console.log(`[Notification][Info] ${title}: ${message}`);
|
|
367
|
+
},
|
|
368
|
+
warning(title, message) {
|
|
369
|
+
console.warn(`[Notification][Warning] ${title}: ${message}`);
|
|
370
|
+
},
|
|
371
|
+
apiError(error) {
|
|
372
|
+
console.warn(`[Notification][API Error]`, error);
|
|
373
|
+
}
|
|
374
|
+
};
|
|
375
|
+
function ElevasisCoreProvider({
|
|
376
|
+
auth,
|
|
377
|
+
queryClient,
|
|
378
|
+
apiUrl,
|
|
379
|
+
onError,
|
|
380
|
+
notifications,
|
|
381
|
+
crmActions,
|
|
382
|
+
listActions,
|
|
383
|
+
children
|
|
384
|
+
}) {
|
|
385
|
+
if (auth.mode === "apiKey") {
|
|
386
|
+
throw new Error(
|
|
387
|
+
`ElevasisCoreProvider: auth mode 'apiKey' is not yet implemented. Only 'authkit' mode is supported.`
|
|
388
|
+
);
|
|
389
|
+
}
|
|
390
|
+
const resolvedQueryClient = queryClient ?? getDefaultQueryClient();
|
|
391
|
+
const resolvedCrmActions = crmActions ?? DEFAULT_CRM_ACTIONS;
|
|
392
|
+
const resolvedListActions = listActions ?? EMPTY_LIST_ACTIONS;
|
|
393
|
+
const content = apiUrl ? /* @__PURE__ */ jsx(ServiceStack, { apiUrl, onError, notifications, children }) : children;
|
|
394
|
+
const AuthInner = /* @__PURE__ */ jsx(Suspense, { fallback: null, children: /* @__PURE__ */ jsx(LazyCoreAuthKitInner, { auth, children: content }) });
|
|
395
|
+
return /* @__PURE__ */ jsx(QueryClientProvider, { client: resolvedQueryClient, children: /* @__PURE__ */ jsx(CrmActionsProvider, { actions: resolvedCrmActions, children: /* @__PURE__ */ jsx(ListActionsProvider, { registry: resolvedListActions, children: AuthInner }) }) });
|
|
396
|
+
}
|
|
397
|
+
function ServiceStack({
|
|
398
|
+
apiUrl,
|
|
399
|
+
onError,
|
|
400
|
+
notifications,
|
|
401
|
+
children
|
|
402
|
+
}) {
|
|
403
|
+
const { getAccessToken } = useAuthContext();
|
|
404
|
+
const orgIdRef = useRef(null);
|
|
405
|
+
const getOrganizationId = useRef(() => orgIdRef.current).current;
|
|
406
|
+
return /* @__PURE__ */ jsx(
|
|
407
|
+
ApiClientProvider,
|
|
408
|
+
{
|
|
409
|
+
getAccessToken,
|
|
410
|
+
getOrganizationId,
|
|
411
|
+
isOrganizationReady: false,
|
|
412
|
+
onError,
|
|
413
|
+
children: /* @__PURE__ */ jsx(ServiceStackInner, { apiUrl, orgIdRef, notifications, children })
|
|
414
|
+
}
|
|
415
|
+
);
|
|
416
|
+
}
|
|
417
|
+
function ServiceStackInner({
|
|
418
|
+
apiUrl,
|
|
419
|
+
orgIdRef,
|
|
420
|
+
notifications,
|
|
421
|
+
children
|
|
422
|
+
}) {
|
|
423
|
+
const { apiRequest } = useApiClient(apiUrl);
|
|
424
|
+
const resolvedNotifications = notifications ?? consoleNotificationAdapter;
|
|
425
|
+
return /* @__PURE__ */ jsx(ProfileProvider, { apiRequest, children: /* @__PURE__ */ jsx(OrganizationProvider, { apiRequest, children: /* @__PURE__ */ jsx(OrgServiceBridge, { orgIdRef, apiRequest, notifications: resolvedNotifications, children }) }) });
|
|
426
|
+
}
|
|
427
|
+
function OrgServiceBridge({
|
|
428
|
+
orgIdRef,
|
|
429
|
+
apiRequest,
|
|
430
|
+
notifications,
|
|
431
|
+
children
|
|
432
|
+
}) {
|
|
433
|
+
const { currentWorkOSOrganizationId, isInitializing, isOrgRefreshing } = useOrganization();
|
|
434
|
+
orgIdRef.current = currentWorkOSOrganizationId;
|
|
435
|
+
const isReady = !!currentWorkOSOrganizationId && !isInitializing && !isOrgRefreshing;
|
|
436
|
+
return /* @__PURE__ */ jsx(
|
|
437
|
+
ElevasisServiceProvider,
|
|
438
|
+
{
|
|
439
|
+
apiRequest,
|
|
440
|
+
workOSOrganizationId: currentWorkOSOrganizationId,
|
|
441
|
+
isReady,
|
|
442
|
+
children: /* @__PURE__ */ jsx(NotificationProvider, { adapter: notifications, children: /* @__PURE__ */ jsx(InitializationProvider, { children }) })
|
|
443
|
+
}
|
|
444
|
+
);
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
export { CrmActionsProvider, EMPTY_LIST_ACTIONS, ElevasisCoreProvider, ListActionsProvider, NotificationProvider, deriveActions, findListActionByAction, getListActionWorkflowId, useCrmActions, useListActions, useNotificationAdapter };
|