@burtson-labs/bandit-engine 2.0.120 → 2.0.121

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/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  chat_default
3
- } from "./chunk-32R7DYFL.mjs";
3
+ } from "./chunk-26KZF54U.mjs";
4
4
  import {
5
5
  chat_provider_default
6
6
  } from "./chunk-VTKRZNLI.mjs";
@@ -10,7 +10,7 @@ import {
10
10
  useGatewayHealth,
11
11
  useGatewayMemory,
12
12
  useGatewayModels
13
- } from "./chunk-CVBR7PUH.mjs";
13
+ } from "./chunk-HLNEVIFS.mjs";
14
14
  import "./chunk-W2EPDR5G.mjs";
15
15
  import "./chunk-HAUDGBUS.mjs";
16
16
  import "./chunk-BN3D45E2.mjs";
@@ -20035,7 +20035,7 @@ var init_chat = __esm({
20035
20035
  "src/chat/chat.css"() {
20036
20036
  "use strict";
20037
20037
  init_style_inject();
20038
- styleInject(".typing-only {\n display: inline-flex;\n gap: 0.4rem;\n padding: 0;\n background: transparent;\n border-radius: 999px;\n box-shadow: none;\n}\n.typing-only .dot {\n width: 6px;\n height: 6px;\n background: #a78bfa;\n border-radius: 50%;\n animation: bounce 1.3s infinite ease-in-out;\n}\n.typing-only .dot:nth-child(2) {\n animation-delay: 0.2s;\n}\n.typing-only .dot:nth-child(3) {\n animation-delay: 0.4s;\n}\n@keyframes bounce {\n 0%, 80%, 100% {\n transform: translateY(0);\n opacity: 0.3;\n }\n 40% {\n transform: translateY(-6px);\n opacity: 1;\n }\n}\n@keyframes float {\n 0% {\n transform: translateY(0);\n }\n 50% {\n transform: translateY(-8px);\n }\n 100% {\n transform: translateY(0);\n }\n}\n.logo-animated {\n animation: pulseBandit 4s infinite ease-in-out;\n transition: transform 0.3s ease-in-out;\n}\n@keyframes pulseBandit {\n 0% {\n transform: scale(1) rotate(0deg);\n opacity: 0.85;\n }\n 50% {\n transform: scale(1.05) rotate(1deg);\n opacity: 1;\n }\n 100% {\n transform: scale(1) rotate(0deg);\n opacity: 0.85;\n }\n}\n.logo-container {\n transition: opacity 0.5s ease, transform 0.5s ease;\n}\n.fade-in {\n opacity: 1;\n transform: scale(1);\n}\n.fade-out {\n opacity: 0;\n transform: translateY(-16px) scale(0.95);\n}\n@keyframes fadeOut {\n to {\n opacity: 0;\n transform: translateY(-5px);\n visibility: hidden;\n }\n}\n");
20038
+ styleInject(".typing-only {\n display: inline-flex;\n gap: 0.4rem;\n padding: 0;\n background: transparent;\n border-radius: 999px;\n box-shadow: none;\n}\n.typing-only .dot {\n width: 6px;\n height: 6px;\n background: #a78bfa;\n border-radius: 50%;\n animation: bounce 1.3s infinite ease-in-out;\n}\n.typing-only .dot:nth-child(2) {\n animation-delay: 0.2s;\n}\n.typing-only .dot:nth-child(3) {\n animation-delay: 0.4s;\n}\n@keyframes bounce {\n 0%, 80%, 100% {\n transform: translateY(0);\n opacity: 0.3;\n }\n 40% {\n transform: translateY(-6px);\n opacity: 1;\n }\n}\n.logo-container {\n transition: opacity 0.5s ease, transform 0.5s ease;\n}\n.fade-in {\n opacity: 1;\n transform: scale(1);\n}\n.fade-out {\n opacity: 0;\n transform: translateY(-16px) scale(0.95);\n}\n@keyframes fadeOut {\n to {\n opacity: 0;\n transform: translateY(-5px);\n visibility: hidden;\n }\n}\n");
20039
20039
  }
20040
20040
  });
20041
20041
 
@@ -20093,7 +20093,7 @@ var init_custom_logo = __esm({
20093
20093
  component: "img",
20094
20094
  src: logoBase64,
20095
20095
  alt: "Custom Logo",
20096
- className: `logo-container ${visible ? "fade-in" : "fade-out"} logo-animated`,
20096
+ className: `logo-container ${visible ? "fade-in" : "fade-out"}`,
20097
20097
  sx: {
20098
20098
  width: isMobile ? "80vw" : "60vw",
20099
20099
  maxWidth: 600,
@@ -20108,7 +20108,7 @@ var init_custom_logo = __esm({
20108
20108
  {
20109
20109
  src: logoBase64,
20110
20110
  variant: "circular",
20111
- className: `logo-container ${visible ? "fade-in" : "fade-out"} logo-animated`,
20111
+ className: `logo-container ${visible ? "fade-in" : "fade-out"}`,
20112
20112
  sx: {
20113
20113
  width: isMobile ? "50vw" : "400px",
20114
20114
  height: isMobile ? "50vw" : "400px",
@@ -30296,7 +30296,8 @@ var init_chat2 = __esm({
30296
30296
  if (brandingConfig) {
30297
30297
  setBranding({
30298
30298
  brandingText: brandingConfig.brandingText || "",
30299
- logoBase64: brandingConfig.logoBase64 ?? void 0
30299
+ logoBase64: brandingConfig.logoBase64 ?? void 0,
30300
+ headerMode: brandingConfig.headerMode || "logo"
30300
30301
  });
30301
30302
  if (brandingConfig.brandingText) {
30302
30303
  document.title = brandingConfig.brandingText;
@@ -30339,7 +30340,8 @@ var init_chat2 = __esm({
30339
30340
  debugLogger.info("Loading branding and theme from CDN config");
30340
30341
  setBranding({
30341
30342
  brandingText: cdnBranding.brandingText,
30342
- logoBase64: cdnBranding.logoBase64 ?? void 0
30343
+ logoBase64: cdnBranding.logoBase64 ?? void 0,
30344
+ headerMode: cdnBranding.headerMode || "logo"
30343
30345
  });
30344
30346
  if (cdnBranding.brandingText) {
30345
30347
  document.title = cdnBranding.brandingText;
@@ -31020,7 +31022,44 @@ var init_chat2 = __esm({
31020
31022
  pt: 2
31021
31023
  },
31022
31024
  children: [
31023
- logoShouldRender && !brandingLoading && (branding?.logoBase64 ? /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(custom_logo_default, { visible: logoVisible, atTop: true }) : /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(bandit_chat_logo_default, { visible: logoVisible, atTop: true })),
31025
+ logoShouldRender && !brandingLoading && (() => {
31026
+ const headerMode = branding?.headerMode ?? "logo";
31027
+ if (headerMode === "minimal") {
31028
+ return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
31029
+ import_material52.Box,
31030
+ {
31031
+ sx: (theme) => ({
31032
+ textAlign: "center",
31033
+ mt: { xs: 6, md: 10 },
31034
+ mb: 2,
31035
+ px: 2,
31036
+ opacity: logoVisible ? 1 : 0,
31037
+ transition: "opacity 0.5s ease",
31038
+ color: theme.palette.text.primary
31039
+ }),
31040
+ children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_material52.Typography, { sx: { fontWeight: 500, fontSize: { xs: "1.5rem", md: "1.9rem" }, lineHeight: 1.2 }, children: "What can I help with?" })
31041
+ }
31042
+ );
31043
+ }
31044
+ if (headerMode === "text") {
31045
+ return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
31046
+ import_material52.Box,
31047
+ {
31048
+ sx: (theme) => ({
31049
+ textAlign: "center",
31050
+ mt: { xs: 6, md: 10 },
31051
+ mb: 2,
31052
+ px: 2,
31053
+ opacity: logoVisible ? 1 : 0,
31054
+ transition: "opacity 0.5s ease",
31055
+ color: theme.palette.text.primary
31056
+ }),
31057
+ children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_material52.Typography, { sx: { fontWeight: 600, fontSize: { xs: "1.6rem", md: "2.1rem" }, lineHeight: 1.2 }, children: branding?.brandingText?.trim() || "Bandit AI" })
31058
+ }
31059
+ );
31060
+ }
31061
+ return branding?.logoBase64 ? /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(custom_logo_default, { visible: logoVisible, atTop: true }) : /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(bandit_chat_logo_default, { visible: logoVisible, atTop: true });
31062
+ })(),
31024
31063
  /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
31025
31064
  import_material52.Box,
31026
31065
  {
@@ -36910,37 +36949,50 @@ var LogoCropper = ({
36910
36949
  onClose();
36911
36950
  }, [onClose]);
36912
36951
  const handleCrop = (0, import_react28.useCallback)(() => {
36913
- const canvas = document.createElement("canvas");
36914
- const ctx = canvas.getContext("2d");
36915
36952
  const image = imageRef.current;
36916
- if (!ctx || !image) return;
36953
+ if (!image) return;
36917
36954
  const cropDims = getCropDimensions();
36955
+ const scene = document.createElement("canvas");
36956
+ scene.width = CANVAS_SIZE;
36957
+ scene.height = CANVAS_SIZE;
36958
+ const sceneCtx = scene.getContext("2d");
36959
+ if (!sceneCtx) return;
36960
+ sceneCtx.clearRect(0, 0, CANVAS_SIZE, CANVAS_SIZE);
36961
+ sceneCtx.save();
36962
+ sceneCtx.translate(CANVAS_SIZE / 2, CANVAS_SIZE / 2);
36963
+ sceneCtx.rotate(cropSettings.rotation * Math.PI / 180);
36964
+ sceneCtx.scale(cropSettings.scale, cropSettings.scale);
36965
+ sceneCtx.translate(-image.naturalWidth / 2 + cropSettings.x, -image.naturalHeight / 2 + cropSettings.y);
36966
+ sceneCtx.drawImage(image, 0, 0, image.naturalWidth, image.naturalHeight);
36967
+ sceneCtx.restore();
36968
+ const cropX = (CANVAS_SIZE - cropDims.width) / 2;
36969
+ const cropY = (CANVAS_SIZE - cropDims.height) / 2;
36918
36970
  const finalSize = LOGO_OUTPUT_SIZES[outputSize];
36919
- const aspectRatioValue = cropDims.width / cropDims.height;
36971
+ const cropAspect = cropDims.width / cropDims.height;
36920
36972
  let outputWidth = finalSize;
36921
36973
  let outputHeight = finalSize;
36922
- if (aspectRatio !== "square") {
36923
- if (aspectRatioValue > 1) {
36924
- outputHeight = finalSize / aspectRatioValue;
36925
- } else {
36926
- outputWidth = finalSize * aspectRatioValue;
36927
- }
36974
+ if (cropAspect > 1) {
36975
+ outputHeight = Math.round(finalSize / cropAspect);
36976
+ } else if (cropAspect < 1) {
36977
+ outputWidth = Math.round(finalSize * cropAspect);
36928
36978
  }
36979
+ const canvas = document.createElement("canvas");
36929
36980
  canvas.width = outputWidth;
36930
36981
  canvas.height = outputHeight;
36931
- ctx.save();
36982
+ const ctx = canvas.getContext("2d");
36983
+ if (!ctx) return;
36932
36984
  ctx.clearRect(0, 0, outputWidth, outputHeight);
36933
- const scaleX = outputWidth / cropDims.width;
36934
- const scaleY = outputHeight / cropDims.height;
36935
- ctx.translate(outputWidth / 2, outputHeight / 2);
36936
- ctx.rotate(cropSettings.rotation * Math.PI / 180);
36937
- ctx.scale(cropSettings.scale * scaleX, cropSettings.scale * scaleY);
36938
- ctx.translate(
36939
- -image.naturalWidth / 2 + cropSettings.x * scaleX,
36940
- -image.naturalHeight / 2 + cropSettings.y * scaleY
36985
+ ctx.drawImage(
36986
+ scene,
36987
+ cropX,
36988
+ cropY,
36989
+ cropDims.width,
36990
+ cropDims.height,
36991
+ 0,
36992
+ 0,
36993
+ outputWidth,
36994
+ outputHeight
36941
36995
  );
36942
- ctx.drawImage(image, 0, 0, image.naturalWidth, image.naturalHeight);
36943
- ctx.restore();
36944
36996
  const croppedDataUrl = canvas.toDataURL("image/png", 1);
36945
36997
  onCrop(croppedDataUrl);
36946
36998
  setImageSrc("");
@@ -36948,7 +37000,7 @@ var LogoCropper = ({
36948
37000
  setCropSettings({ x: 0, y: 0, scale: 1, rotation: 0 });
36949
37001
  setAspectRatio("square");
36950
37002
  onClose();
36951
- }, [cropSettings, onCrop, getCropDimensions, outputSize, aspectRatio, onClose]);
37003
+ }, [cropSettings, onCrop, getCropDimensions, outputSize, onClose]);
36952
37004
  const handleScaleChange = (0, import_react28.useCallback)((value) => {
36953
37005
  const cropDims = getCropDimensions();
36954
37006
  const minScale2 = Math.max(
@@ -36982,8 +37034,8 @@ var LogoCropper = ({
36982
37034
  },
36983
37035
  children: [
36984
37036
  /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_material21.DialogTitle, { sx: { pb: 1 }, children: [
36985
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_material21.Typography, { variant: "h6", sx: { fontWeight: 600 }, children: "\u{1F3A8} Crop Your Logo" }),
36986
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_material21.Typography, { variant: "body2", color: "text.secondary", children: "Position, resize, and format your logo for perfect branding" })
37037
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_material21.Typography, { variant: "h6", sx: { fontWeight: 600 }, children: "Crop Logo" }),
37038
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_material21.Typography, { variant: "body2", color: "text.secondary", children: "Position and size your logo. The selected region is exported at its true aspect ratio." })
36987
37039
  ] }),
36988
37040
  /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_material21.DialogContent, { children: imageSrc && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_jsx_runtime20.Fragment, { children: [
36989
37041
  /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
@@ -37047,7 +37099,7 @@ var LogoCropper = ({
37047
37099
  pointerEvents: "none",
37048
37100
  opacity: 0.9
37049
37101
  },
37050
- children: "Drag to reposition \u2022 Blue area will be exported"
37102
+ children: "Drag to reposition \u2014 the outlined area is exported"
37051
37103
  }
37052
37104
  )
37053
37105
  ]
@@ -37056,7 +37108,7 @@ var LogoCropper = ({
37056
37108
  /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_material21.Box, { sx: { width: 300, display: "flex", flexDirection: "column", gap: 3 }, children: [
37057
37109
  /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_material21.Box, { children: [
37058
37110
  /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_material21.Typography, { variant: "body2", sx: { mb: 1, fontWeight: 600 }, children: [
37059
- "\u{1F4CB} Preview (",
37111
+ "Preview (",
37060
37112
  LOGO_OUTPUT_SIZES[outputSize],
37061
37113
  "px)"
37062
37114
  ] }),
@@ -37076,7 +37128,7 @@ var LogoCropper = ({
37076
37128
  ) })
37077
37129
  ] }),
37078
37130
  /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_material21.Box, { children: [
37079
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_material21.Typography, { variant: "body2", sx: { mb: 1, fontWeight: 600 }, children: "\u{1F4D0} Aspect Ratio" }),
37131
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_material21.Typography, { variant: "body2", sx: { mb: 1, fontWeight: 600 }, children: "Aspect Ratio" }),
37080
37132
  /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
37081
37133
  import_material21.ToggleButtonGroup,
37082
37134
  {
@@ -37103,7 +37155,7 @@ var LogoCropper = ({
37103
37155
  )
37104
37156
  ] }),
37105
37157
  /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_material21.Box, { children: [
37106
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_material21.Typography, { variant: "body2", sx: { mb: 1, fontWeight: 600 }, children: "\u{1F4CF} Output Size" }),
37158
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_material21.Typography, { variant: "body2", sx: { mb: 1, fontWeight: 600 }, children: "Output Size" }),
37107
37159
  /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
37108
37160
  import_material21.ToggleButtonGroup,
37109
37161
  {
@@ -37122,7 +37174,7 @@ var LogoCropper = ({
37122
37174
  ] }),
37123
37175
  /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_material21.Box, { children: [
37124
37176
  /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_material21.Typography, { variant: "body2", sx: { mb: 1, fontWeight: 600 }, children: [
37125
- "\u{1F50D} Zoom: ",
37177
+ "Zoom: ",
37126
37178
  Math.round(cropSettings.scale * 100),
37127
37179
  "%"
37128
37180
  ] }),
@@ -37159,7 +37211,7 @@ var LogoCropper = ({
37159
37211
  ] })
37160
37212
  ] }),
37161
37213
  /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_material21.Box, { children: [
37162
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_material21.Typography, { variant: "body2", sx: { mb: 1, fontWeight: 600 }, children: "\u{1F504} Rotation" }),
37214
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_material21.Typography, { variant: "body2", sx: { mb: 1, fontWeight: 600 }, children: "Rotation" }),
37163
37215
  /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_material21.Box, { sx: { display: "flex", gap: 1 }, children: [
37164
37216
  /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
37165
37217
  import_material21.Button,
@@ -37194,26 +37246,7 @@ var LogoCropper = ({
37194
37246
  }
37195
37247
  )
37196
37248
  ] }),
37197
- /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_material21.Alert, { severity: "success", sx: { borderRadius: 2 }, children: [
37198
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_material21.Typography, { variant: "body2", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("strong", { children: "\u2728 Logo Features:" }) }),
37199
- /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_material21.Typography, { variant: "body2", sx: { mt: 0.5, fontSize: "0.8rem" }, children: [
37200
- "\u2022 ",
37201
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("strong", { children: "Transparency preserved" }),
37202
- " for clean logos",
37203
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("br", {}),
37204
- "\u2022 ",
37205
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("strong", { children: "High quality PNG" }),
37206
- " output",
37207
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("br", {}),
37208
- "\u2022 ",
37209
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("strong", { children: "Multiple sizes" }),
37210
- " for different uses",
37211
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("br", {}),
37212
- "\u2022 ",
37213
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("strong", { children: "Perfect for branding" }),
37214
- " across platforms"
37215
- ] })
37216
- ] })
37249
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_material21.Alert, { severity: "info", variant: "outlined", sx: { borderRadius: 2, py: 0.5 }, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_material21.Typography, { variant: "caption", sx: { fontSize: "0.75rem", lineHeight: 1.5 }, children: "Exported as a transparent PNG at the selected aspect ratio. Wide logos stay wide." }) })
37217
37250
  ] })
37218
37251
  ] }) : /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_material21.Box, { sx: { display: "flex", justifyContent: "center", py: 4 }, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_material21.Typography, { children: "Loading image..." }) })
37219
37252
  ] }) }),
@@ -37229,7 +37262,7 @@ var LogoCropper = ({
37229
37262
  px: 3,
37230
37263
  fontWeight: 600
37231
37264
  },
37232
- children: "\u2702\uFE0F Crop Logo"
37265
+ children: "Apply Crop"
37233
37266
  }
37234
37267
  )
37235
37268
  ] })
@@ -37249,6 +37282,8 @@ var BrandingTab = ({
37249
37282
  logoBase64,
37250
37283
  brandingText,
37251
37284
  setBrandingText,
37285
+ headerMode,
37286
+ setHeaderMode,
37252
37287
  theme,
37253
37288
  setTheme,
37254
37289
  predefinedThemes: predefinedThemes2,
@@ -37431,10 +37466,9 @@ var BrandingTab = ({
37431
37466
  import_material22.Box,
37432
37467
  {
37433
37468
  sx: {
37434
- width: { xs: "100%", md: "26%" },
37469
+ width: { xs: "100%", md: "34%" },
37435
37470
  display: "flex",
37436
37471
  flexDirection: "column",
37437
- height: { xs: "auto", md: 260 },
37438
37472
  gap: { xs: 1.5, md: 0 }
37439
37473
  },
37440
37474
  children: [
@@ -37545,22 +37579,47 @@ var BrandingTab = ({
37545
37579
  )
37546
37580
  ] })
37547
37581
  ] }),
37548
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_material22.Box, { sx: { mt: 1.5, flex: "0 0 auto" }, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
37549
- import_material22.TextField,
37550
- {
37551
- label: "Custom Branding Text",
37552
- variant: "outlined",
37553
- value: brandingText,
37554
- onChange: (e) => setBrandingText(e.target.value),
37555
- fullWidth: true,
37556
- placeholder: "e.g., Powered by YourCompany",
37557
- size: "small",
37558
- sx: {
37559
- "& .MuiInputBase-root": { fontSize: "0.85rem" },
37560
- "& .MuiFormHelperText-root": { fontSize: "0.7rem" }
37582
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_material22.Box, { sx: { mt: 1.5, flex: "0 0 auto", display: "flex", flexDirection: "column", gap: 1.25 }, children: [
37583
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
37584
+ import_material22.TextField,
37585
+ {
37586
+ label: "Custom Branding Text",
37587
+ variant: "outlined",
37588
+ value: brandingText,
37589
+ onChange: (e) => setBrandingText(e.target.value),
37590
+ fullWidth: true,
37591
+ placeholder: "e.g., Powered by YourCompany",
37592
+ size: "small",
37593
+ sx: {
37594
+ "& .MuiInputBase-root": { fontSize: "0.85rem" },
37595
+ "& .MuiFormHelperText-root": { fontSize: "0.7rem" }
37596
+ }
37561
37597
  }
37562
- }
37563
- ) })
37598
+ ),
37599
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_material22.Box, { children: [
37600
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_material22.Typography, { variant: "overline", sx: { mb: 0.5, fontWeight: 700, fontSize: "0.7rem", letterSpacing: 0.6, color: "text.secondary", display: "block" }, children: "Welcome Header" }),
37601
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
37602
+ import_material22.ToggleButtonGroup,
37603
+ {
37604
+ value: headerMode,
37605
+ exclusive: true,
37606
+ onChange: (_, mode) => mode && setHeaderMode(mode),
37607
+ size: "small",
37608
+ fullWidth: true,
37609
+ children: [
37610
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_material22.ToggleButton, { value: "logo", sx: { fontSize: "0.7rem", py: 0.4, textTransform: "none" }, children: "Logo" }),
37611
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_material22.ToggleButton, { value: "text", sx: { fontSize: "0.7rem", py: 0.4, textTransform: "none" }, children: "Text" }),
37612
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_material22.ToggleButton, { value: "minimal", sx: { fontSize: "0.7rem", py: 0.4, textTransform: "none" }, children: "Minimal" })
37613
+ ]
37614
+ }
37615
+ ),
37616
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_material22.Typography, { variant: "caption", color: "text.secondary", sx: { display: "block", mt: 0.5, fontSize: "0.68rem", lineHeight: 1.4 }, children: [
37617
+ headerMode === "logo" && "Show the brand logo above the chat.",
37618
+ headerMode === "text" && "Show branding text only, no logo.",
37619
+ headerMode === "minimal" && "No logo or text \u2014 clean greeting only."
37620
+ ] })
37621
+ ] })
37622
+ ] })
37564
37623
  ]
37565
37624
  }
37566
37625
  ),
@@ -37570,79 +37629,65 @@ var BrandingTab = ({
37570
37629
  import_material22.Box,
37571
37630
  {
37572
37631
  sx: {
37573
- height: { xs: 220, md: 260 },
37632
+ height: { xs: 180, md: 200 },
37574
37633
  display: "flex",
37575
37634
  flexDirection: "column",
37576
37635
  position: "relative",
37577
37636
  bgcolor: "background.default",
37578
37637
  borderRadius: 2,
37579
37638
  overflow: "hidden",
37639
+ border: "1px solid",
37640
+ borderColor: "divider",
37580
37641
  px: 2,
37581
- py: 2
37642
+ py: 1.5
37582
37643
  },
37583
37644
  children: [
37584
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_material22.Box, { sx: {
37645
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_material22.Box, { sx: {
37585
37646
  display: "flex",
37586
37647
  justifyContent: "center",
37587
37648
  alignItems: "center",
37588
37649
  flex: "1 1 auto",
37589
37650
  minHeight: 0
37590
- }, children: logoBase64 || getDefaultLogo() ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
37591
- "img",
37592
- {
37593
- src: logoBase64 || getDefaultLogo(),
37594
- alt: "Logo Preview",
37595
- style: {
37596
- maxWidth: "320px",
37597
- height: "auto",
37598
- imageRendering: "auto",
37599
- objectFit: "contain",
37600
- filter: "contrast(1.1) saturate(1.05)"
37601
- }
37602
- }
37603
- ) : /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_material22.Box, { sx: {
37604
- display: "flex",
37605
- flexDirection: "column",
37606
- alignItems: "center",
37607
- gap: 0.5
37608
37651
  }, children: [
37609
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
37652
+ headerMode === "logo" && (logoBase64 || getDefaultLogo() ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
37653
+ "img",
37654
+ {
37655
+ src: logoBase64 || getDefaultLogo(),
37656
+ alt: "Logo Preview",
37657
+ style: {
37658
+ maxWidth: "240px",
37659
+ maxHeight: "100%",
37660
+ height: "auto",
37661
+ imageRendering: "auto",
37662
+ objectFit: "contain",
37663
+ filter: "contrast(1.1) saturate(1.05)"
37664
+ }
37665
+ }
37666
+ ) : /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
37610
37667
  import_material22.Skeleton,
37611
37668
  {
37612
37669
  variant: "rectangular",
37613
- width: 160,
37614
- height: 40,
37670
+ width: 140,
37671
+ height: 36,
37615
37672
  sx: {
37616
37673
  borderRadius: 2,
37617
37674
  bgcolor: (theme2) => theme2.palette.mode === "dark" ? "rgba(255,255,255,0.08)" : "rgba(0,0,0,0.08)"
37618
37675
  }
37619
37676
  }
37620
- ),
37621
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_material22.Typography, { variant: "caption", color: "text.disabled", sx: { fontSize: "0.7rem" }, children: "Logo preview" })
37622
- ] }) }),
37677
+ )),
37678
+ headerMode === "text" && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_material22.Typography, { variant: "h6", sx: { fontWeight: 600, color: "text.primary", textAlign: "center" }, children: brandingText || "Bandit AI" }),
37679
+ headerMode === "minimal" && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_material22.Typography, { variant: "h6", sx: { fontWeight: 500, color: "text.secondary", textAlign: "center" }, children: "What can I help with?" })
37680
+ ] }),
37623
37681
  /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_material22.Box, { sx: {
37624
37682
  display: "flex",
37625
37683
  flexDirection: "column",
37626
37684
  alignItems: "center",
37627
37685
  width: "100%",
37628
37686
  flex: "0 0 auto",
37629
- gap: 1
37687
+ gap: 0.75
37630
37688
  }, children: [
37631
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_material22.Stack, { direction: "row", spacing: 1, justifyContent: "center", sx: { flexWrap: "wrap", gap: 1 }, children: [1, 2, 3].map((i) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
37632
- import_material22.Skeleton,
37633
- {
37634
- variant: "rectangular",
37635
- width: 80,
37636
- height: 24,
37637
- sx: {
37638
- borderRadius: 2,
37639
- bgcolor: (theme2) => theme2.palette.mode === "dark" ? "rgba(255,255,255,0.05)" : "rgba(0,0,0,0.05)"
37640
- }
37641
- },
37642
- i
37643
- )) }),
37644
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_material22.Paper, { elevation: 3, sx: { px: 2, py: 1.5, borderRadius: 2, width: "100%", maxWidth: 500 }, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_material22.Typography, { variant: "body1", sx: { color: "text.secondary" }, children: "What's on your mind?" }) }),
37645
- /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_material22.Typography, { variant: "caption", sx: { textAlign: "center", color: "text.secondary", mt: 1 }, children: [
37689
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_material22.Paper, { elevation: 2, sx: { px: 2, py: 1, borderRadius: 2, width: "100%", maxWidth: 440 }, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_material22.Typography, { variant: "body2", sx: { color: "text.secondary" }, children: "What's on your mind?" }) }),
37690
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_material22.Typography, { variant: "caption", sx: { textAlign: "center", color: "text.secondary", fontSize: "0.68rem" }, children: [
37646
37691
  brandingText ? `${brandingText} \u2022 ` : "Bandit AI \u2022 ",
37647
37692
  "may be wrong \u2014 double-check important info."
37648
37693
  ] })
@@ -37803,7 +37848,7 @@ var BrandingTab = ({
37803
37848
  disabled: saveStatus === "saving",
37804
37849
  color: saveStatus === "saved" ? "success" : saveStatus === "error" ? "error" : "primary",
37805
37850
  sx: { height: 36, fontSize: "0.8rem" },
37806
- children: saveStatus === "saving" ? "Saving..." : saveStatus === "saved" ? "\u2713 Saved" : saveStatus === "error" ? "\u2717 Error" : "Save"
37851
+ children: saveStatus === "saving" ? "Saving..." : saveStatus === "saved" ? "Saved" : saveStatus === "error" ? "Error" : "Save"
37807
37852
  }
37808
37853
  ) }),
37809
37854
  /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_material22.Box, { sx: { flexBasis: { xs: "calc(50% - 4px)", sm: "calc(25% - 6px)" } }, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
@@ -43741,6 +43786,7 @@ var Management = () => {
43741
43786
  const [logoFile, setLogoFile] = (0, import_react62.useState)(null);
43742
43787
  const [logoBase64, setLogoBase64] = (0, import_react62.useState)(null);
43743
43788
  const [brandingText, setBrandingText] = (0, import_react62.useState)("");
43789
+ const [headerMode, setHeaderMode] = (0, import_react62.useState)("logo");
43744
43790
  const [theme, setTheme] = (0, import_react62.useState)("bandit-dark");
43745
43791
  const [customAvatarBase64, setCustomAvatarBase64] = (0, import_react62.useState)(null);
43746
43792
  const [presetAvatar, setPresetAvatar] = (0, import_react62.useState)(null);
@@ -43834,6 +43880,7 @@ var Management = () => {
43834
43880
  hasCustomTheme: !!(brandingConfig?.theme && brandingConfig.theme !== "bandit-dark")
43835
43881
  });
43836
43882
  setBrandingText(brandingConfig?.brandingText || "");
43883
+ setHeaderMode(brandingConfig?.headerMode || "logo");
43837
43884
  setTheme(brandingConfig?.theme || "bandit-dark");
43838
43885
  setLogoBase64(brandingConfig?.logoBase64 || null);
43839
43886
  if (brandingConfig?.hasTransparentLogo !== void 0) {
@@ -43859,6 +43906,7 @@ var Management = () => {
43859
43906
  if (cdnBranding) {
43860
43907
  debugLogger.info("Applying CDN branding");
43861
43908
  setBrandingText(cdnBranding.brandingText || "");
43909
+ setHeaderMode(cdnBranding.headerMode || "logo");
43862
43910
  setTheme(cdnBranding.theme || "bandit-dark");
43863
43911
  setLogoBase64(cdnBranding.logoBase64 || null);
43864
43912
  if (cdnBranding.hasTransparentLogo !== void 0) {
@@ -44057,6 +44105,7 @@ var Management = () => {
44057
44105
  branding: {
44058
44106
  logoBase64,
44059
44107
  brandingText,
44108
+ headerMode,
44060
44109
  theme,
44061
44110
  hasTransparentLogo: finalHasTransparentLogo,
44062
44111
  userSaved: true
@@ -44115,6 +44164,7 @@ var Management = () => {
44115
44164
  branding: {
44116
44165
  logoBase64: logoBase64 || "",
44117
44166
  brandingText: brandingText || "",
44167
+ headerMode,
44118
44168
  theme,
44119
44169
  hasTransparentLogo: hasLogo ? await detectTransparency(logoBase64) : false
44120
44170
  },
@@ -44159,6 +44209,7 @@ var Management = () => {
44159
44209
  if (cdnBranding) {
44160
44210
  setLogoBase64(cdnBranding.logoBase64 || null);
44161
44211
  setBrandingText(cdnBranding.brandingText || "");
44212
+ setHeaderMode(cdnBranding.headerMode || "logo");
44162
44213
  setTheme(cdnBranding.theme || "bandit-dark");
44163
44214
  if (cdnBranding.hasTransparentLogo !== void 0) {
44164
44215
  setHasTransparentLogo(cdnBranding.hasTransparentLogo);
@@ -44169,6 +44220,7 @@ var Management = () => {
44169
44220
  } else {
44170
44221
  setLogoBase64(null);
44171
44222
  setBrandingText("");
44223
+ setHeaderMode("logo");
44172
44224
  setTheme("bandit-dark");
44173
44225
  setHasTransparentLogo(true);
44174
44226
  debugLogger.info("Applied Bandit default branding");
@@ -44193,6 +44245,7 @@ var Management = () => {
44193
44245
  } : {
44194
44246
  logoBase64: null,
44195
44247
  brandingText: "",
44248
+ headerMode: "logo",
44196
44249
  theme: "bandit-dark",
44197
44250
  hasTransparentLogo: true,
44198
44251
  userSaved: false
@@ -44292,6 +44345,7 @@ var Management = () => {
44292
44345
  const data = JSON.parse(e.target?.result);
44293
44346
  if (data.branding) {
44294
44347
  setBrandingText(data.branding.brandingText || "");
44348
+ setHeaderMode(data.branding.headerMode || "logo");
44295
44349
  setTheme(data.branding.theme || "Dark");
44296
44350
  setLogoBase64(data.branding.logoBase64 || null);
44297
44351
  setLogoFile(null);
@@ -44936,6 +44990,8 @@ var Management = () => {
44936
44990
  logoBase64,
44937
44991
  brandingText,
44938
44992
  setBrandingText,
44993
+ headerMode,
44994
+ setHeaderMode,
44939
44995
  theme,
44940
44996
  setTheme,
44941
44997
  predefinedThemes,