@arbidocs/blocks 0.5.23 → 0.5.24
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/{WorkspaceTableView-6JVHGDUB.cjs → WorkspaceTableView-GIDGNGBW.cjs} +6 -6
- package/dist/{WorkspaceTableView-6JVHGDUB.cjs.map → WorkspaceTableView-GIDGNGBW.cjs.map} +1 -1
- package/dist/{WorkspaceTableView-ECPHGWHF.js → WorkspaceTableView-S2PTTVHL.js} +4 -4
- package/dist/{WorkspaceTableView-ECPHGWHF.js.map → WorkspaceTableView-S2PTTVHL.js.map} +1 -1
- package/dist/{chunk-7DDMF3DZ.cjs → chunk-53T2FY4Z.cjs} +5 -31
- package/dist/chunk-53T2FY4Z.cjs.map +1 -0
- package/dist/chunk-5ZBXFHZW.js +434 -0
- package/dist/chunk-5ZBXFHZW.js.map +1 -0
- package/dist/{chunk-O4EQYPLO.cjs → chunk-C2SZQKX2.cjs} +169 -27
- package/dist/chunk-C2SZQKX2.cjs.map +1 -0
- package/dist/{chunk-RVKVGS72.js → chunk-FDUQQNDT.js} +2 -2
- package/dist/{chunk-RVKVGS72.js.map → chunk-FDUQQNDT.js.map} +1 -1
- package/dist/{chunk-TTJGCJWX.cjs → chunk-H3XAHVDT.cjs} +42 -2
- package/dist/chunk-H3XAHVDT.cjs.map +1 -0
- package/dist/{chunk-XL55UDLO.js → chunk-IJJKUTKM.js} +5 -30
- package/dist/chunk-IJJKUTKM.js.map +1 -0
- package/dist/{chunk-ZX663X3X.cjs → chunk-KNRAKOCO.cjs} +6 -428
- package/dist/chunk-KNRAKOCO.cjs.map +1 -0
- package/dist/chunk-KUQOHPKP.cjs +443 -0
- package/dist/chunk-KUQOHPKP.cjs.map +1 -0
- package/dist/{chunk-F2BYURQZ.cjs → chunk-LYF47OXX.cjs} +5 -5
- package/dist/{chunk-F2BYURQZ.cjs.map → chunk-LYF47OXX.cjs.map} +1 -1
- package/dist/{chunk-PZRTRYPD.js → chunk-MKTEVOC3.js} +44 -5
- package/dist/chunk-MKTEVOC3.js.map +1 -0
- package/dist/{chunk-6XW3CMU4.js → chunk-N3KNAQ55.js} +144 -4
- package/dist/chunk-N3KNAQ55.js.map +1 -0
- package/dist/{chunk-FZVAJFRH.cjs → chunk-RHKFCSFC.cjs} +2 -2
- package/dist/{chunk-FZVAJFRH.cjs.map → chunk-RHKFCSFC.cjs.map} +1 -1
- package/dist/{chunk-NVRJ6WTR.js → chunk-RTAYJUQM.js} +3 -3
- package/dist/{chunk-NVRJ6WTR.js.map → chunk-RTAYJUQM.js.map} +1 -1
- package/dist/{chunk-SLRVI2YU.js → chunk-X6U6L6BG.js} +29 -4
- package/dist/chunk-X6U6L6BG.js.map +1 -0
- package/dist/{chunk-SQ5F5BFW.cjs → chunk-XDU3HHUU.cjs} +32 -6
- package/dist/chunk-XDU3HHUU.cjs.map +1 -0
- package/dist/{chunk-SKVVOEMX.js → chunk-XXUPUXBF.js} +8 -423
- package/dist/chunk-XXUPUXBF.js.map +1 -0
- package/dist/connect/index.cjs +1039 -565
- package/dist/connect/index.cjs.map +1 -1
- package/dist/connect/index.js +649 -180
- package/dist/connect/index.js.map +1 -1
- package/dist/connection/auth/CompactLogin.d.ts +26 -0
- package/dist/connection/auth/ConnectedLoginPage.d.ts +9 -1
- package/dist/connection/auth/index.d.ts +3 -1
- package/dist/connection/auth/sso-popup.d.ts +13 -0
- package/dist/connection/auth/sso-sign-in.d.ts +38 -0
- package/dist/connection/auth/useLoginActions.d.ts +4 -2
- package/dist/connection/projects/ConnectedProjectsPanel.d.ts +9 -1
- package/dist/connection/projects/ProjectsListPage.d.ts +40 -0
- package/dist/connection/projects/index.d.ts +1 -0
- package/dist/connection/settings-page/appearanceSection.d.ts +30 -0
- package/dist/connection/settings-page/index.d.ts +1 -0
- package/dist/index.cjs +162 -190
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +9 -48
- package/dist/index.js.map +1 -1
- package/dist/settings/AppearanceSettings.d.ts +1 -2
- package/dist/settings/index.cjs +153 -153
- package/dist/settings/index.d.ts +2 -1
- package/dist/settings/index.js +1 -1
- package/dist/site/index.cjs +82 -74
- package/dist/site/index.d.ts +2 -0
- package/dist/site/index.js +3 -3
- package/dist/studio/index.cjs +73 -73
- package/dist/studio/index.js +5 -5
- package/dist/theme/appearance.d.ts +47 -0
- package/dist/theme/fromCss.d.ts +33 -0
- package/node_modules/@arbidocs/coedit/package.json +1 -1
- package/package.json +5 -5
- package/dist/chunk-6XW3CMU4.js.map +0 -1
- package/dist/chunk-7DDMF3DZ.cjs.map +0 -1
- package/dist/chunk-AMTWY22T.js +0 -11
- package/dist/chunk-AMTWY22T.js.map +0 -1
- package/dist/chunk-O4EQYPLO.cjs.map +0 -1
- package/dist/chunk-PZRTRYPD.js.map +0 -1
- package/dist/chunk-SKVVOEMX.js.map +0 -1
- package/dist/chunk-SLRVI2YU.js.map +0 -1
- package/dist/chunk-SQ5F5BFW.cjs.map +0 -1
- package/dist/chunk-TTJGCJWX.cjs.map +0 -1
- package/dist/chunk-XL55UDLO.js.map +0 -1
- package/dist/chunk-ZU2B2RZK.cjs +0 -13
- package/dist/chunk-ZU2B2RZK.cjs.map +0 -1
- package/dist/chunk-ZX663X3X.cjs.map +0 -1
package/dist/connect/index.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var chunkLYF47OXX_cjs = require('../chunk-LYF47OXX.cjs');
|
|
5
5
|
var chunkKJVDYWAM_cjs = require('../chunk-KJVDYWAM.cjs');
|
|
6
6
|
var chunkJUUOJP7I_cjs = require('../chunk-JUUOJP7I.cjs');
|
|
7
7
|
var chunkPSIKUQYM_cjs = require('../chunk-PSIKUQYM.cjs');
|
|
@@ -9,7 +9,7 @@ var chunkYD3RN2FY_cjs = require('../chunk-YD3RN2FY.cjs');
|
|
|
9
9
|
var chunkFCWS7I5C_cjs = require('../chunk-FCWS7I5C.cjs');
|
|
10
10
|
var chunkOU3RGQFX_cjs = require('../chunk-OU3RGQFX.cjs');
|
|
11
11
|
require('../chunk-UAEYU2NN.cjs');
|
|
12
|
-
var
|
|
12
|
+
var chunkRHKFCSFC_cjs = require('../chunk-RHKFCSFC.cjs');
|
|
13
13
|
var chunk7ZHPLTGK_cjs = require('../chunk-7ZHPLTGK.cjs');
|
|
14
14
|
var chunkBL74GYSA_cjs = require('../chunk-BL74GYSA.cjs');
|
|
15
15
|
var chunkWPOQLGKJ_cjs = require('../chunk-WPOQLGKJ.cjs');
|
|
@@ -23,13 +23,13 @@ require('../chunk-464YPRAE.cjs');
|
|
|
23
23
|
require('../chunk-NML42O7Q.cjs');
|
|
24
24
|
var chunk5FYU7ZIU_cjs = require('../chunk-5FYU7ZIU.cjs');
|
|
25
25
|
require('../chunk-ZESMRGDV.cjs');
|
|
26
|
-
var
|
|
26
|
+
var chunkH3XAHVDT_cjs = require('../chunk-H3XAHVDT.cjs');
|
|
27
27
|
var chunkC2ECYOPP_cjs = require('../chunk-C2ECYOPP.cjs');
|
|
28
28
|
var chunkGOWXP5KT_cjs = require('../chunk-GOWXP5KT.cjs');
|
|
29
29
|
var chunkYBTKLOGG_cjs = require('../chunk-YBTKLOGG.cjs');
|
|
30
30
|
var chunkQZTNTP75_cjs = require('../chunk-QZTNTP75.cjs');
|
|
31
|
-
var
|
|
32
|
-
require('../chunk-
|
|
31
|
+
var chunkXDU3HHUU_cjs = require('../chunk-XDU3HHUU.cjs');
|
|
32
|
+
var chunkKUQOHPKP_cjs = require('../chunk-KUQOHPKP.cjs');
|
|
33
33
|
var chunkVPPX5XUF_cjs = require('../chunk-VPPX5XUF.cjs');
|
|
34
34
|
require('../chunk-PCB2BPN3.cjs');
|
|
35
35
|
require('../chunk-NWNVWO6L.cjs');
|
|
@@ -163,9 +163,9 @@ var ConnectedUserEntity = React7.memo(function ConnectedUserEntity2({
|
|
|
163
163
|
if (isMe) openSettings();
|
|
164
164
|
else openDirectChat?.(user.external_id);
|
|
165
165
|
};
|
|
166
|
-
const tooltipContent = /* @__PURE__ */ jsxRuntime.jsxs(
|
|
166
|
+
const tooltipContent = /* @__PURE__ */ jsxRuntime.jsxs(chunkH3XAHVDT_cjs.EntityTooltip, { children: [
|
|
167
167
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
168
|
-
|
|
168
|
+
chunkH3XAHVDT_cjs.EntityTooltipHeader,
|
|
169
169
|
{
|
|
170
170
|
lead: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
171
171
|
ui.Avatar,
|
|
@@ -196,13 +196,13 @@ var ConnectedUserEntity = React7.memo(function ConnectedUserEntity2({
|
|
|
196
196
|
subtitle: user.email
|
|
197
197
|
}
|
|
198
198
|
),
|
|
199
|
-
userIsAgent && agentOwner && /* @__PURE__ */ jsxRuntime.jsx(
|
|
199
|
+
userIsAgent && agentOwner && /* @__PURE__ */ jsxRuntime.jsx(chunkH3XAHVDT_cjs.EntityTooltipSection, { children: /* @__PURE__ */ jsxRuntime.jsxs(chunkH3XAHVDT_cjs.EntityTooltipHint, { icon: /* @__PURE__ */ jsxRuntime.jsx(react.ArbiBotHeadIcon, { className: "w-3.5 h-3.5 flex-shrink-0" }), children: [
|
|
200
200
|
"Agent of",
|
|
201
201
|
" ",
|
|
202
202
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-medium text-foreground", children: ui.getUserDisplayName(agentOwner) })
|
|
203
203
|
] }) }),
|
|
204
204
|
sharedWorkspaces.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(
|
|
205
|
-
|
|
205
|
+
chunkH3XAHVDT_cjs.EntityTooltipSection,
|
|
206
206
|
{
|
|
207
207
|
icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Users, { className: "w-3.5 h-3.5 flex-shrink-0" }),
|
|
208
208
|
heading: "Shared Workspaces",
|
|
@@ -233,7 +233,7 @@ var ConnectedUserEntity = React7.memo(function ConnectedUserEntity2({
|
|
|
233
233
|
] })
|
|
234
234
|
}
|
|
235
235
|
),
|
|
236
|
-
interactive && variant === "pill" && canChat && /* @__PURE__ */ jsxRuntime.jsx(
|
|
236
|
+
interactive && variant === "pill" && canChat && /* @__PURE__ */ jsxRuntime.jsx(chunkH3XAHVDT_cjs.EntityTooltipHint, { isRuled: true, icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.MessageCircleMore, { className: "w-3 h-3" }), children: "Click to send message" })
|
|
237
237
|
] });
|
|
238
238
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
239
239
|
ui.UserEntity,
|
|
@@ -368,7 +368,7 @@ function ConnectedWorkspaceActivity({
|
|
|
368
368
|
[feed.data]
|
|
369
369
|
);
|
|
370
370
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
371
|
-
|
|
371
|
+
chunkH3XAHVDT_cjs.WorkspaceActivityList,
|
|
372
372
|
{
|
|
373
373
|
...listProps,
|
|
374
374
|
items,
|
|
@@ -1088,7 +1088,7 @@ function NotificationCenter({
|
|
|
1088
1088
|
}
|
|
1089
1089
|
];
|
|
1090
1090
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col h-full bg-background", "data-testid": "notifications-page", children: [
|
|
1091
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1091
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkRHKFCSFC_cjs.DraggableHeader, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1092
1092
|
chunkMEMWZ72Y_cjs.TabHeader,
|
|
1093
1093
|
{
|
|
1094
1094
|
tabs,
|
|
@@ -1401,7 +1401,7 @@ function ConnectedWorkspaceNotificationMenu({
|
|
|
1401
1401
|
}, [error, notify17]);
|
|
1402
1402
|
if (!workspaceId) return null;
|
|
1403
1403
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1404
|
-
|
|
1404
|
+
chunkH3XAHVDT_cjs.WorkspaceNotificationMenu,
|
|
1405
1405
|
{
|
|
1406
1406
|
...menuProps,
|
|
1407
1407
|
level,
|
|
@@ -1420,7 +1420,7 @@ function ConnectedThreadFollow({
|
|
|
1420
1420
|
enabled: live
|
|
1421
1421
|
});
|
|
1422
1422
|
if (!conversationId) return null;
|
|
1423
|
-
const Control = as === "menu-item" ?
|
|
1423
|
+
const Control = as === "menu-item" ? chunkH3XAHVDT_cjs.ThreadFollowMenuItem : chunkH3XAHVDT_cjs.ThreadFollowButton;
|
|
1424
1424
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1425
1425
|
Control,
|
|
1426
1426
|
{
|
|
@@ -3217,10 +3217,10 @@ function cascadeTagCombination(tags, previous, next) {
|
|
|
3217
3217
|
function tagCombinationMatches(combination, items) {
|
|
3218
3218
|
if (!isCombining(combination)) return void 0;
|
|
3219
3219
|
const pass = (list) => new Set(
|
|
3220
|
-
|
|
3220
|
+
chunkRHKFCSFC_cjs.applyInvertedIndexFilter(
|
|
3221
3221
|
[...list],
|
|
3222
3222
|
combination,
|
|
3223
|
-
|
|
3223
|
+
chunkRHKFCSFC_cjs.buildInvertedIndex(
|
|
3224
3224
|
[...list],
|
|
3225
3225
|
(item) => item.id,
|
|
3226
3226
|
(item) => item.tagIds
|
|
@@ -3337,7 +3337,7 @@ function ConnectedTagTable({
|
|
|
3337
3337
|
const fail = (fallback) => (e) => notify17(browser.refusalReason(e, fallback), "error");
|
|
3338
3338
|
const snapshot3 = (data) => {
|
|
3339
3339
|
const title = exportTitle ?? ui.tagKindTitle(kind, { plural: true });
|
|
3340
|
-
const bytes =
|
|
3340
|
+
const bytes = chunkH3XAHVDT_cjs.tagTableDocx(data, {
|
|
3341
3341
|
title,
|
|
3342
3342
|
nameOf: (id) => people.find((p) => p.value === id)?.label
|
|
3343
3343
|
});
|
|
@@ -3346,7 +3346,7 @@ function ConnectedTagTable({
|
|
|
3346
3346
|
return { blob: new Blob([bytes], { type: chunkJIOHDVWH_cjs.DOCX_MIME_TYPE }), name };
|
|
3347
3347
|
};
|
|
3348
3348
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3349
|
-
|
|
3349
|
+
chunkH3XAHVDT_cjs.TagTable,
|
|
3350
3350
|
{
|
|
3351
3351
|
...props,
|
|
3352
3352
|
table,
|
|
@@ -3484,9 +3484,9 @@ function GlossaryExport({ labelId, nameOf }) {
|
|
|
3484
3484
|
const narrowed = agreements.find((a) => a.id === narrowTo);
|
|
3485
3485
|
const title = narrowed ? `Glossary - ${narrowed.name}` : "Glossary";
|
|
3486
3486
|
const download = (format) => {
|
|
3487
|
-
const entries =
|
|
3488
|
-
const blob = format === "docx" ? new Blob([
|
|
3489
|
-
documentTools.downloadBlob(blob,
|
|
3487
|
+
const entries = chunkH3XAHVDT_cjs.glossaryEntries(sources, { labelId: narrowed?.id });
|
|
3488
|
+
const blob = format === "docx" ? new Blob([chunkH3XAHVDT_cjs.glossaryDocx(entries, { title })], { type: chunkJIOHDVWH_cjs.DOCX_MIME_TYPE }) : new Blob([chunkH3XAHVDT_cjs.glossaryMarkdown(entries, { title })], { type: "text/markdown" });
|
|
3489
|
+
documentTools.downloadBlob(blob, chunkH3XAHVDT_cjs.glossaryFileName(title, format));
|
|
3490
3490
|
};
|
|
3491
3491
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", "data-testid": "tags-glossary", children: [
|
|
3492
3492
|
agreements.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -4272,7 +4272,7 @@ var DocumentSharedCell = React7.memo(function DocumentSharedCell2({
|
|
|
4272
4272
|
[document2.external_id, onToggle]
|
|
4273
4273
|
);
|
|
4274
4274
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
4275
|
-
|
|
4275
|
+
chunkH3XAHVDT_cjs.SharedCell,
|
|
4276
4276
|
{
|
|
4277
4277
|
item: document2,
|
|
4278
4278
|
onToggle: handleToggle,
|
|
@@ -4855,7 +4855,7 @@ function TagFilterChips({
|
|
|
4855
4855
|
const name = (id) => tags.find((t) => t.external_id === id)?.name ?? id;
|
|
4856
4856
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-wrap items-center gap-1.5", "data-testid": "tags-filter-chips", children: [
|
|
4857
4857
|
set2.map(([id, state]) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
4858
|
-
|
|
4858
|
+
chunkRHKFCSFC_cjs.FilterChip,
|
|
4859
4859
|
{
|
|
4860
4860
|
label: name(id),
|
|
4861
4861
|
state,
|
|
@@ -4983,7 +4983,7 @@ function KindSection({
|
|
|
4983
4983
|
{
|
|
4984
4984
|
testId: `tags-kind-${kind}`,
|
|
4985
4985
|
title: ui.tagKindTitle(kind, { plural: true }),
|
|
4986
|
-
description:
|
|
4986
|
+
description: chunkH3XAHVDT_cjs.tagKindDescription(kind),
|
|
4987
4987
|
actions: picker,
|
|
4988
4988
|
children: [
|
|
4989
4989
|
browser.isEntityTag({ kind }) && extractingCount > 0 && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -4994,9 +4994,9 @@ function KindSection({
|
|
|
4994
4994
|
children: [
|
|
4995
4995
|
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Loader2, { className: "size-4 animate-spin" }),
|
|
4996
4996
|
"Extracting ",
|
|
4997
|
-
|
|
4997
|
+
chunkH3XAHVDT_cjs.entitiesPhrase().toLowerCase(),
|
|
4998
4998
|
" from ",
|
|
4999
|
-
|
|
4999
|
+
chunkH3XAHVDT_cjs.documentCount(extractingCount),
|
|
5000
5000
|
"\u2026"
|
|
5001
5001
|
]
|
|
5002
5002
|
}
|
|
@@ -5014,7 +5014,7 @@ function KindSection({
|
|
|
5014
5014
|
onOpenDocument: (id) => openDocument(id),
|
|
5015
5015
|
onOpenFact: ctx.onOpenFact,
|
|
5016
5016
|
onOpenThread: (id) => openConversation(id),
|
|
5017
|
-
labels:
|
|
5017
|
+
labels: chunkH3XAHVDT_cjs.tagTableLabels(kind),
|
|
5018
5018
|
testId: `tags-table-${kind}`
|
|
5019
5019
|
}
|
|
5020
5020
|
)
|
|
@@ -5116,12 +5116,12 @@ function TagSection({
|
|
|
5116
5116
|
onOpenDocument: (id) => openDocument(id),
|
|
5117
5117
|
onOpenFact: ctx.onOpenFact,
|
|
5118
5118
|
onOpenThread: (id) => openConversation(id),
|
|
5119
|
-
labels:
|
|
5119
|
+
labels: chunkH3XAHVDT_cjs.tagTableLabels(tag.kind),
|
|
5120
5120
|
testId: "tags-rows"
|
|
5121
5121
|
}
|
|
5122
5122
|
),
|
|
5123
5123
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5124
|
-
|
|
5124
|
+
chunkH3XAHVDT_cjs.TagDetail,
|
|
5125
5125
|
{
|
|
5126
5126
|
row: detailRow && narrowTagRow(detailRow, ctx.filter.matches),
|
|
5127
5127
|
fields: schema.data?.fields ?? [],
|
|
@@ -5133,10 +5133,10 @@ function TagSection({
|
|
|
5133
5133
|
onOpenDocument: (id) => openDocument(id),
|
|
5134
5134
|
onOpenFact: ctx.onOpenFact,
|
|
5135
5135
|
onOpenThread: (id) => openConversation(id),
|
|
5136
|
-
noteLabel:
|
|
5136
|
+
noteLabel: chunkH3XAHVDT_cjs.tagNoteLabel(tag.kind),
|
|
5137
5137
|
noteIsValue: tag.kind === "annotation",
|
|
5138
5138
|
renderPassages: (d, label) => renderPassages(d.doc_ext_id, label),
|
|
5139
|
-
labels:
|
|
5139
|
+
labels: chunkH3XAHVDT_cjs.tagDetailLabels(),
|
|
5140
5140
|
testId: "tags-detail"
|
|
5141
5141
|
}
|
|
5142
5142
|
)
|
|
@@ -5224,7 +5224,7 @@ function ConnectedTagsPage({
|
|
|
5224
5224
|
const onDelete = async (t) => {
|
|
5225
5225
|
const nested = browser.getChildTags([...tags], t.external_id);
|
|
5226
5226
|
const uses = browser.tagUseCount(t);
|
|
5227
|
-
const n2 =
|
|
5227
|
+
const n2 = chunkH3XAHVDT_cjs.tagsPageNouns();
|
|
5228
5228
|
const tagNoun = (count2) => (count2 === 1 ? n2.tag : n2.tags).toLowerCase();
|
|
5229
5229
|
const carriers = uses === 1 ? `${n2.document}, ${n2.fact} or ${n2.thread}` : `${n2.documents}, ${n2.facts} and ${n2.threads}`;
|
|
5230
5230
|
const message = `Delete ${ui.tagKindNouns(t.kind).singular} "${t.name}"?` + (uses > 0 ? `
|
|
@@ -5245,16 +5245,16 @@ ${nested.length} nested ${tagNoun(nested.length)} ${nested.length === 1 ? "moves
|
|
|
5245
5245
|
try {
|
|
5246
5246
|
await extract.mutateAsync(docIds);
|
|
5247
5247
|
notify17(
|
|
5248
|
-
`Extracting ${
|
|
5248
|
+
`Extracting ${chunkH3XAHVDT_cjs.entitiesPhrase().toLowerCase()} from ${chunkH3XAHVDT_cjs.documentCount(docIds.length)}. You will be notified when it is done.`,
|
|
5249
5249
|
"info"
|
|
5250
5250
|
);
|
|
5251
5251
|
} catch (error) {
|
|
5252
|
-
notify17(browser.refusalReason(error, `Could not extract ${
|
|
5252
|
+
notify17(browser.refusalReason(error, `Could not extract ${chunkH3XAHVDT_cjs.entitiesPhrase().toLowerCase()}`), "error");
|
|
5253
5253
|
throw error;
|
|
5254
5254
|
}
|
|
5255
5255
|
};
|
|
5256
5256
|
const picker = /* @__PURE__ */ jsxRuntime.jsx(
|
|
5257
|
-
|
|
5257
|
+
chunkH3XAHVDT_cjs.TagPicker,
|
|
5258
5258
|
{
|
|
5259
5259
|
tags: viewTags,
|
|
5260
5260
|
selectedId: tag?.external_id,
|
|
@@ -5268,10 +5268,10 @@ ${nested.length} nested ${tagNoun(nested.length)} ${nested.length === 1 ? "moves
|
|
|
5268
5268
|
onOpenTag: openTag,
|
|
5269
5269
|
onOpenFact
|
|
5270
5270
|
};
|
|
5271
|
-
const n =
|
|
5271
|
+
const n = chunkH3XAHVDT_cjs.tagsPageNouns();
|
|
5272
5272
|
const action = view === "person" || view === "organisation" ? {
|
|
5273
5273
|
label: "Extract",
|
|
5274
|
-
title: `Extract ${
|
|
5274
|
+
title: `Extract ${chunkH3XAHVDT_cjs.entitiesPhrase().toLowerCase()} from ${n.documents.toLowerCase()}`,
|
|
5275
5275
|
icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Sparkles, { className: "h-4 w-4" }),
|
|
5276
5276
|
run: () => setExtracting(true),
|
|
5277
5277
|
testId: "tags-extract-entities"
|
|
@@ -5421,7 +5421,7 @@ ${nested.length} nested ${tagNoun(nested.length)} ${nested.length === 1 ? "moves
|
|
|
5421
5421
|
}
|
|
5422
5422
|
),
|
|
5423
5423
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5424
|
-
|
|
5424
|
+
chunkH3XAHVDT_cjs.ExtractEntitiesDialog,
|
|
5425
5425
|
{
|
|
5426
5426
|
open: extracting,
|
|
5427
5427
|
onOpenChange: setExtracting,
|
|
@@ -6118,10 +6118,10 @@ function useFactFilters(notes, view, chat) {
|
|
|
6118
6118
|
const factFilters = view.filters;
|
|
6119
6119
|
const setFactFilters = view.setFilters;
|
|
6120
6120
|
const quickFilteredNotes = React7.useMemo(
|
|
6121
|
-
() =>
|
|
6121
|
+
() => chunkRHKFCSFC_cjs.applyInvertedIndexFilter(
|
|
6122
6122
|
notes,
|
|
6123
6123
|
factFilters,
|
|
6124
|
-
|
|
6124
|
+
chunkRHKFCSFC_cjs.buildInvertedIndex(
|
|
6125
6125
|
notes,
|
|
6126
6126
|
(f) => f.external_id,
|
|
6127
6127
|
(f) => Object.entries(getFactFilterAttributes(f)).filter(([id, on]) => on && factFilterIds.includes(id)).map(([id]) => id)
|
|
@@ -7424,7 +7424,7 @@ function ConnectedFactsPage({
|
|
|
7424
7424
|
onNewFact: composing && !editingId ? () => void 0 : composer.startNewFact,
|
|
7425
7425
|
navSlotRef: setNavSlot,
|
|
7426
7426
|
navigator: view === "table" ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
7427
|
-
|
|
7427
|
+
chunkH3XAHVDT_cjs.GridRowNavigator,
|
|
7428
7428
|
{
|
|
7429
7429
|
gridApi,
|
|
7430
7430
|
selectedId: editingId,
|
|
@@ -7764,11 +7764,11 @@ function ConnectedProfileCard({
|
|
|
7764
7764
|
const display = profile?.fullName || "Unnamed";
|
|
7765
7765
|
return /* @__PURE__ */ jsxRuntime.jsxs(chunkIRY63R4L_cjs.SettingsSection, { icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.UserCircle, {}), title, children: [
|
|
7766
7766
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7767
|
-
|
|
7767
|
+
chunkRHKFCSFC_cjs.ProfileCard,
|
|
7768
7768
|
{
|
|
7769
7769
|
avatar: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
7770
7770
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7771
|
-
|
|
7771
|
+
chunkRHKFCSFC_cjs.AvatarPicker,
|
|
7772
7772
|
{
|
|
7773
7773
|
pictureUrl: profile?.picture,
|
|
7774
7774
|
initials: chunkUFEXJIEY_cjs.initials(display),
|
|
@@ -7818,7 +7818,7 @@ function ConnectedIdentityVerification({
|
|
|
7818
7818
|
});
|
|
7819
7819
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
7820
7820
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7821
|
-
|
|
7821
|
+
chunkRHKFCSFC_cjs.IdentityVerificationCard,
|
|
7822
7822
|
{
|
|
7823
7823
|
flow,
|
|
7824
7824
|
labels,
|
|
@@ -7827,7 +7827,7 @@ function ConnectedIdentityVerification({
|
|
|
7827
7827
|
}
|
|
7828
7828
|
),
|
|
7829
7829
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7830
|
-
|
|
7830
|
+
chunkRHKFCSFC_cjs.IdentityVerificationDialog,
|
|
7831
7831
|
{
|
|
7832
7832
|
flow,
|
|
7833
7833
|
accountName: profile?.fullName ?? "",
|
|
@@ -7840,7 +7840,7 @@ function ConnectedIdentityVerification({
|
|
|
7840
7840
|
function ConnectedRequireVerified({ children, labels }) {
|
|
7841
7841
|
const { data: profile } = react.useProfile();
|
|
7842
7842
|
const flow = react.useIdentityVerification();
|
|
7843
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
7843
|
+
return /* @__PURE__ */ jsxRuntime.jsx(chunkRHKFCSFC_cjs.RequireVerified, { flow, accountName: profile?.fullName ?? "", labels, children });
|
|
7844
7844
|
}
|
|
7845
7845
|
function ConnectedPasswordChangeDialog({
|
|
7846
7846
|
open,
|
|
@@ -7865,7 +7865,7 @@ function ConnectedPasswordChangeDialog({
|
|
|
7865
7865
|
onRecoveryComplete
|
|
7866
7866
|
});
|
|
7867
7867
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
7868
|
-
|
|
7868
|
+
chunkRHKFCSFC_cjs.PasswordChangeDialog,
|
|
7869
7869
|
{
|
|
7870
7870
|
open,
|
|
7871
7871
|
onClose: form.onCancel,
|
|
@@ -7905,23 +7905,23 @@ function ConnectedSecuritySection({ children }) {
|
|
|
7905
7905
|
] });
|
|
7906
7906
|
}
|
|
7907
7907
|
function ConnectedNotificationPreferences({
|
|
7908
|
-
categories =
|
|
7908
|
+
categories = chunkRHKFCSFC_cjs.EMAIL_NOTIFICATION_CATEGORIES,
|
|
7909
7909
|
title = "Notifications"
|
|
7910
7910
|
}) {
|
|
7911
7911
|
const keys = React7.useMemo(
|
|
7912
|
-
() => categories ===
|
|
7912
|
+
() => categories === chunkRHKFCSFC_cjs.EMAIL_NOTIFICATION_CATEGORIES ? chunkRHKFCSFC_cjs.EMAIL_NOTIFICATION_KEYS : categories.map((c) => c.key),
|
|
7913
7913
|
[categories]
|
|
7914
7914
|
);
|
|
7915
7915
|
const prefs = react.useNotificationPreferences(keys);
|
|
7916
7916
|
return /* @__PURE__ */ jsxRuntime.jsx(chunkIRY63R4L_cjs.SettingsSection, { title, children: /* @__PURE__ */ jsxRuntime.jsx(chunkIRY63R4L_cjs.SettingsCard, { className: "space-y-0", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
7917
|
-
|
|
7917
|
+
chunkRHKFCSFC_cjs.NotificationCategoryList,
|
|
7918
7918
|
{
|
|
7919
7919
|
masterId: "emailNotifications",
|
|
7920
7920
|
masterTitle: "Email Notifications",
|
|
7921
7921
|
masterDescription: "Email me about activity when I\u2019m away",
|
|
7922
7922
|
masterChecked: prefs.masterChecked,
|
|
7923
7923
|
onMasterChange: prefs.setAll,
|
|
7924
|
-
categories:
|
|
7924
|
+
categories: chunkRHKFCSFC_cjs.toNotificationCategories(prefs.checked, categories),
|
|
7925
7925
|
onCategoryChange: prefs.setCategory
|
|
7926
7926
|
}
|
|
7927
7927
|
) }) });
|
|
@@ -7934,7 +7934,7 @@ function ConnectedSessionsRow({
|
|
|
7934
7934
|
const sessions = react.useSessions({ enabled: open });
|
|
7935
7935
|
const currentSessionId = react.useCurrentSessionId();
|
|
7936
7936
|
const terminate = react.useTerminateSession();
|
|
7937
|
-
const views =
|
|
7937
|
+
const views = chunkRHKFCSFC_cjs.toActiveSessionViews(sessions.data ?? [], {
|
|
7938
7938
|
currentSessionId,
|
|
7939
7939
|
terminatingId: terminate.isPending ? terminate.variables : null,
|
|
7940
7940
|
renderIcon: renderSessionIcon
|
|
@@ -7963,7 +7963,7 @@ function ConnectedSessionsRow({
|
|
|
7963
7963
|
}
|
|
7964
7964
|
),
|
|
7965
7965
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7966
|
-
|
|
7966
|
+
chunkRHKFCSFC_cjs.ActiveSessionsDialog,
|
|
7967
7967
|
{
|
|
7968
7968
|
open,
|
|
7969
7969
|
onOpenChange: setOpen,
|
|
@@ -8005,7 +8005,7 @@ function ConnectedLogoutDialog({
|
|
|
8005
8005
|
signOut.mutate({ everywhere, reason: "manual" });
|
|
8006
8006
|
};
|
|
8007
8007
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
8008
|
-
|
|
8008
|
+
chunkRHKFCSFC_cjs.LogoutDialog,
|
|
8009
8009
|
{
|
|
8010
8010
|
open,
|
|
8011
8011
|
onClose,
|
|
@@ -8013,7 +8013,7 @@ function ConnectedLogoutDialog({
|
|
|
8013
8013
|
onLogoutAll: () => void run(true),
|
|
8014
8014
|
canLogoutAll,
|
|
8015
8015
|
isOnline,
|
|
8016
|
-
sessions:
|
|
8016
|
+
sessions: chunkRHKFCSFC_cjs.toLogoutSessionViews(sessions.data ?? []),
|
|
8017
8017
|
renderSessionIcon
|
|
8018
8018
|
}
|
|
8019
8019
|
);
|
|
@@ -8055,12 +8055,12 @@ function ConnectedDangerZone({ renderSubscriptionLink }) {
|
|
|
8055
8055
|
}
|
|
8056
8056
|
),
|
|
8057
8057
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8058
|
-
|
|
8058
|
+
chunkRHKFCSFC_cjs.DeleteAccountDialog,
|
|
8059
8059
|
{
|
|
8060
8060
|
open: dialogOpen,
|
|
8061
8061
|
onClose: flow.onClose,
|
|
8062
8062
|
step: flow.step,
|
|
8063
|
-
blockers:
|
|
8063
|
+
blockers: chunkRHKFCSFC_cjs.toDeleteBlockerViews(flow.blockers, renderSubscriptionLink),
|
|
8064
8064
|
onContinue: flow.onContinue,
|
|
8065
8065
|
onBack: flow.onBack,
|
|
8066
8066
|
userEmail,
|
|
@@ -8220,7 +8220,7 @@ function ConnectedBoxPortalSection() {
|
|
|
8220
8220
|
function ServerConnectionRow({ onRefresh, ...status }) {
|
|
8221
8221
|
const { runtimeConfig } = chunk2QQUGL2V_cjs.useBlocksEnvironment();
|
|
8222
8222
|
const [isRefreshing, setIsRefreshing] = React7.useState(false);
|
|
8223
|
-
const view =
|
|
8223
|
+
const view = chunkRHKFCSFC_cjs.serverConnectionView(status, runtimeConfig.deploymentDomain || "server");
|
|
8224
8224
|
const refresh = async () => {
|
|
8225
8225
|
setIsRefreshing(true);
|
|
8226
8226
|
try {
|
|
@@ -8230,7 +8230,7 @@ function ServerConnectionRow({ onRefresh, ...status }) {
|
|
|
8230
8230
|
}
|
|
8231
8231
|
};
|
|
8232
8232
|
return /* @__PURE__ */ jsxRuntime.jsx(chunkIRY63R4L_cjs.SettingsRow, { label: "Server connection", description: view.description, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
8233
|
-
|
|
8233
|
+
chunkRHKFCSFC_cjs.ServerConnectionButton,
|
|
8234
8234
|
{
|
|
8235
8235
|
state: view.state,
|
|
8236
8236
|
label: view.label,
|
|
@@ -8640,13 +8640,13 @@ var COLUMNS = [
|
|
|
8640
8640
|
flex: 1,
|
|
8641
8641
|
minWidth: 120,
|
|
8642
8642
|
cellRenderer: (params) => isStandard(params.data) ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
8643
|
-
|
|
8643
|
+
chunkRHKFCSFC_cjs.ModelProviderLabel,
|
|
8644
8644
|
{
|
|
8645
8645
|
logo: /* @__PURE__ */ jsxRuntime.jsx(ui.ArbiIcon, { size: 14, "aria-label": "ARBI", className: "flex-shrink-0 rounded-sm" }),
|
|
8646
8646
|
children: "ARBI CITY"
|
|
8647
8647
|
}
|
|
8648
8648
|
) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
8649
|
-
|
|
8649
|
+
chunkRHKFCSFC_cjs.ModelProviderLabel,
|
|
8650
8650
|
{
|
|
8651
8651
|
logo: /* @__PURE__ */ jsxRuntime.jsx(ui.ProviderIcon, { modelName: params.data?.model_name, provider: params.value, size: 14 }),
|
|
8652
8652
|
children: PROVIDER_NAMES[params.value ?? ""] || params.value || "\u2014"
|
|
@@ -8723,7 +8723,7 @@ function ConnectedPremiumModels() {
|
|
|
8723
8723
|
);
|
|
8724
8724
|
if (premiumModels.length === 0) return null;
|
|
8725
8725
|
return /* @__PURE__ */ jsxRuntime.jsx(chunkIRY63R4L_cjs.SettingsPanel, { className: "max-w-2xl space-y-4", children: /* @__PURE__ */ jsxRuntime.jsx(chunkIRY63R4L_cjs.SettingsSection, { title: "Premium models", children: /* @__PURE__ */ jsxRuntime.jsx(chunkIRY63R4L_cjs.SettingsCard, { className: "space-y-0", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
8726
|
-
|
|
8726
|
+
chunkRHKFCSFC_cjs.PremiumModelsFrame,
|
|
8727
8727
|
{
|
|
8728
8728
|
enabled: premiumModel !== "",
|
|
8729
8729
|
onEnabledChange: (enabled) => {
|
|
@@ -8852,10 +8852,10 @@ function ConnectedAppsSettings({
|
|
|
8852
8852
|
}
|
|
8853
8853
|
};
|
|
8854
8854
|
if (isLoading) {
|
|
8855
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
8855
|
+
return /* @__PURE__ */ jsxRuntime.jsx(chunkRHKFCSFC_cjs.ConnectionsLoading, { message: "Loading connected apps\u2026" });
|
|
8856
8856
|
}
|
|
8857
8857
|
if (catalogError) {
|
|
8858
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
8858
|
+
return /* @__PURE__ */ jsxRuntime.jsx(chunkRHKFCSFC_cjs.ConnectionsError, { message: "Failed to load connector catalog. Please refresh and try again." });
|
|
8859
8859
|
}
|
|
8860
8860
|
const visibleCatalog = catalog.filter((c) => isVendorVisible(c.vendor_key));
|
|
8861
8861
|
const sharePointVisible = isVendorVisible("microsoft_sharepoint");
|
|
@@ -8864,7 +8864,7 @@ function ConnectedAppsSettings({
|
|
|
8864
8864
|
(c) => !react.isMailboxSyncVendor(c.vendor_key) && !react.isSharePointVendor(c.vendor_key)
|
|
8865
8865
|
);
|
|
8866
8866
|
const renderCard = (entry) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
8867
|
-
|
|
8867
|
+
chunkRHKFCSFC_cjs.ConnectionCard,
|
|
8868
8868
|
{
|
|
8869
8869
|
connection: toConnectionCardView(entry, connectedByVendor[entry.vendor_key], {
|
|
8870
8870
|
isDisconnecting: disconnect.isPending && disconnect.variables?.vendorKey === entry.vendor_key,
|
|
@@ -8992,7 +8992,7 @@ function ConnectedAppsSettings({
|
|
|
8992
8992
|
}
|
|
8993
8993
|
)
|
|
8994
8994
|
] }),
|
|
8995
|
-
catalog.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx(chunkIRY63R4L_cjs.SettingsCard, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
8995
|
+
catalog.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx(chunkIRY63R4L_cjs.SettingsCard, { children: /* @__PURE__ */ jsxRuntime.jsx(chunkRHKFCSFC_cjs.ConnectionsEmpty, { message: "No connectors available yet." }) }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
8996
8996
|
renderGroup("Email & Drive", EMAIL_AND_DRIVE_SUBTITLE, /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Mail, {}), emailCatalog),
|
|
8997
8997
|
renderGroup(
|
|
8998
8998
|
"Apps & Integrations (MCP)",
|
|
@@ -9153,7 +9153,7 @@ function StorageItemsTable({
|
|
|
9153
9153
|
}
|
|
9154
9154
|
];
|
|
9155
9155
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
9156
|
-
|
|
9156
|
+
chunkXDU3HHUU_cjs.DataTable,
|
|
9157
9157
|
{
|
|
9158
9158
|
columns,
|
|
9159
9159
|
rows,
|
|
@@ -9498,7 +9498,7 @@ function ConnectedStorageProjectCard({
|
|
|
9498
9498
|
project.personal && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-0.5 text-sm text-muted-foreground", children: "Mail, recordings of calls you host, chat attachments and everything not in a project." })
|
|
9499
9499
|
] }),
|
|
9500
9500
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
9501
|
-
|
|
9501
|
+
chunkRHKFCSFC_cjs.UsageToggle,
|
|
9502
9502
|
{
|
|
9503
9503
|
value: view,
|
|
9504
9504
|
onChange: setView,
|
|
@@ -9583,7 +9583,7 @@ function ConnectedStorageProjectCard({
|
|
|
9583
9583
|
] })
|
|
9584
9584
|
] }),
|
|
9585
9585
|
view === "largest" && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-3", children: [
|
|
9586
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
9586
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkRHKFCSFC_cjs.UsageToggle, { value: kind, onChange: setKind, options: KIND_FILTERS, ariaLabel: "Kind" }),
|
|
9587
9587
|
largest.isLoading ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground", children: "Loading\u2026" }) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
9588
9588
|
StorageItemsTable,
|
|
9589
9589
|
{
|
|
@@ -9833,7 +9833,7 @@ function ConnectedSettingsPage({
|
|
|
9833
9833
|
}, [requested]);
|
|
9834
9834
|
const controlled = section !== void 0;
|
|
9835
9835
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
9836
|
-
|
|
9836
|
+
chunkRHKFCSFC_cjs.SettingsPage,
|
|
9837
9837
|
{
|
|
9838
9838
|
...page,
|
|
9839
9839
|
sections,
|
|
@@ -9865,7 +9865,7 @@ function UsageSettings({ icon: icon2 }) {
|
|
|
9865
9865
|
description: "AI usage today, in \xA3 (ex VAT).",
|
|
9866
9866
|
testId: "settings-usage",
|
|
9867
9867
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
9868
|
-
|
|
9868
|
+
chunkRHKFCSFC_cjs.UsageSummary,
|
|
9869
9869
|
{
|
|
9870
9870
|
stats: [
|
|
9871
9871
|
{
|
|
@@ -9940,6 +9940,62 @@ function organisationSettingsSection({
|
|
|
9940
9940
|
)
|
|
9941
9941
|
};
|
|
9942
9942
|
}
|
|
9943
|
+
function appearanceSettingsSection(options2) {
|
|
9944
|
+
const TabIcon = options2.theme ? lucideReact.Palette : lucideReact.Type;
|
|
9945
|
+
return {
|
|
9946
|
+
id: "appearance",
|
|
9947
|
+
label: "Appearance",
|
|
9948
|
+
icon: /* @__PURE__ */ jsxRuntime.jsx(TabIcon, { className: "w-6 h-6" }),
|
|
9949
|
+
render: () => /* @__PURE__ */ jsxRuntime.jsx(AppearanceSection, { ...options2 })
|
|
9950
|
+
};
|
|
9951
|
+
}
|
|
9952
|
+
function AppearanceSection({
|
|
9953
|
+
appearance,
|
|
9954
|
+
theme,
|
|
9955
|
+
themePreview,
|
|
9956
|
+
icon: icon2 = /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Palette, { className: "size-4" }),
|
|
9957
|
+
description = "Colours and type on this device."
|
|
9958
|
+
}) {
|
|
9959
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
9960
|
+
appearance && /* @__PURE__ */ jsxRuntime.jsx(ReaderAppearance, { bundle: appearance }),
|
|
9961
|
+
theme && /* @__PURE__ */ jsxRuntime.jsx(
|
|
9962
|
+
chunkIRY63R4L_cjs.SettingsSection,
|
|
9963
|
+
{
|
|
9964
|
+
icon: icon2,
|
|
9965
|
+
title: "Appearance",
|
|
9966
|
+
description,
|
|
9967
|
+
testId: appearance ? "settings-appearance-theme" : "settings-appearance",
|
|
9968
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
9969
|
+
chunkKUQOHPKP_cjs.ThemeEditor,
|
|
9970
|
+
{
|
|
9971
|
+
bundle: theme,
|
|
9972
|
+
variant: "collapsed",
|
|
9973
|
+
preview: themePreview,
|
|
9974
|
+
testIdPrefix: "settings-theme"
|
|
9975
|
+
}
|
|
9976
|
+
)
|
|
9977
|
+
}
|
|
9978
|
+
)
|
|
9979
|
+
] });
|
|
9980
|
+
}
|
|
9981
|
+
function ReaderAppearance({ bundle }) {
|
|
9982
|
+
const state = bundle.useStore();
|
|
9983
|
+
const { defaults } = bundle;
|
|
9984
|
+
const isDefault = state.pairingId === defaults.pairingId && state.colorScheme === defaults.colorScheme && state.textSize === defaults.textSize;
|
|
9985
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
9986
|
+
chunkRHKFCSFC_cjs.AppearanceSettings,
|
|
9987
|
+
{
|
|
9988
|
+
colorScheme: state.colorScheme,
|
|
9989
|
+
onColorSchemeChange: state.setColorScheme,
|
|
9990
|
+
textSize: state.textSize,
|
|
9991
|
+
onTextSizeChange: state.setTextSize,
|
|
9992
|
+
pairingId: state.pairingId,
|
|
9993
|
+
onPairingChange: state.setPairing,
|
|
9994
|
+
pairingIds: bundle.pairingIds,
|
|
9995
|
+
onReset: isDefault ? void 0 : state.reset
|
|
9996
|
+
}
|
|
9997
|
+
);
|
|
9998
|
+
}
|
|
9943
9999
|
function ConnectedProjectStorage({ projectExtId }) {
|
|
9944
10000
|
const { data, isLoading } = react.useStorageProjects("mine", projectExtId);
|
|
9945
10001
|
const project = data?.projects.find((p) => p.project_ext_id === projectExtId);
|
|
@@ -10058,7 +10114,7 @@ function ConnectedDeploymentStorage() {
|
|
|
10058
10114
|
deployment.unattributed_bytes > 0 && ` \xB7 ${formatBytes(deployment.unattributed_bytes)} not owned by any project`
|
|
10059
10115
|
] }),
|
|
10060
10116
|
trend.dates.length > 1 && /* @__PURE__ */ jsxRuntime.jsx(
|
|
10061
|
-
|
|
10117
|
+
chunkRHKFCSFC_cjs.UsageLineChart,
|
|
10062
10118
|
{
|
|
10063
10119
|
dates: trend.dates,
|
|
10064
10120
|
series: trend.series,
|
|
@@ -10067,7 +10123,7 @@ function ConnectedDeploymentStorage() {
|
|
|
10067
10123
|
}
|
|
10068
10124
|
),
|
|
10069
10125
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
10070
|
-
|
|
10126
|
+
chunkRHKFCSFC_cjs.UsageToggle,
|
|
10071
10127
|
{
|
|
10072
10128
|
value: view,
|
|
10073
10129
|
onChange: setView,
|
|
@@ -10080,7 +10136,7 @@ function ConnectedDeploymentStorage() {
|
|
|
10080
10136
|
}
|
|
10081
10137
|
),
|
|
10082
10138
|
view === "items" ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
10083
|
-
|
|
10139
|
+
chunkXDU3HHUU_cjs.DataTable,
|
|
10084
10140
|
{
|
|
10085
10141
|
columns: itemColumns,
|
|
10086
10142
|
rows: (items.data?.items ?? []).map((item) => ({ item })),
|
|
@@ -10089,7 +10145,7 @@ function ConnectedDeploymentStorage() {
|
|
|
10089
10145
|
emptyTitle: "Nothing stored yet"
|
|
10090
10146
|
}
|
|
10091
10147
|
) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
10092
|
-
|
|
10148
|
+
chunkXDU3HHUU_cjs.DataTable,
|
|
10093
10149
|
{
|
|
10094
10150
|
columns: projectColumns,
|
|
10095
10151
|
rows: [...view === "people" ? people : projects].sort(byBytes),
|
|
@@ -10542,13 +10598,13 @@ function ConnectedWorkspaceSettings({
|
|
|
10542
10598
|
const [membersExpanded, setMembersExpanded] = React7.useState(false);
|
|
10543
10599
|
const [shareOpen, setShareOpen] = React7.useState(false);
|
|
10544
10600
|
if (!workspace) {
|
|
10545
|
-
return /* @__PURE__ */ jsxRuntime.jsx(chunkKJVDYWAM_cjs.PageLoading, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
10601
|
+
return /* @__PURE__ */ jsxRuntime.jsx(chunkKJVDYWAM_cjs.PageLoading, { children: /* @__PURE__ */ jsxRuntime.jsx(chunkH3XAHVDT_cjs.LoadingIndicator, { message: "Loading workspace..." }) });
|
|
10546
10602
|
}
|
|
10547
10603
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
10548
10604
|
/* @__PURE__ */ jsxRuntime.jsxs(chunkKJVDYWAM_cjs.WorkspacePageFrame, { testId, children: [
|
|
10549
10605
|
/* @__PURE__ */ jsxRuntime.jsxs(chunkKJVDYWAM_cjs.WorkspaceIdentityPanel, { children: [
|
|
10550
10606
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
10551
|
-
|
|
10607
|
+
chunkH3XAHVDT_cjs.EntityIdentityBar,
|
|
10552
10608
|
{
|
|
10553
10609
|
testId: "workspace-identity-bar",
|
|
10554
10610
|
canEdit: isOwner,
|
|
@@ -10565,7 +10621,7 @@ function ConnectedWorkspaceSettings({
|
|
|
10565
10621
|
label: "Name",
|
|
10566
10622
|
value: workspace.name,
|
|
10567
10623
|
placeholder: "Untitled",
|
|
10568
|
-
maxLength:
|
|
10624
|
+
maxLength: chunkH3XAHVDT_cjs.IDENTITY_NAME_MAX_LENGTH,
|
|
10569
10625
|
valueClassName: "truncate text-base font-semibold",
|
|
10570
10626
|
testId: "workspace-home-title",
|
|
10571
10627
|
hideLabel: true,
|
|
@@ -10846,9 +10902,9 @@ function ConnectedMailboxSyncDialog({
|
|
|
10846
10902
|
showDescription: true,
|
|
10847
10903
|
className: "w-[92vw] sm:max-w-lg",
|
|
10848
10904
|
children: [
|
|
10849
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
10850
|
-
!lockedWorkspaceExtId && /* @__PURE__ */ jsxRuntime.jsx(
|
|
10851
|
-
|
|
10905
|
+
/* @__PURE__ */ jsxRuntime.jsxs(chunkRHKFCSFC_cjs.SyncDialogBody, { children: [
|
|
10906
|
+
!lockedWorkspaceExtId && /* @__PURE__ */ jsxRuntime.jsx(chunkRHKFCSFC_cjs.SyncField, { label: "Target workspace", htmlFor: "sync-workspace", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
10907
|
+
chunkRHKFCSFC_cjs.SyncSelect,
|
|
10852
10908
|
{
|
|
10853
10909
|
id: "sync-workspace",
|
|
10854
10910
|
value: workspaceExtId,
|
|
@@ -10857,9 +10913,9 @@ function ConnectedMailboxSyncDialog({
|
|
|
10857
10913
|
options: memberWorkspaces.map((w) => ({ value: w.external_id, label: w.name }))
|
|
10858
10914
|
}
|
|
10859
10915
|
) }),
|
|
10860
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
10916
|
+
/* @__PURE__ */ jsxRuntime.jsxs(chunkRHKFCSFC_cjs.SyncField, { label: "Backfill window", htmlFor: "sync-backfill", children: [
|
|
10861
10917
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
10862
|
-
|
|
10918
|
+
chunkRHKFCSFC_cjs.SyncSelect,
|
|
10863
10919
|
{
|
|
10864
10920
|
id: "sync-backfill",
|
|
10865
10921
|
value: backfill,
|
|
@@ -10879,17 +10935,17 @@ function ConnectedMailboxSyncDialog({
|
|
|
10879
10935
|
"aria-label": "Import emails since date"
|
|
10880
10936
|
}
|
|
10881
10937
|
),
|
|
10882
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
10938
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkRHKFCSFC_cjs.SyncSmallNote, { children: "Emails are always imported from this date onward \u2014 the start point never moves." })
|
|
10883
10939
|
] })
|
|
10884
10940
|
] }),
|
|
10885
10941
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
10886
|
-
|
|
10942
|
+
chunkRHKFCSFC_cjs.SyncField,
|
|
10887
10943
|
{
|
|
10888
10944
|
label: `Folders to import${selectedFolders.length > 0 ? ` (${selectedFolders.length})` : ""}`,
|
|
10889
10945
|
hint: "Select at least one folder to import.",
|
|
10890
|
-
actions: folders.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
10946
|
+
actions: folders.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs(chunkRHKFCSFC_cjs.SyncLinkRow, { children: [
|
|
10891
10947
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
10892
|
-
|
|
10948
|
+
chunkRHKFCSFC_cjs.SyncLinkButton,
|
|
10893
10949
|
{
|
|
10894
10950
|
onClick: () => setExpandAllNonce((n) => n + 1),
|
|
10895
10951
|
testId: "mail-folders-expand-all",
|
|
@@ -10897,20 +10953,20 @@ function ConnectedMailboxSyncDialog({
|
|
|
10897
10953
|
}
|
|
10898
10954
|
),
|
|
10899
10955
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
10900
|
-
|
|
10956
|
+
chunkRHKFCSFC_cjs.SyncLinkButton,
|
|
10901
10957
|
{
|
|
10902
10958
|
onClick: () => setCollapseAllNonce((n) => n + 1),
|
|
10903
10959
|
testId: "mail-folders-collapse-all",
|
|
10904
10960
|
children: "Collapse all"
|
|
10905
10961
|
}
|
|
10906
10962
|
),
|
|
10907
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
10963
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkRHKFCSFC_cjs.SyncLinkButton, { onClick: toggleAllFolders, children: allSelected ? "Clear all" : "Select all" })
|
|
10908
10964
|
] }),
|
|
10909
|
-
children: foldersLoading ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
10965
|
+
children: foldersLoading ? /* @__PURE__ */ jsxRuntime.jsx(chunkRHKFCSFC_cjs.SyncLoading, { children: "Loading folders\u2026" }) : foldersError ? (
|
|
10910
10966
|
// A failed fetch is not an empty mailbox: it hides auth/scope errors (e.g. a Gmail
|
|
10911
10967
|
// account needing reconnect).
|
|
10912
10968
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
10913
|
-
|
|
10969
|
+
chunkRHKFCSFC_cjs.SyncReconnectNotice,
|
|
10914
10970
|
{
|
|
10915
10971
|
message: `Couldn\u2019t load folders from ${catalog.display_name}. Reconnect the account and try again.`,
|
|
10916
10972
|
onReconnect: () => void reconnect(),
|
|
@@ -10918,7 +10974,7 @@ function ConnectedMailboxSyncDialog({
|
|
|
10918
10974
|
testId: "folders-reconnect"
|
|
10919
10975
|
}
|
|
10920
10976
|
)
|
|
10921
|
-
) : folders.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
10977
|
+
) : folders.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx(chunkRHKFCSFC_cjs.SyncNote, { children: "No folders found." }) : /* @__PURE__ */ jsxRuntime.jsx(chunkRHKFCSFC_cjs.SyncTreeFrame, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
10922
10978
|
chunkWUG24K7P_cjs.MailFolderTree,
|
|
10923
10979
|
{
|
|
10924
10980
|
nodes: folderTree,
|
|
@@ -10930,9 +10986,9 @@ function ConnectedMailboxSyncDialog({
|
|
|
10930
10986
|
) })
|
|
10931
10987
|
}
|
|
10932
10988
|
),
|
|
10933
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
10989
|
+
/* @__PURE__ */ jsxRuntime.jsxs(chunkRHKFCSFC_cjs.SyncOptions, { children: [
|
|
10934
10990
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
10935
|
-
|
|
10991
|
+
chunkRHKFCSFC_cjs.SyncOptionToggle,
|
|
10936
10992
|
{
|
|
10937
10993
|
checked: skipDuplicates,
|
|
10938
10994
|
onCheckedChange: setSkipDuplicates,
|
|
@@ -10942,7 +10998,7 @@ function ConnectedMailboxSyncDialog({
|
|
|
10942
10998
|
}
|
|
10943
10999
|
),
|
|
10944
11000
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
10945
|
-
|
|
11001
|
+
chunkRHKFCSFC_cjs.SyncOptionToggle,
|
|
10946
11002
|
{
|
|
10947
11003
|
checked: autoRename,
|
|
10948
11004
|
onCheckedChange: setAutoRename,
|
|
@@ -10952,7 +11008,7 @@ function ConnectedMailboxSyncDialog({
|
|
|
10952
11008
|
}
|
|
10953
11009
|
),
|
|
10954
11010
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
10955
|
-
|
|
11011
|
+
chunkRHKFCSFC_cjs.SyncOptionToggle,
|
|
10956
11012
|
{
|
|
10957
11013
|
checked: shared,
|
|
10958
11014
|
onCheckedChange: setShared,
|
|
@@ -10962,7 +11018,7 @@ function ConnectedMailboxSyncDialog({
|
|
|
10962
11018
|
}
|
|
10963
11019
|
),
|
|
10964
11020
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
10965
|
-
|
|
11021
|
+
chunkRHKFCSFC_cjs.SyncOptionToggle,
|
|
10966
11022
|
{
|
|
10967
11023
|
checked: autoSync,
|
|
10968
11024
|
onCheckedChange: setAutoSync,
|
|
@@ -10974,7 +11030,7 @@ function ConnectedMailboxSyncDialog({
|
|
|
10974
11030
|
] })
|
|
10975
11031
|
] }),
|
|
10976
11032
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
10977
|
-
|
|
11033
|
+
chunkRHKFCSFC_cjs.SyncDialogFooter,
|
|
10978
11034
|
{
|
|
10979
11035
|
onCancel: () => onOpenChange(false),
|
|
10980
11036
|
onSave: handleEnableSubmit,
|
|
@@ -11036,7 +11092,7 @@ function DriveFolderNode({
|
|
|
11036
11092
|
const mightHaveChildren = docCount == null || docCount > 0;
|
|
11037
11093
|
const orderedChildren = [...children].sort((a, b) => a.name.localeCompare(b.name));
|
|
11038
11094
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
11039
|
-
|
|
11095
|
+
chunkRHKFCSFC_cjs.SyncFolderRow,
|
|
11040
11096
|
{
|
|
11041
11097
|
id: folder.id,
|
|
11042
11098
|
name: folder.name,
|
|
@@ -11050,7 +11106,7 @@ function DriveFolderNode({
|
|
|
11050
11106
|
onCheckedChange: () => onToggle(folder.id),
|
|
11051
11107
|
count: typeof docCount === "number" ? docCount : void 0,
|
|
11052
11108
|
isCountLoading: isSelectable && countLoading,
|
|
11053
|
-
children: isLoading ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
11109
|
+
children: isLoading ? /* @__PURE__ */ jsxRuntime.jsx(chunkRHKFCSFC_cjs.SyncFolderStatus, { depth, kind: "loading" }) : orderedChildren.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx(chunkRHKFCSFC_cjs.SyncFolderStatus, { depth, kind: "empty" }) : orderedChildren.map((child) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
11054
11110
|
DriveFolderNode,
|
|
11055
11111
|
{
|
|
11056
11112
|
vendorKey,
|
|
@@ -11196,9 +11252,9 @@ function ConnectedDriveSyncDialog({
|
|
|
11196
11252
|
showDescription: true,
|
|
11197
11253
|
className: "w-[92vw] sm:max-w-lg",
|
|
11198
11254
|
children: [
|
|
11199
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
11200
|
-
!lockedWorkspaceExtId && /* @__PURE__ */ jsxRuntime.jsx(
|
|
11201
|
-
|
|
11255
|
+
/* @__PURE__ */ jsxRuntime.jsxs(chunkRHKFCSFC_cjs.SyncDialogBody, { children: [
|
|
11256
|
+
!lockedWorkspaceExtId && /* @__PURE__ */ jsxRuntime.jsx(chunkRHKFCSFC_cjs.SyncField, { label: "Target workspace", htmlFor: "drive-sync-workspace", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
11257
|
+
chunkRHKFCSFC_cjs.SyncSelect,
|
|
11202
11258
|
{
|
|
11203
11259
|
id: "drive-sync-workspace",
|
|
11204
11260
|
value: workspaceExtId,
|
|
@@ -11208,13 +11264,13 @@ function ConnectedDriveSyncDialog({
|
|
|
11208
11264
|
}
|
|
11209
11265
|
) }),
|
|
11210
11266
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
11211
|
-
|
|
11267
|
+
chunkRHKFCSFC_cjs.SyncField,
|
|
11212
11268
|
{
|
|
11213
11269
|
label: `Folders to import${selectedFolders.length > 0 ? ` (${selectedFolders.length})` : ""}`,
|
|
11214
11270
|
hint: "Select at least one folder. Importing a folder includes everything inside it.",
|
|
11215
|
-
actions: orderedFolders.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
11271
|
+
actions: orderedFolders.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs(chunkRHKFCSFC_cjs.SyncLinkRow, { children: [
|
|
11216
11272
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
11217
|
-
|
|
11273
|
+
chunkRHKFCSFC_cjs.SyncLinkButton,
|
|
11218
11274
|
{
|
|
11219
11275
|
onClick: () => setExpandAllNonce((n) => n + 1),
|
|
11220
11276
|
testId: "drive-folders-expand-all",
|
|
@@ -11222,7 +11278,7 @@ function ConnectedDriveSyncDialog({
|
|
|
11222
11278
|
}
|
|
11223
11279
|
),
|
|
11224
11280
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
11225
|
-
|
|
11281
|
+
chunkRHKFCSFC_cjs.SyncLinkButton,
|
|
11226
11282
|
{
|
|
11227
11283
|
onClick: () => setCollapseAllNonce((n) => n + 1),
|
|
11228
11284
|
testId: "drive-folders-collapse-all",
|
|
@@ -11230,19 +11286,19 @@ function ConnectedDriveSyncDialog({
|
|
|
11230
11286
|
}
|
|
11231
11287
|
)
|
|
11232
11288
|
] }),
|
|
11233
|
-
children: foldersLoading ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
11234
|
-
|
|
11289
|
+
children: foldersLoading ? /* @__PURE__ */ jsxRuntime.jsx(chunkRHKFCSFC_cjs.SyncLoading, { children: "Loading folders\u2026" }) : needsReconnect ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
11290
|
+
chunkRHKFCSFC_cjs.SyncReconnectNotice,
|
|
11235
11291
|
{
|
|
11236
11292
|
...reconnectButtonProps,
|
|
11237
11293
|
message: `Reconnect ${catalog.display_name} to enable ${productName} \u2014 your account needs to grant file access.`
|
|
11238
11294
|
}
|
|
11239
11295
|
) : foldersError ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
11240
|
-
|
|
11296
|
+
chunkRHKFCSFC_cjs.SyncReconnectNotice,
|
|
11241
11297
|
{
|
|
11242
11298
|
...reconnectButtonProps,
|
|
11243
11299
|
message: `Couldn\u2019t load folders from ${productName}. Reconnect the account and try again.`
|
|
11244
11300
|
}
|
|
11245
|
-
) : orderedFolders.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
11301
|
+
) : orderedFolders.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx(chunkRHKFCSFC_cjs.SyncNote, { children: "No folders found." }) : /* @__PURE__ */ jsxRuntime.jsx(chunkRHKFCSFC_cjs.SyncTreeFrame, { children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-0.5", "data-testid": "drive-folder-tree", children: orderedFolders.map((f) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
11246
11302
|
DriveFolderNode,
|
|
11247
11303
|
{
|
|
11248
11304
|
vendorKey: catalog.vendor_key,
|
|
@@ -11259,9 +11315,9 @@ function ConnectedDriveSyncDialog({
|
|
|
11259
11315
|
)) }) })
|
|
11260
11316
|
}
|
|
11261
11317
|
),
|
|
11262
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
11318
|
+
/* @__PURE__ */ jsxRuntime.jsxs(chunkRHKFCSFC_cjs.SyncOptions, { children: [
|
|
11263
11319
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
11264
|
-
|
|
11320
|
+
chunkRHKFCSFC_cjs.SyncOptionToggle,
|
|
11265
11321
|
{
|
|
11266
11322
|
checked: skipDuplicates,
|
|
11267
11323
|
onCheckedChange: setSkipDuplicates,
|
|
@@ -11270,7 +11326,7 @@ function ConnectedDriveSyncDialog({
|
|
|
11270
11326
|
}
|
|
11271
11327
|
),
|
|
11272
11328
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
11273
|
-
|
|
11329
|
+
chunkRHKFCSFC_cjs.SyncOptionToggle,
|
|
11274
11330
|
{
|
|
11275
11331
|
checked: autoRename,
|
|
11276
11332
|
onCheckedChange: setAutoRename,
|
|
@@ -11279,7 +11335,7 @@ function ConnectedDriveSyncDialog({
|
|
|
11279
11335
|
}
|
|
11280
11336
|
),
|
|
11281
11337
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
11282
|
-
|
|
11338
|
+
chunkRHKFCSFC_cjs.SyncOptionToggle,
|
|
11283
11339
|
{
|
|
11284
11340
|
checked: shared,
|
|
11285
11341
|
onCheckedChange: setShared,
|
|
@@ -11288,7 +11344,7 @@ function ConnectedDriveSyncDialog({
|
|
|
11288
11344
|
}
|
|
11289
11345
|
),
|
|
11290
11346
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
11291
|
-
|
|
11347
|
+
chunkRHKFCSFC_cjs.SyncOptionToggle,
|
|
11292
11348
|
{
|
|
11293
11349
|
checked: autoSync,
|
|
11294
11350
|
onCheckedChange: setAutoSync,
|
|
@@ -11300,7 +11356,7 @@ function ConnectedDriveSyncDialog({
|
|
|
11300
11356
|
] })
|
|
11301
11357
|
] }),
|
|
11302
11358
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
11303
|
-
|
|
11359
|
+
chunkRHKFCSFC_cjs.SyncDialogFooter,
|
|
11304
11360
|
{
|
|
11305
11361
|
onCancel: () => onOpenChange(false),
|
|
11306
11362
|
onSave: handleEnableSubmit,
|
|
@@ -11372,7 +11428,7 @@ function BillingProjectEntity({
|
|
|
11372
11428
|
subscription = "none",
|
|
11373
11429
|
...props
|
|
11374
11430
|
}) {
|
|
11375
|
-
const { stripeEnabled } =
|
|
11431
|
+
const { stripeEnabled } = chunkLYF47OXX_cjs.useBillingSupport();
|
|
11376
11432
|
const isPaid2 = stripeEnabled && (subscription === "active" || subscription === "past_due" || subscription === "dev");
|
|
11377
11433
|
return /* @__PURE__ */ jsxRuntime.jsx(ui.ProjectEntity, { ...props, subscription, isPaid: isPaid2 });
|
|
11378
11434
|
}
|
|
@@ -11399,8 +11455,8 @@ function InvoicesModal({
|
|
|
11399
11455
|
key: inv.number ?? String(i),
|
|
11400
11456
|
date: formatInvoiceDate(inv.date),
|
|
11401
11457
|
kind: KIND_LABELS2[inv.kind],
|
|
11402
|
-
amount:
|
|
11403
|
-
amountNote: inv.amount_ex_vat != null && inv.amount_ex_vat !== inv.amount ? `${
|
|
11458
|
+
amount: chunkLYF47OXX_cjs.formatMoney(inv.amount, inv.currency),
|
|
11459
|
+
amountNote: inv.amount_ex_vat != null && inv.amount_ex_vat !== inv.amount ? `${chunkLYF47OXX_cjs.formatMoney(inv.amount_ex_vat, inv.currency)} ex VAT` : void 0,
|
|
11404
11460
|
status: inv.status,
|
|
11405
11461
|
isPaid: isPaid2,
|
|
11406
11462
|
href: inv.hosted_invoice_url ?? inv.url ?? inv.pdf_url ?? void 0,
|
|
@@ -11408,7 +11464,7 @@ function InvoicesModal({
|
|
|
11408
11464
|
};
|
|
11409
11465
|
});
|
|
11410
11466
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
11411
|
-
|
|
11467
|
+
chunkRHKFCSFC_cjs.InvoicesDialog,
|
|
11412
11468
|
{
|
|
11413
11469
|
open,
|
|
11414
11470
|
onOpenChange,
|
|
@@ -11435,7 +11491,7 @@ function StripeCheckoutModal({
|
|
|
11435
11491
|
const [clientSecret, setClientSecret] = React7.useState(null);
|
|
11436
11492
|
const [isCreating, setIsCreating] = React7.useState(false);
|
|
11437
11493
|
const [stripe, setStripe] = React7.useState(null);
|
|
11438
|
-
const { stripeEnabled, checkout } =
|
|
11494
|
+
const { stripeEnabled, checkout } = chunkLYF47OXX_cjs.useBillingSupport();
|
|
11439
11495
|
const createCheckout = react.useCreateProjectCheckout();
|
|
11440
11496
|
const refreshProject = react.useRefreshProject();
|
|
11441
11497
|
const invalidateProjects = react.useInvalidateProjects();
|
|
@@ -11462,7 +11518,7 @@ function StripeCheckoutModal({
|
|
|
11462
11518
|
projectExtId,
|
|
11463
11519
|
body: {
|
|
11464
11520
|
interval,
|
|
11465
|
-
packs:
|
|
11521
|
+
packs: chunkLYF47OXX_cjs.PRO_PACKS,
|
|
11466
11522
|
ai_blocks: aiBlocks,
|
|
11467
11523
|
storage_blocks: storageBlocks,
|
|
11468
11524
|
addon_budget_pence: addonBudgetPence,
|
|
@@ -11478,7 +11534,7 @@ function StripeCheckoutModal({
|
|
|
11478
11534
|
},
|
|
11479
11535
|
onError: (error) => {
|
|
11480
11536
|
console.error("Failed to create checkout session:", error);
|
|
11481
|
-
const reason =
|
|
11537
|
+
const reason = chunkLYF47OXX_cjs.apiErrorDetail(error)?.message;
|
|
11482
11538
|
shell.notify.error(
|
|
11483
11539
|
reason ? `Checkout didn't start: ${reason}` : "Checkout didn't start. Try again."
|
|
11484
11540
|
);
|
|
@@ -11511,9 +11567,9 @@ function StripeCheckoutModal({
|
|
|
11511
11567
|
}
|
|
11512
11568
|
}, [open]);
|
|
11513
11569
|
const isStripeConfigured = stripeEnabled;
|
|
11514
|
-
const vatNote = quote ? `${
|
|
11570
|
+
const vatNote = quote ? `${chunkLYF47OXX_cjs.checkoutItemsLabel(aiBlocks, storageBlocks)} \xB7 ${chunkLYF47OXX_cjs.quoteTotalLine(quote)}` : null;
|
|
11515
11571
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
11516
|
-
|
|
11572
|
+
chunkRHKFCSFC_cjs.CheckoutDialogFrame,
|
|
11517
11573
|
{
|
|
11518
11574
|
open,
|
|
11519
11575
|
onOpenChange,
|
|
@@ -11523,7 +11579,7 @@ function StripeCheckoutModal({
|
|
|
11523
11579
|
children: clientSecret && !!stripe && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
11524
11580
|
vatNote && /* @__PURE__ */ jsxRuntime.jsx("p", { "data-testid": "checkout-vat-note", className: "mb-4 text-sm text-muted-foreground", children: vatNote }),
|
|
11525
11581
|
checkout?.render(stripe, { clientSecret, onComplete: handleComplete }),
|
|
11526
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-3", children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
11582
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-3", children: /* @__PURE__ */ jsxRuntime.jsxs(chunkRHKFCSFC_cjs.MoreInfo, { title: "Paying", label: "Payment help", testId: "checkout-payment-help", children: [
|
|
11527
11583
|
/* @__PURE__ */ jsxRuntime.jsx("p", { "data-testid": "checkout-decline-note", children: "Card declined? Nothing was charged. Try again or use another card." }),
|
|
11528
11584
|
/* @__PURE__ */ jsxRuntime.jsx("p", { "data-testid": "checkout-vat-id-note", children: "No VAT number? Leave \u2018purchasing as a business\u2019 unticked." }),
|
|
11529
11585
|
/* @__PURE__ */ jsxRuntime.jsx("p", { children: "Add-ons chosen here are on the first invoice with the plan and renew with it until you reduce them." })
|
|
@@ -11565,31 +11621,31 @@ function defaultBillingCountry(languages = typeof navigator === "undefined" ? []
|
|
|
11565
11621
|
}
|
|
11566
11622
|
var choiceForPacks = (packs) => packs > 0 ? "pro" : "free";
|
|
11567
11623
|
function proCard(selected, isAnnual, prices) {
|
|
11568
|
-
const packs =
|
|
11624
|
+
const packs = chunkLYF47OXX_cjs.PLAN_CHOICE_PACKS.pro;
|
|
11569
11625
|
const currency = prices.monthly?.currency ?? prices.annual?.currency ?? "gbp";
|
|
11570
|
-
const monthly =
|
|
11571
|
-
const annual =
|
|
11626
|
+
const monthly = chunkLYF47OXX_cjs.packPrice(prices.monthly, packs);
|
|
11627
|
+
const annual = chunkLYF47OXX_cjs.packPrice(prices.annual, packs);
|
|
11572
11628
|
const current2 = isAnnual ? annual : monthly;
|
|
11573
11629
|
const effectiveMonthly = current2 ? isAnnual ? current2.amount_ex_vat / 12 : current2.amount_ex_vat : null;
|
|
11574
11630
|
return {
|
|
11575
11631
|
id: packs,
|
|
11576
|
-
name:
|
|
11632
|
+
name: chunkLYF47OXX_cjs.planNameForPacks(packs),
|
|
11577
11633
|
isSelected: selected === "pro",
|
|
11578
11634
|
price: current2 && effectiveMonthly != null ? {
|
|
11579
11635
|
annual: isAnnual,
|
|
11580
|
-
yearlyStrike: isAnnual && monthly && monthly.amount_ex_vat * 12 > current2.amount_ex_vat ?
|
|
11581
|
-
yearlyTotal: isAnnual ?
|
|
11636
|
+
yearlyStrike: isAnnual && monthly && monthly.amount_ex_vat * 12 > current2.amount_ex_vat ? chunkLYF47OXX_cjs.formatMoney(monthly.amount_ex_vat * 12, currency) : void 0,
|
|
11637
|
+
yearlyTotal: isAnnual ? chunkLYF47OXX_cjs.formatMoney(current2.amount_ex_vat, currency) : void 0,
|
|
11582
11638
|
intervalLabel: isAnnual ? "/yr + VAT" : "/mo",
|
|
11583
|
-
monthly:
|
|
11639
|
+
monthly: chunkLYF47OXX_cjs.formatMoney(Math.round(effectiveMonthly), currency),
|
|
11584
11640
|
taxLabel: "+ VAT",
|
|
11585
11641
|
// The inclusive figure for a UK customer, right under the headline.
|
|
11586
|
-
note: `${
|
|
11642
|
+
note: `${chunkLYF47OXX_cjs.formatMoney(current2.amount, currency)}${isAnnual ? "/yr" : "/mo"} incl. UK VAT`
|
|
11587
11643
|
} : void 0,
|
|
11588
11644
|
features: [
|
|
11589
|
-
`${react.formatGbp(
|
|
11590
|
-
`${
|
|
11645
|
+
`${react.formatGbp(chunkLYF47OXX_cjs.PRO_AI_GBP)} of AI usage / month`,
|
|
11646
|
+
`${chunkLYF47OXX_cjs.PRO_STORAGE_GB} GB storage`,
|
|
11591
11647
|
"Unlimited collaborators",
|
|
11592
|
-
...isAnnual ? [
|
|
11648
|
+
...isAnnual ? [chunkLYF47OXX_cjs.ANNUAL_PREMIUM_AI_NOTE] : []
|
|
11593
11649
|
]
|
|
11594
11650
|
};
|
|
11595
11651
|
}
|
|
@@ -11601,9 +11657,9 @@ function buildPlanCards(selected, isAnnual, prices, isOnFree) {
|
|
|
11601
11657
|
isCurrent: isOnFree,
|
|
11602
11658
|
isSelected: selected === "free" && !isOnFree,
|
|
11603
11659
|
features: [
|
|
11604
|
-
`${react.formatGbp(
|
|
11605
|
-
`${
|
|
11606
|
-
|
|
11660
|
+
`${react.formatGbp(chunkLYF47OXX_cjs.FREE_AI_GBP)} of AI usage / month`,
|
|
11661
|
+
`${chunkLYF47OXX_cjs.FREE_STORAGE_MB.toLocaleString("en-US")} MB storage`,
|
|
11662
|
+
chunkLYF47OXX_cjs.FREE_COLLABORATORS === 0 ? "Just you" : `${chunkLYF47OXX_cjs.FREE_COLLABORATORS} collaborators`
|
|
11607
11663
|
]
|
|
11608
11664
|
};
|
|
11609
11665
|
return [free, proCard(selected, isAnnual, prices)];
|
|
@@ -11616,7 +11672,7 @@ function PlanChoiceCards({
|
|
|
11616
11672
|
isOnFree = false
|
|
11617
11673
|
}) {
|
|
11618
11674
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
11619
|
-
|
|
11675
|
+
chunkRHKFCSFC_cjs.PlanCardGrid,
|
|
11620
11676
|
{
|
|
11621
11677
|
plans: buildPlanCards(selected, isAnnual, prices, isOnFree),
|
|
11622
11678
|
onSelect: (id) => onSelect(choiceForPacks(id))
|
|
@@ -11625,13 +11681,13 @@ function PlanChoiceCards({
|
|
|
11625
11681
|
}
|
|
11626
11682
|
function PlanInfoPopover2() {
|
|
11627
11683
|
const { openSettings } = chunk2QQUGL2V_cjs.useBlocksEnvironment();
|
|
11628
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
11684
|
+
return /* @__PURE__ */ jsxRuntime.jsx(chunkRHKFCSFC_cjs.PlanInfoPopover, { onOpenModelList: () => openSettings("chat") });
|
|
11629
11685
|
}
|
|
11630
11686
|
function CheckoutAddonBudget({
|
|
11631
11687
|
value,
|
|
11632
11688
|
onChange
|
|
11633
11689
|
}) {
|
|
11634
|
-
const budget =
|
|
11690
|
+
const budget = chunkLYF47OXX_cjs.parseBudgetPounds(value);
|
|
11635
11691
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
11636
11692
|
"div",
|
|
11637
11693
|
{
|
|
@@ -11654,7 +11710,7 @@ function CheckoutAddonBudget({
|
|
|
11654
11710
|
step: 25,
|
|
11655
11711
|
className: "h-8 w-24",
|
|
11656
11712
|
value,
|
|
11657
|
-
placeholder: String(
|
|
11713
|
+
placeholder: String(chunkLYF47OXX_cjs.DEFAULT_SPEND_CAP_PENCE / 100),
|
|
11658
11714
|
onChange: (e) => onChange(e.target.value),
|
|
11659
11715
|
"aria-invalid": budget === void 0,
|
|
11660
11716
|
"data-testid": "checkout-addon-budget-input"
|
|
@@ -11672,7 +11728,7 @@ function BlockStepper({
|
|
|
11672
11728
|
onChange,
|
|
11673
11729
|
testId
|
|
11674
11730
|
}) {
|
|
11675
|
-
const set2 = (n) => onChange(Math.max(0, Math.min(
|
|
11731
|
+
const set2 = (n) => onChange(Math.max(0, Math.min(chunkLYF47OXX_cjs.MAX_CHECKOUT_BLOCKS, n)));
|
|
11676
11732
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
11677
11733
|
"div",
|
|
11678
11734
|
{
|
|
@@ -11716,7 +11772,7 @@ function BlockStepper({
|
|
|
11716
11772
|
className: "size-8",
|
|
11717
11773
|
"aria-label": `More: ${label}`,
|
|
11718
11774
|
onClick: () => set2(value + 1),
|
|
11719
|
-
disabled: value >=
|
|
11775
|
+
disabled: value >= chunkLYF47OXX_cjs.MAX_CHECKOUT_BLOCKS,
|
|
11720
11776
|
"data-testid": `${testId}-increment`,
|
|
11721
11777
|
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Plus, { className: "size-4" })
|
|
11722
11778
|
}
|
|
@@ -11733,8 +11789,8 @@ function CheckoutAddonBlocks({
|
|
|
11733
11789
|
onStorageBlocksChange,
|
|
11734
11790
|
price
|
|
11735
11791
|
}) {
|
|
11736
|
-
const ai =
|
|
11737
|
-
const storage =
|
|
11792
|
+
const ai = chunkLYF47OXX_cjs.addonPrice(price, "ai_usage");
|
|
11793
|
+
const storage = chunkLYF47OXX_cjs.addonPrice(price, "storage");
|
|
11738
11794
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
11739
11795
|
"div",
|
|
11740
11796
|
{
|
|
@@ -11744,8 +11800,8 @@ function CheckoutAddonBlocks({
|
|
|
11744
11800
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
11745
11801
|
BlockStepper,
|
|
11746
11802
|
{
|
|
11747
|
-
label: `+${react.formatGbp(ai?.ai_gbp ||
|
|
11748
|
-
priceText:
|
|
11803
|
+
label: `+${react.formatGbp(ai?.ai_gbp || chunkLYF47OXX_cjs.ADDON_BLOCK_AI_GBP)} of AI usage`,
|
|
11804
|
+
priceText: chunkLYF47OXX_cjs.checkoutBlockPriceText(price, "ai_usage"),
|
|
11749
11805
|
value: aiBlocks,
|
|
11750
11806
|
onChange: onAiBlocksChange,
|
|
11751
11807
|
testId: "checkout-ai-blocks"
|
|
@@ -11754,8 +11810,8 @@ function CheckoutAddonBlocks({
|
|
|
11754
11810
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
11755
11811
|
BlockStepper,
|
|
11756
11812
|
{
|
|
11757
|
-
label: `+${storage?.storage_gb ||
|
|
11758
|
-
priceText:
|
|
11813
|
+
label: `+${storage?.storage_gb || chunkLYF47OXX_cjs.STORAGE_BLOCK_GB} GB storage`,
|
|
11814
|
+
priceText: chunkLYF47OXX_cjs.checkoutBlockPriceText(price, "storage"),
|
|
11759
11815
|
value: storageBlocks,
|
|
11760
11816
|
onChange: onStorageBlocksChange,
|
|
11761
11817
|
testId: "checkout-storage-blocks"
|
|
@@ -11810,14 +11866,14 @@ function ConnectedReferralRewardSummary({
|
|
|
11810
11866
|
if (!reward) return null;
|
|
11811
11867
|
const applied = totalCents != null && currency ? applyReferralReward(totalCents, reward, currency) : null;
|
|
11812
11868
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
11813
|
-
|
|
11869
|
+
chunkRHKFCSFC_cjs.ReferralRewardSummary,
|
|
11814
11870
|
{
|
|
11815
|
-
amountLabel:
|
|
11871
|
+
amountLabel: chunkLYF47OXX_cjs.formatMoney(reward.amount, reward.currency),
|
|
11816
11872
|
breakdown: applied && totalCents != null && currency ? {
|
|
11817
|
-
subtotal:
|
|
11818
|
-
reward:
|
|
11819
|
-
youPay:
|
|
11820
|
-
rollover: applied.remaining > 0 ?
|
|
11873
|
+
subtotal: chunkLYF47OXX_cjs.formatMoney(totalCents, currency),
|
|
11874
|
+
reward: chunkLYF47OXX_cjs.formatMoney(applied.bonus, currency),
|
|
11875
|
+
youPay: chunkLYF47OXX_cjs.formatMoney(applied.youPay, currency),
|
|
11876
|
+
rollover: applied.remaining > 0 ? chunkLYF47OXX_cjs.formatMoney(applied.remaining, currency) : void 0
|
|
11821
11877
|
} : void 0
|
|
11822
11878
|
}
|
|
11823
11879
|
);
|
|
@@ -11825,7 +11881,7 @@ function ConnectedReferralRewardSummary({
|
|
|
11825
11881
|
function ConnectedReferralRewardNote() {
|
|
11826
11882
|
const reward = useReferralReward();
|
|
11827
11883
|
if (!reward) return null;
|
|
11828
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
11884
|
+
return /* @__PURE__ */ jsxRuntime.jsx(chunkRHKFCSFC_cjs.ReferralRewardNote, { amountLabel: chunkLYF47OXX_cjs.formatMoney(reward.amount, reward.currency) });
|
|
11829
11885
|
}
|
|
11830
11886
|
function CheckoutTotal({
|
|
11831
11887
|
state,
|
|
@@ -11854,7 +11910,7 @@ function CheckoutTotal({
|
|
|
11854
11910
|
className: "text-sm font-medium text-foreground",
|
|
11855
11911
|
"data-testid": "checkout-total",
|
|
11856
11912
|
"aria-live": "polite",
|
|
11857
|
-
children: state.quote && !state.isLoading ?
|
|
11913
|
+
children: state.quote && !state.isLoading ? chunkLYF47OXX_cjs.quoteTotalLine(state.quote) : state.isLoading ? "Calculating total\u2026" : state.error
|
|
11858
11914
|
}
|
|
11859
11915
|
)
|
|
11860
11916
|
] });
|
|
@@ -11887,13 +11943,13 @@ function useCheckoutQuote({
|
|
|
11887
11943
|
...aiBlocks || storageBlocks ? { addons: { ai_usage: aiBlocks, storage: storageBlocks } } : {}
|
|
11888
11944
|
} : null
|
|
11889
11945
|
);
|
|
11890
|
-
const { code, message } = query.isError ?
|
|
11891
|
-
const locationInvalid = code ===
|
|
11946
|
+
const { code, message } = query.isError ? chunkLYF47OXX_cjs.quoteError(query.error) : {};
|
|
11947
|
+
const locationInvalid = code === chunkLYF47OXX_cjs.TAX_LOCATION_INVALID;
|
|
11892
11948
|
const isLoading = enabled && (query.isLoading || postal !== postalCode.trim());
|
|
11893
11949
|
return {
|
|
11894
11950
|
quote: query.data,
|
|
11895
11951
|
isLoading,
|
|
11896
|
-
showPostcode:
|
|
11952
|
+
showPostcode: chunkLYF47OXX_cjs.POSTCODE_COUNTRIES.includes(country) || locationInvalid || postalCode !== "",
|
|
11897
11953
|
error: query.isError ? locationInvalid ? message ?? "Enter your ZIP / postal code to see the total." : message ?? "Couldn't calculate tax. Stripe shows the total next." : null,
|
|
11898
11954
|
canContinue: !isLoading && (!!query.data || query.isError && !locationInvalid)
|
|
11899
11955
|
};
|
|
@@ -11902,7 +11958,7 @@ function SubscriptionPlans({ projectExtId, onDismiss }) {
|
|
|
11902
11958
|
const { data: products, isLoading, error } = react.useProducts();
|
|
11903
11959
|
const [isAnnual, setIsAnnual] = React7.useState(false);
|
|
11904
11960
|
const [promoCode, setPromoCode] = React7.useState("");
|
|
11905
|
-
const [addonBudget, setAddonBudget] = React7.useState(String(
|
|
11961
|
+
const [addonBudget, setAddonBudget] = React7.useState(String(chunkLYF47OXX_cjs.DEFAULT_SPEND_CAP_PENCE / 100));
|
|
11906
11962
|
const [checkoutBudget, setCheckoutBudget] = React7.useState(null);
|
|
11907
11963
|
const [aiBlocks, setAiBlocks] = React7.useState(0);
|
|
11908
11964
|
const [storageBlocks, setStorageBlocks] = React7.useState(0);
|
|
@@ -11920,31 +11976,31 @@ function SubscriptionPlans({ projectExtId, onDismiss }) {
|
|
|
11920
11976
|
storageBlocks,
|
|
11921
11977
|
enabled: !!products?.length
|
|
11922
11978
|
});
|
|
11923
|
-
if (isLoading) return /* @__PURE__ */ jsxRuntime.jsx(
|
|
11924
|
-
if (error) return /* @__PURE__ */ jsxRuntime.jsx(
|
|
11925
|
-
if (!products || products.length === 0) return /* @__PURE__ */ jsxRuntime.jsx(
|
|
11926
|
-
const prices =
|
|
11979
|
+
if (isLoading) return /* @__PURE__ */ jsxRuntime.jsx(chunkRHKFCSFC_cjs.PlanNotice, { children: "Loading plans\u2026" });
|
|
11980
|
+
if (error) return /* @__PURE__ */ jsxRuntime.jsx(chunkRHKFCSFC_cjs.PlanNotice, { tone: "error", children: "Plans didn't load. Try again." });
|
|
11981
|
+
if (!products || products.length === 0) return /* @__PURE__ */ jsxRuntime.jsx(chunkRHKFCSFC_cjs.PlanNotice, { children: "No plans available." });
|
|
11982
|
+
const prices = chunkLYF47OXX_cjs.findProPrices(products);
|
|
11927
11983
|
const intervalPrice = isAnnual ? prices.annual : prices.monthly;
|
|
11928
|
-
const selectedPrice =
|
|
11984
|
+
const selectedPrice = chunkLYF47OXX_cjs.packPrice(intervalPrice);
|
|
11929
11985
|
if (!intervalPrice) return null;
|
|
11930
11986
|
const interval = isAnnual ? "year" : "month";
|
|
11931
|
-
const savingsPercent =
|
|
11987
|
+
const savingsPercent = chunkLYF47OXX_cjs.calcSavingsPercent(prices.monthly, prices.annual);
|
|
11932
11988
|
const handleSubscribe = () => {
|
|
11933
11989
|
setCheckoutInterval(interval);
|
|
11934
|
-
const parsed =
|
|
11935
|
-
setCheckoutBudget(parsed == null || parsed ===
|
|
11990
|
+
const parsed = chunkLYF47OXX_cjs.parseBudgetPounds(addonBudget);
|
|
11991
|
+
setCheckoutBudget(parsed == null || parsed === chunkLYF47OXX_cjs.DEFAULT_SPEND_CAP_PENCE ? null : parsed);
|
|
11936
11992
|
setCheckoutQuote(quote.quote);
|
|
11937
11993
|
setIsCheckoutModalOpen(true);
|
|
11938
11994
|
};
|
|
11939
11995
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
11940
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
11996
|
+
/* @__PURE__ */ jsxRuntime.jsxs(chunkRHKFCSFC_cjs.PlanStack, { children: [
|
|
11941
11997
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
11942
|
-
|
|
11998
|
+
chunkRHKFCSFC_cjs.PlanPickerHeader,
|
|
11943
11999
|
{
|
|
11944
12000
|
title: "Plan",
|
|
11945
12001
|
info: /* @__PURE__ */ jsxRuntime.jsx(PlanInfoPopover2, {}),
|
|
11946
12002
|
toggle: /* @__PURE__ */ jsxRuntime.jsx(
|
|
11947
|
-
|
|
12003
|
+
chunkRHKFCSFC_cjs.PricingToggle,
|
|
11948
12004
|
{
|
|
11949
12005
|
isAnnual,
|
|
11950
12006
|
onToggle: () => setIsAnnual(!isAnnual),
|
|
@@ -11981,7 +12037,7 @@ function SubscriptionPlans({ projectExtId, onDismiss }) {
|
|
|
11981
12037
|
currency: intervalPrice.currency
|
|
11982
12038
|
}
|
|
11983
12039
|
),
|
|
11984
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
12040
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkRHKFCSFC_cjs.PromoCodeInput, { value: promoCode, onChange: setPromoCode }),
|
|
11985
12041
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
11986
12042
|
CheckoutCountrySelect,
|
|
11987
12043
|
{
|
|
@@ -11993,9 +12049,9 @@ function SubscriptionPlans({ projectExtId, onDismiss }) {
|
|
|
11993
12049
|
}
|
|
11994
12050
|
),
|
|
11995
12051
|
/* @__PURE__ */ jsxRuntime.jsx(CheckoutTotal, { state: quote, postalCode, onPostalCodeChange: setPostalCode }),
|
|
11996
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
12052
|
+
/* @__PURE__ */ jsxRuntime.jsxs(chunkRHKFCSFC_cjs.PlanActionRow, { children: [
|
|
11997
12053
|
onDismiss && /* @__PURE__ */ jsxRuntime.jsx(
|
|
11998
|
-
|
|
12054
|
+
chunkRHKFCSFC_cjs.PlanActionButton,
|
|
11999
12055
|
{
|
|
12000
12056
|
tone: "muted",
|
|
12001
12057
|
fill: true,
|
|
@@ -12006,11 +12062,11 @@ function SubscriptionPlans({ projectExtId, onDismiss }) {
|
|
|
12006
12062
|
}
|
|
12007
12063
|
),
|
|
12008
12064
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
12009
|
-
|
|
12065
|
+
chunkRHKFCSFC_cjs.PlanActionButton,
|
|
12010
12066
|
{
|
|
12011
12067
|
fill: true,
|
|
12012
12068
|
onClick: handleSubscribe,
|
|
12013
|
-
disabled: !selectedPrice ||
|
|
12069
|
+
disabled: !selectedPrice || chunkLYF47OXX_cjs.parseBudgetPounds(addonBudget) === void 0 || !quote.canContinue,
|
|
12014
12070
|
size: "sm",
|
|
12015
12071
|
"data-testid": "subscribe-button",
|
|
12016
12072
|
children: "Continue to payment"
|
|
@@ -12050,7 +12106,7 @@ var FALLBACK_MESSAGES = {
|
|
|
12050
12106
|
BILLING_ADDRESS_REQUIRED: "Add a billing address first."
|
|
12051
12107
|
};
|
|
12052
12108
|
function addonErrorMessage(error) {
|
|
12053
|
-
const detail =
|
|
12109
|
+
const detail = chunkLYF47OXX_cjs.apiErrorDetail(error);
|
|
12054
12110
|
if (detail && typeof detail === "object") {
|
|
12055
12111
|
const { code, message } = detail;
|
|
12056
12112
|
if (message) return message;
|
|
@@ -12072,18 +12128,18 @@ function chargeRefusalMessage(error) {
|
|
|
12072
12128
|
return code ? REFUSALS[code] : null;
|
|
12073
12129
|
}
|
|
12074
12130
|
function addonErrorCode(error) {
|
|
12075
|
-
const detail =
|
|
12131
|
+
const detail = chunkLYF47OXX_cjs.apiErrorDetail(error);
|
|
12076
12132
|
if (detail && typeof detail === "object") {
|
|
12077
12133
|
const code = detail.code;
|
|
12078
12134
|
if (code && code in FALLBACK_MESSAGES) return code;
|
|
12079
12135
|
}
|
|
12080
12136
|
return null;
|
|
12081
12137
|
}
|
|
12082
|
-
var addedMessage = (kind, blockAiGbp, blockStorageGb) => kind === "ai_usage" ? `${react.formatGbp(blockAiGbp ??
|
|
12138
|
+
var addedMessage = (kind, blockAiGbp, blockStorageGb) => kind === "ai_usage" ? `${react.formatGbp(blockAiGbp ?? chunkLYF47OXX_cjs.ADDON_BLOCK_AI_GBP)} of AI usage added` : `${blockStorageGb ?? chunkLYF47OXX_cjs.STORAGE_BLOCK_GB} GB added`;
|
|
12083
12139
|
function useAddonPurchase() {
|
|
12084
12140
|
const addBlock = react.useAddProjectAddonBlock();
|
|
12085
12141
|
const { mutate } = addBlock;
|
|
12086
|
-
const { onAddonBlocksBought } =
|
|
12142
|
+
const { onAddonBlocksBought } = chunkLYF47OXX_cjs.useBillingSupport();
|
|
12087
12143
|
const buy = React7.useCallback(
|
|
12088
12144
|
(kind, projectExtId, options2) => {
|
|
12089
12145
|
mutate(
|
|
@@ -12127,7 +12183,7 @@ function PlanChangeLines({
|
|
|
12127
12183
|
isError,
|
|
12128
12184
|
className
|
|
12129
12185
|
}) {
|
|
12130
|
-
const lines = preview ?
|
|
12186
|
+
const lines = preview ? chunkLYF47OXX_cjs.planPreviewLines(preview) : [{ id: "pay-today", text: isError ? chunkLYF47OXX_cjs.PAY_TODAY_UNPRICED : "Checking price\u2026" }];
|
|
12131
12187
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className, "data-testid": "plan-change-lines", children: lines.map((line) => /* @__PURE__ */ jsxRuntime.jsx("p", { "data-testid": `plan-change-${line.id}`, children: line.text }, line.id)) });
|
|
12132
12188
|
}
|
|
12133
12189
|
var BANK_CONFIRM_PLAN_CHANGE = "Confirm with your bank. Nothing is charged until you do.";
|
|
@@ -12135,13 +12191,13 @@ function notifyPlanChange(data, fallback, planName2) {
|
|
|
12135
12191
|
const outcome = data?.plan_change;
|
|
12136
12192
|
switch (outcome?.result) {
|
|
12137
12193
|
case "upgraded": {
|
|
12138
|
-
const plan =
|
|
12139
|
-
const charged = outcome.charged_pence > 0 ? ` \xB7 ${
|
|
12194
|
+
const plan = chunkLYF47OXX_cjs.planNameForPacks(data?.addons?.packs ?? data?.packs);
|
|
12195
|
+
const charged = outcome.charged_pence > 0 ? ` \xB7 ${chunkLYF47OXX_cjs.formatMoney(outcome.charged_pence, "gbp")} charged` : "";
|
|
12140
12196
|
shell.notify.success(`Upgraded to ${plan}${charged}`);
|
|
12141
12197
|
break;
|
|
12142
12198
|
}
|
|
12143
12199
|
case "scheduled": {
|
|
12144
|
-
const when2 =
|
|
12200
|
+
const when2 = chunkLYF47OXX_cjs.formatPeriodEnd(data?.addons?.period_end ?? data?.current_period_end);
|
|
12145
12201
|
shell.notify.success(when2 ? `Scheduled for ${when2}` : fallback);
|
|
12146
12202
|
break;
|
|
12147
12203
|
}
|
|
@@ -12174,23 +12230,23 @@ function ChangeProPlan({
|
|
|
12174
12230
|
const { data: products } = react.useProducts();
|
|
12175
12231
|
const changePlan = react.useChangeProjectPlan();
|
|
12176
12232
|
const cancel = react.useCancelProjectSubscription();
|
|
12177
|
-
const prices =
|
|
12233
|
+
const prices = chunkLYF47OXX_cjs.findProPrices(products);
|
|
12178
12234
|
const addons = project.addons;
|
|
12179
12235
|
const isCanceling = project.cancel_at_period_end === true || project.subscription === "canceled";
|
|
12180
|
-
const currentPacks = Math.max(addons?.packs ?? project.packs ??
|
|
12181
|
-
const isLegacyMultiPack = currentPacks >
|
|
12236
|
+
const currentPacks = Math.max(addons?.packs ?? project.packs ?? chunkLYF47OXX_cjs.PRO_PACKS, chunkLYF47OXX_cjs.PRO_PACKS);
|
|
12237
|
+
const isLegacyMultiPack = currentPacks > chunkLYF47OXX_cjs.PRO_PACKS;
|
|
12182
12238
|
const currentInterval = project.plan_interval === "year" ? "year" : "month";
|
|
12183
12239
|
const scheduledPacks = isCanceling ? 0 : addons?.packs_next ?? currentPacks;
|
|
12184
12240
|
const scheduledInterval = addons?.pending_interval ?? currentInterval;
|
|
12185
12241
|
const [targetPacks, setTargetPacks] = React7.useState(scheduledPacks);
|
|
12186
12242
|
const [chosenInterval, setChosenInterval] = React7.useState(scheduledInterval);
|
|
12187
|
-
const targetInterval = targetPacks >
|
|
12243
|
+
const targetInterval = targetPacks > chunkLYF47OXX_cjs.PRO_PACKS ? currentInterval : chosenInterval;
|
|
12188
12244
|
const periodEnd = formatDate(addons?.period_end ?? project.current_period_end);
|
|
12189
12245
|
const when2 = periodEnd ?? "the end of the period";
|
|
12190
12246
|
const shortWhen = periodEnd ? periodEnd.replace(/ \d{4}$/, "") : "period end";
|
|
12191
12247
|
const isPending = changePlan.isPending || cancel.isPending;
|
|
12192
12248
|
const sameAsScheduled = targetPacks === scheduledPacks && (targetPacks === 0 || targetInterval === scheduledInterval);
|
|
12193
|
-
const packOptions = isLegacyMultiPack ? [currentPacks,
|
|
12249
|
+
const packOptions = isLegacyMultiPack ? [currentPacks, chunkLYF47OXX_cjs.PRO_PACKS, 0] : [chunkLYF47OXX_cjs.PRO_PACKS, 0];
|
|
12194
12250
|
const intervalPrice = targetInterval === "year" ? prices.annual : prices.monthly;
|
|
12195
12251
|
const currency = intervalPrice?.currency ?? project.currency ?? "gbp";
|
|
12196
12252
|
const preview = react.usePreviewProjectPlanChange(
|
|
@@ -12198,7 +12254,7 @@ function ChangeProPlan({
|
|
|
12198
12254
|
sameAsScheduled || targetPacks === 0 ? null : { packs: targetPacks, interval: targetInterval }
|
|
12199
12255
|
);
|
|
12200
12256
|
const noChange = sameAsScheduled || preview.data?.unchanged === true;
|
|
12201
|
-
const nameFor = (packs) => packs === currentPacks && packs > 0 ?
|
|
12257
|
+
const nameFor = (packs) => packs === currentPacks && packs > 0 ? chunkLYF47OXX_cjs.proTierName(project) : chunkLYF47OXX_cjs.planNameForPacks(packs);
|
|
12202
12258
|
const effects = [];
|
|
12203
12259
|
const target = nameFor(targetPacks);
|
|
12204
12260
|
if (targetPacks === 0) {
|
|
@@ -12208,7 +12264,7 @@ function ChangeProPlan({
|
|
|
12208
12264
|
if (targetPacks < currentPacks) {
|
|
12209
12265
|
effects.push(`Changes to one Pro licence on ${when2}. No refund.`);
|
|
12210
12266
|
} else if (!isCanceling && addons?.packs_next != null) {
|
|
12211
|
-
effects.push(`Cancels the change to ${
|
|
12267
|
+
effects.push(`Cancels the change to ${chunkLYF47OXX_cjs.planNameForPacks(addons.packs_next)}.`);
|
|
12212
12268
|
}
|
|
12213
12269
|
if (targetInterval !== currentInterval) {
|
|
12214
12270
|
effects.push(`${targetInterval === "year" ? "Annual" : "Monthly"} billing from ${when2}.`);
|
|
@@ -12247,33 +12303,33 @@ function ChangeProPlan({
|
|
|
12247
12303
|
if (packs === 0) {
|
|
12248
12304
|
return {
|
|
12249
12305
|
total: "\xA30",
|
|
12250
|
-
summary: `${react.formatGbp(
|
|
12306
|
+
summary: `${react.formatGbp(chunkLYF47OXX_cjs.FREE_AI_GBP)} of AI usage \xB7 ${chunkLYF47OXX_cjs.FREE_STORAGE_MB} MB \xB7 just you`
|
|
12251
12307
|
};
|
|
12252
12308
|
}
|
|
12253
|
-
const allowance = `${react.formatGbp(
|
|
12254
|
-
const legacy = packs >
|
|
12255
|
-
const exVat = legacy ? project.amount_ex_vat :
|
|
12309
|
+
const allowance = `${react.formatGbp(chunkLYF47OXX_cjs.PRO_AI_GBP * packs)} of AI usage \xB7 ${chunkLYF47OXX_cjs.PRO_STORAGE_GB * packs} GB`;
|
|
12310
|
+
const legacy = packs > chunkLYF47OXX_cjs.PRO_PACKS;
|
|
12311
|
+
const exVat = legacy ? project.amount_ex_vat : chunkLYF47OXX_cjs.packPrice(intervalPrice)?.amount_ex_vat;
|
|
12256
12312
|
return {
|
|
12257
|
-
total: exVat != null ?
|
|
12313
|
+
total: exVat != null ? chunkLYF47OXX_cjs.plusVat(exVat, currency) : void 0,
|
|
12258
12314
|
summary: allowance
|
|
12259
12315
|
};
|
|
12260
12316
|
};
|
|
12261
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
12317
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(chunkRHKFCSFC_cjs.PlanStack, { gap: 4, testId: "change-pro-plan", children: [
|
|
12262
12318
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-wrap items-center justify-between gap-2", children: [
|
|
12263
12319
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm font-medium text-foreground", children: "Billing" }),
|
|
12264
|
-
targetPacks >
|
|
12265
|
-
|
|
12320
|
+
targetPacks > chunkLYF47OXX_cjs.PRO_PACKS ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm text-muted-foreground", "data-testid": "change-plan-interval-fixed", children: currentInterval === "year" ? "Annual" : "Monthly" }) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
12321
|
+
chunkRHKFCSFC_cjs.PricingToggle,
|
|
12266
12322
|
{
|
|
12267
12323
|
isAnnual: targetInterval === "year",
|
|
12268
12324
|
onToggle: () => setChosenInterval(targetInterval === "year" ? "month" : "year"),
|
|
12269
|
-
savingsPercent:
|
|
12325
|
+
savingsPercent: chunkLYF47OXX_cjs.calcSavingsPercent(prices.monthly, prices.annual)
|
|
12270
12326
|
}
|
|
12271
12327
|
)
|
|
12272
12328
|
] }),
|
|
12273
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
12329
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkRHKFCSFC_cjs.PlanStack, { gap: 2, children: packOptions.map((packs) => {
|
|
12274
12330
|
const { total, summary } = optionFor(packs);
|
|
12275
12331
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
12276
|
-
|
|
12332
|
+
chunkRHKFCSFC_cjs.PlanTierOption,
|
|
12277
12333
|
{
|
|
12278
12334
|
onSelect: setTargetPacks,
|
|
12279
12335
|
option: {
|
|
@@ -12290,13 +12346,13 @@ function ChangeProPlan({
|
|
|
12290
12346
|
);
|
|
12291
12347
|
}) }),
|
|
12292
12348
|
isLegacyMultiPack && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-wrap items-center gap-x-3 gap-y-1", children: [
|
|
12293
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
12294
|
-
|
|
12349
|
+
/* @__PURE__ */ jsxRuntime.jsxs(chunkRHKFCSFC_cjs.PlanNotice, { className: "text-xs", testId: "change-plan-legacy-note", children: [
|
|
12350
|
+
chunkLYF47OXX_cjs.proTierName(project),
|
|
12295
12351
|
" is no longer sold"
|
|
12296
12352
|
] }),
|
|
12297
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
12353
|
+
/* @__PURE__ */ jsxRuntime.jsxs(chunkRHKFCSFC_cjs.MoreInfo, { title: "Legacy plan", testId: "change-plan-legacy-more-info", children: [
|
|
12298
12354
|
/* @__PURE__ */ jsxRuntime.jsxs("p", { children: [
|
|
12299
|
-
|
|
12355
|
+
chunkLYF47OXX_cjs.proTierName(project),
|
|
12300
12356
|
" keeps renewing at its own price, with its allowance and add-ons, until you change it."
|
|
12301
12357
|
] }),
|
|
12302
12358
|
/* @__PURE__ */ jsxRuntime.jsxs("p", { children: [
|
|
@@ -12317,7 +12373,7 @@ function ChangeProPlan({
|
|
|
12317
12373
|
),
|
|
12318
12374
|
targetPacks > 0 && /* @__PURE__ */ jsxRuntime.jsx(ConnectedReferralRewardNote, {}),
|
|
12319
12375
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
12320
|
-
|
|
12376
|
+
chunkRHKFCSFC_cjs.PlanActionButton,
|
|
12321
12377
|
{
|
|
12322
12378
|
onClick: apply,
|
|
12323
12379
|
disabled: noChange || isPending,
|
|
@@ -12328,9 +12384,9 @@ function ChangeProPlan({
|
|
|
12328
12384
|
] });
|
|
12329
12385
|
}
|
|
12330
12386
|
function ChangePlanDialog({ project, open, onOpenChange }) {
|
|
12331
|
-
const isPro = !!project &&
|
|
12387
|
+
const isPro = !!project && chunkLYF47OXX_cjs.isProProject(project);
|
|
12332
12388
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
12333
|
-
|
|
12389
|
+
chunkRHKFCSFC_cjs.PlanDialogFrame,
|
|
12334
12390
|
{
|
|
12335
12391
|
open,
|
|
12336
12392
|
onOpenChange,
|
|
@@ -12350,14 +12406,14 @@ function ChangePlanDialog({ project, open, onOpenChange }) {
|
|
|
12350
12406
|
}
|
|
12351
12407
|
function ProjectsTable() {
|
|
12352
12408
|
const { data: projects, isLoading } = react.useProjects();
|
|
12353
|
-
const currentUserExtId =
|
|
12409
|
+
const currentUserExtId = chunkLYF47OXX_cjs.useSelfExtId();
|
|
12354
12410
|
const { openProject } = chunk2QQUGL2V_cjs.useBlocksEnvironment();
|
|
12355
12411
|
const updateProject = react.useUpdateProjectFields();
|
|
12356
12412
|
const [renameTarget, setRenameTarget] = React7.useState(null);
|
|
12357
12413
|
const [renameValue, setRenameValue] = React7.useState("");
|
|
12358
12414
|
const [invoicesTarget, setInvoicesTarget] = React7.useState(null);
|
|
12359
12415
|
const [upgradeTarget, setUpgradeTarget] = React7.useState(null);
|
|
12360
|
-
const { stripeEnabled } =
|
|
12416
|
+
const { stripeEnabled } = chunkLYF47OXX_cjs.useBillingSupport();
|
|
12361
12417
|
const ownedProjects = React7.useMemo(
|
|
12362
12418
|
() => (projects ?? []).filter((p) => p.created_by === currentUserExtId),
|
|
12363
12419
|
[projects, currentUserExtId]
|
|
@@ -12396,13 +12452,13 @@ function ProjectsTable() {
|
|
|
12396
12452
|
const hasPaid = p.subscription === "active" || p.subscription === "past_due";
|
|
12397
12453
|
const canUpgrade = stripeEnabled && !hasPaid && p.subscription !== "canceled" && p.subscription !== "dev";
|
|
12398
12454
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
12399
|
-
|
|
12455
|
+
chunkRHKFCSFC_cjs.ProjectRow,
|
|
12400
12456
|
{
|
|
12401
12457
|
testId: `project-row-${p.external_id}`,
|
|
12402
12458
|
onOpen: () => openProject(p.external_id),
|
|
12403
12459
|
identity: /* @__PURE__ */ jsxRuntime.jsx(BillingProjectEntity, { name: p.name, relation: "mine", subscription: p.subscription, size: "sm" }),
|
|
12404
|
-
summary: stripeEnabled ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex items-center whitespace-nowrap", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
12405
|
-
usage: p.quotas ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
12460
|
+
summary: stripeEnabled ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex items-center whitespace-nowrap", children: /* @__PURE__ */ jsxRuntime.jsx(chunkRHKFCSFC_cjs.PlanBadge, { ...chunkLYF47OXX_cjs.planBadgeView(p) }) }) : void 0,
|
|
12461
|
+
usage: p.quotas ? /* @__PURE__ */ jsxRuntime.jsx(chunkRHKFCSFC_cjs.QuotaMeter, { items: chunkLYF47OXX_cjs.getQuotaItems(p.quotas), size: "lg" }) : void 0,
|
|
12406
12462
|
actions: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
12407
12463
|
canUpgrade && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
12408
12464
|
ui.Button,
|
|
@@ -12436,9 +12492,9 @@ function ProjectsTable() {
|
|
|
12436
12492
|
);
|
|
12437
12493
|
};
|
|
12438
12494
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
12439
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
12495
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkRHKFCSFC_cjs.ProjectList, { isLoading, isEmpty: ownedProjects.length === 0, isFilteredOut: false, children: ownedProjects.map(renderRow) }),
|
|
12440
12496
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
12441
|
-
|
|
12497
|
+
chunkRHKFCSFC_cjs.RenameDialog,
|
|
12442
12498
|
{
|
|
12443
12499
|
open: !!renameTarget,
|
|
12444
12500
|
onClose: () => setRenameTarget(null),
|
|
@@ -12469,7 +12525,7 @@ function ProjectsTable() {
|
|
|
12469
12525
|
}
|
|
12470
12526
|
function SharedProjects() {
|
|
12471
12527
|
const { data: projects } = react.useProjects();
|
|
12472
|
-
const currentUserExtId =
|
|
12528
|
+
const currentUserExtId = chunkLYF47OXX_cjs.useSelfExtId();
|
|
12473
12529
|
const { data: usageToday } = react.useUserUsageToday();
|
|
12474
12530
|
const shared = React7.useMemo(
|
|
12475
12531
|
() => (projects ?? []).filter((p) => p.created_by !== currentUserExtId),
|
|
@@ -12477,10 +12533,10 @@ function SharedProjects() {
|
|
|
12477
12533
|
);
|
|
12478
12534
|
if (shared.length === 0) return null;
|
|
12479
12535
|
const usedToday = usageToday?.used_gbp ?? 0;
|
|
12480
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
12536
|
+
return /* @__PURE__ */ jsxRuntime.jsx(chunkRHKFCSFC_cjs.SharedProjectsSection, { footnote: "Your daily AI usage allowance in projects other people run \u2014 their plan and billing are theirs.", children: shared.map((p) => {
|
|
12481
12537
|
const cap = p.daily_cap_per_user;
|
|
12482
12538
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
12483
|
-
|
|
12539
|
+
chunkRHKFCSFC_cjs.SharedProjectRow,
|
|
12484
12540
|
{
|
|
12485
12541
|
testId: `shared-project-${p.external_id}`,
|
|
12486
12542
|
identity: /* @__PURE__ */ jsxRuntime.jsx(BillingProjectEntity, { name: p.name, relation: "other", size: "sm" }),
|
|
@@ -12524,7 +12580,7 @@ function DailyCapEditor({ project }) {
|
|
|
12524
12580
|
);
|
|
12525
12581
|
};
|
|
12526
12582
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
12527
|
-
|
|
12583
|
+
chunkRHKFCSFC_cjs.DailyCapField,
|
|
12528
12584
|
{
|
|
12529
12585
|
value,
|
|
12530
12586
|
onChange: setValue,
|
|
@@ -12537,11 +12593,11 @@ function DailyCapEditor({ project }) {
|
|
|
12537
12593
|
function SubscriptionStatus({ project }) {
|
|
12538
12594
|
const { quotas, cancel_at_period_end, subscription, current_period_end, addons } = project;
|
|
12539
12595
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
12540
|
-
|
|
12596
|
+
chunkRHKFCSFC_cjs.SubscriptionStatusView,
|
|
12541
12597
|
{
|
|
12542
|
-
resetDate:
|
|
12598
|
+
resetDate: chunkLYF47OXX_cjs.formatResetDate(addons?.ai_usage_reset_at ?? current_period_end),
|
|
12543
12599
|
isCanceling: subscription === "canceled" || cancel_at_period_end === true,
|
|
12544
|
-
meters:
|
|
12600
|
+
meters: chunkLYF47OXX_cjs.getQuotaItems(quotas).map((q) => ({
|
|
12545
12601
|
key: q.key,
|
|
12546
12602
|
icon: q.icon,
|
|
12547
12603
|
label: q.label,
|
|
@@ -12605,7 +12661,7 @@ function PendingChange({
|
|
|
12605
12661
|
}
|
|
12606
12662
|
);
|
|
12607
12663
|
}
|
|
12608
|
-
var titleFor = (kind, blockAiGbp, blockStorageGb) => kind === "ai_usage" ? `Add ${react.formatGbp(blockAiGbp ??
|
|
12664
|
+
var titleFor = (kind, blockAiGbp, blockStorageGb) => kind === "ai_usage" ? `Add ${react.formatGbp(blockAiGbp ?? chunkLYF47OXX_cjs.ADDON_BLOCK_AI_GBP)} of AI usage` : `Add ${blockStorageGb ?? chunkLYF47OXX_cjs.STORAGE_BLOCK_GB} GB storage`;
|
|
12609
12665
|
var blocksOf = (kind, project) => (kind === "ai_usage" ? project.addons?.ai_blocks : project.addons?.storage_blocks) ?? 0;
|
|
12610
12666
|
function Row({ label, children }) {
|
|
12611
12667
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-baseline justify-between gap-4", children: [
|
|
@@ -12626,11 +12682,11 @@ function AddAddonDialog({
|
|
|
12626
12682
|
const addons = project.addons;
|
|
12627
12683
|
if (!addons) return null;
|
|
12628
12684
|
const isAnnual = project.plan_interval === "year";
|
|
12629
|
-
const price =
|
|
12630
|
-
const nextCharge =
|
|
12631
|
-
const now = quote.data ?
|
|
12632
|
-
const renewal = quote.data ?
|
|
12633
|
-
const today = now ? { total:
|
|
12685
|
+
const price = chunkLYF47OXX_cjs.addonCharge(kind, addons, isAnnual, addons.period_end ?? project.current_period_end);
|
|
12686
|
+
const nextCharge = chunkLYF47OXX_cjs.formatPeriodEnd(addons.period_end ?? project.current_period_end);
|
|
12687
|
+
const now = quote.data ? chunkLYF47OXX_cjs.quoteParts(quote.data.now) : null;
|
|
12688
|
+
const renewal = quote.data ? chunkLYF47OXX_cjs.quoteParts(quote.data.renewal) : null;
|
|
12689
|
+
const today = now ? { total: chunkLYF47OXX_cjs.money2(now.total), detail: chunkLYF47OXX_cjs.taxDetail(now) } : { total: price.now, detail: `incl. VAT (${price.nowExVat} + ${price.nowVat} VAT)` };
|
|
12634
12690
|
const pricing = quote.isLoading;
|
|
12635
12691
|
const confirm = () => {
|
|
12636
12692
|
const before = blocksOf(kind, project);
|
|
@@ -12669,8 +12725,8 @@ function AddAddonDialog({
|
|
|
12669
12725
|
isAnnual ? "yearly" : "monthly",
|
|
12670
12726
|
" \xB7 no refund"
|
|
12671
12727
|
] }),
|
|
12672
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
12673
|
-
|
|
12728
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkRHKFCSFC_cjs.MoreInfo, { title: "Adding a top-up", testId: "add-addon-more-info", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
12729
|
+
chunkRHKFCSFC_cjs.MoreInfoList,
|
|
12674
12730
|
{
|
|
12675
12731
|
items: [
|
|
12676
12732
|
{
|
|
@@ -12685,7 +12741,7 @@ function AddAddonDialog({
|
|
|
12685
12741
|
term: "Usage cap",
|
|
12686
12742
|
text: "Adding by hand is never blocked by the usage cap; the cap limits automatic top-ups only."
|
|
12687
12743
|
},
|
|
12688
|
-
...isAnnual && kind === "ai_usage" ? [{ term: "Annual", text: `${
|
|
12744
|
+
...isAnnual && kind === "ai_usage" ? [{ term: "Annual", text: `${chunkLYF47OXX_cjs.ANNUAL_PREMIUM_AI_NOTE}.` }] : []
|
|
12689
12745
|
]
|
|
12690
12746
|
}
|
|
12691
12747
|
) })
|
|
@@ -12708,7 +12764,7 @@ function AddAddonDialog({
|
|
|
12708
12764
|
)
|
|
12709
12765
|
] }) }),
|
|
12710
12766
|
!pricing && /* @__PURE__ */ jsxRuntime.jsxs(Row, { label: "Next charge", children: [
|
|
12711
|
-
renewal ?
|
|
12767
|
+
renewal ? chunkLYF47OXX_cjs.totalWithTaxWord(renewal) : price.then.replace(/\/(month|year)/, ""),
|
|
12712
12768
|
nextCharge ? ` on ${nextCharge}` : " at renewal"
|
|
12713
12769
|
] })
|
|
12714
12770
|
] }) }),
|
|
@@ -12739,11 +12795,11 @@ function ReduceAddonDialog({
|
|
|
12739
12795
|
const update = react.useUpdateProjectNextPeriodAddons();
|
|
12740
12796
|
const addons = project.addons;
|
|
12741
12797
|
if (!addons) return null;
|
|
12742
|
-
const { min, next } =
|
|
12798
|
+
const { min, next } = chunkLYF47OXX_cjs.reduceBounds(kind, addons);
|
|
12743
12799
|
const keep = Math.max(min, next - 1);
|
|
12744
|
-
const size =
|
|
12745
|
-
const what =
|
|
12746
|
-
const from =
|
|
12800
|
+
const size = chunkLYF47OXX_cjs.nextRemovedBlockSize(kind, addons);
|
|
12801
|
+
const what = chunkLYF47OXX_cjs.stepLabel(kind, size);
|
|
12802
|
+
const from = chunkLYF47OXX_cjs.formatPeriodEnd(addons.period_end ?? project.current_period_end) ?? "your next renewal";
|
|
12747
12803
|
const fromShort = from.replace(/ \d{4}$/, "");
|
|
12748
12804
|
const allowanceNext = kind === "ai_usage" ? addons.ai_allowance_next_gbp - size : addons.storage_allowance_next_gb - size;
|
|
12749
12805
|
const allowanceNow = kind === "ai_usage" ? addons.ai_allowance_gbp : addons.storage_allowance_gb;
|
|
@@ -12751,7 +12807,7 @@ function ReduceAddonDialog({
|
|
|
12751
12807
|
const save = () => update.mutate(
|
|
12752
12808
|
{
|
|
12753
12809
|
projectExtId: project.external_id,
|
|
12754
|
-
body:
|
|
12810
|
+
body: chunkLYF47OXX_cjs.nextPeriodBody(kind, keep)
|
|
12755
12811
|
},
|
|
12756
12812
|
{
|
|
12757
12813
|
onSuccess: () => {
|
|
@@ -12779,7 +12835,7 @@ function ReduceAddonDialog({
|
|
|
12779
12835
|
fromShort,
|
|
12780
12836
|
" \xB7 no refund"
|
|
12781
12837
|
] }),
|
|
12782
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
12838
|
+
/* @__PURE__ */ jsxRuntime.jsxs(chunkRHKFCSFC_cjs.MoreInfo, { title: "Reducing a top-up", testId: "reduce-addon-more-info", children: [
|
|
12783
12839
|
/* @__PURE__ */ jsxRuntime.jsxs("p", { children: [
|
|
12784
12840
|
"The reduction applies from your next renewal (",
|
|
12785
12841
|
from,
|
|
@@ -12818,7 +12874,7 @@ function ReduceAddonDialog({
|
|
|
12818
12874
|
}
|
|
12819
12875
|
) });
|
|
12820
12876
|
}
|
|
12821
|
-
var gbp = (pence) =>
|
|
12877
|
+
var gbp = (pence) => chunkLYF47OXX_cjs.formatMoney(pence, "gbp");
|
|
12822
12878
|
var gb2 = (n) => `${Math.round(n * 10) / 10} GB`;
|
|
12823
12879
|
var pct = (used, limit) => limit > 0 ? Math.min(100, used / limit * 100) : 0;
|
|
12824
12880
|
function formatShortDate(unix) {
|
|
@@ -12830,20 +12886,20 @@ function AutoTopupThreshold({
|
|
|
12830
12886
|
addons
|
|
12831
12887
|
}) {
|
|
12832
12888
|
const updateSettings = react.useUpdateProjectAddonSettings();
|
|
12833
|
-
const min = addons.min_auto_topup_threshold_gbp ||
|
|
12889
|
+
const min = addons.min_auto_topup_threshold_gbp || chunkLYF47OXX_cjs.MIN_AUTO_TOPUP_THRESHOLD_GBP;
|
|
12834
12890
|
const saved = addons.auto_topup_threshold_gbp;
|
|
12835
12891
|
const [value, setValue] = React7.useState(String(saved));
|
|
12836
12892
|
React7.useEffect(() => setValue(String(saved)), [saved]);
|
|
12837
12893
|
const parsed = Number(value);
|
|
12838
12894
|
const valid = Number.isFinite(parsed) && parsed >= min;
|
|
12839
12895
|
const dirty = valid && parsed !== saved;
|
|
12840
|
-
const off =
|
|
12896
|
+
const off = chunkLYF47OXX_cjs.isAddonBudgetZero(addons);
|
|
12841
12897
|
const save = () => {
|
|
12842
12898
|
if (!dirty) return;
|
|
12843
12899
|
updateSettings.mutate(
|
|
12844
12900
|
{
|
|
12845
12901
|
projectExtId: project.external_id,
|
|
12846
|
-
body:
|
|
12902
|
+
body: chunkLYF47OXX_cjs.addonSettingsBody(addons, { auto_topup_threshold_gbp: parsed })
|
|
12847
12903
|
},
|
|
12848
12904
|
{
|
|
12849
12905
|
onSuccess: () => shell.notify.success(`Auto-add below ${react.formatGbp(parsed)} of AI usage left`),
|
|
@@ -12940,10 +12996,10 @@ function ResourceMeter({
|
|
|
12940
12996
|
const update = react.useUpdateProjectNextPeriodAddons();
|
|
12941
12997
|
const isAi = kind === "ai_usage";
|
|
12942
12998
|
const slug = isAi ? "ai-usage" : "storage";
|
|
12943
|
-
const periodEnd =
|
|
12999
|
+
const periodEnd = chunkLYF47OXX_cjs.formatPeriodEnd(addons.period_end ?? project.current_period_end);
|
|
12944
13000
|
const from = periodEnd ?? "your next renewal";
|
|
12945
13001
|
const fromShort = formatShortDate(addons.period_end ?? project.current_period_end) ?? "renewal";
|
|
12946
|
-
const { min, current: current2, next } =
|
|
13002
|
+
const { min, current: current2, next } = chunkLYF47OXX_cjs.reduceBounds(kind, addons);
|
|
12947
13003
|
const fmt = (n) => isAi ? react.formatGbp(n) : gb2(n);
|
|
12948
13004
|
const used = isAi ? addons.ai_used_gbp : addons.storage_used_gb;
|
|
12949
13005
|
const allowance = isAi ? addons.ai_allowance_gbp : addons.storage_allowance_gb;
|
|
@@ -12951,15 +13007,15 @@ function ResourceMeter({
|
|
|
12951
13007
|
const plan = isAi ? addons.plan_ai_gbp : addons.plan_storage_gb;
|
|
12952
13008
|
const topUps = Math.max(0, allowance - plan);
|
|
12953
13009
|
const blocks = isAi ? addons.ai_blocks : addons.storage_blocks;
|
|
12954
|
-
const hasLegacy =
|
|
12955
|
-
const room =
|
|
12956
|
-
const capZero =
|
|
12957
|
-
const resets = isAi ? formatShortDate(
|
|
12958
|
-
const removeSize =
|
|
13010
|
+
const hasLegacy = chunkLYF47OXX_cjs.splitBlocks(kind, blocks, addons).legacy > 0;
|
|
13011
|
+
const room = chunkLYF47OXX_cjs.autoRoom(kind, addons);
|
|
13012
|
+
const capZero = chunkLYF47OXX_cjs.isAddonBudgetZero(addons);
|
|
13013
|
+
const resets = isAi ? formatShortDate(chunkLYF47OXX_cjs.aiUsageResetTimestamp(project)) : null;
|
|
13014
|
+
const removeSize = chunkLYF47OXX_cjs.nextRemovedBlockSize(kind, addons);
|
|
12959
13015
|
const undo = () => update.mutate(
|
|
12960
13016
|
{
|
|
12961
13017
|
projectExtId: project.external_id,
|
|
12962
|
-
body:
|
|
13018
|
+
body: chunkLYF47OXX_cjs.nextPeriodBody(kind, current2)
|
|
12963
13019
|
},
|
|
12964
13020
|
{
|
|
12965
13021
|
onSuccess: () => shell.notify.success("Kept"),
|
|
@@ -12976,7 +13032,7 @@ function ResourceMeter({
|
|
|
12976
13032
|
allowance: { used, plan, topUps, autoRoom: capZero ? 0 : room },
|
|
12977
13033
|
legend: {
|
|
12978
13034
|
plan: `Plan ${fmt(plan)}`,
|
|
12979
|
-
topUps: topUps > 0 ? `Top-ups ${fmt(topUps)}${hasLegacy ? ` (${
|
|
13035
|
+
topUps: topUps > 0 ? `Top-ups ${fmt(topUps)}${hasLegacy ? ` (${chunkLYF47OXX_cjs.blocksLabel(kind, blocks, addons)})` : ""}` : void 0,
|
|
12980
13036
|
autoRoom: room != null && room > 0 && !capZero ? `Automatic up to ${fmt(room)}` : void 0
|
|
12981
13037
|
},
|
|
12982
13038
|
testId: `usage-meter-${slug}`,
|
|
@@ -13005,9 +13061,9 @@ function ResourceMeter({
|
|
|
13005
13061
|
{
|
|
13006
13062
|
icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Plus, { className: "size-3.5" }),
|
|
13007
13063
|
label: isAi ? react.formatGbp(addons.block_ai_gbp) : `${addons.block_storage_gb} GB`,
|
|
13008
|
-
caption:
|
|
13064
|
+
caption: chunkLYF47OXX_cjs.addStepCaption(kind, addons),
|
|
13009
13065
|
onClick: onAdd,
|
|
13010
|
-
ariaLabel: `Add ${
|
|
13066
|
+
ariaLabel: `Add ${chunkLYF47OXX_cjs.stepLabel(kind, isAi ? addons.block_ai_gbp : addons.block_storage_gb)}`,
|
|
13011
13067
|
testId: isAi ? "add-ai-block-button" : "add-storage-block-button"
|
|
13012
13068
|
}
|
|
13013
13069
|
),
|
|
@@ -13018,7 +13074,7 @@ function ResourceMeter({
|
|
|
13018
13074
|
label: isAi ? react.formatGbp(removeSize) : `${removeSize} GB`,
|
|
13019
13075
|
caption: `from ${fromShort}`,
|
|
13020
13076
|
onClick: onReduce,
|
|
13021
|
-
ariaLabel: `Remove ${
|
|
13077
|
+
ariaLabel: `Remove ${chunkLYF47OXX_cjs.stepLabel(kind, removeSize)} from ${from}`,
|
|
13022
13078
|
testId: `reduce-${slug}-button`
|
|
13023
13079
|
}
|
|
13024
13080
|
)
|
|
@@ -13057,10 +13113,10 @@ function UsageCapEditor({ project, addons }) {
|
|
|
13057
13113
|
updateSettings.mutate(
|
|
13058
13114
|
{
|
|
13059
13115
|
projectExtId: project.external_id,
|
|
13060
|
-
body:
|
|
13116
|
+
body: chunkLYF47OXX_cjs.addonSettingsBody(addons, { spend_cap_pence: nextCap })
|
|
13061
13117
|
},
|
|
13062
13118
|
{
|
|
13063
|
-
onSuccess: () => shell.notify.success(
|
|
13119
|
+
onSuccess: () => shell.notify.success(chunkLYF47OXX_cjs.budgetSavedMessage(nextCap)),
|
|
13064
13120
|
onError: (error) => shell.notify.error(addonErrorMessage(error))
|
|
13065
13121
|
}
|
|
13066
13122
|
);
|
|
@@ -13071,14 +13127,14 @@ function UsageCapEditor({ project, addons }) {
|
|
|
13071
13127
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
13072
13128
|
chunkQZTNTP75_cjs.UsageMeter,
|
|
13073
13129
|
{
|
|
13074
|
-
label:
|
|
13130
|
+
label: chunkLYF47OXX_cjs.USAGE_CAP_LABEL,
|
|
13075
13131
|
hint: spendResets && savedCap !== 0 ? `resets ${spendResets}` : void 0,
|
|
13076
13132
|
value: readout,
|
|
13077
13133
|
pct: savedCap != null && savedCap > 0 ? pct(spent, savedCap) : 0,
|
|
13078
13134
|
testId: "addon-spend"
|
|
13079
13135
|
}
|
|
13080
13136
|
),
|
|
13081
|
-
addons.cap_reached && savedCap != null && savedCap > 0 && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted-foreground", "data-testid": "addon-cap-reached", children:
|
|
13137
|
+
addons.cap_reached && savedCap != null && savedCap > 0 && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted-foreground", "data-testid": "addon-cap-reached", children: chunkLYF47OXX_cjs.CAP_REACHED_MESSAGE }),
|
|
13082
13138
|
addons.manual_spent_pence > 0 && /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "text-xs text-muted-foreground", "data-testid": "addon-manual-spend", children: [
|
|
13083
13139
|
"Added by hand this month: ",
|
|
13084
13140
|
gbp(addons.manual_spent_pence),
|
|
@@ -13099,7 +13155,7 @@ function UsageCapEditor({ project, addons }) {
|
|
|
13099
13155
|
step: 25,
|
|
13100
13156
|
className: "h-9 w-28",
|
|
13101
13157
|
value: noCap ? "" : value,
|
|
13102
|
-
placeholder: noCap ? "No limit" : String(
|
|
13158
|
+
placeholder: noCap ? "No limit" : String(chunkLYF47OXX_cjs.DEFAULT_SPEND_CAP_PENCE / 100),
|
|
13103
13159
|
disabled: noCap,
|
|
13104
13160
|
onChange: (e) => setValue(e.target.value),
|
|
13105
13161
|
onKeyDown: (e) => e.key === "Enter" && save(),
|
|
@@ -13125,7 +13181,7 @@ function UsageCapEditor({ project, addons }) {
|
|
|
13125
13181
|
checked: noCap,
|
|
13126
13182
|
onCheckedChange: (checked) => {
|
|
13127
13183
|
setNoCap(checked);
|
|
13128
|
-
if (!checked && value === "") setValue(String(
|
|
13184
|
+
if (!checked && value === "") setValue(String(chunkLYF47OXX_cjs.DEFAULT_SPEND_CAP_PENCE / 100));
|
|
13129
13185
|
},
|
|
13130
13186
|
"data-testid": "no-cap-switch"
|
|
13131
13187
|
}
|
|
@@ -13138,8 +13194,8 @@ function UsageCapEditor({ project, addons }) {
|
|
|
13138
13194
|
function UsageInfo({ addons, isAnnual }) {
|
|
13139
13195
|
const period = isAnnual ? "year" : "month";
|
|
13140
13196
|
const legacy = (addons.legacy_ai_blocks ?? 0) > 0 || (addons.legacy_storage_blocks ?? 0) > 0;
|
|
13141
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
13142
|
-
|
|
13197
|
+
return /* @__PURE__ */ jsxRuntime.jsx(chunkRHKFCSFC_cjs.MoreInfo, { title: "Usage and top-ups", testId: "usage-more-info", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
13198
|
+
chunkRHKFCSFC_cjs.MoreInfoList,
|
|
13143
13199
|
{
|
|
13144
13200
|
items: [
|
|
13145
13201
|
{
|
|
@@ -13154,7 +13210,7 @@ function UsageInfo({ addons, isAnnual }) {
|
|
|
13154
13210
|
term: "Automatic top-ups",
|
|
13155
13211
|
text: "One step is added when AI usage drops below your auto top-up level, or when an upload needs more storage."
|
|
13156
13212
|
},
|
|
13157
|
-
{ term: "Usage cap", text:
|
|
13213
|
+
{ term: "Usage cap", text: chunkLYF47OXX_cjs.USAGE_CAP_HELP },
|
|
13158
13214
|
{
|
|
13159
13215
|
term: "Reducing",
|
|
13160
13216
|
text: "\u2212 removes one step from your next renewal. You keep this period's allowance. No refunds."
|
|
@@ -13165,7 +13221,7 @@ function UsageInfo({ addons, isAnnual }) {
|
|
|
13165
13221
|
text: "Top-ups bought on an earlier price keep their size and price until removed; they are removed last."
|
|
13166
13222
|
}
|
|
13167
13223
|
] : [],
|
|
13168
|
-
...isAnnual ? [{ term: "Annual", text: `${
|
|
13224
|
+
...isAnnual ? [{ term: "Annual", text: `${chunkLYF47OXX_cjs.ANNUAL_PREMIUM_AI_NOTE}.` }] : [],
|
|
13169
13225
|
{
|
|
13170
13226
|
term: "Prices",
|
|
13171
13227
|
text: "Shown ex VAT. The confirm step shows the total with VAT before you pay."
|
|
@@ -13257,7 +13313,7 @@ function formatShortDate2(unix) {
|
|
|
13257
13313
|
if (!unix) return null;
|
|
13258
13314
|
return new Date(unix * 1e3).toLocaleDateString("en-GB", { day: "numeric", month: "short" });
|
|
13259
13315
|
}
|
|
13260
|
-
var gbp2 = (pence) =>
|
|
13316
|
+
var gbp2 = (pence) => chunkLYF47OXX_cjs.formatMoney(pence, "gbp");
|
|
13261
13317
|
var gbNum = (n) => `${Math.round(n * 10) / 10}`;
|
|
13262
13318
|
var pct2 = (used, limit) => limit > 0 ? Math.min(100, used / limit * 100) : 0;
|
|
13263
13319
|
function Meter({
|
|
@@ -13275,15 +13331,15 @@ function Meter({
|
|
|
13275
13331
|
] });
|
|
13276
13332
|
}
|
|
13277
13333
|
function usePlanPrice(project) {
|
|
13278
|
-
const { data: products } = react.useProducts({ enabled:
|
|
13279
|
-
if (!
|
|
13334
|
+
const { data: products } = react.useProducts({ enabled: chunkLYF47OXX_cjs.isProProject(project) });
|
|
13335
|
+
if (!chunkLYF47OXX_cjs.isProProject(project)) return null;
|
|
13280
13336
|
const isAnnual = project.plan_interval === "year";
|
|
13281
13337
|
if (project.amount != null) {
|
|
13282
13338
|
return { incl: project.amount, ex: project.amount_ex_vat ?? null, isAnnual };
|
|
13283
13339
|
}
|
|
13284
|
-
if ((project.packs ??
|
|
13285
|
-
const prices =
|
|
13286
|
-
const pp =
|
|
13340
|
+
if ((project.packs ?? chunkLYF47OXX_cjs.PRO_PACKS) > chunkLYF47OXX_cjs.PRO_PACKS) return null;
|
|
13341
|
+
const prices = chunkLYF47OXX_cjs.findProPrices(products);
|
|
13342
|
+
const pp = chunkLYF47OXX_cjs.packPrice(isAnnual ? prices.annual : prices.monthly);
|
|
13287
13343
|
return pp ? { incl: pp.amount, ex: pp.amount_ex_vat, isAnnual } : null;
|
|
13288
13344
|
}
|
|
13289
13345
|
function paidLine(payment, addons) {
|
|
@@ -13296,11 +13352,11 @@ function ProjectPlanCard({
|
|
|
13296
13352
|
onChangePlan
|
|
13297
13353
|
}) {
|
|
13298
13354
|
const { quotas, addons } = project;
|
|
13299
|
-
const isPro =
|
|
13355
|
+
const isPro = chunkLYF47OXX_cjs.isProProject(project);
|
|
13300
13356
|
const used = quotas?.ai_usage?.used ?? 0;
|
|
13301
13357
|
const limit = quotas?.ai_usage?.limit ?? 0;
|
|
13302
|
-
const resetDate = formatShortDate2(
|
|
13303
|
-
const periodEnd =
|
|
13358
|
+
const resetDate = formatShortDate2(chunkLYF47OXX_cjs.aiUsageResetTimestamp(project));
|
|
13359
|
+
const periodEnd = chunkLYF47OXX_cjs.formatPeriodEnd(addons?.period_end ?? project.current_period_end);
|
|
13304
13360
|
const when2 = periodEnd ?? "the end of the period";
|
|
13305
13361
|
const storageUsed = quotas?.storage_gb?.used ?? 0;
|
|
13306
13362
|
const storageLimit = quotas?.storage_gb?.limit ?? 0;
|
|
@@ -13316,7 +13372,7 @@ function ProjectPlanCard({
|
|
|
13316
13372
|
project.external_id,
|
|
13317
13373
|
hasScheduledChange && addons ? { packs: packsNext ?? addons.packs, interval: pending ?? currentInterval } : null
|
|
13318
13374
|
).data;
|
|
13319
|
-
const tier = isPro ?
|
|
13375
|
+
const tier = isPro ? chunkLYF47OXX_cjs.proTierName(project) : project.subscription === "dev" ? "Dev" : "Free";
|
|
13320
13376
|
const pendingPayment = addons?.payment?.status === "pending" ? addons.payment : null;
|
|
13321
13377
|
const confirmUrl = pendingPayment?.confirm_url ?? addons?.confirm_url;
|
|
13322
13378
|
const paidPayment = addons?.payment?.status === "paid" ? addons.payment : null;
|
|
@@ -13350,7 +13406,7 @@ function ProjectPlanCard({
|
|
|
13350
13406
|
isPro && " ",
|
|
13351
13407
|
isPro && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ml-1 text-sm font-normal text-muted-foreground", children: currentInterval === "year" ? "Annual" : "Monthly" })
|
|
13352
13408
|
] }),
|
|
13353
|
-
isPro && periodEnd && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-sm text-muted-foreground", "data-testid": "project-plan-renews", children: isCanceling ? `Ends ${periodEnd}` : hasScheduledChange && nextBill ? `Next bill ${
|
|
13409
|
+
isPro && periodEnd && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-sm text-muted-foreground", "data-testid": "project-plan-renews", children: isCanceling ? `Ends ${periodEnd}` : hasScheduledChange && nextBill ? `Next bill ${chunkLYF47OXX_cjs.totalWithTaxWord({
|
|
13354
13410
|
subtotal: nextBill.next_renewal_ex_vat_pence,
|
|
13355
13411
|
tax: nextBill.next_renewal_tax_pence,
|
|
13356
13412
|
total: nextBill.next_renewal_pence,
|
|
@@ -13359,7 +13415,7 @@ function ProjectPlanCard({
|
|
|
13359
13415
|
] }),
|
|
13360
13416
|
price && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "ml-auto text-right", "data-testid": "project-plan-price", children: [
|
|
13361
13417
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-lg font-semibold tabular-nums text-foreground", children: [
|
|
13362
|
-
price.ex != null ?
|
|
13418
|
+
price.ex != null ? chunkLYF47OXX_cjs.plusVat(price.ex) : gbp2(price.incl),
|
|
13363
13419
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm font-normal text-muted-foreground", children: price.isAnnual ? "/year" : "/month" })
|
|
13364
13420
|
] }),
|
|
13365
13421
|
price.ex != null && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-xs text-muted-foreground", children: [
|
|
@@ -13397,7 +13453,7 @@ function ProjectPlanCard({
|
|
|
13397
13453
|
undoTestId: "undo-plan-change-button",
|
|
13398
13454
|
children: [
|
|
13399
13455
|
"Changes to ",
|
|
13400
|
-
|
|
13456
|
+
chunkLYF47OXX_cjs.planNameForPacks(packsNext),
|
|
13401
13457
|
" on ",
|
|
13402
13458
|
when2,
|
|
13403
13459
|
"."
|
|
@@ -13442,8 +13498,8 @@ function ProjectPlanCard({
|
|
|
13442
13498
|
}
|
|
13443
13499
|
)
|
|
13444
13500
|
] }),
|
|
13445
|
-
addons?.billing_error && /* @__PURE__ */ jsxRuntime.jsx(
|
|
13446
|
-
confirmUrl ? /* @__PURE__ */ jsxRuntime.jsxs(
|
|
13501
|
+
addons?.billing_error && /* @__PURE__ */ jsxRuntime.jsx(chunkRHKFCSFC_cjs.PlanNotice, { tone: "error", testId: "plan-billing-error", children: addons.billing_error }),
|
|
13502
|
+
confirmUrl ? /* @__PURE__ */ jsxRuntime.jsxs(chunkRHKFCSFC_cjs.PlanNotice, { testId: "plan-payment-state", children: [
|
|
13447
13503
|
"Waiting for your bank",
|
|
13448
13504
|
pendingPayment?.amount_pence ? ` \xB7 ${gbp2(pendingPayment.amount_pence)}` : "",
|
|
13449
13505
|
" \xB7",
|
|
@@ -13461,7 +13517,7 @@ function ProjectPlanCard({
|
|
|
13461
13517
|
]
|
|
13462
13518
|
}
|
|
13463
13519
|
)
|
|
13464
|
-
] }) : paidPayment && addons && /* @__PURE__ */ jsxRuntime.jsx(
|
|
13520
|
+
] }) : paidPayment && addons && /* @__PURE__ */ jsxRuntime.jsx(chunkRHKFCSFC_cjs.PlanNotice, { testId: "plan-payment-state", children: paidLine(paidPayment, addons) }),
|
|
13465
13521
|
isPro && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
13466
13522
|
"button",
|
|
13467
13523
|
{
|
|
@@ -13488,7 +13544,7 @@ function ProjectBilling({
|
|
|
13488
13544
|
const { addons } = project;
|
|
13489
13545
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-4", "data-testid": "project-billing", children: [
|
|
13490
13546
|
/* @__PURE__ */ jsxRuntime.jsx(ProjectPlanCard, { project, onChangePlan }),
|
|
13491
|
-
addons &&
|
|
13547
|
+
addons && chunkLYF47OXX_cjs.isProProject(project) && /* @__PURE__ */ jsxRuntime.jsx(ProjectUsageCard, { project, addons })
|
|
13492
13548
|
] });
|
|
13493
13549
|
}
|
|
13494
13550
|
var BREAKDOWN_LABELS = {
|
|
@@ -13623,13 +13679,13 @@ function ProjectUsageContent({
|
|
|
13623
13679
|
};
|
|
13624
13680
|
const quotaPct = effectiveUsage && aiUsageLimit ? Math.round(effectiveUsage.total_spend / aiUsageLimit * 100) : 0;
|
|
13625
13681
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
13626
|
-
|
|
13682
|
+
chunkRHKFCSFC_cjs.UsagePanel,
|
|
13627
13683
|
{
|
|
13628
13684
|
state,
|
|
13629
13685
|
dateRange,
|
|
13630
13686
|
emptyMessage: `No usage ${period === "current" ? "yet this month" : "last month"}.`,
|
|
13631
13687
|
period: /* @__PURE__ */ jsxRuntime.jsx(
|
|
13632
|
-
|
|
13688
|
+
chunkRHKFCSFC_cjs.UsageToggle,
|
|
13633
13689
|
{
|
|
13634
13690
|
ariaLabel: "Period",
|
|
13635
13691
|
value: period,
|
|
@@ -13642,7 +13698,7 @@ function ProjectUsageContent({
|
|
|
13642
13698
|
),
|
|
13643
13699
|
actions: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
13644
13700
|
effectiveUsage?.invoice_pdf && /* @__PURE__ */ jsxRuntime.jsx(
|
|
13645
|
-
|
|
13701
|
+
chunkRHKFCSFC_cjs.UsageActionButton,
|
|
13646
13702
|
{
|
|
13647
13703
|
label: "Download Stripe invoice PDF",
|
|
13648
13704
|
icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Download, { className: "size-3.5" }),
|
|
@@ -13650,7 +13706,7 @@ function ProjectUsageContent({
|
|
|
13650
13706
|
}
|
|
13651
13707
|
),
|
|
13652
13708
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
13653
|
-
|
|
13709
|
+
chunkRHKFCSFC_cjs.UsageActionButton,
|
|
13654
13710
|
{
|
|
13655
13711
|
label: "Print usage summary",
|
|
13656
13712
|
icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Printer, { className: "size-3.5" }),
|
|
@@ -13660,7 +13716,7 @@ function ProjectUsageContent({
|
|
|
13660
13716
|
] }),
|
|
13661
13717
|
children: effectiveUsage && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
13662
13718
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
13663
|
-
|
|
13719
|
+
chunkRHKFCSFC_cjs.UsageSummary,
|
|
13664
13720
|
{
|
|
13665
13721
|
stats: [
|
|
13666
13722
|
{
|
|
@@ -13668,7 +13724,7 @@ function ProjectUsageContent({
|
|
|
13668
13724
|
value: /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: react.formatGbp(effectiveUsage.total_spend) }),
|
|
13669
13725
|
label: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
13670
13726
|
"AI usage",
|
|
13671
|
-
quotaPct > 0 ? /* @__PURE__ */ jsxRuntime.jsxs(
|
|
13727
|
+
quotaPct > 0 ? /* @__PURE__ */ jsxRuntime.jsxs(chunkRHKFCSFC_cjs.UsageQuotaHint, { children: [
|
|
13672
13728
|
"(",
|
|
13673
13729
|
quotaPct,
|
|
13674
13730
|
"% of quota)"
|
|
@@ -13689,7 +13745,7 @@ function ProjectUsageContent({
|
|
|
13689
13745
|
}
|
|
13690
13746
|
),
|
|
13691
13747
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
13692
|
-
|
|
13748
|
+
chunkRHKFCSFC_cjs.UsageToggle,
|
|
13693
13749
|
{
|
|
13694
13750
|
ariaLabel: "Breakdown by",
|
|
13695
13751
|
size: "fill",
|
|
@@ -13702,12 +13758,12 @@ function ProjectUsageContent({
|
|
|
13702
13758
|
}
|
|
13703
13759
|
),
|
|
13704
13760
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
13705
|
-
|
|
13761
|
+
chunkRHKFCSFC_cjs.UsageSection,
|
|
13706
13762
|
{
|
|
13707
|
-
footer: /* @__PURE__ */ jsxRuntime.jsx(
|
|
13763
|
+
footer: /* @__PURE__ */ jsxRuntime.jsx(chunkRHKFCSFC_cjs.UsageLegend, { series }),
|
|
13708
13764
|
title: `Daily AI usage${breakdown === "model" ? ` by ${BREAKDOWN_LABELS[breakdown]}` : ""}`,
|
|
13709
13765
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
13710
|
-
|
|
13766
|
+
chunkRHKFCSFC_cjs.UsageLineChart,
|
|
13711
13767
|
{
|
|
13712
13768
|
dates,
|
|
13713
13769
|
series,
|
|
@@ -13718,12 +13774,12 @@ function ProjectUsageContent({
|
|
|
13718
13774
|
}
|
|
13719
13775
|
),
|
|
13720
13776
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
13721
|
-
|
|
13777
|
+
chunkRHKFCSFC_cjs.UsageSection,
|
|
13722
13778
|
{
|
|
13723
13779
|
title: "Breakdown",
|
|
13724
13780
|
gap: "md",
|
|
13725
13781
|
action: /* @__PURE__ */ jsxRuntime.jsx(
|
|
13726
|
-
|
|
13782
|
+
chunkRHKFCSFC_cjs.UsageToggle,
|
|
13727
13783
|
{
|
|
13728
13784
|
ariaLabel: "Breakdown metric",
|
|
13729
13785
|
value: metric,
|
|
@@ -13735,7 +13791,7 @@ function ProjectUsageContent({
|
|
|
13735
13791
|
}
|
|
13736
13792
|
),
|
|
13737
13793
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
13738
|
-
|
|
13794
|
+
chunkRHKFCSFC_cjs.UsageProportionBar,
|
|
13739
13795
|
{
|
|
13740
13796
|
metric,
|
|
13741
13797
|
items: breakdownItems.map((item) => ({
|
|
@@ -13753,13 +13809,13 @@ function ProjectUsageContent({
|
|
|
13753
13809
|
);
|
|
13754
13810
|
}
|
|
13755
13811
|
function ProjectDetail({ projectExtId, storage }) {
|
|
13756
|
-
const { stripeEnabled } =
|
|
13812
|
+
const { stripeEnabled } = chunkLYF47OXX_cjs.useBillingSupport();
|
|
13757
13813
|
const [planOpen, setPlanOpen] = React7.useState(false);
|
|
13758
13814
|
const [renameOpen, setRenameOpen] = React7.useState(false);
|
|
13759
13815
|
const [renameValue, setRenameValue] = React7.useState("");
|
|
13760
13816
|
const updateProject = react.useUpdateProjectFields();
|
|
13761
13817
|
const { data: projects, isLoading } = react.useProjects();
|
|
13762
|
-
const currentUserExtId =
|
|
13818
|
+
const currentUserExtId = chunkLYF47OXX_cjs.useSelfExtId();
|
|
13763
13819
|
const project = projects?.find((p) => p.external_id === projectExtId);
|
|
13764
13820
|
const handleSaveRename = React7.useCallback(() => {
|
|
13765
13821
|
const trimmed = renameValue.trim();
|
|
@@ -13793,7 +13849,7 @@ function ProjectDetail({ projectExtId, storage }) {
|
|
|
13793
13849
|
}
|
|
13794
13850
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "p-6 space-y-6 max-w-4xl", "data-testid": `project-detail-${project.external_id}`, children: [
|
|
13795
13851
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
13796
|
-
|
|
13852
|
+
chunkRHKFCSFC_cjs.ProjectDetailHeader,
|
|
13797
13853
|
{
|
|
13798
13854
|
icon: /* @__PURE__ */ jsxRuntime.jsx(ui.EntityIcon, { entityType: "PROJECT" }),
|
|
13799
13855
|
name: project.name,
|
|
@@ -13801,11 +13857,11 @@ function ProjectDetail({ projectExtId, storage }) {
|
|
|
13801
13857
|
setRenameValue(project.name);
|
|
13802
13858
|
setRenameOpen(true);
|
|
13803
13859
|
},
|
|
13804
|
-
badge: stripeEnabled ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
13860
|
+
badge: stripeEnabled ? /* @__PURE__ */ jsxRuntime.jsx(chunkRHKFCSFC_cjs.PlanBadge, { ...chunkLYF47OXX_cjs.planBadgeView(project), size: "md" }) : void 0
|
|
13805
13861
|
}
|
|
13806
13862
|
),
|
|
13807
13863
|
hasBilling && /* @__PURE__ */ jsxRuntime.jsx(ProjectBilling, { project, onChangePlan: () => setPlanOpen(true) }),
|
|
13808
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
13864
|
+
/* @__PURE__ */ jsxRuntime.jsxs(chunkRHKFCSFC_cjs.ProjectDetailSection, { title: hasBilling ? "Collaborator limits" : "Plan limits", children: [
|
|
13809
13865
|
!hasBilling && /* @__PURE__ */ jsxRuntime.jsx(SubscriptionStatus, { project }),
|
|
13810
13866
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
13811
13867
|
"div",
|
|
@@ -13821,7 +13877,7 @@ function ProjectDetail({ projectExtId, storage }) {
|
|
|
13821
13877
|
}
|
|
13822
13878
|
)
|
|
13823
13879
|
] }),
|
|
13824
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
13880
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkRHKFCSFC_cjs.ProjectDetailSection, { title: "Usage", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
13825
13881
|
ProjectUsageContent,
|
|
13826
13882
|
{
|
|
13827
13883
|
projectExtId: project.external_id,
|
|
@@ -13831,7 +13887,7 @@ function ProjectDetail({ projectExtId, storage }) {
|
|
|
13831
13887
|
) }),
|
|
13832
13888
|
storage,
|
|
13833
13889
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
13834
|
-
|
|
13890
|
+
chunkRHKFCSFC_cjs.RenameDialog,
|
|
13835
13891
|
{
|
|
13836
13892
|
open: renameOpen,
|
|
13837
13893
|
onClose: () => setRenameOpen(false),
|
|
@@ -13846,7 +13902,7 @@ function ProjectDetail({ projectExtId, storage }) {
|
|
|
13846
13902
|
] });
|
|
13847
13903
|
}
|
|
13848
13904
|
function createProjectErrorMessage(error, fallback = "Failed to create project") {
|
|
13849
|
-
const detail =
|
|
13905
|
+
const detail = chunkLYF47OXX_cjs.apiErrorDetail(error);
|
|
13850
13906
|
if (typeof detail === "string" && detail) return detail;
|
|
13851
13907
|
const message = detail?.message;
|
|
13852
13908
|
return typeof message === "string" && message ? message : fallback;
|
|
@@ -13856,7 +13912,7 @@ function NewProjectFlow({ open, onOpenChange, defaultName }) {
|
|
|
13856
13912
|
const [plan, setPlan] = React7.useState("pro");
|
|
13857
13913
|
const [isAnnual, setIsAnnual] = React7.useState(false);
|
|
13858
13914
|
const [promoCode, setPromoCode] = React7.useState("");
|
|
13859
|
-
const [addonBudget, setAddonBudget] = React7.useState(String(
|
|
13915
|
+
const [addonBudget, setAddonBudget] = React7.useState(String(chunkLYF47OXX_cjs.DEFAULT_SPEND_CAP_PENCE / 100));
|
|
13860
13916
|
const [checkoutBudget, setCheckoutBudget] = React7.useState(null);
|
|
13861
13917
|
const [aiBlocks, setAiBlocks] = React7.useState(0);
|
|
13862
13918
|
const [storageBlocks, setStorageBlocks] = React7.useState(0);
|
|
@@ -13870,7 +13926,7 @@ function NewProjectFlow({ open, onOpenChange, defaultName }) {
|
|
|
13870
13926
|
const [checkoutProjectName, setCheckoutProjectName] = React7.useState("");
|
|
13871
13927
|
const [checkoutInterval, setCheckoutInterval] = React7.useState("month");
|
|
13872
13928
|
const paymentCompletedRef = React7.useRef(false);
|
|
13873
|
-
const { stripeEnabled } =
|
|
13929
|
+
const { stripeEnabled } = chunkLYF47OXX_cjs.useBillingSupport();
|
|
13874
13930
|
const { data: products, isLoading: productsLoading } = react.useProducts({
|
|
13875
13931
|
enabled: stripeEnabled
|
|
13876
13932
|
});
|
|
@@ -13899,18 +13955,18 @@ function NewProjectFlow({ open, onOpenChange, defaultName }) {
|
|
|
13899
13955
|
setPlan("pro");
|
|
13900
13956
|
setPromoCode("");
|
|
13901
13957
|
setPostalCode("");
|
|
13902
|
-
setAddonBudget(String(
|
|
13958
|
+
setAddonBudget(String(chunkLYF47OXX_cjs.DEFAULT_SPEND_CAP_PENCE / 100));
|
|
13903
13959
|
setAiBlocks(0);
|
|
13904
13960
|
setStorageBlocks(0);
|
|
13905
13961
|
setIsCreating(false);
|
|
13906
13962
|
}
|
|
13907
13963
|
onOpenChange(newOpen);
|
|
13908
13964
|
};
|
|
13909
|
-
const prices =
|
|
13965
|
+
const prices = chunkLYF47OXX_cjs.findProPrices(products);
|
|
13910
13966
|
const intervalPrice = isAnnual ? prices.annual : prices.monthly;
|
|
13911
|
-
const selectedPrice =
|
|
13967
|
+
const selectedPrice = chunkLYF47OXX_cjs.packPrice(intervalPrice);
|
|
13912
13968
|
const currency = intervalPrice?.currency ?? "gbp";
|
|
13913
|
-
const savingsPercent =
|
|
13969
|
+
const savingsPercent = chunkLYF47OXX_cjs.calcSavingsPercent(prices.monthly, prices.annual);
|
|
13914
13970
|
const isPro = stripeEnabled && plan !== "free";
|
|
13915
13971
|
const quote = useCheckoutQuote({
|
|
13916
13972
|
interval: isAnnual ? "year" : "month",
|
|
@@ -13920,14 +13976,14 @@ function NewProjectFlow({ open, onOpenChange, defaultName }) {
|
|
|
13920
13976
|
storageBlocks,
|
|
13921
13977
|
enabled: open && isPro && !!selectedPrice
|
|
13922
13978
|
});
|
|
13923
|
-
const canSubmit = !!projectName.trim() && !isCreating && !createProject.isPending && (!isPro || !!selectedPrice &&
|
|
13979
|
+
const canSubmit = !!projectName.trim() && !isCreating && !createProject.isPending && (!isPro || !!selectedPrice && chunkLYF47OXX_cjs.parseBudgetPounds(addonBudget) !== void 0 && quote.canContinue);
|
|
13924
13980
|
const handleCreateFree = () => {
|
|
13925
13981
|
setIsCreating(true);
|
|
13926
13982
|
createProject.mutate(
|
|
13927
13983
|
{
|
|
13928
13984
|
name: projectName.trim(),
|
|
13929
13985
|
plan: "free",
|
|
13930
|
-
daily_cap_per_user:
|
|
13986
|
+
daily_cap_per_user: chunkLYF47OXX_cjs.SUGGESTED_DAILY_CAP_PER_USER
|
|
13931
13987
|
},
|
|
13932
13988
|
{
|
|
13933
13989
|
onSuccess: () => {
|
|
@@ -13944,14 +14000,14 @@ function NewProjectFlow({ open, onOpenChange, defaultName }) {
|
|
|
13944
14000
|
};
|
|
13945
14001
|
const handleSubscribe = () => {
|
|
13946
14002
|
const interval = isAnnual ? "year" : "month";
|
|
13947
|
-
const parsed =
|
|
13948
|
-
const budgetToSend = parsed == null || parsed ===
|
|
14003
|
+
const parsed = chunkLYF47OXX_cjs.parseBudgetPounds(addonBudget);
|
|
14004
|
+
const budgetToSend = parsed == null || parsed === chunkLYF47OXX_cjs.DEFAULT_SPEND_CAP_PENCE ? null : parsed;
|
|
13949
14005
|
setIsCreating(true);
|
|
13950
14006
|
createProject.mutate(
|
|
13951
14007
|
{
|
|
13952
14008
|
name: projectName.trim(),
|
|
13953
14009
|
plan: "pro",
|
|
13954
|
-
daily_cap_per_user:
|
|
14010
|
+
daily_cap_per_user: chunkLYF47OXX_cjs.SUGGESTED_DAILY_CAP_PER_USER
|
|
13955
14011
|
},
|
|
13956
14012
|
{
|
|
13957
14013
|
onSuccess: (newProject) => {
|
|
@@ -13992,8 +14048,8 @@ function NewProjectFlow({ open, onOpenChange, defaultName }) {
|
|
|
13992
14048
|
description: stripeEnabled ? "Name it and pick a plan." : "Projects group your workspaces.",
|
|
13993
14049
|
showDescription: true,
|
|
13994
14050
|
size: "xl",
|
|
13995
|
-
children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
13996
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
14051
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(chunkRHKFCSFC_cjs.PlanStack, { gap: 5, children: [
|
|
14052
|
+
/* @__PURE__ */ jsxRuntime.jsxs(chunkRHKFCSFC_cjs.PlanStack, { gap: 2, children: [
|
|
13997
14053
|
/* @__PURE__ */ jsxRuntime.jsx(ui.Label, { htmlFor: "new-project-name", children: "Name" }),
|
|
13998
14054
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
13999
14055
|
ui.Input,
|
|
@@ -14009,16 +14065,16 @@ function NewProjectFlow({ open, onOpenChange, defaultName }) {
|
|
|
14009
14065
|
}
|
|
14010
14066
|
)
|
|
14011
14067
|
] }),
|
|
14012
|
-
stripeEnabled && (productsLoading ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
14013
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
14068
|
+
stripeEnabled && (productsLoading ? /* @__PURE__ */ jsxRuntime.jsx(chunkRHKFCSFC_cjs.PlanNotice, { children: "Loading plans\u2026" }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
14069
|
+
/* @__PURE__ */ jsxRuntime.jsxs(chunkRHKFCSFC_cjs.PlanPickerCard, { children: [
|
|
14014
14070
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
14015
|
-
|
|
14071
|
+
chunkRHKFCSFC_cjs.PlanPickerHeader,
|
|
14016
14072
|
{
|
|
14017
14073
|
title: "Plan",
|
|
14018
14074
|
info: /* @__PURE__ */ jsxRuntime.jsx(PlanInfoPopover2, {}),
|
|
14019
14075
|
infoPlacement: "toggle",
|
|
14020
14076
|
toggle: plan !== "free" ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
14021
|
-
|
|
14077
|
+
chunkRHKFCSFC_cjs.PricingToggle,
|
|
14022
14078
|
{
|
|
14023
14079
|
isAnnual,
|
|
14024
14080
|
onToggle: () => setIsAnnual(!isAnnual),
|
|
@@ -14056,7 +14112,7 @@ function NewProjectFlow({ open, onOpenChange, defaultName }) {
|
|
|
14056
14112
|
currency
|
|
14057
14113
|
}
|
|
14058
14114
|
),
|
|
14059
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
14115
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkRHKFCSFC_cjs.PromoCodeInput, { value: promoCode, onChange: setPromoCode }),
|
|
14060
14116
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
14061
14117
|
CheckoutCountrySelect,
|
|
14062
14118
|
{
|
|
@@ -14075,10 +14131,10 @@ function NewProjectFlow({ open, onOpenChange, defaultName }) {
|
|
|
14075
14131
|
onPostalCodeChange: setPostalCode
|
|
14076
14132
|
}
|
|
14077
14133
|
)
|
|
14078
|
-
] }) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
14134
|
+
] }) : /* @__PURE__ */ jsxRuntime.jsx(chunkRHKFCSFC_cjs.PlanNotice, { children: "Pro isn't available right now." }))
|
|
14079
14135
|
] })),
|
|
14080
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
14081
|
-
isSlow && /* @__PURE__ */ jsxRuntime.jsx(
|
|
14136
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkRHKFCSFC_cjs.PlanActionButton, { onClick: submit, disabled: !canSubmit, children: isCreating ? "Creating\u2026" : isPro ? "Continue to payment" : "Create project" }),
|
|
14137
|
+
isSlow && /* @__PURE__ */ jsxRuntime.jsx(chunkRHKFCSFC_cjs.PlanNotice, { className: "text-xs", testId: "new-project-still-working", children: "Still working. We'll update here." })
|
|
14082
14138
|
] })
|
|
14083
14139
|
}
|
|
14084
14140
|
),
|
|
@@ -14106,7 +14162,7 @@ function NewProjectFlow({ open, onOpenChange, defaultName }) {
|
|
|
14106
14162
|
function useAutoRefreshPendingProjects() {
|
|
14107
14163
|
const { data: projects } = react.useProjects();
|
|
14108
14164
|
const refreshProject = react.useRefreshProject();
|
|
14109
|
-
const currentUserExtId =
|
|
14165
|
+
const currentUserExtId = chunkLYF47OXX_cjs.useSelfExtId();
|
|
14110
14166
|
const refreshedRef = React7.useRef(/* @__PURE__ */ new Set());
|
|
14111
14167
|
React7.useEffect(() => {
|
|
14112
14168
|
if (!projects || !currentUserExtId) return;
|
|
@@ -14137,7 +14193,7 @@ function ConnectedQuotaDialog({ info, onClose: close }) {
|
|
|
14137
14193
|
if (quotaProjectId) void refetchProjects();
|
|
14138
14194
|
}, [quotaProjectId, refetchProjects]);
|
|
14139
14195
|
const project = info?.projectExtId ? projects?.find((p) => p.external_id === info.projectExtId) : void 0;
|
|
14140
|
-
const addons = project &&
|
|
14196
|
+
const addons = project && chunkLYF47OXX_cjs.isProProject(project) ? project.addons : null;
|
|
14141
14197
|
const handleUpgrade = () => {
|
|
14142
14198
|
if (info?.projectExtId) {
|
|
14143
14199
|
requestProjectBillingFocus({ projectExtId: info.projectExtId, openUpgrade: true });
|
|
@@ -14173,8 +14229,8 @@ function ConnectedQuotaDialog({ info, onClose: close }) {
|
|
|
14173
14229
|
/* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, {})
|
|
14174
14230
|
);
|
|
14175
14231
|
} else if (addons) {
|
|
14176
|
-
const price = `${
|
|
14177
|
-
const capZero =
|
|
14232
|
+
const price = `${chunkLYF47OXX_cjs.formatMoney(addons.ai_block_price_ex_vat_pence, "gbp")} + VAT`;
|
|
14233
|
+
const capZero = chunkLYF47OXX_cjs.isAddonBudgetZero(addons);
|
|
14178
14234
|
const addAiUsage = /* @__PURE__ */ jsxRuntime.jsxs(ui.Button, { onClick: handleAddAiUsage, "data-testid": "quota-add-ai-usage-button", children: [
|
|
14179
14235
|
"Add ",
|
|
14180
14236
|
react.formatGbp(addons.block_ai_gbp),
|
|
@@ -14182,7 +14238,7 @@ function ConnectedQuotaDialog({ info, onClose: close }) {
|
|
|
14182
14238
|
price
|
|
14183
14239
|
] });
|
|
14184
14240
|
if (capZero || addons.cap_reached) {
|
|
14185
|
-
message = capZero ?
|
|
14241
|
+
message = capZero ? chunkLYF47OXX_cjs.ZERO_BUDGET_MESSAGE : chunkLYF47OXX_cjs.CAP_REACHED_MESSAGE;
|
|
14186
14242
|
actions = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
14187
14243
|
addAiUsage,
|
|
14188
14244
|
/* @__PURE__ */ jsxRuntime.jsx(ui.Button, { variant: "outline", onClick: handleRaiseCap, "data-testid": "quota-raise-cap-button", children: capZero ? "Set cap" : "Raise cap" })
|
|
@@ -14195,7 +14251,7 @@ function ConnectedQuotaDialog({ info, onClose: close }) {
|
|
|
14195
14251
|
const addAiUsageProject = addAiUsageFor ? projects?.find((p) => p.external_id === addAiUsageFor) : void 0;
|
|
14196
14252
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
14197
14253
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
14198
|
-
|
|
14254
|
+
chunkRHKFCSFC_cjs.QuotaExceededDialogView,
|
|
14199
14255
|
{
|
|
14200
14256
|
open,
|
|
14201
14257
|
onClose: close,
|
|
@@ -14292,7 +14348,7 @@ function ConnectedWelcomeDialog({
|
|
|
14292
14348
|
}) {
|
|
14293
14349
|
const currentUser = react.useArbiSession().user;
|
|
14294
14350
|
const { data: projects } = react.useProjects();
|
|
14295
|
-
const balance =
|
|
14351
|
+
const balance = chunkLYF47OXX_cjs.useRewardBalance();
|
|
14296
14352
|
const [showPlans, setShowPlans] = React7.useState(false);
|
|
14297
14353
|
const [showInvite, setShowInvite] = React7.useState(false);
|
|
14298
14354
|
const [selectedProjectId, setSelectedProjectId] = React7.useState(null);
|
|
@@ -14313,25 +14369,25 @@ function ConnectedWelcomeDialog({
|
|
|
14313
14369
|
return /* @__PURE__ */ jsxRuntime.jsx(ChangePlanDialog, { project: selectedProject, open, onOpenChange: handleOpenChange });
|
|
14314
14370
|
}
|
|
14315
14371
|
if (showInvite) {
|
|
14316
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
14372
|
+
return /* @__PURE__ */ jsxRuntime.jsx(chunkRHKFCSFC_cjs.InviteContactsDialog, { open, onClose: () => handleOpenChange(false), children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
14317
14373
|
ConnectedAddContacts,
|
|
14318
14374
|
{
|
|
14319
14375
|
onClose: () => handleOpenChange(false),
|
|
14320
|
-
rewardAmount:
|
|
14376
|
+
rewardAmount: chunkLYF47OXX_cjs.formatMoney(REFERRAL_OFFER.amount, REFERRAL_OFFER.currency)
|
|
14321
14377
|
}
|
|
14322
14378
|
) });
|
|
14323
14379
|
}
|
|
14324
|
-
const
|
|
14380
|
+
const firstName2 = currentUser?.given_name;
|
|
14325
14381
|
const hasBalance = balance !== null;
|
|
14326
|
-
const quotaItems =
|
|
14327
|
-
const resetTs =
|
|
14328
|
-
const aiUsageHint = resetTs ? `resets ${
|
|
14382
|
+
const quotaItems = chunkLYF47OXX_cjs.getQuotaItems(selectedProject.quotas);
|
|
14383
|
+
const resetTs = chunkLYF47OXX_cjs.aiUsageResetTimestamp(selectedProject);
|
|
14384
|
+
const aiUsageHint = resetTs ? `resets ${chunkLYF47OXX_cjs.formatResetDate(resetTs)}` : void 0;
|
|
14329
14385
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
14330
|
-
|
|
14386
|
+
chunkRHKFCSFC_cjs.WelcomeDialog,
|
|
14331
14387
|
{
|
|
14332
14388
|
open,
|
|
14333
14389
|
onClose: () => handleOpenChange(false),
|
|
14334
|
-
firstName,
|
|
14390
|
+
firstName: firstName2,
|
|
14335
14391
|
hasReward: hasBalance,
|
|
14336
14392
|
projectPicker: /* @__PURE__ */ jsxRuntime.jsx(
|
|
14337
14393
|
chunkKJVDYWAM_cjs.ProjectPicker,
|
|
@@ -14342,7 +14398,7 @@ function ConnectedWelcomeDialog({
|
|
|
14342
14398
|
onChange: setSelectedProjectId
|
|
14343
14399
|
}
|
|
14344
14400
|
),
|
|
14345
|
-
planBadge: /* @__PURE__ */ jsxRuntime.jsx(
|
|
14401
|
+
planBadge: /* @__PURE__ */ jsxRuntime.jsx(chunkRHKFCSFC_cjs.PlanBadge, { ...chunkLYF47OXX_cjs.planBadgeView(selectedProject), size: "md" }),
|
|
14346
14402
|
quotas: quotaItems.map((q) => ({
|
|
14347
14403
|
key: q.key,
|
|
14348
14404
|
icon: q.icon,
|
|
@@ -14352,9 +14408,9 @@ function ConnectedWelcomeDialog({
|
|
|
14352
14408
|
hint: q.key === "ai-usage" ? aiUsageHint : void 0
|
|
14353
14409
|
})),
|
|
14354
14410
|
onSeePlans: () => setShowPlans(true),
|
|
14355
|
-
referralOfferLabel: `${
|
|
14411
|
+
referralOfferLabel: `${chunkLYF47OXX_cjs.formatMoney(REFERRAL_OFFER.amount, REFERRAL_OFFER.currency)} off your plan`,
|
|
14356
14412
|
onInvite: () => setShowInvite(true),
|
|
14357
|
-
rewardBalanceLabel: hasBalance ?
|
|
14413
|
+
rewardBalanceLabel: hasBalance ? chunkLYF47OXX_cjs.formatMoney(balance.amount, balance.currency) : void 0
|
|
14358
14414
|
}
|
|
14359
14415
|
);
|
|
14360
14416
|
}
|
|
@@ -14391,7 +14447,7 @@ function WorkspaceCardsView({
|
|
|
14391
14447
|
createDisabledReason,
|
|
14392
14448
|
workspaceState
|
|
14393
14449
|
}) {
|
|
14394
|
-
const { stripeEnabled } =
|
|
14450
|
+
const { stripeEnabled } = chunkLYF47OXX_cjs.useBillingSupport();
|
|
14395
14451
|
const { hrefFor } = chunk2QQUGL2V_cjs.useBlocksEnvironment();
|
|
14396
14452
|
const workspaceLabel = ui.getEntityLabel("WORKSPACE");
|
|
14397
14453
|
const projectLabel = ui.getEntityLabel("PROJECT").toLowerCase();
|
|
@@ -14411,7 +14467,7 @@ function WorkspaceCardsView({
|
|
|
14411
14467
|
}
|
|
14412
14468
|
return /* @__PURE__ */ jsxRuntime.jsx(chunkKJVDYWAM_cjs.WorkspaceList, { testId: "workspace-cards-list", children: groups.map((group) => {
|
|
14413
14469
|
const project = projects.find((p) => p.external_id === group.projectExtId);
|
|
14414
|
-
const { breakdown, readout } =
|
|
14470
|
+
const { breakdown, readout } = chunkLYF47OXX_cjs.projectGroupBilling(project, {
|
|
14415
14471
|
isOwned: group.isOwned,
|
|
14416
14472
|
stripeEnabled
|
|
14417
14473
|
});
|
|
@@ -14570,7 +14626,7 @@ function useConnectedWorkspaceList({
|
|
|
14570
14626
|
[selfId, pinned]
|
|
14571
14627
|
);
|
|
14572
14628
|
const filtered = React7.useMemo(
|
|
14573
|
-
() =>
|
|
14629
|
+
() => chunkRHKFCSFC_cjs.applyTriStateFilters(workspaces, filterMap, attributesOf),
|
|
14574
14630
|
[workspaces, filterMap, attributesOf]
|
|
14575
14631
|
);
|
|
14576
14632
|
const groups = React7.useMemo(
|
|
@@ -14635,7 +14691,7 @@ function useConnectedWorkspaceList({
|
|
|
14635
14691
|
};
|
|
14636
14692
|
}
|
|
14637
14693
|
var WorkspaceTableView = React7.lazy(
|
|
14638
|
-
() => import('../WorkspaceTableView-
|
|
14694
|
+
() => import('../WorkspaceTableView-GIDGNGBW.cjs').then((m) => ({ default: m.WorkspaceTableView }))
|
|
14639
14695
|
);
|
|
14640
14696
|
var WORKSPACES_TAB_ID = "workspaces";
|
|
14641
14697
|
var defaultRenderMember2 = (user, size) => {
|
|
@@ -14687,7 +14743,7 @@ function ConnectedWorkspaceList({
|
|
|
14687
14743
|
else void openWorkspace(workspace.external_id, { name: workspace.name });
|
|
14688
14744
|
};
|
|
14689
14745
|
const createDisabledReason = list.canCreateProjects === false ? react.PROJECT_CREATION_DENIED_REASON : void 0;
|
|
14690
|
-
if (list.isLoading) return /* @__PURE__ */ jsxRuntime.jsx(
|
|
14746
|
+
if (list.isLoading) return /* @__PURE__ */ jsxRuntime.jsx(chunkH3XAHVDT_cjs.LoadingIndicator, { message: "Loading workspaces..." });
|
|
14691
14747
|
if (list.error) {
|
|
14692
14748
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
14693
14749
|
chunkFCWS7I5C_cjs.HomeLoadError,
|
|
@@ -14760,7 +14816,7 @@ function ConnectedWorkspaceList({
|
|
|
14760
14816
|
workspaceState
|
|
14761
14817
|
}
|
|
14762
14818
|
) })
|
|
14763
|
-
) : /* @__PURE__ */ jsxRuntime.jsx(React7.Suspense, { fallback: /* @__PURE__ */ jsxRuntime.jsx(
|
|
14819
|
+
) : /* @__PURE__ */ jsxRuntime.jsx(React7.Suspense, { fallback: /* @__PURE__ */ jsxRuntime.jsx(chunkH3XAHVDT_cjs.LoadingIndicator, { message: "Loading grid..." }), children: /* @__PURE__ */ jsxRuntime.jsx(chunkFCWS7I5C_cjs.HomeCenteredColumn, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
14764
14820
|
WorkspaceTableView,
|
|
14765
14821
|
{
|
|
14766
14822
|
list,
|
|
@@ -14774,6 +14830,242 @@ function ConnectedWorkspaceList({
|
|
|
14774
14830
|
) }) }) })
|
|
14775
14831
|
] });
|
|
14776
14832
|
}
|
|
14833
|
+
function workspaceSummary(w) {
|
|
14834
|
+
return {
|
|
14835
|
+
id: w.external_id,
|
|
14836
|
+
name: w.name,
|
|
14837
|
+
description: w.description ?? void 0,
|
|
14838
|
+
isPublic: !!w.is_public,
|
|
14839
|
+
documentCount: chunkJUUOJP7I_cjs.workspaceDocumentCount(w),
|
|
14840
|
+
conversationCount: chunkJUUOJP7I_cjs.workspaceConversationCount(w),
|
|
14841
|
+
memberCount: w.users?.length ?? 0,
|
|
14842
|
+
filesMb: w.user_files_mb ?? 0,
|
|
14843
|
+
updatedAt: w.updated_at
|
|
14844
|
+
};
|
|
14845
|
+
}
|
|
14846
|
+
function distinctMembers(workspaces) {
|
|
14847
|
+
const byId = /* @__PURE__ */ new Map();
|
|
14848
|
+
for (const w of workspaces) {
|
|
14849
|
+
for (const member of w.users ?? []) {
|
|
14850
|
+
const user = member.user;
|
|
14851
|
+
const id = user?.external_id;
|
|
14852
|
+
if (!id || byId.has(id)) continue;
|
|
14853
|
+
const name = [user.given_name, user.family_name].filter(Boolean).join(" ").trim();
|
|
14854
|
+
byId.set(id, {
|
|
14855
|
+
id,
|
|
14856
|
+
name: name || user.email || "Unknown",
|
|
14857
|
+
email: user.email ?? "",
|
|
14858
|
+
role: member.role ?? "member",
|
|
14859
|
+
isAgent: Boolean(member.agent_ext_id) || chunkJUUOJP7I_cjs.isAgentAccount(user)
|
|
14860
|
+
});
|
|
14861
|
+
}
|
|
14862
|
+
}
|
|
14863
|
+
return [...byId.values()];
|
|
14864
|
+
}
|
|
14865
|
+
function buildProjectSummaries(projects, workspaces) {
|
|
14866
|
+
const byProject = /* @__PURE__ */ new Map();
|
|
14867
|
+
for (const w of workspaces ?? []) {
|
|
14868
|
+
const id = w.project_ext_id;
|
|
14869
|
+
if (!id) continue;
|
|
14870
|
+
byProject.set(id, [...byProject.get(id) ?? [], w]);
|
|
14871
|
+
}
|
|
14872
|
+
const summaries = (projects ?? []).map((p) => {
|
|
14873
|
+
const own = byProject.get(p.external_id) ?? [];
|
|
14874
|
+
const storage = p.quotas?.storage_gb;
|
|
14875
|
+
const aiUsage = p.quotas?.ai_usage;
|
|
14876
|
+
const stats = chunkJUUOJP7I_cjs.workspaceGroupStats(own);
|
|
14877
|
+
return {
|
|
14878
|
+
id: p.external_id,
|
|
14879
|
+
name: p.name,
|
|
14880
|
+
createdAt: p.created_at,
|
|
14881
|
+
subscription: p.subscription ?? "none",
|
|
14882
|
+
workspaces: own.map(workspaceSummary),
|
|
14883
|
+
workspaceCount: own.length,
|
|
14884
|
+
documentCount: stats.documents,
|
|
14885
|
+
conversationCount: stats.conversations,
|
|
14886
|
+
members: distinctMembers(own),
|
|
14887
|
+
memberCount: stats.members,
|
|
14888
|
+
filesMb: own.reduce((sum, w) => sum + (w.user_files_mb ?? 0), 0),
|
|
14889
|
+
storageUsedGb: storage?.used ?? 0,
|
|
14890
|
+
storageLimitGb: storage?.limit ?? 0,
|
|
14891
|
+
aiUsageUsed: aiUsage?.used ?? 0,
|
|
14892
|
+
aiUsageLimit: aiUsage?.limit ?? 0,
|
|
14893
|
+
client: p.client ?? null,
|
|
14894
|
+
clientRef: p.client_ref ?? null,
|
|
14895
|
+
stage: p.stage ?? null,
|
|
14896
|
+
leadUser: p.lead_user ?? null,
|
|
14897
|
+
budget: p.budget ?? null,
|
|
14898
|
+
fields: p.fields ?? {}
|
|
14899
|
+
};
|
|
14900
|
+
});
|
|
14901
|
+
const work = (s) => s.documentCount + s.conversationCount;
|
|
14902
|
+
return summaries.sort((a, b) => work(b) - work(a));
|
|
14903
|
+
}
|
|
14904
|
+
function useProjectSummaries() {
|
|
14905
|
+
const projects = react.useProjects();
|
|
14906
|
+
const workspaces = react.useWorkspaces();
|
|
14907
|
+
const summaries = React7.useMemo(
|
|
14908
|
+
() => buildProjectSummaries(
|
|
14909
|
+
projects.data,
|
|
14910
|
+
workspaces.data
|
|
14911
|
+
),
|
|
14912
|
+
[projects.data, workspaces.data]
|
|
14913
|
+
);
|
|
14914
|
+
return {
|
|
14915
|
+
projects: summaries,
|
|
14916
|
+
isLoading: projects.isLoading || workspaces.isLoading,
|
|
14917
|
+
isError: projects.isError || workspaces.isError,
|
|
14918
|
+
error: projects.error ?? workspaces.error
|
|
14919
|
+
};
|
|
14920
|
+
}
|
|
14921
|
+
function useProjectSummary(projectId) {
|
|
14922
|
+
const { projects, isLoading, isError } = useProjectSummaries();
|
|
14923
|
+
const project = React7.useMemo(() => projects.find((p) => p.id === projectId), [projects, projectId]);
|
|
14924
|
+
const usage = react.useProjectUsage(projectId, 0, { enabled: !!projectId });
|
|
14925
|
+
return { project, usage: usage.data, usageLoading: usage.isLoading, isLoading, isError };
|
|
14926
|
+
}
|
|
14927
|
+
function primaryProjectWorkspace(project) {
|
|
14928
|
+
const work = (w) => w.documentCount + w.conversationCount;
|
|
14929
|
+
return [...project.workspaces].sort((a, b) => work(b) - work(a))[0];
|
|
14930
|
+
}
|
|
14931
|
+
var DEFAULT_PROJECT_LIST_COLUMNS = [
|
|
14932
|
+
"name",
|
|
14933
|
+
"client",
|
|
14934
|
+
"stage",
|
|
14935
|
+
"documents",
|
|
14936
|
+
"conversations",
|
|
14937
|
+
"members",
|
|
14938
|
+
"storage"
|
|
14939
|
+
];
|
|
14940
|
+
var DEFAULT_PROJECTS_LIST_LABELS = {
|
|
14941
|
+
title: "Projects",
|
|
14942
|
+
description: "Every project: its client, stage, documents and the work on it.",
|
|
14943
|
+
searchPlaceholder: "Search projects and workspaces\u2026",
|
|
14944
|
+
columns: {
|
|
14945
|
+
name: "Project",
|
|
14946
|
+
client: "Client",
|
|
14947
|
+
stage: "Stage",
|
|
14948
|
+
documents: "Documents",
|
|
14949
|
+
conversations: "Threads",
|
|
14950
|
+
members: "Team",
|
|
14951
|
+
storage: "Storage"
|
|
14952
|
+
},
|
|
14953
|
+
opened: "opened",
|
|
14954
|
+
loadingTitle: "Loading projects\u2026",
|
|
14955
|
+
loadingDescription: "Fetching your projects.",
|
|
14956
|
+
emptyTitle: "No projects yet"
|
|
14957
|
+
};
|
|
14958
|
+
function formatStorageGb(gb3) {
|
|
14959
|
+
if (gb3 <= 0) return "\u2014";
|
|
14960
|
+
if (gb3 < 0.1) return `${Math.round(gb3 * 1024)} MB`;
|
|
14961
|
+
return `${gb3.toFixed(2)} GB`;
|
|
14962
|
+
}
|
|
14963
|
+
function ProjectsListPage({
|
|
14964
|
+
labels: given,
|
|
14965
|
+
columns: shown = DEFAULT_PROJECT_LIST_COLUMNS,
|
|
14966
|
+
actions,
|
|
14967
|
+
testId = "projects"
|
|
14968
|
+
}) {
|
|
14969
|
+
const labels = {
|
|
14970
|
+
...DEFAULT_PROJECTS_LIST_LABELS,
|
|
14971
|
+
...given,
|
|
14972
|
+
columns: { ...DEFAULT_PROJECTS_LIST_LABELS.columns, ...given?.columns }
|
|
14973
|
+
};
|
|
14974
|
+
const { openProject } = chunk2QQUGL2V_cjs.useBlocksEnvironment();
|
|
14975
|
+
const [search, setSearch] = React7.useState("");
|
|
14976
|
+
const { projects, isLoading } = useProjectSummaries();
|
|
14977
|
+
const rows = React7.useMemo(() => {
|
|
14978
|
+
const q = search.trim().toLowerCase();
|
|
14979
|
+
if (!q) return projects;
|
|
14980
|
+
return projects.filter(
|
|
14981
|
+
(p) => p.name.toLowerCase().includes(q) || p.workspaces.some((w) => w.name.toLowerCase().includes(q))
|
|
14982
|
+
);
|
|
14983
|
+
}, [search, projects]);
|
|
14984
|
+
const all = {
|
|
14985
|
+
name: {
|
|
14986
|
+
key: "name",
|
|
14987
|
+
header: labels.columns.name,
|
|
14988
|
+
render: (p) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "min-w-0", children: [
|
|
14989
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "max-w-[22rem] truncate font-medium text-foreground", children: p.name }),
|
|
14990
|
+
/* @__PURE__ */ jsxRuntime.jsxs("p", { className: "truncate text-xs text-muted-foreground", children: [
|
|
14991
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-mono", children: p.clientRef || p.id }),
|
|
14992
|
+
" \xB7 ",
|
|
14993
|
+
labels.opened,
|
|
14994
|
+
" ",
|
|
14995
|
+
chunkUFEXJIEY_cjs.fmtDate(p.createdAt)
|
|
14996
|
+
] })
|
|
14997
|
+
] })
|
|
14998
|
+
},
|
|
14999
|
+
client: {
|
|
15000
|
+
key: "client",
|
|
15001
|
+
header: labels.columns.client,
|
|
15002
|
+
render: (p) => /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm text-foreground", children: p.client || "\u2014" })
|
|
15003
|
+
},
|
|
15004
|
+
stage: {
|
|
15005
|
+
key: "stage",
|
|
15006
|
+
header: labels.columns.stage,
|
|
15007
|
+
render: (p) => p.stage ? /* @__PURE__ */ jsxRuntime.jsx(ui.Badge, { variant: "secondary", children: p.stage }) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs text-muted-foreground", children: "\u2014" })
|
|
15008
|
+
},
|
|
15009
|
+
documents: {
|
|
15010
|
+
key: "documents",
|
|
15011
|
+
header: labels.columns.documents,
|
|
15012
|
+
align: "right",
|
|
15013
|
+
render: (p) => /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-medium text-foreground", children: p.documentCount.toLocaleString() })
|
|
15014
|
+
},
|
|
15015
|
+
conversations: {
|
|
15016
|
+
key: "conversations",
|
|
15017
|
+
header: labels.columns.conversations,
|
|
15018
|
+
align: "right",
|
|
15019
|
+
render: (p) => /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-medium text-foreground", children: p.conversationCount.toLocaleString() })
|
|
15020
|
+
},
|
|
15021
|
+
members: {
|
|
15022
|
+
key: "team",
|
|
15023
|
+
header: labels.columns.members,
|
|
15024
|
+
render: (p) => p.memberCount ? /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "inline-flex items-center gap-1.5 text-sm text-foreground", children: [
|
|
15025
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Users, { className: "size-3.5 text-muted-foreground" }),
|
|
15026
|
+
p.memberCount
|
|
15027
|
+
] }) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs text-muted-foreground", children: "\u2014" })
|
|
15028
|
+
},
|
|
15029
|
+
storage: {
|
|
15030
|
+
key: "storage",
|
|
15031
|
+
header: labels.columns.storage,
|
|
15032
|
+
align: "right",
|
|
15033
|
+
render: (p) => /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm text-muted-foreground", children: formatStorageGb(p.storageUsedGb) })
|
|
15034
|
+
}
|
|
15035
|
+
};
|
|
15036
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-6", "data-testid": `page-${testId}`, children: [
|
|
15037
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
15038
|
+
chunkXDU3HHUU_cjs.PageHeader,
|
|
15039
|
+
{
|
|
15040
|
+
eyebrow: labels.eyebrow,
|
|
15041
|
+
title: labels.title,
|
|
15042
|
+
description: labels.description,
|
|
15043
|
+
actions
|
|
15044
|
+
}
|
|
15045
|
+
),
|
|
15046
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
15047
|
+
chunkH3XAHVDT_cjs.Toolbar,
|
|
15048
|
+
{
|
|
15049
|
+
search,
|
|
15050
|
+
onSearch: setSearch,
|
|
15051
|
+
searchPlaceholder: labels.searchPlaceholder,
|
|
15052
|
+
testId: `${testId}-toolbar`
|
|
15053
|
+
}
|
|
15054
|
+
),
|
|
15055
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
15056
|
+
chunkXDU3HHUU_cjs.DataTable,
|
|
15057
|
+
{
|
|
15058
|
+
area: testId,
|
|
15059
|
+
columns: shown.map((c) => all[c]),
|
|
15060
|
+
rows,
|
|
15061
|
+
getRowId: (p) => p.id,
|
|
15062
|
+
onRowClick: (p) => openProject(p.id),
|
|
15063
|
+
emptyTitle: isLoading ? labels.loadingTitle : labels.emptyTitle,
|
|
15064
|
+
emptyDescription: isLoading ? labels.loadingDescription : labels.emptyDescription
|
|
15065
|
+
}
|
|
15066
|
+
)
|
|
15067
|
+
] });
|
|
15068
|
+
}
|
|
14777
15069
|
var PROJECTS_BASE_TAB_ID = "projects";
|
|
14778
15070
|
var isPaid = (p) => p.subscription === "active" || p.subscription === "past_due";
|
|
14779
15071
|
function useLocalProjectTabs() {
|
|
@@ -14793,6 +15085,13 @@ function useLocalProjectTabs() {
|
|
|
14793
15085
|
};
|
|
14794
15086
|
}
|
|
14795
15087
|
function ConnectedProjectsPanel({
|
|
15088
|
+
layout = "panel",
|
|
15089
|
+
page,
|
|
15090
|
+
...panel
|
|
15091
|
+
}) {
|
|
15092
|
+
return layout === "page" ? /* @__PURE__ */ jsxRuntime.jsx(ProjectsListPage, { ...page }) : /* @__PURE__ */ jsxRuntime.jsx(ProjectsPanel, { ...panel });
|
|
15093
|
+
}
|
|
15094
|
+
function ProjectsPanel({
|
|
14796
15095
|
tabs: hostTabs,
|
|
14797
15096
|
projectStorage,
|
|
14798
15097
|
footer,
|
|
@@ -14809,7 +15108,7 @@ function ConnectedProjectsPanel({
|
|
|
14809
15108
|
const { data: projects } = react.useProjects();
|
|
14810
15109
|
const canCreateProjects = react.useCanCreateProjects();
|
|
14811
15110
|
const { userId } = chunkIWT4QVQL_cjs.useConnectedWorkspace();
|
|
14812
|
-
const { stripeEnabled } =
|
|
15111
|
+
const { stripeEnabled } = chunkLYF47OXX_cjs.useBillingSupport();
|
|
14813
15112
|
const billingPortal = useOpenBillingPortal();
|
|
14814
15113
|
const [newProjectOpen, setNewProjectOpen] = React7.useState(false);
|
|
14815
15114
|
useAutoRefreshPendingProjects();
|
|
@@ -14836,15 +15135,15 @@ function ConnectedProjectsPanel({
|
|
|
14836
15135
|
[ownedCount, tabs, projects]
|
|
14837
15136
|
);
|
|
14838
15137
|
const paidProject = projects?.find(isPaid);
|
|
14839
|
-
const panel = /* @__PURE__ */ jsxRuntime.jsxs(
|
|
14840
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
15138
|
+
const panel = /* @__PURE__ */ jsxRuntime.jsxs(chunkRHKFCSFC_cjs.PanelFrame, { className, testId: "projects-panel", children: [
|
|
15139
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkRHKFCSFC_cjs.DraggableHeader, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
14841
15140
|
chunkMEMWZ72Y_cjs.TabHeader,
|
|
14842
15141
|
{
|
|
14843
15142
|
tabs: headerTabs,
|
|
14844
15143
|
activeTabId: activeProjectId ?? PROJECTS_BASE_TAB_ID,
|
|
14845
15144
|
onTabChange: (id) => tabs.onSelect(id === PROJECTS_BASE_TAB_ID ? null : id),
|
|
14846
15145
|
afterTabs: (isCompact) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
14847
|
-
|
|
15146
|
+
chunkRHKFCSFC_cjs.PanelAddButton,
|
|
14848
15147
|
{
|
|
14849
15148
|
label: "New project",
|
|
14850
15149
|
onClick: () => setNewProjectOpen(true),
|
|
@@ -14859,15 +15158,15 @@ function ConnectedProjectsPanel({
|
|
|
14859
15158
|
compactBreakpoint: 360
|
|
14860
15159
|
}
|
|
14861
15160
|
) }),
|
|
14862
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
15161
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkRHKFCSFC_cjs.PanelFrameBody, { children: activeProjectId ? /* @__PURE__ */ jsxRuntime.jsx(chunkRHKFCSFC_cjs.PanelScroll, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
14863
15162
|
ProjectDetail,
|
|
14864
15163
|
{
|
|
14865
15164
|
projectExtId: activeProjectId,
|
|
14866
15165
|
storage: projectStorage?.(activeProjectId)
|
|
14867
15166
|
}
|
|
14868
|
-
) }) : /* @__PURE__ */ jsxRuntime.jsxs(
|
|
15167
|
+
) }) : /* @__PURE__ */ jsxRuntime.jsxs(chunkRHKFCSFC_cjs.PanelScroll, { variant: "padded", children: [
|
|
14869
15168
|
/* @__PURE__ */ jsxRuntime.jsx(ProjectsTable, {}),
|
|
14870
|
-
stripeEnabled && paidProject && /* @__PURE__ */ jsxRuntime.jsx(
|
|
15169
|
+
stripeEnabled && paidProject && /* @__PURE__ */ jsxRuntime.jsx(chunkRHKFCSFC_cjs.PanelActionsRow, { children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
14871
15170
|
ui.Button,
|
|
14872
15171
|
{
|
|
14873
15172
|
onClick: () => billingPortal.open(paidProject.external_id),
|
|
@@ -14895,104 +15194,6 @@ function ConnectedProjectsPanel({
|
|
|
14895
15194
|
] });
|
|
14896
15195
|
return hostTabs ? panel : /* @__PURE__ */ jsxRuntime.jsx(chunkMB3S2ETI_cjs.ArbiHost, { config: localHost, children: panel });
|
|
14897
15196
|
}
|
|
14898
|
-
function workspaceSummary(w) {
|
|
14899
|
-
return {
|
|
14900
|
-
id: w.external_id,
|
|
14901
|
-
name: w.name,
|
|
14902
|
-
description: w.description ?? void 0,
|
|
14903
|
-
isPublic: !!w.is_public,
|
|
14904
|
-
documentCount: chunkJUUOJP7I_cjs.workspaceDocumentCount(w),
|
|
14905
|
-
conversationCount: chunkJUUOJP7I_cjs.workspaceConversationCount(w),
|
|
14906
|
-
memberCount: w.users?.length ?? 0,
|
|
14907
|
-
filesMb: w.user_files_mb ?? 0,
|
|
14908
|
-
updatedAt: w.updated_at
|
|
14909
|
-
};
|
|
14910
|
-
}
|
|
14911
|
-
function distinctMembers(workspaces) {
|
|
14912
|
-
const byId = /* @__PURE__ */ new Map();
|
|
14913
|
-
for (const w of workspaces) {
|
|
14914
|
-
for (const member of w.users ?? []) {
|
|
14915
|
-
const user = member.user;
|
|
14916
|
-
const id = user?.external_id;
|
|
14917
|
-
if (!id || byId.has(id)) continue;
|
|
14918
|
-
const name = [user.given_name, user.family_name].filter(Boolean).join(" ").trim();
|
|
14919
|
-
byId.set(id, {
|
|
14920
|
-
id,
|
|
14921
|
-
name: name || user.email || "Unknown",
|
|
14922
|
-
email: user.email ?? "",
|
|
14923
|
-
role: member.role ?? "member",
|
|
14924
|
-
isAgent: Boolean(member.agent_ext_id) || chunkJUUOJP7I_cjs.isAgentAccount(user)
|
|
14925
|
-
});
|
|
14926
|
-
}
|
|
14927
|
-
}
|
|
14928
|
-
return [...byId.values()];
|
|
14929
|
-
}
|
|
14930
|
-
function buildProjectSummaries(projects, workspaces) {
|
|
14931
|
-
const byProject = /* @__PURE__ */ new Map();
|
|
14932
|
-
for (const w of workspaces ?? []) {
|
|
14933
|
-
const id = w.project_ext_id;
|
|
14934
|
-
if (!id) continue;
|
|
14935
|
-
byProject.set(id, [...byProject.get(id) ?? [], w]);
|
|
14936
|
-
}
|
|
14937
|
-
const summaries = (projects ?? []).map((p) => {
|
|
14938
|
-
const own = byProject.get(p.external_id) ?? [];
|
|
14939
|
-
const storage = p.quotas?.storage_gb;
|
|
14940
|
-
const aiUsage = p.quotas?.ai_usage;
|
|
14941
|
-
const stats = chunkJUUOJP7I_cjs.workspaceGroupStats(own);
|
|
14942
|
-
return {
|
|
14943
|
-
id: p.external_id,
|
|
14944
|
-
name: p.name,
|
|
14945
|
-
createdAt: p.created_at,
|
|
14946
|
-
subscription: p.subscription ?? "none",
|
|
14947
|
-
workspaces: own.map(workspaceSummary),
|
|
14948
|
-
workspaceCount: own.length,
|
|
14949
|
-
documentCount: stats.documents,
|
|
14950
|
-
conversationCount: stats.conversations,
|
|
14951
|
-
members: distinctMembers(own),
|
|
14952
|
-
memberCount: stats.members,
|
|
14953
|
-
filesMb: own.reduce((sum, w) => sum + (w.user_files_mb ?? 0), 0),
|
|
14954
|
-
storageUsedGb: storage?.used ?? 0,
|
|
14955
|
-
storageLimitGb: storage?.limit ?? 0,
|
|
14956
|
-
aiUsageUsed: aiUsage?.used ?? 0,
|
|
14957
|
-
aiUsageLimit: aiUsage?.limit ?? 0,
|
|
14958
|
-
client: p.client ?? null,
|
|
14959
|
-
clientRef: p.client_ref ?? null,
|
|
14960
|
-
stage: p.stage ?? null,
|
|
14961
|
-
leadUser: p.lead_user ?? null,
|
|
14962
|
-
budget: p.budget ?? null,
|
|
14963
|
-
fields: p.fields ?? {}
|
|
14964
|
-
};
|
|
14965
|
-
});
|
|
14966
|
-
const work = (s) => s.documentCount + s.conversationCount;
|
|
14967
|
-
return summaries.sort((a, b) => work(b) - work(a));
|
|
14968
|
-
}
|
|
14969
|
-
function useProjectSummaries() {
|
|
14970
|
-
const projects = react.useProjects();
|
|
14971
|
-
const workspaces = react.useWorkspaces();
|
|
14972
|
-
const summaries = React7.useMemo(
|
|
14973
|
-
() => buildProjectSummaries(
|
|
14974
|
-
projects.data,
|
|
14975
|
-
workspaces.data
|
|
14976
|
-
),
|
|
14977
|
-
[projects.data, workspaces.data]
|
|
14978
|
-
);
|
|
14979
|
-
return {
|
|
14980
|
-
projects: summaries,
|
|
14981
|
-
isLoading: projects.isLoading || workspaces.isLoading,
|
|
14982
|
-
isError: projects.isError || workspaces.isError,
|
|
14983
|
-
error: projects.error ?? workspaces.error
|
|
14984
|
-
};
|
|
14985
|
-
}
|
|
14986
|
-
function useProjectSummary(projectId) {
|
|
14987
|
-
const { projects, isLoading, isError } = useProjectSummaries();
|
|
14988
|
-
const project = React7.useMemo(() => projects.find((p) => p.id === projectId), [projects, projectId]);
|
|
14989
|
-
const usage = react.useProjectUsage(projectId, 0, { enabled: !!projectId });
|
|
14990
|
-
return { project, usage: usage.data, usageLoading: usage.isLoading, isLoading, isError };
|
|
14991
|
-
}
|
|
14992
|
-
function primaryProjectWorkspace(project) {
|
|
14993
|
-
const work = (w) => w.documentCount + w.conversationCount;
|
|
14994
|
-
return [...project.workspaces].sort((a, b) => work(b) - work(a))[0];
|
|
14995
|
-
}
|
|
14996
15197
|
function RowsEditor({
|
|
14997
15198
|
label,
|
|
14998
15199
|
rows,
|
|
@@ -22744,9 +22945,9 @@ function ConnectedTagEntity({
|
|
|
22744
22945
|
onEditClick();
|
|
22745
22946
|
}
|
|
22746
22947
|
};
|
|
22747
|
-
const tooltipContent = showTooltip ? /* @__PURE__ */ jsxRuntime.jsxs(
|
|
22948
|
+
const tooltipContent = showTooltip ? /* @__PURE__ */ jsxRuntime.jsxs(chunkH3XAHVDT_cjs.EntityTooltip, { children: [
|
|
22748
22949
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
22749
|
-
|
|
22950
|
+
chunkH3XAHVDT_cjs.EntityTooltipHeader,
|
|
22750
22951
|
{
|
|
22751
22952
|
lead: /* @__PURE__ */ jsxRuntime.jsx(
|
|
22752
22953
|
"span",
|
|
@@ -24643,7 +24844,7 @@ function useDocumentFilters({
|
|
|
24643
24844
|
[documentFilters]
|
|
24644
24845
|
);
|
|
24645
24846
|
const baseFilteredDocuments = React7.useMemo(
|
|
24646
|
-
() =>
|
|
24847
|
+
() => chunkRHKFCSFC_cjs.applyInvertedIndexFilter(documents, documentFilters, invertedIndex, getDocId),
|
|
24647
24848
|
[documents, documentFilters, invertedIndex]
|
|
24648
24849
|
);
|
|
24649
24850
|
const filteredDocuments = React7.useMemo(() => {
|
|
@@ -25858,7 +26059,7 @@ function ConnectedFieldsManager({
|
|
|
25858
26059
|
) });
|
|
25859
26060
|
}
|
|
25860
26061
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col h-full", children: [
|
|
25861
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
26062
|
+
/* @__PURE__ */ jsxRuntime.jsxs(chunkRHKFCSFC_cjs.DraggableHeader, { children: [
|
|
25862
26063
|
/* @__PURE__ */ jsxRuntime.jsx(chunkEWWVKXEQ_cjs.FieldsManagerTitle, { title, className: "px-4 pt-3.5 pb-2" }),
|
|
25863
26064
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "px-3", children: tabHeader })
|
|
25864
26065
|
] }),
|
|
@@ -27316,7 +27517,7 @@ function ConnectedFilesPage({
|
|
|
27316
27517
|
viewMode === "grid" ? (
|
|
27317
27518
|
// ‹ n / N › over the table's displayed rows; a step opens the document.
|
|
27318
27519
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
27319
|
-
|
|
27520
|
+
chunkH3XAHVDT_cjs.GridRowNavigator,
|
|
27320
27521
|
{
|
|
27321
27522
|
gridApi,
|
|
27322
27523
|
selectedId: viewingDocumentId ?? selectedDocumentIds[0] ?? null,
|
|
@@ -28395,7 +28596,7 @@ function ConnectedMessenger({
|
|
|
28395
28596
|
}
|
|
28396
28597
|
);
|
|
28397
28598
|
if (!activeId && layout === "panel") {
|
|
28398
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
28599
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(chunkRHKFCSFC_cjs.PanelFrame, { testId: "dm-messenger", children: [
|
|
28399
28600
|
list,
|
|
28400
28601
|
peoplePicker
|
|
28401
28602
|
] });
|
|
@@ -28405,7 +28606,7 @@ function ConnectedMessenger({
|
|
|
28405
28606
|
const presence = activePeer ? host.presenceOf?.(activePeer.external_id) : void 0;
|
|
28406
28607
|
const threadName = active?.title ?? (activePeer ? react.userDisplayName(activePeer) : null);
|
|
28407
28608
|
const thread = activeId ? /* @__PURE__ */ jsxRuntime.jsxs(
|
|
28408
|
-
|
|
28609
|
+
chunkRHKFCSFC_cjs.PanelFrame,
|
|
28409
28610
|
{
|
|
28410
28611
|
testId: isSplit ? "dm-messenger-thread" : "dm-messenger",
|
|
28411
28612
|
className: isSplit ? "min-w-0 flex-1 bg-card" : void 0,
|
|
@@ -28472,7 +28673,7 @@ function ConnectedMessenger({
|
|
|
28472
28673
|
groupChat.external_id
|
|
28473
28674
|
) : null,
|
|
28474
28675
|
peoplePicker,
|
|
28475
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
28676
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkRHKFCSFC_cjs.PanelFrameBody, { className: "flex flex-col overflow-visible", children: active ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
28476
28677
|
ConnectedChatThread,
|
|
28477
28678
|
{
|
|
28478
28679
|
chat: active.chat,
|
|
@@ -29072,7 +29273,7 @@ function DeveloperFooter({
|
|
|
29072
29273
|
}, [configVersions, configToLoad, parentMessage?.config_ext_id]);
|
|
29073
29274
|
const hasLoadedConfig = !!loadedConfigId && loadedConfigId !== "default";
|
|
29074
29275
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
29075
|
-
|
|
29276
|
+
chunkRHKFCSFC_cjs.ConfigSwitcherBar,
|
|
29076
29277
|
{
|
|
29077
29278
|
options: options2,
|
|
29078
29279
|
value: loadedConfigId || "default",
|
|
@@ -29341,8 +29542,8 @@ function ConnectedDeveloperConfig({ modeSwitcher } = {}) {
|
|
|
29341
29542
|
handleDeleteConfig,
|
|
29342
29543
|
handleLoadConfig
|
|
29343
29544
|
} = useDeveloperConfig();
|
|
29344
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
29345
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
29545
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(chunkRHKFCSFC_cjs.PanelFrame, { testId: "developer-config", children: [
|
|
29546
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkRHKFCSFC_cjs.DraggableHeader, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
29346
29547
|
chunkMEMWZ72Y_cjs.TabHeader,
|
|
29347
29548
|
{
|
|
29348
29549
|
tabs: [{ id: "config", label: "Developer Config", icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Code2, { className: "size-4" }) }],
|
|
@@ -29352,7 +29553,7 @@ function ConnectedDeveloperConfig({ modeSwitcher } = {}) {
|
|
|
29352
29553
|
rightContent: modeSwitcher
|
|
29353
29554
|
}
|
|
29354
29555
|
) }),
|
|
29355
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
29556
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkRHKFCSFC_cjs.PanelFrameBody, { className: "overflow-auto p-4", children: configSchema ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
29356
29557
|
ConnectedConfigForm,
|
|
29357
29558
|
{
|
|
29358
29559
|
schema: configSchema,
|
|
@@ -29360,7 +29561,7 @@ function ConnectedDeveloperConfig({ modeSwitcher } = {}) {
|
|
|
29360
29561
|
onChange: handleConfigChange,
|
|
29361
29562
|
availableModels: availableModels?.models
|
|
29362
29563
|
}
|
|
29363
|
-
) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
29564
|
+
) : /* @__PURE__ */ jsxRuntime.jsx(chunkRHKFCSFC_cjs.PanelNote, { children: "Loading configuration schema..." }) }),
|
|
29364
29565
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
29365
29566
|
DeveloperFooter,
|
|
29366
29567
|
{
|
|
@@ -29804,9 +30005,9 @@ function ConnectedWorkspaceEntity({
|
|
|
29804
30005
|
);
|
|
29805
30006
|
const documentCount2 = (workspace.shared_document_count ?? 0) + (workspace.private_document_count ?? 0);
|
|
29806
30007
|
const conversationCount = (workspace.shared_conversation_count ?? 0) + (workspace.private_conversation_count ?? 0);
|
|
29807
|
-
const tooltipContent = /* @__PURE__ */ jsxRuntime.jsxs(
|
|
30008
|
+
const tooltipContent = /* @__PURE__ */ jsxRuntime.jsxs(chunkH3XAHVDT_cjs.EntityTooltip, { children: [
|
|
29808
30009
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
29809
|
-
|
|
30010
|
+
chunkH3XAHVDT_cjs.EntityTooltipHeader,
|
|
29810
30011
|
{
|
|
29811
30012
|
lead: /* @__PURE__ */ jsxRuntime.jsx(
|
|
29812
30013
|
ui.ShieldIcon,
|
|
@@ -29823,7 +30024,7 @@ function ConnectedWorkspaceEntity({
|
|
|
29823
30024
|
}
|
|
29824
30025
|
),
|
|
29825
30026
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
29826
|
-
|
|
30027
|
+
chunkH3XAHVDT_cjs.EntityTooltipStats,
|
|
29827
30028
|
{
|
|
29828
30029
|
stats: [
|
|
29829
30030
|
{
|
|
@@ -29847,11 +30048,11 @@ function ConnectedWorkspaceEntity({
|
|
|
29847
30048
|
]
|
|
29848
30049
|
}
|
|
29849
30050
|
),
|
|
29850
|
-
workspace.updated_at && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
30051
|
+
workspace.updated_at && /* @__PURE__ */ jsxRuntime.jsxs(chunkH3XAHVDT_cjs.EntityTooltipHint, { children: [
|
|
29851
30052
|
"Updated ",
|
|
29852
30053
|
ui.formatFriendlyDate(workspace.updated_at)
|
|
29853
30054
|
] }),
|
|
29854
|
-
interactive && variant !== "icon" && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
30055
|
+
interactive && variant !== "icon" && /* @__PURE__ */ jsxRuntime.jsxs(chunkH3XAHVDT_cjs.EntityTooltipHint, { icon: /* @__PURE__ */ jsxRuntime.jsx(ui.EntityIcon, { entityType: "WORKSPACE", className: "w-3 h-3" }), children: [
|
|
29855
30056
|
"Click to open ",
|
|
29856
30057
|
ui.getEntityLabel("WORKSPACE").toLowerCase(),
|
|
29857
30058
|
" settings"
|
|
@@ -29919,7 +30120,7 @@ function ConnectedProjectEntity({
|
|
|
29919
30120
|
subscription = "none",
|
|
29920
30121
|
...props
|
|
29921
30122
|
}) {
|
|
29922
|
-
const { stripeEnabled } =
|
|
30123
|
+
const { stripeEnabled } = chunkLYF47OXX_cjs.useBillingSupport();
|
|
29923
30124
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
29924
30125
|
ui.ProjectEntity,
|
|
29925
30126
|
{
|
|
@@ -30637,7 +30838,7 @@ function ConnectedThreadTaskBar({
|
|
|
30637
30838
|
) }),
|
|
30638
30839
|
/* @__PURE__ */ jsxRuntime.jsxs(ui.DropdownMenuContent, { align: "end", children: [
|
|
30639
30840
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
30640
|
-
|
|
30841
|
+
chunkH3XAHVDT_cjs.ThreadFollowMenuItem,
|
|
30641
30842
|
{
|
|
30642
30843
|
following: follow.following,
|
|
30643
30844
|
onFollowingChange: (on) => (
|
|
@@ -30688,7 +30889,7 @@ function ConnectedThreadTaskBar({
|
|
|
30688
30889
|
] }),
|
|
30689
30890
|
error && /* @__PURE__ */ jsxRuntime.jsx("span", { role: "alert", className: "text-xs text-destructive", children: error }),
|
|
30690
30891
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
30691
|
-
|
|
30892
|
+
chunkRHKFCSFC_cjs.RenameDialog,
|
|
30692
30893
|
{
|
|
30693
30894
|
open: renameOpen,
|
|
30694
30895
|
onClose: () => setRenameOpen(false),
|
|
@@ -32887,7 +33088,7 @@ function MessageDetailsModal({
|
|
|
32887
33088
|
]
|
|
32888
33089
|
}
|
|
32889
33090
|
),
|
|
32890
|
-
messageDetails && /* @__PURE__ */ jsxRuntime.jsx("div", { "data-testid": "message-details-content", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
33091
|
+
messageDetails && /* @__PURE__ */ jsxRuntime.jsx("div", { "data-testid": "message-details-content", children: /* @__PURE__ */ jsxRuntime.jsx(chunkRHKFCSFC_cjs.MessageJsonTree, { data: messageDetails, name: "message", defaultExpanded: true }) })
|
|
32891
33092
|
] })
|
|
32892
33093
|
]
|
|
32893
33094
|
}
|
|
@@ -35893,16 +36094,74 @@ async function backUpOnSignup({
|
|
|
35893
36094
|
}
|
|
35894
36095
|
}
|
|
35895
36096
|
|
|
35896
|
-
// src/connection/auth/
|
|
36097
|
+
// src/connection/auth/sso-name.ts
|
|
36098
|
+
var clean = (value) => value?.trim() ?? "";
|
|
36099
|
+
function resolveSsoName(profile, preferred = {}, emailFallback) {
|
|
36100
|
+
const fullName = clean(profile.name);
|
|
36101
|
+
let given = clean(preferred.given_name) || clean(profile.given_name);
|
|
36102
|
+
let family = clean(preferred.family_name) || clean(profile.family_name);
|
|
36103
|
+
if (!given && fullName) {
|
|
36104
|
+
const surnameAtEnd = family && fullName.length > family.length && fullName.toLowerCase().endsWith(family.toLowerCase());
|
|
36105
|
+
given = surnameAtEnd ? fullName.slice(0, fullName.length - family.length).trim() : fullName.split(/\s+/)[0];
|
|
36106
|
+
}
|
|
36107
|
+
if (!family && given && fullName.toLowerCase().startsWith(given.toLowerCase())) {
|
|
36108
|
+
family = fullName.slice(given.length).trim();
|
|
36109
|
+
}
|
|
36110
|
+
if (!given && emailFallback) given = emailFallback.split("@")[0];
|
|
36111
|
+
return { given_name: given, family_name: family };
|
|
36112
|
+
}
|
|
36113
|
+
|
|
36114
|
+
// src/connection/auth/sso-sign-in.ts
|
|
36115
|
+
function ssoAccountStatus(arbi, token, user) {
|
|
36116
|
+
return arbi.sso.status({ token, email: user.email, picture: user.picture });
|
|
36117
|
+
}
|
|
36118
|
+
async function completeSsoSignIn(arbi, { token, user, status, password, saveRecoveryKey = true }) {
|
|
36119
|
+
const email = user.email;
|
|
36120
|
+
if (status.status === "new_user") {
|
|
36121
|
+
const { given_name: firstName2, family_name: lastName } = resolveSsoName(user, status, email);
|
|
36122
|
+
const { signingPrivateKey } = await arbi.sso.register({
|
|
36123
|
+
token,
|
|
36124
|
+
email,
|
|
36125
|
+
password,
|
|
36126
|
+
firstName: firstName2,
|
|
36127
|
+
lastName,
|
|
36128
|
+
picture: user.picture
|
|
36129
|
+
});
|
|
36130
|
+
await backUpOnSignup({
|
|
36131
|
+
email,
|
|
36132
|
+
password,
|
|
36133
|
+
signingPrivateKey,
|
|
36134
|
+
saveRecoveryKey,
|
|
36135
|
+
auth0Sub: user.sub
|
|
36136
|
+
});
|
|
36137
|
+
const login2 = await arbi.sso.login({
|
|
36138
|
+
token,
|
|
36139
|
+
email,
|
|
36140
|
+
password,
|
|
36141
|
+
profile: { ...resolveSsoName(user, status), picture: user.picture ?? null }
|
|
36142
|
+
});
|
|
36143
|
+
return { login: login2, registered: true, linked: false };
|
|
36144
|
+
}
|
|
36145
|
+
const linked = status.status === "local_exists";
|
|
36146
|
+
const signIn = linked ? arbi.sso.link : arbi.sso.login;
|
|
36147
|
+
const login = await signIn({ token, email, password });
|
|
36148
|
+
return { login: login ?? void 0, registered: false, linked };
|
|
36149
|
+
}
|
|
35897
36150
|
var BAD_CREDENTIALS = "This username/password combination is not valid. Please double-check your credentials and try again.";
|
|
35898
36151
|
function useLoginActions({
|
|
35899
36152
|
formState,
|
|
35900
|
-
formActions
|
|
36153
|
+
formActions,
|
|
36154
|
+
onError
|
|
35901
36155
|
}) {
|
|
35902
36156
|
const arbi = react.useArbi();
|
|
35903
36157
|
const signInLayer = chunkIWT4QVQL_cjs.useOptionalConnection();
|
|
35904
36158
|
const sso = useSsoSignIn();
|
|
35905
|
-
const
|
|
36159
|
+
const environment = chunk2QQUGL2V_cjs.useBlocksEnvironment();
|
|
36160
|
+
const environmentNotify = environment.notify;
|
|
36161
|
+
const notify17 = React7.useCallback(
|
|
36162
|
+
(...args) => args[1] === "error" && onError && typeof args[0] === "string" ? onError(args[0]) : environmentNotify(...args),
|
|
36163
|
+
[environmentNotify, onError]
|
|
36164
|
+
);
|
|
35906
36165
|
const { passwordRules, onRegistered, onUnlockedOffline } = useAuthPages();
|
|
35907
36166
|
const [isAuthenticating, setIsAuthenticating] = React7.useState(false);
|
|
35908
36167
|
const [isRequestingCode, setIsRequestingCode] = React7.useState(false);
|
|
@@ -35910,7 +36169,7 @@ function useLoginActions({
|
|
|
35910
36169
|
email,
|
|
35911
36170
|
password,
|
|
35912
36171
|
confirmPassword,
|
|
35913
|
-
firstName,
|
|
36172
|
+
firstName: firstName2,
|
|
35914
36173
|
lastName,
|
|
35915
36174
|
verificationCode,
|
|
35916
36175
|
cooldownSeconds
|
|
@@ -35989,6 +36248,7 @@ function useLoginActions({
|
|
|
35989
36248
|
try {
|
|
35990
36249
|
const login = await arbi.login(loginEmail, loginPassword);
|
|
35991
36250
|
if (opts?.isFreshRegistration) onRegistered?.(login);
|
|
36251
|
+
return login;
|
|
35992
36252
|
} catch (error) {
|
|
35993
36253
|
setIsAuthenticating(false);
|
|
35994
36254
|
console.error("Login error:", error);
|
|
@@ -36014,7 +36274,7 @@ function useLoginActions({
|
|
|
36014
36274
|
const handleRegister = React7.useCallback(
|
|
36015
36275
|
async (saveRecoveryKey = true) => {
|
|
36016
36276
|
arbi.session?.setSsoMode(false);
|
|
36017
|
-
if (!password || !confirmPassword || !
|
|
36277
|
+
if (!password || !confirmPassword || !firstName2 || !lastName || !verificationCode) {
|
|
36018
36278
|
notify17("Please fill in all required fields.", "error");
|
|
36019
36279
|
return;
|
|
36020
36280
|
}
|
|
@@ -36034,7 +36294,7 @@ function useLoginActions({
|
|
|
36034
36294
|
email,
|
|
36035
36295
|
password,
|
|
36036
36296
|
verificationCode: verificationCode.trim(),
|
|
36037
|
-
firstName,
|
|
36297
|
+
firstName: firstName2,
|
|
36038
36298
|
lastName
|
|
36039
36299
|
});
|
|
36040
36300
|
await backUpOnSignup({ email, password, signingPrivateKey, saveRecoveryKey });
|
|
@@ -36050,7 +36310,7 @@ function useLoginActions({
|
|
|
36050
36310
|
email,
|
|
36051
36311
|
password,
|
|
36052
36312
|
confirmPassword,
|
|
36053
|
-
|
|
36313
|
+
firstName2,
|
|
36054
36314
|
lastName,
|
|
36055
36315
|
verificationCode,
|
|
36056
36316
|
validateEmailWithError,
|
|
@@ -36074,7 +36334,7 @@ function useLoginForm() {
|
|
|
36074
36334
|
const [email, setEmail] = React7.useState("");
|
|
36075
36335
|
const [password, setPassword] = React7.useState("");
|
|
36076
36336
|
const [confirmPassword, setConfirmPassword] = React7.useState("");
|
|
36077
|
-
const [
|
|
36337
|
+
const [firstName2, setFirstName] = React7.useState("");
|
|
36078
36338
|
const [lastName, setLastName] = React7.useState("");
|
|
36079
36339
|
const [verificationCode, setVerificationCode] = React7.useState("");
|
|
36080
36340
|
const [verificationSent, setVerificationSent] = React7.useState(false);
|
|
@@ -36210,7 +36470,7 @@ function useLoginForm() {
|
|
|
36210
36470
|
email,
|
|
36211
36471
|
password,
|
|
36212
36472
|
confirmPassword,
|
|
36213
|
-
firstName,
|
|
36473
|
+
firstName: firstName2,
|
|
36214
36474
|
lastName,
|
|
36215
36475
|
verificationCode,
|
|
36216
36476
|
verificationSent,
|
|
@@ -36246,36 +36506,242 @@ function useLoginForm() {
|
|
|
36246
36506
|
};
|
|
36247
36507
|
return { ...state, ...actions };
|
|
36248
36508
|
}
|
|
36249
|
-
function useRegisterSubmitState(isRegistering, isPending, password, confirmPassword, email,
|
|
36509
|
+
function useRegisterSubmitState(isRegistering, isPending, password, confirmPassword, email, firstName2, lastName, verificationCode, isPasswordValid) {
|
|
36250
36510
|
const isDisabled = React7.useMemo(() => {
|
|
36251
36511
|
if (!isRegistering) return false;
|
|
36252
|
-
return isPending || !isPasswordValid(password) || password !== confirmPassword || !email || !
|
|
36512
|
+
return isPending || !isPasswordValid(password) || password !== confirmPassword || !email || !firstName2 || !lastName || !verificationCode;
|
|
36253
36513
|
}, [
|
|
36254
36514
|
isRegistering,
|
|
36255
36515
|
isPending,
|
|
36256
36516
|
password,
|
|
36257
36517
|
confirmPassword,
|
|
36258
36518
|
email,
|
|
36259
|
-
|
|
36519
|
+
firstName2,
|
|
36260
36520
|
lastName,
|
|
36261
36521
|
verificationCode,
|
|
36262
36522
|
isPasswordValid
|
|
36263
36523
|
]);
|
|
36264
36524
|
const isDefault = React7.useMemo(() => {
|
|
36265
36525
|
if (!isRegistering) return false;
|
|
36266
|
-
return email && password && confirmPassword &&
|
|
36526
|
+
return email && password && confirmPassword && firstName2 && lastName && verificationCode && isPasswordValid(password) && password === confirmPassword;
|
|
36267
36527
|
}, [
|
|
36268
36528
|
isRegistering,
|
|
36269
36529
|
email,
|
|
36270
36530
|
password,
|
|
36271
36531
|
confirmPassword,
|
|
36272
|
-
|
|
36532
|
+
firstName2,
|
|
36273
36533
|
lastName,
|
|
36274
36534
|
verificationCode,
|
|
36275
36535
|
isPasswordValid
|
|
36276
36536
|
]);
|
|
36277
36537
|
return { isDisabled, isDefault };
|
|
36278
36538
|
}
|
|
36539
|
+
var firstName = (user, fallback) => user?.given_name || fallback.split("@")[0];
|
|
36540
|
+
function CompactLogin({
|
|
36541
|
+
onSsoSignIn,
|
|
36542
|
+
onSignedIn,
|
|
36543
|
+
appName = "ARBI",
|
|
36544
|
+
ssoName = appName
|
|
36545
|
+
}) {
|
|
36546
|
+
const arbi = react.useArbi();
|
|
36547
|
+
const auth = useAuthPages();
|
|
36548
|
+
const { notify: notify17 } = chunk2QQUGL2V_cjs.useBlocksEnvironment();
|
|
36549
|
+
const isSsoOnly = !!auth.ssoOnly;
|
|
36550
|
+
const [error, setError] = React7.useState(null);
|
|
36551
|
+
const formState = useLoginForm();
|
|
36552
|
+
const { email, password, setEmail, setPassword } = formState;
|
|
36553
|
+
const { isAuthenticating, handleLocalLogin } = useLoginActions({
|
|
36554
|
+
formState,
|
|
36555
|
+
formActions: formState,
|
|
36556
|
+
onError: setError
|
|
36557
|
+
});
|
|
36558
|
+
const [sso, setSso] = React7.useState(null);
|
|
36559
|
+
const [masterPassword, setMasterPassword] = React7.useState("");
|
|
36560
|
+
const signInLocally = async (e) => {
|
|
36561
|
+
e.preventDefault();
|
|
36562
|
+
setError(null);
|
|
36563
|
+
const login = await handleLocalLogin();
|
|
36564
|
+
if (login) onSignedIn?.(firstName(login.response?.user, email));
|
|
36565
|
+
};
|
|
36566
|
+
const finishSso = async () => {
|
|
36567
|
+
if (!sso?.user.email) {
|
|
36568
|
+
setError("User email not available");
|
|
36569
|
+
return;
|
|
36570
|
+
}
|
|
36571
|
+
try {
|
|
36572
|
+
const status = await ssoAccountStatus(arbi, sso.accessToken, sso.user);
|
|
36573
|
+
const { login } = await completeSsoSignIn(arbi, {
|
|
36574
|
+
token: sso.accessToken,
|
|
36575
|
+
user: sso.user,
|
|
36576
|
+
status,
|
|
36577
|
+
password: masterPassword
|
|
36578
|
+
});
|
|
36579
|
+
const name = login?.response?.user.given_name ?? sso.user.given_name ?? sso.user.name;
|
|
36580
|
+
setError(null);
|
|
36581
|
+
setSso(null);
|
|
36582
|
+
setMasterPassword("");
|
|
36583
|
+
const shown = name ?? sso.user.email.split("@")[0];
|
|
36584
|
+
notify17(`Welcome, ${shown}!`, "success");
|
|
36585
|
+
onSignedIn?.(shown);
|
|
36586
|
+
} catch (err) {
|
|
36587
|
+
console.error("[SSO] Error during authentication:", err);
|
|
36588
|
+
setError(chunkBYJUI4AT_cjs.parseAuthError(err, { defaultMessage: "Authentication failed. Please try again." }));
|
|
36589
|
+
}
|
|
36590
|
+
};
|
|
36591
|
+
const startSso = async () => {
|
|
36592
|
+
if (!onSsoSignIn) return;
|
|
36593
|
+
try {
|
|
36594
|
+
const result = await onSsoSignIn();
|
|
36595
|
+
if (result) setSso(result);
|
|
36596
|
+
} catch (err) {
|
|
36597
|
+
setError(err instanceof Error ? err.message : "Authentication failed. Please try again.");
|
|
36598
|
+
}
|
|
36599
|
+
};
|
|
36600
|
+
const cancelSso = () => {
|
|
36601
|
+
setSso(null);
|
|
36602
|
+
setMasterPassword("");
|
|
36603
|
+
setError(null);
|
|
36604
|
+
};
|
|
36605
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-4", "data-testid": "embedded-auth", children: [
|
|
36606
|
+
error && /* @__PURE__ */ jsxRuntime.jsx(
|
|
36607
|
+
"div",
|
|
36608
|
+
{
|
|
36609
|
+
className: "bg-destructive/10 text-destructive p-3 rounded-md",
|
|
36610
|
+
"data-testid": "embedded-auth-error",
|
|
36611
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm", children: error })
|
|
36612
|
+
}
|
|
36613
|
+
),
|
|
36614
|
+
sso ? /* @__PURE__ */ jsxRuntime.jsxs(
|
|
36615
|
+
"form",
|
|
36616
|
+
{
|
|
36617
|
+
onSubmit: (e) => {
|
|
36618
|
+
e.preventDefault();
|
|
36619
|
+
if (masterPassword) void finishSso();
|
|
36620
|
+
},
|
|
36621
|
+
className: "space-y-3",
|
|
36622
|
+
children: [
|
|
36623
|
+
/* @__PURE__ */ jsxRuntime.jsxs("p", { className: "text-sm text-muted-foreground", children: [
|
|
36624
|
+
"Enter your ",
|
|
36625
|
+
appName,
|
|
36626
|
+
" ",
|
|
36627
|
+
/* @__PURE__ */ jsxRuntime.jsx("strong", { children: "master password" }),
|
|
36628
|
+
" \u2014 the encryption passphrase you set when you first registered, not your ",
|
|
36629
|
+
ssoName,
|
|
36630
|
+
" sign-in password."
|
|
36631
|
+
] }),
|
|
36632
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
36633
|
+
ui.Input,
|
|
36634
|
+
{
|
|
36635
|
+
type: "password",
|
|
36636
|
+
placeholder: "Enter master password",
|
|
36637
|
+
value: masterPassword,
|
|
36638
|
+
onChange: (e) => setMasterPassword(e.target.value),
|
|
36639
|
+
autoFocus: true,
|
|
36640
|
+
"data-testid": "embedded-auth-password-input"
|
|
36641
|
+
}
|
|
36642
|
+
),
|
|
36643
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
36644
|
+
ui.Button,
|
|
36645
|
+
{
|
|
36646
|
+
type: "submit",
|
|
36647
|
+
className: "w-full",
|
|
36648
|
+
disabled: !masterPassword,
|
|
36649
|
+
"data-testid": "embedded-auth-continue-button",
|
|
36650
|
+
children: "Continue"
|
|
36651
|
+
}
|
|
36652
|
+
),
|
|
36653
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
36654
|
+
ui.Button,
|
|
36655
|
+
{
|
|
36656
|
+
type: "button",
|
|
36657
|
+
variant: "outline",
|
|
36658
|
+
className: "w-full",
|
|
36659
|
+
onClick: cancelSso,
|
|
36660
|
+
"data-testid": "embedded-auth-cancel-button",
|
|
36661
|
+
children: "Cancel"
|
|
36662
|
+
}
|
|
36663
|
+
)
|
|
36664
|
+
]
|
|
36665
|
+
}
|
|
36666
|
+
) : isSsoOnly ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
36667
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground", children: "Please sign in with your organization account." }),
|
|
36668
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
36669
|
+
ui.Button,
|
|
36670
|
+
{
|
|
36671
|
+
onClick: () => void startSso(),
|
|
36672
|
+
className: "w-full",
|
|
36673
|
+
"data-testid": "embedded-auth-sso-button",
|
|
36674
|
+
children: [
|
|
36675
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.LogIn, { className: "mr-2 h-4 w-4" }),
|
|
36676
|
+
"Sign in with ",
|
|
36677
|
+
ssoName
|
|
36678
|
+
]
|
|
36679
|
+
}
|
|
36680
|
+
)
|
|
36681
|
+
] }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
36682
|
+
/* @__PURE__ */ jsxRuntime.jsxs("form", { onSubmit: (e) => void signInLocally(e), className: "space-y-3", children: [
|
|
36683
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
36684
|
+
ui.Input,
|
|
36685
|
+
{
|
|
36686
|
+
type: "email",
|
|
36687
|
+
placeholder: "Email",
|
|
36688
|
+
value: email,
|
|
36689
|
+
onChange: (e) => setEmail(e.target.value),
|
|
36690
|
+
required: true,
|
|
36691
|
+
disabled: isAuthenticating,
|
|
36692
|
+
"data-testid": "embedded-auth-email-input"
|
|
36693
|
+
}
|
|
36694
|
+
),
|
|
36695
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
36696
|
+
ui.Input,
|
|
36697
|
+
{
|
|
36698
|
+
type: "password",
|
|
36699
|
+
placeholder: "Password",
|
|
36700
|
+
value: password,
|
|
36701
|
+
onChange: (e) => setPassword(e.target.value),
|
|
36702
|
+
required: true,
|
|
36703
|
+
disabled: isAuthenticating,
|
|
36704
|
+
"data-testid": "embedded-auth-password-input"
|
|
36705
|
+
}
|
|
36706
|
+
),
|
|
36707
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
36708
|
+
ui.Button,
|
|
36709
|
+
{
|
|
36710
|
+
type: "submit",
|
|
36711
|
+
className: "w-full",
|
|
36712
|
+
disabled: isAuthenticating,
|
|
36713
|
+
"data-testid": "embedded-auth-signin-button",
|
|
36714
|
+
children: isAuthenticating ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
36715
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Loader2, { className: "mr-2 h-4 w-4 animate-spin" }),
|
|
36716
|
+
"Signing in..."
|
|
36717
|
+
] }) : "Sign In"
|
|
36718
|
+
}
|
|
36719
|
+
)
|
|
36720
|
+
] }),
|
|
36721
|
+
onSsoSignIn && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
36722
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative", children: [
|
|
36723
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute inset-0 flex items-center", children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "w-full border-t" }) }),
|
|
36724
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "relative flex justify-center text-sm uppercase", children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "bg-background px-2 text-muted-foreground", children: "Or" }) })
|
|
36725
|
+
] }),
|
|
36726
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
36727
|
+
ui.Button,
|
|
36728
|
+
{
|
|
36729
|
+
onClick: () => void startSso(),
|
|
36730
|
+
className: "w-full",
|
|
36731
|
+
variant: "outline",
|
|
36732
|
+
"data-testid": "embedded-auth-sso-option-button",
|
|
36733
|
+
children: [
|
|
36734
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.LogIn, { className: "mr-2 h-4 w-4" }),
|
|
36735
|
+
"Sign in with ",
|
|
36736
|
+
ssoName,
|
|
36737
|
+
" (SSO)"
|
|
36738
|
+
]
|
|
36739
|
+
}
|
|
36740
|
+
)
|
|
36741
|
+
] })
|
|
36742
|
+
] })
|
|
36743
|
+
] });
|
|
36744
|
+
}
|
|
36279
36745
|
function useSsoVerificationRedirect() {
|
|
36280
36746
|
const sso = useSsoSignIn();
|
|
36281
36747
|
const { notify: notify17 } = chunk2QQUGL2V_cjs.useBlocksEnvironment();
|
|
@@ -36313,7 +36779,13 @@ function warmSodium() {
|
|
|
36313
36779
|
if (typeof window.requestIdleCallback === "function") window.requestIdleCallback(run);
|
|
36314
36780
|
else window.setTimeout(run, 200);
|
|
36315
36781
|
}
|
|
36316
|
-
function ConnectedLoginPage(
|
|
36782
|
+
function ConnectedLoginPage({
|
|
36783
|
+
layout = "page",
|
|
36784
|
+
...compact
|
|
36785
|
+
} = {}) {
|
|
36786
|
+
return layout === "compact" ? /* @__PURE__ */ jsxRuntime.jsx(CompactLogin, { ...compact }) : /* @__PURE__ */ jsxRuntime.jsx(LoginPage, {});
|
|
36787
|
+
}
|
|
36788
|
+
function LoginPage() {
|
|
36317
36789
|
const sso = useSsoSignIn();
|
|
36318
36790
|
const auth = useAuthPages();
|
|
36319
36791
|
const { notify: notify17 } = chunk2QQUGL2V_cjs.useBlocksEnvironment();
|
|
@@ -36328,7 +36800,7 @@ function ConnectedLoginPage() {
|
|
|
36328
36800
|
email,
|
|
36329
36801
|
password,
|
|
36330
36802
|
confirmPassword,
|
|
36331
|
-
firstName,
|
|
36803
|
+
firstName: firstName2,
|
|
36332
36804
|
lastName,
|
|
36333
36805
|
verificationCode,
|
|
36334
36806
|
verificationSent,
|
|
@@ -36369,7 +36841,7 @@ function ConnectedLoginPage() {
|
|
|
36369
36841
|
password,
|
|
36370
36842
|
confirmPassword,
|
|
36371
36843
|
email,
|
|
36372
|
-
|
|
36844
|
+
firstName2,
|
|
36373
36845
|
lastName,
|
|
36374
36846
|
verificationCode,
|
|
36375
36847
|
passwordRules.isValid
|
|
@@ -36623,7 +37095,7 @@ function ConnectedLoginPage() {
|
|
|
36623
37095
|
{
|
|
36624
37096
|
type: "text",
|
|
36625
37097
|
placeholder: "",
|
|
36626
|
-
value:
|
|
37098
|
+
value: firstName2,
|
|
36627
37099
|
onChange: (e) => setFirstName(e.target.value),
|
|
36628
37100
|
"data-testid": "firstname-input",
|
|
36629
37101
|
name: "firstName",
|
|
@@ -36802,6 +37274,46 @@ function ConnectedLoginPage() {
|
|
|
36802
37274
|
}
|
|
36803
37275
|
);
|
|
36804
37276
|
}
|
|
37277
|
+
|
|
37278
|
+
// src/connection/auth/sso-popup.ts
|
|
37279
|
+
function openSsoPopup(url, { features = "width=600,height=700" } = {}) {
|
|
37280
|
+
return new Promise((resolve, reject) => {
|
|
37281
|
+
const opened = window.open(url, "auth", features);
|
|
37282
|
+
if (!opened) {
|
|
37283
|
+
resolve(null);
|
|
37284
|
+
return;
|
|
37285
|
+
}
|
|
37286
|
+
const popup = opened;
|
|
37287
|
+
const closedPoll = setInterval(() => {
|
|
37288
|
+
if (popup.closed) {
|
|
37289
|
+
done();
|
|
37290
|
+
resolve(null);
|
|
37291
|
+
}
|
|
37292
|
+
}, 500);
|
|
37293
|
+
const done = () => {
|
|
37294
|
+
window.removeEventListener("message", onMessage);
|
|
37295
|
+
clearInterval(closedPoll);
|
|
37296
|
+
};
|
|
37297
|
+
function onMessage(event) {
|
|
37298
|
+
if (event.origin !== window.location.origin) return;
|
|
37299
|
+
const data = event.data;
|
|
37300
|
+
if (data?.error) {
|
|
37301
|
+
done();
|
|
37302
|
+
reject(new Error(data.error));
|
|
37303
|
+
return;
|
|
37304
|
+
}
|
|
37305
|
+
if (!data?.accessToken) return;
|
|
37306
|
+
done();
|
|
37307
|
+
if (!popup.closed) popup.close();
|
|
37308
|
+
if (!data.user) {
|
|
37309
|
+
reject(new Error("Invalid authentication response"));
|
|
37310
|
+
return;
|
|
37311
|
+
}
|
|
37312
|
+
resolve({ accessToken: data.accessToken, user: data.user });
|
|
37313
|
+
}
|
|
37314
|
+
window.addEventListener("message", onMessage);
|
|
37315
|
+
});
|
|
37316
|
+
}
|
|
36805
37317
|
var MAX_RESEND_WARNING_THRESHOLD = 3;
|
|
36806
37318
|
var MAX_RESEND_BLOCK_THRESHOLD = 6;
|
|
36807
37319
|
var RATE_LIMIT_COOLDOWN_MS = 6e4;
|
|
@@ -36866,7 +37378,7 @@ function SsoResendVerificationButton({
|
|
|
36866
37378
|
onClick: async () => handleResendEmailVerification(),
|
|
36867
37379
|
disabled: loading || disabled,
|
|
36868
37380
|
"aria-label": "Resend verification email",
|
|
36869
|
-
children: loading ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
37381
|
+
children: loading ? /* @__PURE__ */ jsxRuntime.jsx(chunkH3XAHVDT_cjs.LoadingIndicator, {}) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
36870
37382
|
"Didn't get a verification email? ",
|
|
36871
37383
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-semibold", children: "Resend" })
|
|
36872
37384
|
] })
|
|
@@ -36875,23 +37387,6 @@ function SsoResendVerificationButton({
|
|
|
36875
37387
|
}
|
|
36876
37388
|
) : /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, {});
|
|
36877
37389
|
}
|
|
36878
|
-
|
|
36879
|
-
// src/connection/auth/sso-name.ts
|
|
36880
|
-
var clean = (value) => value?.trim() ?? "";
|
|
36881
|
-
function resolveSsoName(profile, preferred = {}, emailFallback) {
|
|
36882
|
-
const fullName = clean(profile.name);
|
|
36883
|
-
let given = clean(preferred.given_name) || clean(profile.given_name);
|
|
36884
|
-
let family = clean(preferred.family_name) || clean(profile.family_name);
|
|
36885
|
-
if (!given && fullName) {
|
|
36886
|
-
const surnameAtEnd = family && fullName.length > family.length && fullName.toLowerCase().endsWith(family.toLowerCase());
|
|
36887
|
-
given = surnameAtEnd ? fullName.slice(0, fullName.length - family.length).trim() : fullName.split(/\s+/)[0];
|
|
36888
|
-
}
|
|
36889
|
-
if (!family && given && fullName.toLowerCase().startsWith(given.toLowerCase())) {
|
|
36890
|
-
family = fullName.slice(given.length).trim();
|
|
36891
|
-
}
|
|
36892
|
-
if (!given && emailFallback) given = emailFallback.split("@")[0];
|
|
36893
|
-
return { given_name: given, family_name: family };
|
|
36894
|
-
}
|
|
36895
37390
|
var NO_RECOVERY_KEY_WARNING2 = "Without your password or a recovery key, we cannot recover your account or data.";
|
|
36896
37391
|
function ConnectedSsoCallback() {
|
|
36897
37392
|
const sso = useSsoSignIn();
|
|
@@ -37081,11 +37576,7 @@ function ConnectedSsoCallback() {
|
|
|
37081
37576
|
setIsCheckingStatus(true);
|
|
37082
37577
|
try {
|
|
37083
37578
|
console.info("[SSO] Checking user status...");
|
|
37084
|
-
const response = await arbi
|
|
37085
|
-
token: accessToken,
|
|
37086
|
-
email: user.email,
|
|
37087
|
-
picture: user.picture
|
|
37088
|
-
});
|
|
37579
|
+
const response = await ssoAccountStatus(arbi, accessToken, user);
|
|
37089
37580
|
console.info("[SSO] User status:", response.status);
|
|
37090
37581
|
setSsoStatus(response);
|
|
37091
37582
|
} catch (error2) {
|
|
@@ -37129,40 +37620,18 @@ function ConnectedSsoCallback() {
|
|
|
37129
37620
|
setIsSubmitting(true);
|
|
37130
37621
|
setError(null);
|
|
37131
37622
|
try {
|
|
37132
|
-
const
|
|
37133
|
-
|
|
37134
|
-
|
|
37135
|
-
|
|
37136
|
-
|
|
37137
|
-
|
|
37138
|
-
|
|
37139
|
-
|
|
37140
|
-
token: accessToken,
|
|
37141
|
-
email,
|
|
37142
|
-
password,
|
|
37143
|
-
firstName,
|
|
37144
|
-
lastName,
|
|
37145
|
-
picture: user.picture
|
|
37146
|
-
});
|
|
37147
|
-
await backUpOnSignup({
|
|
37148
|
-
email,
|
|
37149
|
-
password,
|
|
37150
|
-
signingPrivateKey,
|
|
37151
|
-
saveRecoveryKey,
|
|
37152
|
-
auth0Sub: user.sub
|
|
37153
|
-
});
|
|
37154
|
-
const login = await arbi.sso.login({
|
|
37155
|
-
token: accessToken,
|
|
37156
|
-
email,
|
|
37157
|
-
password,
|
|
37158
|
-
profile: { ...resolveSsoName(user, ssoStatus), picture: user.picture ?? null }
|
|
37159
|
-
});
|
|
37623
|
+
const { login, registered, linked } = await completeSsoSignIn(arbi, {
|
|
37624
|
+
token: accessToken,
|
|
37625
|
+
user,
|
|
37626
|
+
status: ssoStatus,
|
|
37627
|
+
password,
|
|
37628
|
+
saveRecoveryKey
|
|
37629
|
+
});
|
|
37630
|
+
if (registered && login) {
|
|
37160
37631
|
auth.onRegistered?.(login);
|
|
37161
37632
|
return;
|
|
37162
37633
|
}
|
|
37163
|
-
|
|
37164
|
-
await signIn({ token: accessToken, email, password });
|
|
37165
|
-
if (ssoStatus.status === "local_exists") {
|
|
37634
|
+
if (linked) {
|
|
37166
37635
|
notify17("Your local account has been linked to SSO", "success");
|
|
37167
37636
|
}
|
|
37168
37637
|
} catch (err) {
|
|
@@ -37942,55 +38411,55 @@ function ConnectedAccountAccessBadge() {
|
|
|
37942
38411
|
|
|
37943
38412
|
Object.defineProperty(exports, "CAP_REACHED_MESSAGE", {
|
|
37944
38413
|
enumerable: true,
|
|
37945
|
-
get: function () { return
|
|
38414
|
+
get: function () { return chunkLYF47OXX_cjs.CAP_REACHED_MESSAGE; }
|
|
37946
38415
|
});
|
|
37947
38416
|
Object.defineProperty(exports, "ZERO_BUDGET_MESSAGE", {
|
|
37948
38417
|
enumerable: true,
|
|
37949
|
-
get: function () { return
|
|
38418
|
+
get: function () { return chunkLYF47OXX_cjs.ZERO_BUDGET_MESSAGE; }
|
|
37950
38419
|
});
|
|
37951
38420
|
Object.defineProperty(exports, "aiUsageResetTimestamp", {
|
|
37952
38421
|
enumerable: true,
|
|
37953
|
-
get: function () { return
|
|
38422
|
+
get: function () { return chunkLYF47OXX_cjs.aiUsageResetTimestamp; }
|
|
37954
38423
|
});
|
|
37955
38424
|
Object.defineProperty(exports, "formatMoney", {
|
|
37956
38425
|
enumerable: true,
|
|
37957
|
-
get: function () { return
|
|
38426
|
+
get: function () { return chunkLYF47OXX_cjs.formatMoney; }
|
|
37958
38427
|
});
|
|
37959
38428
|
Object.defineProperty(exports, "formatResetDate", {
|
|
37960
38429
|
enumerable: true,
|
|
37961
|
-
get: function () { return
|
|
38430
|
+
get: function () { return chunkLYF47OXX_cjs.formatResetDate; }
|
|
37962
38431
|
});
|
|
37963
38432
|
Object.defineProperty(exports, "getQuotaItems", {
|
|
37964
38433
|
enumerable: true,
|
|
37965
|
-
get: function () { return
|
|
38434
|
+
get: function () { return chunkLYF47OXX_cjs.getQuotaItems; }
|
|
37966
38435
|
});
|
|
37967
38436
|
Object.defineProperty(exports, "isAddonBudgetZero", {
|
|
37968
38437
|
enumerable: true,
|
|
37969
|
-
get: function () { return
|
|
38438
|
+
get: function () { return chunkLYF47OXX_cjs.isAddonBudgetZero; }
|
|
37970
38439
|
});
|
|
37971
38440
|
Object.defineProperty(exports, "isProProject", {
|
|
37972
38441
|
enumerable: true,
|
|
37973
|
-
get: function () { return
|
|
38442
|
+
get: function () { return chunkLYF47OXX_cjs.isProProject; }
|
|
37974
38443
|
});
|
|
37975
38444
|
Object.defineProperty(exports, "planBadgeView", {
|
|
37976
38445
|
enumerable: true,
|
|
37977
|
-
get: function () { return
|
|
38446
|
+
get: function () { return chunkLYF47OXX_cjs.planBadgeView; }
|
|
37978
38447
|
});
|
|
37979
38448
|
Object.defineProperty(exports, "planName", {
|
|
37980
38449
|
enumerable: true,
|
|
37981
|
-
get: function () { return
|
|
38450
|
+
get: function () { return chunkLYF47OXX_cjs.planName; }
|
|
37982
38451
|
});
|
|
37983
38452
|
Object.defineProperty(exports, "projectGroupBilling", {
|
|
37984
38453
|
enumerable: true,
|
|
37985
|
-
get: function () { return
|
|
38454
|
+
get: function () { return chunkLYF47OXX_cjs.projectGroupBilling; }
|
|
37986
38455
|
});
|
|
37987
38456
|
Object.defineProperty(exports, "useBillingSupport", {
|
|
37988
38457
|
enumerable: true,
|
|
37989
|
-
get: function () { return
|
|
38458
|
+
get: function () { return chunkLYF47OXX_cjs.useBillingSupport; }
|
|
37990
38459
|
});
|
|
37991
38460
|
Object.defineProperty(exports, "useRewardBalance", {
|
|
37992
38461
|
enumerable: true,
|
|
37993
|
-
get: function () { return
|
|
38462
|
+
get: function () { return chunkLYF47OXX_cjs.useRewardBalance; }
|
|
37994
38463
|
});
|
|
37995
38464
|
Object.defineProperty(exports, "ConnectedAssistantDock", {
|
|
37996
38465
|
enumerable: true,
|
|
@@ -38317,6 +38786,8 @@ exports.DEFAULT_CONNECTED_SEARCH_PAGE_LABELS = DEFAULT_CONNECTED_SEARCH_PAGE_LAB
|
|
|
38317
38786
|
exports.DEFAULT_CONNECTED_SKILL_UPLOAD_LABELS = DEFAULT_CONNECTED_SKILL_UPLOAD_LABELS;
|
|
38318
38787
|
exports.DEFAULT_CONNECTED_WORKFLOW_RUNNER_LABELS = DEFAULT_CONNECTED_WORKFLOW_RUNNER_LABELS;
|
|
38319
38788
|
exports.DEFAULT_OAUTH_PERMISSIONS = DEFAULT_OAUTH_PERMISSIONS;
|
|
38789
|
+
exports.DEFAULT_PROJECTS_LIST_LABELS = DEFAULT_PROJECTS_LIST_LABELS;
|
|
38790
|
+
exports.DEFAULT_PROJECT_LIST_COLUMNS = DEFAULT_PROJECT_LIST_COLUMNS;
|
|
38320
38791
|
exports.DEFAULT_SEARCH_FIELDS = DEFAULT_SEARCH_FIELDS;
|
|
38321
38792
|
exports.DEFAULT_SEARCH_ROW_LABELS = DEFAULT_SEARCH_ROW_LABELS;
|
|
38322
38793
|
exports.DEFAULT_SETTINGS_SECTIONS = DEFAULT_SETTINGS_SECTIONS;
|
|
@@ -38386,6 +38857,7 @@ exports.WorkflowRunStatusCell = WorkflowRunStatusCell;
|
|
|
38386
38857
|
exports.WorkflowRunThread = WorkflowRunThread;
|
|
38387
38858
|
exports.WorkflowStepMessage = WorkflowStepMessage;
|
|
38388
38859
|
exports.accountSettingsSection = accountSettingsSection;
|
|
38860
|
+
exports.appearanceSettingsSection = appearanceSettingsSection;
|
|
38389
38861
|
exports.backUpOnSignup = backUpOnSignup;
|
|
38390
38862
|
exports.bookingCancelLink = bookingCancelLink;
|
|
38391
38863
|
exports.buildNotificationCenterItems = buildNotificationCenterItems;
|
|
@@ -38407,6 +38879,7 @@ exports.documentFamilyMeta = documentFamilyMeta;
|
|
|
38407
38879
|
exports.documentFieldContent = documentFieldContent;
|
|
38408
38880
|
exports.filesViewMode = filesViewMode;
|
|
38409
38881
|
exports.filterNotificationCenterItems = filterNotificationCenterItems;
|
|
38882
|
+
exports.formatStorageGb = formatStorageGb;
|
|
38410
38883
|
exports.groupFallbackName = groupFallbackName;
|
|
38411
38884
|
exports.identifyOAuthClient = identifyOAuthClient;
|
|
38412
38885
|
exports.isActiveDocumentStatus = isActiveDocumentStatus;
|
|
@@ -38414,6 +38887,7 @@ exports.joinEventMeeting = joinEventMeeting;
|
|
|
38414
38887
|
exports.loadEventWebinar = loadEventWebinar;
|
|
38415
38888
|
exports.mailSettingsSection = mailSettingsSection;
|
|
38416
38889
|
exports.openMeetingLink = openMeetingLink;
|
|
38890
|
+
exports.openSsoPopup = openSsoPopup;
|
|
38417
38891
|
exports.organisationSettingsSection = organisationSettingsSection;
|
|
38418
38892
|
exports.parseArbiCallUrl = parseArbiCallUrl;
|
|
38419
38893
|
exports.parseOAuthConsentRequest = parseOAuthConsentRequest;
|