@iblai/iblai-js 2.5.9 → 2.5.11
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.
|
@@ -100431,7 +100431,7 @@ var profileAdmin$3 = {
|
|
|
100431
100431
|
applicationsTab: "Applications",
|
|
100432
100432
|
applicationsTabDescription: "Review applications to your organization and edit the questions applicants answer when they apply.",
|
|
100433
100433
|
onboardingTab: "Onboarding",
|
|
100434
|
-
onboardingTabDescription: "Choose the
|
|
100434
|
+
onboardingTabDescription: "Choose the agents new members of this platform can be onboarded by, how each introduces itself, and copy the link that opens it."
|
|
100435
100435
|
};
|
|
100436
100436
|
var profileAutoRechargeModal$3 = {
|
|
100437
100437
|
title: "Manage Usage",
|
|
@@ -103467,24 +103467,39 @@ var onboardingUserOnboarding$3 = {
|
|
|
103467
103467
|
continueToApp: "Continue"
|
|
103468
103468
|
};
|
|
103469
103469
|
var profileOnboardingTab$3 = {
|
|
103470
|
-
editorTitle: "User onboarding
|
|
103471
|
-
editorDescription: "The
|
|
103470
|
+
editorTitle: "User onboarding agents",
|
|
103471
|
+
editorDescription: "The agents new members of this platform can be onboarded by.",
|
|
103472
103472
|
loadError: "Could not load the onboarding settings.",
|
|
103473
103473
|
save: "Save changes",
|
|
103474
103474
|
saving: "Saving...",
|
|
103475
|
-
savedToast: "Onboarding
|
|
103476
|
-
saveFailedToast: "Could not save the onboarding
|
|
103475
|
+
savedToast: "Onboarding agents saved",
|
|
103476
|
+
saveFailedToast: "Could not save the onboarding agents",
|
|
103477
103477
|
unsavedChanges: "Unsaved changes",
|
|
103478
|
-
agentLabel: "
|
|
103478
|
+
agentLabel: "Agents",
|
|
103479
103479
|
searchAgents: "Search agents",
|
|
103480
103480
|
loadingAgents: "Loading agents...",
|
|
103481
103481
|
noAgents: "No agents found.",
|
|
103482
|
-
clearAgent: "
|
|
103482
|
+
clearAgent: "Remove this agent",
|
|
103483
103483
|
agentTitleLabel: "Heading",
|
|
103484
103484
|
agentTitlePlaceholder: "Meet your assistant",
|
|
103485
103485
|
agentDescriptionLabel: "Sub-heading",
|
|
103486
103486
|
agentDescriptionPlaceholder: "Ask your assistant anything to get started.",
|
|
103487
|
-
noAgentHint: "With no agent set, members skip onboarding entirely."
|
|
103487
|
+
noAgentHint: "With no agent set, members skip onboarding entirely.",
|
|
103488
|
+
copyLink: "Copy link",
|
|
103489
|
+
linkCopied: "Copied",
|
|
103490
|
+
defaultBadge: "Default",
|
|
103491
|
+
defaultBadgeHint: "Members who arrive without a link meet this agent.",
|
|
103492
|
+
emptyTitle: "No onboarding agent yet",
|
|
103493
|
+
emptyBody: "Search above to pick the agent new members meet when they arrive. Until then, they skip onboarding entirely.",
|
|
103494
|
+
moveUp: "Move up",
|
|
103495
|
+
moveDown: "Move down",
|
|
103496
|
+
linkLabel: "Onboarding link",
|
|
103497
|
+
introLabel: "Introduction",
|
|
103498
|
+
introSummary: "Heading and sub-heading shown above the agent",
|
|
103499
|
+
collapse: "Hide introduction",
|
|
103500
|
+
expand: "Edit introduction",
|
|
103501
|
+
oneAgent: "1 agent",
|
|
103502
|
+
multipleAgents: "{count} agents"
|
|
103488
103503
|
};
|
|
103489
103504
|
var en = {
|
|
103490
103505
|
accessTabAddAccess: accessTabAddAccess$3,
|
|
@@ -107536,7 +107551,7 @@ var profileAdmin$2 = {
|
|
|
107536
107551
|
applicationsTab: "Candidatures",
|
|
107537
107552
|
applicationsTabDescription: "Consultez les candidatures à votre organisation et modifiez les questions auxquelles les candidats répondent lorsqu'ils postulent.",
|
|
107538
107553
|
onboardingTab: "Intégration",
|
|
107539
|
-
onboardingTabDescription: "Choisissez l'
|
|
107554
|
+
onboardingTabDescription: "Choisissez les agents pouvant accompagner l'arrivée des nouveaux membres de cette plateforme, leur présentation, et copiez le lien qui les ouvre."
|
|
107540
107555
|
};
|
|
107541
107556
|
var profileAutoRechargeModal$2 = {
|
|
107542
107557
|
title: "Gérer l'utilisation",
|
|
@@ -110406,24 +110421,39 @@ var onboardingUserOnboarding$2 = {
|
|
|
110406
110421
|
continueToApp: "Continuer"
|
|
110407
110422
|
};
|
|
110408
110423
|
var profileOnboardingTab$2 = {
|
|
110409
|
-
editorTitle: "
|
|
110410
|
-
editorDescription: "
|
|
110424
|
+
editorTitle: "Agents d'intégration des utilisateurs",
|
|
110425
|
+
editorDescription: "Les agents qui peuvent accompagner l'arrivée des nouveaux membres de cette plateforme.",
|
|
110411
110426
|
loadError: "Impossible de charger les paramètres d'intégration.",
|
|
110412
110427
|
save: "Enregistrer les modifications",
|
|
110413
110428
|
saving: "Enregistrement...",
|
|
110414
|
-
savedToast: "
|
|
110415
|
-
saveFailedToast: "Impossible d'enregistrer
|
|
110429
|
+
savedToast: "Agents d'intégration enregistrés",
|
|
110430
|
+
saveFailedToast: "Impossible d'enregistrer les agents d'intégration",
|
|
110416
110431
|
unsavedChanges: "Modifications non enregistrées",
|
|
110417
|
-
agentLabel: "
|
|
110432
|
+
agentLabel: "Agents",
|
|
110418
110433
|
searchAgents: "Rechercher des agents",
|
|
110419
110434
|
loadingAgents: "Chargement des agents...",
|
|
110420
110435
|
noAgents: "Aucun agent trouvé.",
|
|
110421
|
-
clearAgent: "
|
|
110436
|
+
clearAgent: "Retirer cet agent",
|
|
110422
110437
|
agentTitleLabel: "Titre",
|
|
110423
110438
|
agentTitlePlaceholder: "Rencontrez votre assistant",
|
|
110424
110439
|
agentDescriptionLabel: "Sous-titre",
|
|
110425
110440
|
agentDescriptionPlaceholder: "Posez toutes vos questions à votre assistant pour commencer.",
|
|
110426
|
-
noAgentHint: "Sans agent défini, les membres ignorent complètement l'intégration."
|
|
110441
|
+
noAgentHint: "Sans agent défini, les membres ignorent complètement l'intégration.",
|
|
110442
|
+
copyLink: "Copier le lien",
|
|
110443
|
+
linkCopied: "Copié",
|
|
110444
|
+
defaultBadge: "Par défaut",
|
|
110445
|
+
defaultBadgeHint: "Les membres arrivant sans lien rencontrent cet agent.",
|
|
110446
|
+
emptyTitle: "Aucun agent d'intégration",
|
|
110447
|
+
emptyBody: "Cherchez ci-dessus l'agent que rencontreront les nouveaux membres à leur arrivée. D'ici là, ils passent l'intégration.",
|
|
110448
|
+
moveUp: "Monter",
|
|
110449
|
+
moveDown: "Descendre",
|
|
110450
|
+
linkLabel: "Lien d'intégration",
|
|
110451
|
+
introLabel: "Présentation",
|
|
110452
|
+
introSummary: "Titre et sous-titre affichés au-dessus de l'agent",
|
|
110453
|
+
collapse: "Masquer la présentation",
|
|
110454
|
+
expand: "Modifier la présentation",
|
|
110455
|
+
oneAgent: "1 agent",
|
|
110456
|
+
multipleAgents: "{count} agents"
|
|
110427
110457
|
};
|
|
110428
110458
|
var fr = {
|
|
110429
110459
|
accessTabAddAccess: accessTabAddAccess$2,
|
|
@@ -114475,7 +114505,7 @@ var profileAdmin$1 = {
|
|
|
114475
114505
|
applicationsTab: "Solicitudes",
|
|
114476
114506
|
applicationsTabDescription: "Revise las solicitudes a su organización y edite las preguntas que responden los solicitantes cuando postulan.",
|
|
114477
114507
|
onboardingTab: "Incorporación",
|
|
114478
|
-
onboardingTabDescription: "Elija
|
|
114508
|
+
onboardingTabDescription: "Elija los agentes que pueden acompañar a los nuevos miembros de esta plataforma, cómo se presenta cada uno, y copie el enlace que lo abre."
|
|
114479
114509
|
};
|
|
114480
114510
|
var profileAutoRechargeModal$1 = {
|
|
114481
114511
|
title: "Gestionar uso",
|
|
@@ -117345,24 +117375,39 @@ var onboardingUserOnboarding$1 = {
|
|
|
117345
117375
|
continueToApp: "Continuar"
|
|
117346
117376
|
};
|
|
117347
117377
|
var profileOnboardingTab$1 = {
|
|
117348
|
-
editorTitle: "
|
|
117349
|
-
editorDescription: "
|
|
117378
|
+
editorTitle: "Agentes de incorporación de usuarios",
|
|
117379
|
+
editorDescription: "Los agentes que pueden acompañar a los nuevos miembros de esta plataforma.",
|
|
117350
117380
|
loadError: "No se pudo cargar la configuración de incorporación.",
|
|
117351
117381
|
save: "Guardar cambios",
|
|
117352
117382
|
saving: "Guardando...",
|
|
117353
|
-
savedToast: "
|
|
117354
|
-
saveFailedToast: "No se
|
|
117383
|
+
savedToast: "Agentes de incorporación guardados",
|
|
117384
|
+
saveFailedToast: "No se pudieron guardar los agentes de incorporación",
|
|
117355
117385
|
unsavedChanges: "Cambios sin guardar",
|
|
117356
|
-
agentLabel: "
|
|
117386
|
+
agentLabel: "Agentes",
|
|
117357
117387
|
searchAgents: "Buscar agentes",
|
|
117358
117388
|
loadingAgents: "Cargando agentes...",
|
|
117359
117389
|
noAgents: "No se encontraron agentes.",
|
|
117360
|
-
clearAgent: "Quitar
|
|
117390
|
+
clearAgent: "Quitar este agente",
|
|
117361
117391
|
agentTitleLabel: "Encabezado",
|
|
117362
117392
|
agentTitlePlaceholder: "Conozca a su asistente",
|
|
117363
117393
|
agentDescriptionLabel: "Subtítulo",
|
|
117364
117394
|
agentDescriptionPlaceholder: "Pregúntele lo que quiera a su asistente para empezar.",
|
|
117365
|
-
noAgentHint: "Sin un agente definido, los miembros omiten por completo la incorporación."
|
|
117395
|
+
noAgentHint: "Sin un agente definido, los miembros omiten por completo la incorporación.",
|
|
117396
|
+
copyLink: "Copiar enlace",
|
|
117397
|
+
linkCopied: "Copiado",
|
|
117398
|
+
defaultBadge: "Predeterminado",
|
|
117399
|
+
defaultBadgeHint: "Los miembros que llegan sin enlace conocen a este agente.",
|
|
117400
|
+
emptyTitle: "Aún no hay agente de incorporación",
|
|
117401
|
+
emptyBody: "Busque arriba el agente que conocerán los nuevos miembros al llegar. Hasta entonces, omiten la incorporación.",
|
|
117402
|
+
moveUp: "Subir",
|
|
117403
|
+
moveDown: "Bajar",
|
|
117404
|
+
linkLabel: "Enlace de incorporación",
|
|
117405
|
+
introLabel: "Presentación",
|
|
117406
|
+
introSummary: "Título y subtítulo mostrados sobre el agente",
|
|
117407
|
+
collapse: "Ocultar presentación",
|
|
117408
|
+
expand: "Editar presentación",
|
|
117409
|
+
oneAgent: "1 agente",
|
|
117410
|
+
multipleAgents: "{count} agentes"
|
|
117366
117411
|
};
|
|
117367
117412
|
var es = {
|
|
117368
117413
|
accessTabAddAccess: accessTabAddAccess$1,
|
|
@@ -121414,7 +121459,7 @@ var profileAdmin = {
|
|
|
121414
121459
|
applicationsTab: "申请",
|
|
121415
121460
|
applicationsTabDescription: "查看向贵组织提交的申请,并编辑申请人申请时回答的问题。",
|
|
121416
121461
|
onboardingTab: "引导",
|
|
121417
|
-
onboardingTabDescription: "
|
|
121462
|
+
onboardingTabDescription: "选择可引导本平台新成员的助手、各自的介绍文案,并复制打开它的链接。"
|
|
121418
121463
|
};
|
|
121419
121464
|
var profileAutoRechargeModal = {
|
|
121420
121465
|
title: "管理用量",
|
|
@@ -124284,24 +124329,39 @@ var onboardingUserOnboarding = {
|
|
|
124284
124329
|
continueToApp: "继续"
|
|
124285
124330
|
};
|
|
124286
124331
|
var profileOnboardingTab = {
|
|
124287
|
-
editorTitle: "
|
|
124288
|
-
editorDescription: "
|
|
124332
|
+
editorTitle: "用户引导助手",
|
|
124333
|
+
editorDescription: "可用于引导本平台新成员的助手。",
|
|
124289
124334
|
loadError: "无法加载引导设置。",
|
|
124290
124335
|
save: "保存更改",
|
|
124291
124336
|
saving: "保存中…",
|
|
124292
|
-
savedToast: "
|
|
124293
|
-
saveFailedToast: "
|
|
124337
|
+
savedToast: "引导助手已保存",
|
|
124338
|
+
saveFailedToast: "无法保存引导助手",
|
|
124294
124339
|
unsavedChanges: "有未保存的更改",
|
|
124295
|
-
agentLabel: "
|
|
124340
|
+
agentLabel: "助手",
|
|
124296
124341
|
searchAgents: "搜索智能体",
|
|
124297
124342
|
loadingAgents: "正在加载智能体…",
|
|
124298
124343
|
noAgents: "未找到智能体。",
|
|
124299
|
-
clearAgent: "
|
|
124344
|
+
clearAgent: "移除此助手",
|
|
124300
124345
|
agentTitleLabel: "标题",
|
|
124301
124346
|
agentTitlePlaceholder: "认识您的助手",
|
|
124302
124347
|
agentDescriptionLabel: "副标题",
|
|
124303
124348
|
agentDescriptionPlaceholder: "有任何问题都可以问您的助手。",
|
|
124304
|
-
noAgentHint: "未设置智能体时,成员将完全跳过引导流程。"
|
|
124349
|
+
noAgentHint: "未设置智能体时,成员将完全跳过引导流程。",
|
|
124350
|
+
copyLink: "复制链接",
|
|
124351
|
+
linkCopied: "已复制",
|
|
124352
|
+
defaultBadge: "默认",
|
|
124353
|
+
defaultBadgeHint: "未通过链接进入的成员会见到该助手。",
|
|
124354
|
+
emptyTitle: "尚未设置引导助手",
|
|
124355
|
+
emptyBody: "在上方搜索新成员进入时要见到的助手。在此之前,他们将跳过引导。",
|
|
124356
|
+
moveUp: "上移",
|
|
124357
|
+
moveDown: "下移",
|
|
124358
|
+
linkLabel: "引导链接",
|
|
124359
|
+
introLabel: "介绍",
|
|
124360
|
+
introSummary: "显示在助手上方的标题与副标题",
|
|
124361
|
+
collapse: "隐藏介绍",
|
|
124362
|
+
expand: "编辑介绍",
|
|
124363
|
+
oneAgent: "1 个助手",
|
|
124364
|
+
multipleAgents: "{count} 个助手"
|
|
124305
124365
|
};
|
|
124306
124366
|
var zh = {
|
|
124307
124367
|
accessTabAddAccess: accessTabAddAccess,
|
|
@@ -217760,31 +217820,91 @@ function Markdown({ children, className }) {
|
|
|
217760
217820
|
}
|
|
217761
217821
|
|
|
217762
217822
|
/**
|
|
217763
|
-
*
|
|
217823
|
+
* Whether the dropdown is open, closing on a pointer press outside `ref` or on
|
|
217824
|
+
* Escape.
|
|
217825
|
+
*
|
|
217826
|
+
* Deliberately NOT closed on the input's `blur`: a press anywhere inside the
|
|
217827
|
+
* panel — its scrollbar above all — blurs the input, so a blur-driven picker
|
|
217828
|
+
* shuts the moment you try to scroll the results. Watching for a press outside
|
|
217829
|
+
* instead means the panel stays put no matter where inside it you press, and
|
|
217830
|
+
* still closes for every gesture that means "I'm done here".
|
|
217831
|
+
*/
|
|
217832
|
+
function useDismissable(ref) {
|
|
217833
|
+
const [isOpen, setIsOpen] = React__default.useState(false);
|
|
217834
|
+
React__default.useEffect(() => {
|
|
217835
|
+
if (!isOpen)
|
|
217836
|
+
return;
|
|
217837
|
+
const onPointerDown = (event) => {
|
|
217838
|
+
var _a;
|
|
217839
|
+
const target = event.target;
|
|
217840
|
+
// A press on a node already detached from the document (an option that
|
|
217841
|
+
// re-rendered under the pointer) is not a press outside.
|
|
217842
|
+
if (target && !target.isConnected)
|
|
217843
|
+
return;
|
|
217844
|
+
if (target && ((_a = ref.current) === null || _a === void 0 ? void 0 : _a.contains(target)))
|
|
217845
|
+
return;
|
|
217846
|
+
setIsOpen(false);
|
|
217847
|
+
};
|
|
217848
|
+
const onKeyDown = (event) => {
|
|
217849
|
+
if (event.key === 'Escape')
|
|
217850
|
+
setIsOpen(false);
|
|
217851
|
+
};
|
|
217852
|
+
document.addEventListener('pointerdown', onPointerDown, true);
|
|
217853
|
+
document.addEventListener('keydown', onKeyDown);
|
|
217854
|
+
return () => {
|
|
217855
|
+
document.removeEventListener('pointerdown', onPointerDown, true);
|
|
217856
|
+
document.removeEventListener('keydown', onKeyDown);
|
|
217857
|
+
};
|
|
217858
|
+
}, [isOpen, ref]);
|
|
217859
|
+
return [isOpen, setIsOpen];
|
|
217860
|
+
}
|
|
217861
|
+
/** The search box plus its absolutely-positioned results panel. */
|
|
217862
|
+
function SearchField({ labels, searchTerm, onSearchTermChange, options, isLoading, minChars, isOpen, onOpen, onPick, testId, renderOptionSuffix, emptyHint, }) {
|
|
217863
|
+
return (jsxs("div", { className: "relative", children: [jsx(Input, { id: `${testId}-input`, className: "focus-visible:border-blue-500 focus-visible:ring-1 focus-visible:ring-blue-500", "aria-label": labels.label || labels.placeholder, value: searchTerm, onChange: (e) => {
|
|
217864
|
+
onSearchTermChange(e.target.value);
|
|
217865
|
+
onOpen();
|
|
217866
|
+
}, onFocus: onOpen, placeholder: labels.placeholder, autoComplete: "off", "aria-autocomplete": "list", "aria-expanded": isOpen, "data-testid": `${testId}-input` }), isOpen && (jsx("div", { className: "absolute top-full right-0 left-0 z-50 mt-1 max-h-64 overflow-y-auto overscroll-contain rounded-md border border-gray-200 bg-white shadow-lg", "data-testid": `${testId}-results`, children: searchTerm.trim().length < minChars ? (jsx("div", { className: "px-3 py-2 text-sm text-gray-600", children: labels.typeToSearch })) : isLoading ? (jsxs("div", { className: "flex items-center gap-2 px-3 py-2 text-sm text-gray-600", children: [jsx(LoaderCircle, { className: "h-3.5 w-3.5 animate-spin", "aria-hidden": "true" }), labels.searching] })) : options.length > 0 ? (options.map((option) => (jsxs("button", { type: "button", className: "flex w-full items-center justify-between gap-2 px-3 py-2 text-left hover:bg-gray-50", onClick: () => onPick(option), "data-testid": `${testId}-option-${option.value}`, children: [jsxs("span", { className: "flex min-w-0 flex-col items-start gap-0.5", children: [jsx("span", { className: "text-sm font-medium text-gray-900", children: option.label }), option.sublabel && (jsx("span", { className: "text-xs text-gray-600", children: option.sublabel }))] }), renderOptionSuffix === null || renderOptionSuffix === void 0 ? void 0 : renderOptionSuffix(option)] }, option.value)))) : (jsx("div", { className: "px-3 py-2 text-sm text-gray-600", "data-testid": `${testId}-no-results`, children: emptyHint !== null && emptyHint !== void 0 ? emptyHint : labels.noResults })) }))] }));
|
|
217867
|
+
}
|
|
217868
|
+
/**
|
|
217869
|
+
* Single-select searchable picker: a debounce-agnostic input + absolute
|
|
217764
217870
|
* results dropdown (the add-access pattern), collapsing to a removable chip
|
|
217765
217871
|
* once something is picked. The caller owns the search term and the fetched
|
|
217766
217872
|
* options so any query hook can back it.
|
|
217873
|
+
*
|
|
217874
|
+
* See {@link MultiSearchSelect} to pick more than one.
|
|
217767
217875
|
*/
|
|
217768
217876
|
function SearchSelect({ labels, selected, onSelect, onClear, searchTerm, onSearchTermChange, options, isLoading, minChars = 2, labelClassName = 'text-xs font-medium text-gray-700', testId, }) {
|
|
217769
|
-
const
|
|
217770
|
-
const
|
|
217771
|
-
React__default.useEffect(() => () => {
|
|
217772
|
-
if (blurTimeout.current)
|
|
217773
|
-
clearTimeout(blurTimeout.current);
|
|
217774
|
-
}, []);
|
|
217877
|
+
const containerRef = React__default.useRef(null);
|
|
217878
|
+
const [isOpen, setIsOpen] = useDismissable(containerRef);
|
|
217775
217879
|
if (selected) {
|
|
217776
217880
|
return (jsxs("div", { className: "space-y-1.5", children: [labels.label && jsx(Label$1, { className: labelClassName, children: labels.label }), jsxs("div", { className: "flex items-center justify-between gap-2 rounded-md border border-gray-200 bg-gray-50 px-3 py-2", "data-testid": `${testId}-selected`, children: [jsxs("div", { className: "min-w-0", children: [jsx("p", { className: "truncate text-sm font-medium text-gray-900", children: selected.label }), selected.sublabel && (jsx("p", { className: "truncate text-xs text-gray-600", children: selected.sublabel }))] }), jsxs(Button$1, { type: "button", size: "icon", variant: "ghost", className: "h-6 w-6 flex-shrink-0 text-gray-500 hover:text-red-600", onClick: onClear, "data-testid": `${testId}-clear`, children: [jsx(X$2, { className: "h-3.5 w-3.5", "aria-hidden": "true" }), jsx("span", { className: "sr-only", children: labels.clear })] })] })] }));
|
|
217777
217881
|
}
|
|
217778
|
-
return (jsxs("div", { className: "space-y-1.5", children: [labels.label && (jsx(Label$1, { className: labelClassName, htmlFor: `${testId}-input`, children: labels.label })),
|
|
217779
|
-
|
|
217780
|
-
|
|
217781
|
-
|
|
217782
|
-
|
|
217783
|
-
|
|
217784
|
-
|
|
217785
|
-
|
|
217786
|
-
|
|
217787
|
-
|
|
217882
|
+
return (jsxs("div", { className: "space-y-1.5", ref: containerRef, children: [labels.label && (jsx(Label$1, { className: labelClassName, htmlFor: `${testId}-input`, children: labels.label })), jsx(SearchField, { labels: labels, searchTerm: searchTerm, onSearchTermChange: onSearchTermChange, options: options, isLoading: isLoading, minChars: minChars, isOpen: isOpen, onOpen: () => setIsOpen(true), onPick: (option) => {
|
|
217883
|
+
onSelect(option);
|
|
217884
|
+
setIsOpen(false);
|
|
217885
|
+
}, testId: testId })] }));
|
|
217886
|
+
}
|
|
217887
|
+
/**
|
|
217888
|
+
* The {@link SearchSelect} search box, picking any number of options.
|
|
217889
|
+
*
|
|
217890
|
+
* The input stays put rather than collapsing into the selection: picking is
|
|
217891
|
+
* usually not a one-off here, and a field that disappears after the first pick
|
|
217892
|
+
* gives no way to add a second. Options already picked stay listed and ticked,
|
|
217893
|
+
* so clicking one again removes it — the list doubles as the state of the
|
|
217894
|
+
* selection instead of silently shrinking as you go.
|
|
217895
|
+
*/
|
|
217896
|
+
function MultiSearchSelect({ labels, selected, onSelect, onRemove, searchTerm, onSearchTermChange, options, isLoading, minChars = 2, labelClassName = 'text-xs font-medium text-gray-700', emptyHint, renderSelected, testId, }) {
|
|
217897
|
+
const containerRef = React__default.useRef(null);
|
|
217898
|
+
const [isOpen, setIsOpen] = useDismissable(containerRef);
|
|
217899
|
+
const picked = new Set(selected.map((option) => option.value));
|
|
217900
|
+
return (jsxs("div", { className: "space-y-1.5", ref: containerRef, children: [labels.label && (jsx(Label$1, { className: labelClassName, htmlFor: `${testId}-input`, children: labels.label })), jsx(SearchField, { labels: labels, searchTerm: searchTerm, onSearchTermChange: onSearchTermChange, options: options, isLoading: isLoading, minChars: minChars, isOpen: isOpen, onOpen: () => setIsOpen(true),
|
|
217901
|
+
// The panel stays open: picking one of several is the normal case here,
|
|
217902
|
+
// and reopening between each would make a set of picks a set of chores.
|
|
217903
|
+
onPick: (option) => (picked.has(option.value) ? onRemove(option.value) : onSelect(option)), testId: testId, renderOptionSuffix: (option) => picked.has(option.value) ? (jsx("span", { className: "shrink-0 text-xs font-medium text-blue-600", "data-testid": `${testId}-picked-${option.value}`, children: "\u2713" })) : null }), selected.length === 0
|
|
217904
|
+
? emptyHint && jsx("p", { className: "text-xs text-gray-400", children: emptyHint })
|
|
217905
|
+
: renderSelected
|
|
217906
|
+
? selected.map((option) => (jsx(React__default.Fragment, { children: renderSelected(option) }, option.value)))
|
|
217907
|
+
: selected.length > 0 && (jsx("div", { className: "flex flex-wrap gap-2", "data-testid": `${testId}-selected`, children: selected.map((option) => (jsxs("span", { className: cn('inline-flex items-center gap-1 rounded-full border border-gray-200', 'bg-gray-50 py-1 pr-1 pl-3 text-sm text-gray-900'), "data-testid": `${testId}-chip-${option.value}`, children: [jsx("span", { className: "truncate", children: option.label }), jsxs(Button$1, { type: "button", size: "icon", variant: "ghost", className: "h-5 w-5 shrink-0 text-gray-500 hover:text-red-600", onClick: () => onRemove(option.value), "data-testid": `${testId}-remove-${option.value}`, children: [jsx(X$2, { className: "h-3 w-3", "aria-hidden": "true" }), jsx("span", { className: "sr-only", children: labels.clear })] })] }, option.value))) }))] }));
|
|
217788
217908
|
}
|
|
217789
217909
|
|
|
217790
217910
|
/**
|
|
@@ -223524,6 +223644,7 @@ function emptyUserOnboardingForm(title = '') {
|
|
|
223524
223644
|
enabled: false,
|
|
223525
223645
|
title,
|
|
223526
223646
|
sections: [],
|
|
223647
|
+
agents: [],
|
|
223527
223648
|
agent: null,
|
|
223528
223649
|
};
|
|
223529
223650
|
}
|
|
@@ -223543,25 +223664,53 @@ function coerceOnboardingAgent(raw) {
|
|
|
223543
223664
|
description: typeof value.description === 'string' ? value.description : undefined,
|
|
223544
223665
|
};
|
|
223545
223666
|
}
|
|
223667
|
+
/**
|
|
223668
|
+
* Defensive read of a stored agent list. Falls back to the legacy single
|
|
223669
|
+
* `agent` key when no list is stored, so a tenant configured before multi-agent
|
|
223670
|
+
* onboarding keeps working without a migration; unusable entries are dropped
|
|
223671
|
+
* rather than failing the whole read.
|
|
223672
|
+
*/
|
|
223673
|
+
function coerceOnboardingAgents(rawAgents, rawAgent) {
|
|
223674
|
+
const value = parseMetadataValue(rawAgents);
|
|
223675
|
+
if (Array.isArray(value)) {
|
|
223676
|
+
const agents = value
|
|
223677
|
+
.map(coerceOnboardingAgent)
|
|
223678
|
+
.filter((agent) => !!agent);
|
|
223679
|
+
// De-duplicate: the same agent twice would give the admin two rows that
|
|
223680
|
+
// write to one another, and the learner an ambiguous link.
|
|
223681
|
+
const seen = new Set();
|
|
223682
|
+
return agents.filter((agent) => {
|
|
223683
|
+
if (seen.has(agent.mentor_unique_id))
|
|
223684
|
+
return false;
|
|
223685
|
+
seen.add(agent.mentor_unique_id);
|
|
223686
|
+
return true;
|
|
223687
|
+
});
|
|
223688
|
+
}
|
|
223689
|
+
const legacy = coerceOnboardingAgent(rawAgent);
|
|
223690
|
+
return legacy ? [legacy] : [];
|
|
223691
|
+
}
|
|
223546
223692
|
/**
|
|
223547
223693
|
* Defensive read of the stored form. Anything unrecognizable (missing key,
|
|
223548
223694
|
* wrong type, unparseable string) reads as an empty, disabled form so both the
|
|
223549
223695
|
* editor and the wizard always have something to work with.
|
|
223550
223696
|
*/
|
|
223551
223697
|
function coerceUserOnboardingForm(raw) {
|
|
223698
|
+
var _a;
|
|
223552
223699
|
const value = parseMetadataValue(raw);
|
|
223553
223700
|
if (!isRecord(value))
|
|
223554
223701
|
return emptyUserOnboardingForm();
|
|
223555
223702
|
const sections = Array.isArray(value.sections)
|
|
223556
223703
|
? value.sections.filter((section) => isRecord(section) && Array.isArray(section.fields))
|
|
223557
223704
|
: [];
|
|
223705
|
+
const agents = coerceOnboardingAgents(value.agents, value.agent);
|
|
223558
223706
|
return {
|
|
223559
223707
|
version: typeof value.version === 'number' ? value.version : USER_ONBOARDING_FORM_VERSION,
|
|
223560
223708
|
enabled: value.enabled === true,
|
|
223561
223709
|
title: typeof value.title === 'string' ? value.title : '',
|
|
223562
223710
|
description: typeof value.description === 'string' ? value.description : undefined,
|
|
223563
223711
|
sections,
|
|
223564
|
-
|
|
223712
|
+
agents,
|
|
223713
|
+
agent: (_a = agents[0]) !== null && _a !== void 0 ? _a : null,
|
|
223565
223714
|
updated_at: typeof value.updated_at === 'string' ? value.updated_at : undefined,
|
|
223566
223715
|
};
|
|
223567
223716
|
}
|
|
@@ -223569,26 +223718,43 @@ function coerceUserOnboardingForm(raw) {
|
|
|
223569
223718
|
function readUserOnboardingForm(metadata) {
|
|
223570
223719
|
return coerceUserOnboardingForm(metadata === null || metadata === void 0 ? void 0 : metadata[USER_ONBOARDING_FORM_SLUG]);
|
|
223571
223720
|
}
|
|
223721
|
+
/**
|
|
223722
|
+
* The learner-facing link for one onboarding agent: `<base>/onboarding/<id>`.
|
|
223723
|
+
* `base` is the host's own origin or path prefix — trailing slashes are the
|
|
223724
|
+
* caller's habit, not their intent, so they are trimmed rather than doubled up.
|
|
223725
|
+
*/
|
|
223726
|
+
function buildOnboardingAgentPath(base, agentId) {
|
|
223727
|
+
return `${(base !== null && base !== void 0 ? base : '').replace(/\/+$/, '')}/onboarding/${encodeURIComponent(agentId)}`;
|
|
223728
|
+
}
|
|
223572
223729
|
/**
|
|
223573
223730
|
* Merge the form into the tenant metadata for a `PUT` (the endpoint replaces
|
|
223574
223731
|
* the whole object, so untouched keys must ride along).
|
|
223575
223732
|
*/
|
|
223576
223733
|
function buildUserOnboardingFormMetadata(metadata, form, updatedAt) {
|
|
223577
|
-
var _a;
|
|
223734
|
+
var _a, _b, _c;
|
|
223578
223735
|
return {
|
|
223579
223736
|
...(metadata !== null && metadata !== void 0 ? metadata : {}),
|
|
223580
223737
|
[USER_ONBOARDING_FORM_SLUG]: {
|
|
223581
223738
|
...form,
|
|
223582
223739
|
version: USER_ONBOARDING_FORM_VERSION,
|
|
223583
|
-
|
|
223740
|
+
agents: (_a = form.agents) !== null && _a !== void 0 ? _a : [],
|
|
223741
|
+
// Mirrored, not authored: see the note on `UserOnboardingForm.agent`.
|
|
223742
|
+
agent: (_c = (_b = form.agents) === null || _b === void 0 ? void 0 : _b[0]) !== null && _c !== void 0 ? _c : null,
|
|
223584
223743
|
updated_at: updatedAt,
|
|
223585
223744
|
},
|
|
223586
223745
|
};
|
|
223587
223746
|
}
|
|
223588
223747
|
|
|
223589
223748
|
/**
|
|
223590
|
-
* Onboarding management: which
|
|
223591
|
-
*
|
|
223749
|
+
* Onboarding management: which agents new members of the platform can be
|
|
223750
|
+
* onboarded by, and how each is introduced (heading + sub-heading).
|
|
223751
|
+
*
|
|
223752
|
+
* More than one agent may be configured. They are not shown in sequence — a
|
|
223753
|
+
* learner meets exactly one, picked by the agent id in the link they arrive
|
|
223754
|
+
* through (`<onboardingBasePath>/onboarding/<agent-id>`, the link the Copy
|
|
223755
|
+
* button here hands out), so a tenant can point different audiences at
|
|
223756
|
+
* different onboardings. Arriving without an id gets the first in the list,
|
|
223757
|
+
* which is why the list is ordered and its head marked as the default.
|
|
223592
223758
|
*
|
|
223593
223759
|
* The whole thing is one tenant-metadata key (`user_onboarding_form`), so
|
|
223594
223760
|
* saving merges the choice in and PUTs the metadata back. The member-facing
|
|
@@ -223596,8 +223762,8 @@ function buildUserOnboardingFormMetadata(metadata, form, updatedAt) {
|
|
|
223596
223762
|
* agent — and nothing at all when no agent is set, handing the user straight
|
|
223597
223763
|
* back to the app.
|
|
223598
223764
|
*/
|
|
223599
|
-
function OnboardingTab({ platformKey, username, }) {
|
|
223600
|
-
var _a
|
|
223765
|
+
function OnboardingTab({ platformKey, username, onboardingBasePath, }) {
|
|
223766
|
+
var _a;
|
|
223601
223767
|
const t = useT();
|
|
223602
223768
|
const { data, isLoading, error } = useGetTenantMetadataQuery([{ org: platformKey }], {
|
|
223603
223769
|
skip: !platformKey,
|
|
@@ -223615,24 +223781,39 @@ function OnboardingTab({ platformKey, username, }) {
|
|
|
223615
223781
|
return '';
|
|
223616
223782
|
}
|
|
223617
223783
|
}, [username]);
|
|
223618
|
-
const [
|
|
223784
|
+
const [agents, setAgents] = React.useState([]);
|
|
223619
223785
|
const [dirty, setDirty] = React.useState(false);
|
|
223620
223786
|
// Seed from the saved metadata, and re-seed when a refetch brings a newer
|
|
223621
223787
|
// saved version.
|
|
223622
223788
|
const saved = readUserOnboardingForm(metadata);
|
|
223623
223789
|
const savedAt = saved.updated_at;
|
|
223624
223790
|
React.useEffect(() => {
|
|
223625
|
-
var _a;
|
|
223626
223791
|
if (!metadata)
|
|
223627
223792
|
return;
|
|
223628
|
-
|
|
223793
|
+
setAgents(readUserOnboardingForm(metadata).agents);
|
|
223629
223794
|
setDirty(false);
|
|
223630
223795
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
223631
223796
|
}, [!!metadata, savedAt]);
|
|
223632
223797
|
const update = (next) => {
|
|
223633
|
-
|
|
223798
|
+
setAgents(next);
|
|
223634
223799
|
setDirty(true);
|
|
223635
223800
|
};
|
|
223801
|
+
const addAgent = (option) => update([...agents, { mentor_unique_id: option.value, name: option.label }]);
|
|
223802
|
+
const removeAgent = (agentId) => update(agents.filter((agent) => agent.mentor_unique_id !== agentId));
|
|
223803
|
+
const patchAgent = (agentId, patch) => update(agents.map((agent) => (agent.mentor_unique_id === agentId ? { ...agent, ...patch } : agent)));
|
|
223804
|
+
/**
|
|
223805
|
+
* Move an agent one place along the list. Order is not decoration: the head
|
|
223806
|
+
* of the list is the agent a member meets when they arrive with no link, so
|
|
223807
|
+
* this is how an admin picks which onboarding is the platform default.
|
|
223808
|
+
*/
|
|
223809
|
+
const moveAgent = (index, delta) => {
|
|
223810
|
+
const target = index + delta;
|
|
223811
|
+
if (target < 0 || target >= agents.length)
|
|
223812
|
+
return;
|
|
223813
|
+
const next = [...agents];
|
|
223814
|
+
[next[index], next[target]] = [next[target], next[index]];
|
|
223815
|
+
update(next);
|
|
223816
|
+
};
|
|
223636
223817
|
// Agent search — the endpoint filters server-side, so only the term is local.
|
|
223637
223818
|
const [searchTerm, setSearchTerm] = React.useState('');
|
|
223638
223819
|
const [debouncedTerm, setDebouncedTerm] = React.useState('');
|
|
@@ -223679,9 +223860,9 @@ function OnboardingTab({ platformKey, username, }) {
|
|
|
223679
223860
|
metadata: buildUserOnboardingFormMetadata(latest, {
|
|
223680
223861
|
...emptyUserOnboardingForm(),
|
|
223681
223862
|
// An agent IS the onboarding here: picking one turns the flow
|
|
223682
|
-
// on, clearing
|
|
223683
|
-
enabled:
|
|
223684
|
-
|
|
223863
|
+
// on, clearing them all turns the flow off.
|
|
223864
|
+
enabled: agents.length > 0,
|
|
223865
|
+
agents,
|
|
223685
223866
|
}, new Date().toISOString()),
|
|
223686
223867
|
},
|
|
223687
223868
|
},
|
|
@@ -223694,26 +223875,84 @@ function OnboardingTab({ platformKey, username, }) {
|
|
|
223694
223875
|
}
|
|
223695
223876
|
};
|
|
223696
223877
|
if (isLoading) {
|
|
223697
|
-
return (jsxs("div", { className: "space-y-4 pt-4", children: [jsx(Skeleton, { className: "h-
|
|
223878
|
+
return (jsxs("div", { className: "space-y-4 pt-4", children: [jsx(Skeleton, { className: "h-11 w-full rounded-xl" }), jsx(Skeleton, { className: "h-28 w-full rounded-xl" }), jsx(Skeleton, { className: "h-28 w-full rounded-xl" })] }));
|
|
223698
223879
|
}
|
|
223699
223880
|
if (error) {
|
|
223700
223881
|
return jsx("p", { className: "pt-4 text-sm text-red-600", children: t('profileOnboardingTab.loadError') });
|
|
223701
223882
|
}
|
|
223702
|
-
return (jsxs("div", { className: "space-y-
|
|
223703
|
-
|
|
223704
|
-
|
|
223705
|
-
|
|
223706
|
-
|
|
223707
|
-
|
|
223708
|
-
|
|
223709
|
-
|
|
223710
|
-
|
|
223711
|
-
|
|
223712
|
-
|
|
223713
|
-
|
|
223714
|
-
|
|
223715
|
-
|
|
223716
|
-
|
|
223883
|
+
return (jsxs("div", { className: "space-y-4 pt-4", children: [jsx("div", { className: "rounded-xl border border-gray-200 bg-white p-4 shadow-sm dark:border-gray-700 dark:bg-gray-900", children: jsx(MultiSearchSelect, { testId: "onboarding-agent", labels: {
|
|
223884
|
+
label: t('profileOnboardingTab.agentLabel'),
|
|
223885
|
+
placeholder: t('profileOnboardingTab.searchAgents'),
|
|
223886
|
+
typeToSearch: t('profileOnboardingTab.searchAgents'),
|
|
223887
|
+
searching: t('profileOnboardingTab.loadingAgents'),
|
|
223888
|
+
noResults: t('profileOnboardingTab.noAgents'),
|
|
223889
|
+
clear: t('profileOnboardingTab.clearAgent'),
|
|
223890
|
+
},
|
|
223891
|
+
// Focusing shows the platform's agents straight away; typing filters.
|
|
223892
|
+
minChars: 0, labelClassName: "text-sm font-medium", selected: agents.map((agent) => ({
|
|
223893
|
+
value: agent.mentor_unique_id,
|
|
223894
|
+
label: agent.name || agent.mentor_unique_id,
|
|
223895
|
+
})), onSelect: addAgent, onRemove: removeAgent, searchTerm: searchTerm, onSearchTermChange: setSearchTerm, options: options, isLoading: isSearching,
|
|
223896
|
+
// The list below IS the selection; chips above it would say the same
|
|
223897
|
+
// thing twice.
|
|
223898
|
+
renderSelected: () => null }) }), agents.length === 0 ? (jsx(EmptyState, {})) : (jsxs("div", { className: "space-y-3", "data-testid": "onboarding-agent-list", children: [jsx("div", { className: "flex items-center justify-between px-1", children: jsx("p", { className: "text-xs font-medium tracking-wide text-gray-500 uppercase", children: agents.length === 1
|
|
223899
|
+
? t('profileOnboardingTab.oneAgent')
|
|
223900
|
+
: t('profileOnboardingTab.multipleAgents', { count: agents.length }) }) }), agents.map((agent, index) => (jsx(AgentCard$1, { agent: agent, basePath: onboardingBasePath, isDefault: index === 0, canMoveUp: index > 0, canMoveDown: index < agents.length - 1, onMove: (delta) => moveAgent(index, delta), onRemove: () => removeAgent(agent.mentor_unique_id), onPatch: (patch) => patchAgent(agent.mentor_unique_id, patch) }, agent.mentor_unique_id)))] })), jsxs("div", { className: "flex flex-wrap items-center justify-end gap-3 pt-1", children: [dirty && (jsx("span", { className: "text-xs text-amber-600", children: t('profileOnboardingTab.unsavedChanges') })), jsx(Button$1, { onClick: handleSave, disabled: saving, className: "bg-gradient-to-r from-blue-600 to-blue-400 text-white hover:opacity-90", children: saving ? t('profileOnboardingTab.saving') : t('profileOnboardingTab.save') })] })] }));
|
|
223901
|
+
}
|
|
223902
|
+
/**
|
|
223903
|
+
* What the page says before anything is configured. Named as a state of its own
|
|
223904
|
+
* rather than a hint under the search box, because it is also the answer to
|
|
223905
|
+
* "what happens to members right now" — nothing, they skip onboarding.
|
|
223906
|
+
*/
|
|
223907
|
+
function EmptyState() {
|
|
223908
|
+
const t = useT();
|
|
223909
|
+
return (jsxs("div", { className: "flex flex-col items-center rounded-xl border border-dashed border-gray-300 bg-gray-50/60 px-6 py-10 text-center dark:border-gray-700 dark:bg-gray-800/40", "data-testid": "onboarding-agent-empty", children: [jsx("span", { className: "mb-3 flex h-11 w-11 items-center justify-center rounded-xl bg-gradient-to-br from-blue-600 to-blue-400 text-white", children: jsx(UserPlus, { className: "h-5 w-5", "aria-hidden": "true" }) }), jsx("p", { className: "text-sm font-medium text-gray-900 dark:text-gray-100", children: t('profileOnboardingTab.emptyTitle') }), jsx("p", { className: "mt-1 max-w-sm text-xs text-gray-500", children: t('profileOnboardingTab.emptyBody') })] }));
|
|
223910
|
+
}
|
|
223911
|
+
/**
|
|
223912
|
+
* One configured agent: who it is, where it sits in the order, the link that
|
|
223913
|
+
* opens it, and — behind a disclosure — the heading and sub-heading shown above
|
|
223914
|
+
* it in the flow. The introduction is tucked away because it is the part an
|
|
223915
|
+
* admin sets once; the link is the part they come back for.
|
|
223916
|
+
*/
|
|
223917
|
+
function AgentCard$1({ agent, basePath, isDefault, canMoveUp, canMoveDown, onMove, onRemove, onPatch, }) {
|
|
223918
|
+
var _a, _b;
|
|
223919
|
+
const t = useT();
|
|
223920
|
+
const id = agent.mentor_unique_id;
|
|
223921
|
+
const titleId = `onboarding-agent-title-${id}`;
|
|
223922
|
+
const descriptionId = `onboarding-agent-description-${id}`;
|
|
223923
|
+
// Open by default: nothing is hidden from an admin who has just added an
|
|
223924
|
+
// agent, and a long list can be tidied away card by card.
|
|
223925
|
+
const [open, setOpen] = React.useState(true);
|
|
223926
|
+
const name = agent.name || id;
|
|
223927
|
+
return (jsxs("div", { className: "overflow-hidden rounded-xl border border-gray-200 bg-white shadow-sm transition-shadow hover:shadow-md dark:border-gray-700 dark:bg-gray-900", "data-testid": `onboarding-agent-card-${id}`, children: [jsxs("div", { className: "flex items-start gap-3 p-4", children: [jsx("span", { className: "flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-gradient-to-br from-blue-600 to-blue-400 text-sm font-semibold text-white", "aria-hidden": "true", children: name.trim().charAt(0).toUpperCase() || '?' }), jsxs("div", { className: "min-w-0 flex-1", children: [jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [jsx("p", { className: "truncate text-sm font-semibold text-gray-900 dark:text-gray-100", children: name }), isDefault && (jsxs("span", { className: "inline-flex items-center gap-1 rounded-full bg-blue-50 px-2 py-0.5 text-[11px] font-medium text-blue-700 dark:bg-blue-950 dark:text-blue-300", title: t('profileOnboardingTab.defaultBadgeHint'), "data-testid": `onboarding-agent-default-${id}`, children: [jsx(Sparkles, { className: "h-3 w-3", "aria-hidden": "true" }), t('profileOnboardingTab.defaultBadge')] }))] }), jsx("p", { className: "truncate text-xs text-gray-500", children: id })] }), jsxs("div", { className: "flex shrink-0 items-center gap-0.5", children: [(canMoveUp || canMoveDown) && (jsxs(Fragment$1, { children: [jsx(IconButton, { label: t('profileOnboardingTab.moveUp'), disabled: !canMoveUp, onClick: () => onMove(-1), testId: `onboarding-agent-move-up-${id}`, children: jsx(ChevronDown, { className: "h-3.5 w-3.5 rotate-180", "aria-hidden": "true" }) }), jsx(IconButton, { label: t('profileOnboardingTab.moveDown'), disabled: !canMoveDown, onClick: () => onMove(1), testId: `onboarding-agent-move-down-${id}`, children: jsx(ChevronDown, { className: "h-3.5 w-3.5", "aria-hidden": "true" }) })] })), jsx(IconButton, { label: t('profileOnboardingTab.clearAgent'), onClick: onRemove, testId: `onboarding-agent-remove-${id}`, className: "hover:text-red-600", children: jsx(Trash2, { className: "h-3.5 w-3.5", "aria-hidden": "true" }) })] })] }), jsx("div", { className: "border-t border-gray-100 px-4 py-3 dark:border-gray-800", children: jsx(CopyLink, { agentId: id, basePath: basePath }) }), jsxs("div", { className: "border-t border-gray-100 dark:border-gray-800", children: [jsxs("button", { type: "button", onClick: () => setOpen((value) => !value), "aria-expanded": open, "aria-controls": `onboarding-agent-intro-${id}`, className: "flex w-full items-center justify-between px-4 py-2.5 text-left text-xs font-medium text-gray-600 transition-colors hover:bg-gray-50 dark:text-gray-300 dark:hover:bg-gray-800", "data-testid": `onboarding-agent-intro-toggle-${id}`, children: [jsxs("span", { className: "flex min-w-0 flex-col", children: [jsx("span", { children: t('profileOnboardingTab.introLabel') }), jsx("span", { className: "truncate text-[11px] font-normal text-gray-400", children: agent.title || t('profileOnboardingTab.introSummary') })] }), jsx(ChevronDown, { className: cn('h-4 w-4 shrink-0 transition-transform', open && 'rotate-180'), "aria-hidden": "true" })] }), open && (jsxs("div", { id: `onboarding-agent-intro-${id}`, className: "grid gap-3 px-4 pt-1 pb-4 sm:grid-cols-2", children: [jsxs("div", { className: "space-y-1.5", children: [jsx(Label$1, { htmlFor: titleId, children: t('profileOnboardingTab.agentTitleLabel') }), jsx(Input, { id: titleId, value: (_a = agent.title) !== null && _a !== void 0 ? _a : '', placeholder: t('profileOnboardingTab.agentTitlePlaceholder'), onChange: (event) => onPatch({ title: event.target.value }) })] }), jsxs("div", { className: "space-y-1.5", children: [jsx(Label$1, { htmlFor: descriptionId, children: t('profileOnboardingTab.agentDescriptionLabel') }), jsx(Input, { id: descriptionId, value: (_b = agent.description) !== null && _b !== void 0 ? _b : '', placeholder: t('profileOnboardingTab.agentDescriptionPlaceholder'), onChange: (event) => onPatch({ description: event.target.value }) })] })] }))] })] }));
|
|
223928
|
+
}
|
|
223929
|
+
/** A square, icon-only action with its name left to assistive tech. */
|
|
223930
|
+
function IconButton({ label, onClick, disabled, testId, className, children, }) {
|
|
223931
|
+
return (jsxs(Button$1, { type: "button", size: "icon", variant: "ghost", className: cn('h-7 w-7 text-gray-400 hover:text-gray-700', className), disabled: disabled, onClick: onClick, title: label, "data-testid": testId, children: [children, jsx("span", { className: "sr-only", children: label })] }));
|
|
223932
|
+
}
|
|
223933
|
+
/** The agent's onboarding link, shown in full and copyable in one press. */
|
|
223934
|
+
function CopyLink({ agentId, basePath }) {
|
|
223935
|
+
const t = useT();
|
|
223936
|
+
const [copied, setCopied] = React.useState(false);
|
|
223937
|
+
// The browser's origin is the right default whenever the admin panel and the
|
|
223938
|
+
// learner-facing onboarding are one deployment; SSR has no origin to read, so
|
|
223939
|
+
// the link resolves on the client.
|
|
223940
|
+
const [origin, setOrigin] = React.useState('');
|
|
223941
|
+
React.useEffect(() => {
|
|
223942
|
+
setOrigin(window.location.origin);
|
|
223943
|
+
}, []);
|
|
223944
|
+
const link = buildOnboardingAgentPath(basePath || origin, agentId);
|
|
223945
|
+
const handleCopy = async () => {
|
|
223946
|
+
try {
|
|
223947
|
+
await navigator.clipboard.writeText(link);
|
|
223948
|
+
setCopied(true);
|
|
223949
|
+
setTimeout(() => setCopied(false), 2000);
|
|
223950
|
+
}
|
|
223951
|
+
catch (_a) {
|
|
223952
|
+
/* Clipboard unavailable (permissions/insecure context). */
|
|
223953
|
+
}
|
|
223954
|
+
};
|
|
223955
|
+
return (jsxs("div", { className: "flex items-center gap-2", children: [jsx(Link2, { className: "h-3.5 w-3.5 shrink-0 text-gray-400", "aria-hidden": "true" }), jsx("code", { className: "min-w-0 flex-1 truncate font-mono text-xs text-gray-600 dark:text-gray-300", title: link, "data-testid": `onboarding-agent-link-${agentId}`, children: link }), jsxs(Button$1, { type: "button", size: "sm", variant: "outline", className: cn('h-7 shrink-0 text-xs transition-colors', copied && 'border-green-200 bg-green-50 text-green-700 hover:bg-green-50'), onClick: handleCopy, "data-testid": `onboarding-agent-copy-${agentId}`, children: [copied ? (jsx(Check, { className: "mr-1.5 h-3.5 w-3.5", "aria-hidden": "true" })) : (jsx(Copy, { className: "mr-1.5 h-3.5 w-3.5", "aria-hidden": "true" })), copied ? t('profileOnboardingTab.linkCopied') : t('profileOnboardingTab.copyLink')] })] }));
|
|
223717
223956
|
}
|
|
223718
223957
|
|
|
223719
223958
|
const TabDescription = ({ icon, title, children }) => {
|
|
@@ -223721,9 +223960,9 @@ const TabDescription = ({ icon, title, children }) => {
|
|
|
223721
223960
|
const [expanded, setExpanded] = useState(false);
|
|
223722
223961
|
return (jsxs("div", { className: "flex gap-3 items-start border rounded-lg p-4 bg-blue-50/60 border-blue-100", children: [jsx("div", { className: "shrink-0 w-9 h-9 rounded-md flex items-center justify-center bg-blue-100 text-blue-600", children: icon }), jsxs("div", { className: "flex-1 min-w-0", children: [jsx("h3", { className: "text-sm font-semibold mb-1 text-blue-900 hidden sm:block", children: title }), jsx("p", { className: `text-sm text-gray-600 leading-relaxed sm:line-clamp-none! ${expanded ? '' : 'line-clamp-2'}`, children: children }), jsx("button", { type: "button", onClick: () => setExpanded((prev) => !prev), className: "mt-1 text-xs font-medium text-blue-700 hover:text-blue-800 sm:hidden", children: expanded ? t('profileAdmin.readLess') : t('profileAdmin.readMore') })] })] }));
|
|
223723
223962
|
};
|
|
223724
|
-
const Admin = ({ tenant, onInviteClick, hasUserTabPermission = false, hasGroupsTabPermission = false, hasRolesTabPermission = false, hasPoliciesTabPermission = false, hasTeamsTabPermission = false, hasAlertsTabPermission = false, hasInviteUserPermission = false, hasCreateTeamPermission = false, onLoadGroupPermissions, rbacPermissions = {}, enableRbac = false, showGradebookTab = false, currentSpa, authSpaUrl, }) => {
|
|
223963
|
+
const Admin = ({ tenant, onInviteClick, hasUserTabPermission = false, hasGroupsTabPermission = false, hasRolesTabPermission = false, hasPoliciesTabPermission = false, hasTeamsTabPermission = false, hasAlertsTabPermission = false, hasInviteUserPermission = false, hasCreateTeamPermission = false, onLoadGroupPermissions, rbacPermissions = {}, enableRbac = false, showGradebookTab = false, currentSpa, authSpaUrl, onboardingBasePath, }) => {
|
|
223725
223964
|
const t = useT();
|
|
223726
|
-
return (jsx("div", { className: "border border-gray-200 rounded-lg p-6", children: jsxs(Tabs, { defaultValue: "users", "aria-label": t('profileAdmin.rbacManagementTabsAriaLabel'), children: [jsxs(TabsList, { "aria-label": t('profileAdmin.managementTabsAriaLabel'), className: "max-w-full overflow-x-auto justify-start px-1", children: [hasUserTabPermission && (jsx(TabsTrigger, { value: "users", children: t('profileAdmin.usersTab') })), hasGroupsTabPermission && (jsx(TabsTrigger, { value: "groups", children: t('profileAdmin.groupsTab') })), hasRolesTabPermission && (jsx(TabsTrigger, { value: "roles", children: t('profileAdmin.rolesTab') })), hasPoliciesTabPermission && (jsx(TabsTrigger, { value: "policies", children: t('profileAdmin.policiesTab') })), hasTeamsTabPermission && (jsx(TabsTrigger, { value: "teams", children: t('profileAdmin.teamsTab') })), hasAlertsTabPermission && (jsx(TabsTrigger, { value: "alerts", children: t('profileAdmin.alertsTab') })), jsx(TabsTrigger, { value: "applications", children: t('profileAdmin.applicationsTab') }), jsx(TabsTrigger, { value: "onboarding", children: t('profileAdmin.onboardingTab') })] }), hasUserTabPermission && (jsxs(TabsContent, { className: "mt-4", value: "users", children: [jsx(TabDescription, { icon: jsx(Users, { className: "w-5 h-5" }), title: t('profileAdmin.usersTab'), children: t('profileAdmin.usersDescription') }), jsx(UsersTab, { tenant: tenant, onInviteClick: onInviteClick, currentSpa: currentSpa, showGradebookTab: showGradebookTab })] })), hasGroupsTabPermission && (jsxs(TabsContent, { className: "mt-4", value: "groups", children: [jsx(TabDescription, { icon: jsx(UsersRound, { className: "w-5 h-5" }), title: t('profileAdmin.groupsTab'), children: t('profileAdmin.groupsDescription') }), jsx(GroupsTab, { tenant: tenant })] })), hasRolesTabPermission && (jsxs(TabsContent, { className: "mt-4", value: "roles", children: [jsx(TabDescription, { icon: jsx(UserCog, { className: "w-5 h-5" }), title: t('profileAdmin.rolesTab'), children: t('profileAdmin.rolesDescription') }), jsx(RolesTab, { tenant: tenant })] })), hasPoliciesTabPermission && (jsxs(TabsContent, { className: "mt-4", value: "policies", children: [jsx(TabDescription, { icon: jsx(ScrollText, { className: "w-5 h-5" }), title: t('profileAdmin.policiesTab'), children: t('profileAdmin.policiesDescription') }), jsx(PoliciesTab, { tenant: tenant })] })), hasTeamsTabPermission && (jsxs(TabsContent, { className: "mt-4", value: "teams", children: [jsx(TabDescription, { icon: jsx(Shield, { className: "w-5 h-5" }), title: t('profileAdmin.teamsTab'), children: t('profileAdmin.teamsDescription') }), jsx(GroupsTab, { tenant: tenant, isTeam: true, onInviteClick: onInviteClick, hasInviteUserPermission: hasInviteUserPermission, hasCreateTeamPermission: hasCreateTeamPermission, onLoadGroupPermissions: onLoadGroupPermissions, rbacPermissions: rbacPermissions, enableRbac: enableRbac })] })), hasAlertsTabPermission && (jsxs(TabsContent, { className: "mt-4", value: "alerts", children: [jsx(TabDescription, { icon: jsx(BellRing, { className: "w-5 h-5" }), title: t('profileAdmin.alertsTab'), children: t('profileAdmin.alertsDescription') }), jsx(AlertsTab, { tenant: tenant })] })), jsxs(TabsContent, { className: "mt-4", value: "applications", children: [jsx(TabDescription, { icon: jsx(ClipboardList, { className: "w-5 h-5" }), title: t('profileAdmin.applicationsTab'), children: t('profileAdmin.applicationsTabDescription') }), jsx(ApplicationsTab, { platformKey: tenant, authSpaUrl: authSpaUrl })] }), jsxs(TabsContent, { className: "mt-4", value: "onboarding", children: [jsx(TabDescription, { icon: jsx(UserPlus, { className: "w-5 h-5" }), title: t('profileAdmin.onboardingTab'), children: t('profileAdmin.onboardingTabDescription') }), jsx(OnboardingTab, { platformKey: tenant })] })] }) }));
|
|
223965
|
+
return (jsx("div", { className: "border border-gray-200 rounded-lg p-6", children: jsxs(Tabs, { defaultValue: "users", "aria-label": t('profileAdmin.rbacManagementTabsAriaLabel'), children: [jsxs(TabsList, { "aria-label": t('profileAdmin.managementTabsAriaLabel'), className: "max-w-full overflow-x-auto justify-start px-1", children: [hasUserTabPermission && (jsx(TabsTrigger, { value: "users", children: t('profileAdmin.usersTab') })), hasGroupsTabPermission && (jsx(TabsTrigger, { value: "groups", children: t('profileAdmin.groupsTab') })), hasRolesTabPermission && (jsx(TabsTrigger, { value: "roles", children: t('profileAdmin.rolesTab') })), hasPoliciesTabPermission && (jsx(TabsTrigger, { value: "policies", children: t('profileAdmin.policiesTab') })), hasTeamsTabPermission && (jsx(TabsTrigger, { value: "teams", children: t('profileAdmin.teamsTab') })), hasAlertsTabPermission && (jsx(TabsTrigger, { value: "alerts", children: t('profileAdmin.alertsTab') })), jsx(TabsTrigger, { value: "applications", children: t('profileAdmin.applicationsTab') }), jsx(TabsTrigger, { value: "onboarding", children: t('profileAdmin.onboardingTab') })] }), hasUserTabPermission && (jsxs(TabsContent, { className: "mt-4", value: "users", children: [jsx(TabDescription, { icon: jsx(Users, { className: "w-5 h-5" }), title: t('profileAdmin.usersTab'), children: t('profileAdmin.usersDescription') }), jsx(UsersTab, { tenant: tenant, onInviteClick: onInviteClick, currentSpa: currentSpa, showGradebookTab: showGradebookTab })] })), hasGroupsTabPermission && (jsxs(TabsContent, { className: "mt-4", value: "groups", children: [jsx(TabDescription, { icon: jsx(UsersRound, { className: "w-5 h-5" }), title: t('profileAdmin.groupsTab'), children: t('profileAdmin.groupsDescription') }), jsx(GroupsTab, { tenant: tenant })] })), hasRolesTabPermission && (jsxs(TabsContent, { className: "mt-4", value: "roles", children: [jsx(TabDescription, { icon: jsx(UserCog, { className: "w-5 h-5" }), title: t('profileAdmin.rolesTab'), children: t('profileAdmin.rolesDescription') }), jsx(RolesTab, { tenant: tenant })] })), hasPoliciesTabPermission && (jsxs(TabsContent, { className: "mt-4", value: "policies", children: [jsx(TabDescription, { icon: jsx(ScrollText, { className: "w-5 h-5" }), title: t('profileAdmin.policiesTab'), children: t('profileAdmin.policiesDescription') }), jsx(PoliciesTab, { tenant: tenant })] })), hasTeamsTabPermission && (jsxs(TabsContent, { className: "mt-4", value: "teams", children: [jsx(TabDescription, { icon: jsx(Shield, { className: "w-5 h-5" }), title: t('profileAdmin.teamsTab'), children: t('profileAdmin.teamsDescription') }), jsx(GroupsTab, { tenant: tenant, isTeam: true, onInviteClick: onInviteClick, hasInviteUserPermission: hasInviteUserPermission, hasCreateTeamPermission: hasCreateTeamPermission, onLoadGroupPermissions: onLoadGroupPermissions, rbacPermissions: rbacPermissions, enableRbac: enableRbac })] })), hasAlertsTabPermission && (jsxs(TabsContent, { className: "mt-4", value: "alerts", children: [jsx(TabDescription, { icon: jsx(BellRing, { className: "w-5 h-5" }), title: t('profileAdmin.alertsTab'), children: t('profileAdmin.alertsDescription') }), jsx(AlertsTab, { tenant: tenant })] })), jsxs(TabsContent, { className: "mt-4", value: "applications", children: [jsx(TabDescription, { icon: jsx(ClipboardList, { className: "w-5 h-5" }), title: t('profileAdmin.applicationsTab'), children: t('profileAdmin.applicationsTabDescription') }), jsx(ApplicationsTab, { platformKey: tenant, authSpaUrl: authSpaUrl })] }), jsxs(TabsContent, { className: "mt-4", value: "onboarding", children: [jsx(TabDescription, { icon: jsx(UserPlus, { className: "w-5 h-5" }), title: t('profileAdmin.onboardingTab'), children: t('profileAdmin.onboardingTabDescription') }), jsx(OnboardingTab, { platformKey: tenant, onboardingBasePath: onboardingBasePath })] })] }) }));
|
|
223727
223966
|
};
|
|
223728
223967
|
|
|
223729
223968
|
function DeleteApiModal$1({ isOpen, onClose, apiKey, tenantKey }) {
|
|
@@ -264156,7 +264395,7 @@ function MemoryAdminTab({ tenantKey, username }) {
|
|
|
264156
264395
|
return (jsxs(Tabs, { defaultValue: "global-memories", "aria-label": t('memoryAdminTab.tabsAriaLabel'), children: [jsxs(TabsList, { "aria-label": t('memoryAdminTab.tabsAriaLabel'), className: "max-w-full overflow-x-auto justify-start px-1", children: [jsx(TabsTrigger, { "data-testid": "memory-admin-sub-tab-global", value: "global-memories", children: t('memoryAdminTab.tabGlobalMemories') }), jsx(TabsTrigger, { "data-testid": "memory-admin-sub-tab-agent", value: "agent-memories", children: t('memoryAdminTab.tabAgentMemories') })] }), jsx(TabsContent, { className: "mt-4", value: "global-memories", children: jsx(GlobalMemoriesSection, { tenantKey: tenantKey, username: username }) }), jsx(TabsContent, { className: "mt-4", value: "agent-memories", children: jsx(AgentMemoriesSection, { tenantKey: tenantKey, username: username }) })] }));
|
|
264157
264396
|
}
|
|
264158
264397
|
|
|
264159
|
-
function Account({ tenant, tenants = [], username, onInviteClick, email, mainPlatformKey, userActiveApp = null, showPlatformName = false, isAdmin = false, targetTab = 'basic', currentPlan: _currentPlan = '', currentSPA = '', authURL, onTenantUpdate, currentPlatformBaseDomain = '', enableRbac = false, showBenchmarks = false, rbacPermissions = {}, onLoadGroupPermissions, onTabChange, defaultSupportPhone = '', enableSupportPhone, showGradebookTab = false, }) {
|
|
264398
|
+
function Account({ tenant, tenants = [], username, onInviteClick, email, mainPlatformKey, userActiveApp = null, showPlatformName = false, isAdmin = false, targetTab = 'basic', currentPlan: _currentPlan = '', currentSPA = '', authURL, onTenantUpdate, currentPlatformBaseDomain = '', enableRbac = false, showBenchmarks = false, rbacPermissions = {}, onLoadGroupPermissions, onTabChange, defaultSupportPhone = '', enableSupportPhone, showGradebookTab = false, onboardingBasePath = '', }) {
|
|
264160
264399
|
var _a, _b, _c, _d;
|
|
264161
264400
|
const t = useT();
|
|
264162
264401
|
const currentTenant = tenants.find((ten) => ten.key === tenant);
|
|
@@ -264257,10 +264496,10 @@ function Account({ tenant, tenants = [], username, onInviteClick, email, mainPla
|
|
|
264257
264496
|
: 'text-gray-600 hover:bg-gray-50'}`, children: [jsx(CreditCard, { className: "h-4 w-4" }), jsx("span", { className: "hidden sm:inline", children: t('profileAccount.tabBilling') }), jsx("span", { className: "sm:hidden", children: t('profileAccount.tabBilling') })] }, 'billing'))] }) }) }), jsxs("div", { className: "flex-1 flex flex-col overflow-hidden", style: { height: '100%' }, children: [jsxs("div", { className: "hidden lg:block flex-shrink-0 p-6 border-b border-gray-200 bg-white dark:bg-gray-900", children: [jsx("h3", { className: "text-lg font-medium text-gray-900 dark:text-gray-100 mb-2", children: (_b = (_a = TABS.find((t) => t.id === activeTab)) === null || _a === void 0 ? void 0 : _a.label) !== null && _b !== void 0 ? _b : (activeTab === 'billing' ? t('profileAccount.tabBilling') : activeTab) }), jsxs("p", { className: "text-gray-600 dark:text-gray-400 text-sm", children: [activeTab === 'management' && t('profileAccount.descManagement'), activeTab === 'organization' && t('profileAccount.descOrganization'), activeTab === 'integrations' && t('profileAccount.descIntegrations'), activeTab === 'billing' && t('profileAccount.descBilling'), activeTab === 'monetization' && t('profileAccount.descMonetization'), activeTab === 'datasets' && t('profileAccount.descBenchmarks'), activeTab === 'memory' && t('profileAccount.descMemory'), activeTab === 'advanced' && t('profileAccount.descAdvanced')] })] }), jsxs("div", { className: "flex-1 p-6 space-y-6", style: {
|
|
264258
264497
|
overflowY: 'auto',
|
|
264259
264498
|
overflowX: 'hidden',
|
|
264260
|
-
}, children: [jsxs("div", { className: "lg:hidden mb-6", children: [jsx("h3", { className: "text-lg font-medium text-gray-900 dark:text-gray-100 mb-2", children: (_d = (_c = TABS.find((t) => t.id === activeTab)) === null || _c === void 0 ? void 0 : _c.label) !== null && _d !== void 0 ? _d : (activeTab === 'billing' ? t('profileAccount.tabBilling') : activeTab) }), jsxs("p", { className: "text-gray-600 dark:text-gray-400 text-sm", children: [activeTab === 'billing' && t('profileAccount.descBilling'), activeTab === 'basic' && t('profileAccount.descBasic'), activeTab === 'social' && t('profileAccount.descSocial'), activeTab === 'security' && t('profileAccount.descSecurity'), activeTab === 'management' && t('profileAccount.descManagement'), activeTab === 'organization' && t('profileAccount.descOrganization'), activeTab === 'monetization' && t('profileAccount.descMonetization'), activeTab === 'datasets' && t('profileAccount.descBenchmarks'), activeTab === 'memory' && t('profileAccount.descMemory'), activeTab === 'advanced' && t('profileAccount.descAdvanced')] })] }), activeTab === 'management' && hasManagementPermissions && (jsx(Admin, { authSpaUrl: authURL, onInviteClick: onInviteClick, tenant: tenant, currentSpa: currentSPA, hasUserTabPermission: hasUserTabPermission, hasGroupsTabPermission: hasGroupsTabPermission, hasPoliciesTabPermission: hasPoliciesTabPermission, hasRolesTabPermission: hasRolesTabPermission, hasTeamsTabPermission: hasTeamsTabPermission, hasInviteUserPermission: hasInviteUserPermission, hasCreateTeamPermission: hasCreateTeamPermission, onLoadGroupPermissions: onLoadGroupPermissions, hasAlertsTabPermission: hasAlertsTabPermission, rbacPermissions: rbacPermissions, enableRbac: enableRbac, showGradebookTab: showGradebookTab })), activeTab === 'organization' && (jsx(OrganizationTab, { platformKey: tenant, tenant: tenants.find((ten) => ten.key === tenant), onTenantUpdate: onTenantUpdate, setOrganizationLogoFromOutside: setOrganizationLogo, defaultSupportPhone: defaultSupportPhone, enableSupportPhone: enableSupportPhone })), activeTab === 'integrations' && (jsx(IntegrationsTab, { tenantKey: tenant, username: username })), activeTab === 'billing' && (jsx(BillingTab, { tenant: tenant, userActiveApp: userActiveApp, username: username, currentUserEmail: email, mainPlatformKey: mainPlatformKey })), activeTab === 'monetization' && (jsx(MonetizationTab, { platformKey: tenant, authURL: authURL })), activeTab === 'datasets' && showBenchmarks && (jsx(BenchmarksTab, { tenantKey: tenant, username: username })), activeTab === 'memory' && jsx(MemoryAdminTab, { tenantKey: tenant, username: username }), activeTab === 'advanced' && (jsx(AdvancedTab, { platformKey: tenant, currentSPA: currentSPA, username: username, authURL: authURL, currentPlatformBaseDomain: currentPlatformBaseDomain }))] })] }), jsx(ToastProvider, {})] }));
|
|
264499
|
+
}, children: [jsxs("div", { className: "lg:hidden mb-6", children: [jsx("h3", { className: "text-lg font-medium text-gray-900 dark:text-gray-100 mb-2", children: (_d = (_c = TABS.find((t) => t.id === activeTab)) === null || _c === void 0 ? void 0 : _c.label) !== null && _d !== void 0 ? _d : (activeTab === 'billing' ? t('profileAccount.tabBilling') : activeTab) }), jsxs("p", { className: "text-gray-600 dark:text-gray-400 text-sm", children: [activeTab === 'billing' && t('profileAccount.descBilling'), activeTab === 'basic' && t('profileAccount.descBasic'), activeTab === 'social' && t('profileAccount.descSocial'), activeTab === 'security' && t('profileAccount.descSecurity'), activeTab === 'management' && t('profileAccount.descManagement'), activeTab === 'organization' && t('profileAccount.descOrganization'), activeTab === 'monetization' && t('profileAccount.descMonetization'), activeTab === 'datasets' && t('profileAccount.descBenchmarks'), activeTab === 'memory' && t('profileAccount.descMemory'), activeTab === 'advanced' && t('profileAccount.descAdvanced')] })] }), activeTab === 'management' && hasManagementPermissions && (jsx(Admin, { onboardingBasePath: onboardingBasePath, authSpaUrl: authURL, onInviteClick: onInviteClick, tenant: tenant, currentSpa: currentSPA, hasUserTabPermission: hasUserTabPermission, hasGroupsTabPermission: hasGroupsTabPermission, hasPoliciesTabPermission: hasPoliciesTabPermission, hasRolesTabPermission: hasRolesTabPermission, hasTeamsTabPermission: hasTeamsTabPermission, hasInviteUserPermission: hasInviteUserPermission, hasCreateTeamPermission: hasCreateTeamPermission, onLoadGroupPermissions: onLoadGroupPermissions, hasAlertsTabPermission: hasAlertsTabPermission, rbacPermissions: rbacPermissions, enableRbac: enableRbac, showGradebookTab: showGradebookTab })), activeTab === 'organization' && (jsx(OrganizationTab, { platformKey: tenant, tenant: tenants.find((ten) => ten.key === tenant), onTenantUpdate: onTenantUpdate, setOrganizationLogoFromOutside: setOrganizationLogo, defaultSupportPhone: defaultSupportPhone, enableSupportPhone: enableSupportPhone })), activeTab === 'integrations' && (jsx(IntegrationsTab, { tenantKey: tenant, username: username })), activeTab === 'billing' && (jsx(BillingTab, { tenant: tenant, userActiveApp: userActiveApp, username: username, currentUserEmail: email, mainPlatformKey: mainPlatformKey })), activeTab === 'monetization' && (jsx(MonetizationTab, { platformKey: tenant, authURL: authURL })), activeTab === 'datasets' && showBenchmarks && (jsx(BenchmarksTab, { tenantKey: tenant, username: username })), activeTab === 'memory' && jsx(MemoryAdminTab, { tenantKey: tenant, username: username }), activeTab === 'advanced' && (jsx(AdvancedTab, { platformKey: tenant, currentSPA: currentSPA, username: username, authURL: authURL, currentPlatformBaseDomain: currentPlatformBaseDomain }))] })] }), jsx(ToastProvider, {})] }));
|
|
264261
264500
|
}
|
|
264262
264501
|
|
|
264263
|
-
function UserProfileModal({ isOpen, onClose, params, email, mainPlatformKey, showMentorAIDisplayCheckbox = false, showLeaderboardDisplayCheckbox = false, showGradebookTab = false, showUsernameField = false, showPlatformName = false, useGravatarPicFallback = true, enableCatalogInvite = false, targetTab = 'basic', currentPlan = '', currentSPA = '', userActiveApp = null, authURL, tenants = [], onTenantUpdate, currentPlatformBaseDomain = '', rbacPermissions = {}, enableRbac = false, onLoadGroupPermissions, onTabChange, defaultSupportPhone = '', onBillingTabRequest, onAccountDeleted, enableMemoryTab = false, showBenchmarks = false, localLLMProps, enableSupportPhone, }) {
|
|
264502
|
+
function UserProfileModal({ isOpen, onClose, params, email, mainPlatformKey, showMentorAIDisplayCheckbox = false, showLeaderboardDisplayCheckbox = false, showGradebookTab = false, showUsernameField = false, showPlatformName = false, useGravatarPicFallback = true, enableCatalogInvite = false, targetTab = 'basic', currentPlan = '', currentSPA = '', userActiveApp = null, authURL, tenants = [], onTenantUpdate, currentPlatformBaseDomain = '', rbacPermissions = {}, enableRbac = false, onLoadGroupPermissions, onTabChange, defaultSupportPhone = '', onBillingTabRequest, onAccountDeleted, enableMemoryTab = false, showBenchmarks = false, localLLMProps, enableSupportPhone, onboardingBasePath = '', }) {
|
|
264264
264503
|
const t = useT();
|
|
264265
264504
|
console.log('[UserProfileModal] localLLMProps received:', {
|
|
264266
264505
|
isAvailable: localLLMProps === null || localLLMProps === void 0 ? void 0 : localLLMProps.isAvailable,
|
|
@@ -264334,7 +264573,7 @@ function UserProfileModal({ isOpen, onClose, params, email, mainPlatformKey, sho
|
|
|
264334
264573
|
'billing',
|
|
264335
264574
|
'monetization',
|
|
264336
264575
|
'datasets',
|
|
264337
|
-
].includes(targetTab) && (jsxs(Fragment$1, { children: [jsx(Account, { onInviteClick: () => setIsInviteUserDialogOpen(true), tenant: params.tenantKey, tenants: tenants, username: getUserName$1(), email: email, mainPlatformKey: mainPlatformKey, showUsernameField: showUsernameField, showPlatformName: showPlatformName, useGravatarPicFallback: useGravatarPicFallback, onClose: onClose, isAdmin: params.isAdmin, targetTab: targetTab, currentPlan: currentPlan, currentSPA: currentSPA, userActiveApp: userActiveApp, authURL: authURL, onTenantUpdate: onTenantUpdate, currentPlatformBaseDomain: currentPlatformBaseDomain, rbacPermissions: rbacPermissions, enableRbac: enableRbac, onLoadGroupPermissions: onLoadGroupPermissions, onTabChange: onTabChange, defaultSupportPhone: defaultSupportPhone, showBenchmarks: showBenchmarks, enableSupportPhone: enableSupportPhone, showGradebookTab: showGradebookTab }), isInviteUserDialogOpen && (jsx(InviteUserDialog, { tenant: params.tenantKey, onClose: () => setIsInviteUserDialogOpen(false), isOpen: isInviteUserDialogOpen, enableCatalogInvite: enableCatalogInvite, hasManageUsersPermission: hasManageUsersPermission })), isInvitedUsersDialogOpen && (jsx(InvitedUsersDialog, { onClose: () => setIsInvitedUsersDialogOpen(false), tenant: params.tenantKey }))] }))] }) }) }));
|
|
264576
|
+
].includes(targetTab) && (jsxs(Fragment$1, { children: [jsx(Account, { onboardingBasePath: onboardingBasePath, onInviteClick: () => setIsInviteUserDialogOpen(true), tenant: params.tenantKey, tenants: tenants, username: getUserName$1(), email: email, mainPlatformKey: mainPlatformKey, showUsernameField: showUsernameField, showPlatformName: showPlatformName, useGravatarPicFallback: useGravatarPicFallback, onClose: onClose, isAdmin: params.isAdmin, targetTab: targetTab, currentPlan: currentPlan, currentSPA: currentSPA, userActiveApp: userActiveApp, authURL: authURL, onTenantUpdate: onTenantUpdate, currentPlatformBaseDomain: currentPlatformBaseDomain, rbacPermissions: rbacPermissions, enableRbac: enableRbac, onLoadGroupPermissions: onLoadGroupPermissions, onTabChange: onTabChange, defaultSupportPhone: defaultSupportPhone, showBenchmarks: showBenchmarks, enableSupportPhone: enableSupportPhone, showGradebookTab: showGradebookTab }), isInviteUserDialogOpen && (jsx(InviteUserDialog, { tenant: params.tenantKey, onClose: () => setIsInviteUserDialogOpen(false), isOpen: isInviteUserDialogOpen, enableCatalogInvite: enableCatalogInvite, hasManageUsersPermission: hasManageUsersPermission })), isInvitedUsersDialogOpen && (jsx(InvitedUsersDialog, { onClose: () => setIsInvitedUsersDialogOpen(false), tenant: params.tenantKey }))] }))] }) }) }));
|
|
264338
264577
|
}
|
|
264339
264578
|
|
|
264340
264579
|
const LOCAL_STORAGE_KEY = 'model_download_state';
|
|
@@ -264809,7 +265048,7 @@ currentSPA = '', showMentorAIDisplayCheckbox = false, showLeaderboardDisplayChec
|
|
|
264809
265048
|
// Local LLM props
|
|
264810
265049
|
localLLMProps,
|
|
264811
265050
|
// Controlled modal state
|
|
264812
|
-
isModalOpen, onModalOpenChange, defaultActiveTab, onAccountDeleted, enableMemoryTab, showBenchmarks = false, }) {
|
|
265051
|
+
isModalOpen, onModalOpenChange, defaultActiveTab, onAccountDeleted, enableMemoryTab, showBenchmarks = false, onboardingBasePath = '', }) {
|
|
264813
265052
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
264814
265053
|
const t = useT();
|
|
264815
265054
|
// Use hooks to fetch user metadata
|
|
@@ -265017,6 +265256,7 @@ isModalOpen, onModalOpenChange, defaultActiveTab, onAccountDeleted, enableMemory
|
|
|
265017
265256
|
onAccountDeleted,
|
|
265018
265257
|
enableMemoryTab,
|
|
265019
265258
|
showBenchmarks,
|
|
265259
|
+
onboardingBasePath,
|
|
265020
265260
|
};
|
|
265021
265261
|
if (CustomProfileModal) {
|
|
265022
265262
|
return jsx(CustomProfileModal, { ...modalProps });
|