@burtson-labs/bandit-engine 2.0.119 → 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-BD6R7MTV.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-3TXU5SOO.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",
@@ -21950,12 +21950,17 @@ var init_rate_limit_prompt = __esm({
21950
21950
  navigate = null;
21951
21951
  }
21952
21952
  const safeNavigate = (to) => {
21953
+ if (typeof window !== "undefined" && /^https?:\/\//.test(to)) {
21954
+ window.location.href = to;
21955
+ return;
21956
+ }
21953
21957
  if (navigate) {
21954
21958
  navigate(to);
21955
21959
  } else if (typeof window !== "undefined") {
21956
21960
  window.location.href = to;
21957
21961
  }
21958
21962
  };
21963
+ const plansUrl = typeof window !== "undefined" && !(window.location.hostname === "banditailabs.com" || window.location.hostname.endsWith(".banditailabs.com") || window.location.hostname === "localhost" || window.location.hostname === "127.0.0.1") ? "https://banditailabs.com/plans" : "/plans";
21959
21964
  if (!prompt) {
21960
21965
  return null;
21961
21966
  }
@@ -22015,7 +22020,7 @@ var init_rate_limit_prompt = __esm({
22015
22020
  startIcon: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(AutoAwesomeIcon, { sx: { fontSize: "0.9rem" } }),
22016
22021
  onClick: () => {
22017
22022
  dismiss();
22018
- safeNavigate("/plans");
22023
+ safeNavigate(plansUrl);
22019
22024
  },
22020
22025
  sx: { textTransform: "none", fontWeight: 600, borderRadius: 2 },
22021
22026
  children: "Upgrade to keep chatting"
@@ -28358,6 +28363,10 @@ var init_chat_app_bar = __esm({
28358
28363
  navigate = null;
28359
28364
  }
28360
28365
  const safeNavigate = (to) => {
28366
+ if (typeof window !== "undefined" && /^https?:\/\//.test(to)) {
28367
+ window.location.href = to;
28368
+ return;
28369
+ }
28361
28370
  if (navigate) {
28362
28371
  navigate(to);
28363
28372
  } else if (typeof window !== "undefined") {
@@ -28470,7 +28479,7 @@ var init_chat_app_bar = __esm({
28470
28479
  const tier = String(getCurrentTier());
28471
28480
  return tier !== "trial" && tier !== "expired" && tier !== "free" && tier !== "basic";
28472
28481
  })();
28473
- const plansPath = "/plans";
28482
+ const plansPath = typeof window !== "undefined" && !(window.location.hostname === "banditailabs.com" || window.location.hostname.endsWith(".banditailabs.com") || window.location.hostname === "localhost" || window.location.hostname === "127.0.0.1") ? "https://banditailabs.com/plans" : "/plans";
28474
28483
  const isTTSAvailable = !!packageSettings?.gatewayApiUrl && preferences.ttsEnabled && hasTTS();
28475
28484
  const currentConversation = conversations.find((c) => c.id === currentId);
28476
28485
  const conversationCountDisplay = conversations.length > 99 ? "99+" : conversations.length.toString();
@@ -30287,7 +30296,8 @@ var init_chat2 = __esm({
30287
30296
  if (brandingConfig) {
30288
30297
  setBranding({
30289
30298
  brandingText: brandingConfig.brandingText || "",
30290
- logoBase64: brandingConfig.logoBase64 ?? void 0
30299
+ logoBase64: brandingConfig.logoBase64 ?? void 0,
30300
+ headerMode: brandingConfig.headerMode || "logo"
30291
30301
  });
30292
30302
  if (brandingConfig.brandingText) {
30293
30303
  document.title = brandingConfig.brandingText;
@@ -30330,7 +30340,8 @@ var init_chat2 = __esm({
30330
30340
  debugLogger.info("Loading branding and theme from CDN config");
30331
30341
  setBranding({
30332
30342
  brandingText: cdnBranding.brandingText,
30333
- logoBase64: cdnBranding.logoBase64 ?? void 0
30343
+ logoBase64: cdnBranding.logoBase64 ?? void 0,
30344
+ headerMode: cdnBranding.headerMode || "logo"
30334
30345
  });
30335
30346
  if (cdnBranding.brandingText) {
30336
30347
  document.title = cdnBranding.brandingText;
@@ -31011,7 +31022,44 @@ var init_chat2 = __esm({
31011
31022
  pt: 2
31012
31023
  },
31013
31024
  children: [
31014
- 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
+ })(),
31015
31063
  /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
31016
31064
  import_material52.Box,
31017
31065
  {
@@ -36901,37 +36949,50 @@ var LogoCropper = ({
36901
36949
  onClose();
36902
36950
  }, [onClose]);
36903
36951
  const handleCrop = (0, import_react28.useCallback)(() => {
36904
- const canvas = document.createElement("canvas");
36905
- const ctx = canvas.getContext("2d");
36906
36952
  const image = imageRef.current;
36907
- if (!ctx || !image) return;
36953
+ if (!image) return;
36908
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;
36909
36970
  const finalSize = LOGO_OUTPUT_SIZES[outputSize];
36910
- const aspectRatioValue = cropDims.width / cropDims.height;
36971
+ const cropAspect = cropDims.width / cropDims.height;
36911
36972
  let outputWidth = finalSize;
36912
36973
  let outputHeight = finalSize;
36913
- if (aspectRatio !== "square") {
36914
- if (aspectRatioValue > 1) {
36915
- outputHeight = finalSize / aspectRatioValue;
36916
- } else {
36917
- outputWidth = finalSize * aspectRatioValue;
36918
- }
36974
+ if (cropAspect > 1) {
36975
+ outputHeight = Math.round(finalSize / cropAspect);
36976
+ } else if (cropAspect < 1) {
36977
+ outputWidth = Math.round(finalSize * cropAspect);
36919
36978
  }
36979
+ const canvas = document.createElement("canvas");
36920
36980
  canvas.width = outputWidth;
36921
36981
  canvas.height = outputHeight;
36922
- ctx.save();
36982
+ const ctx = canvas.getContext("2d");
36983
+ if (!ctx) return;
36923
36984
  ctx.clearRect(0, 0, outputWidth, outputHeight);
36924
- const scaleX = outputWidth / cropDims.width;
36925
- const scaleY = outputHeight / cropDims.height;
36926
- ctx.translate(outputWidth / 2, outputHeight / 2);
36927
- ctx.rotate(cropSettings.rotation * Math.PI / 180);
36928
- ctx.scale(cropSettings.scale * scaleX, cropSettings.scale * scaleY);
36929
- ctx.translate(
36930
- -image.naturalWidth / 2 + cropSettings.x * scaleX,
36931
- -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
36932
36995
  );
36933
- ctx.drawImage(image, 0, 0, image.naturalWidth, image.naturalHeight);
36934
- ctx.restore();
36935
36996
  const croppedDataUrl = canvas.toDataURL("image/png", 1);
36936
36997
  onCrop(croppedDataUrl);
36937
36998
  setImageSrc("");
@@ -36939,7 +37000,7 @@ var LogoCropper = ({
36939
37000
  setCropSettings({ x: 0, y: 0, scale: 1, rotation: 0 });
36940
37001
  setAspectRatio("square");
36941
37002
  onClose();
36942
- }, [cropSettings, onCrop, getCropDimensions, outputSize, aspectRatio, onClose]);
37003
+ }, [cropSettings, onCrop, getCropDimensions, outputSize, onClose]);
36943
37004
  const handleScaleChange = (0, import_react28.useCallback)((value) => {
36944
37005
  const cropDims = getCropDimensions();
36945
37006
  const minScale2 = Math.max(
@@ -36973,8 +37034,8 @@ var LogoCropper = ({
36973
37034
  },
36974
37035
  children: [
36975
37036
  /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_material21.DialogTitle, { sx: { pb: 1 }, children: [
36976
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_material21.Typography, { variant: "h6", sx: { fontWeight: 600 }, children: "\u{1F3A8} Crop Your Logo" }),
36977
- /* @__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." })
36978
37039
  ] }),
36979
37040
  /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_material21.DialogContent, { children: imageSrc && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_jsx_runtime20.Fragment, { children: [
36980
37041
  /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
@@ -37038,7 +37099,7 @@ var LogoCropper = ({
37038
37099
  pointerEvents: "none",
37039
37100
  opacity: 0.9
37040
37101
  },
37041
- children: "Drag to reposition \u2022 Blue area will be exported"
37102
+ children: "Drag to reposition \u2014 the outlined area is exported"
37042
37103
  }
37043
37104
  )
37044
37105
  ]
@@ -37047,7 +37108,7 @@ var LogoCropper = ({
37047
37108
  /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_material21.Box, { sx: { width: 300, display: "flex", flexDirection: "column", gap: 3 }, children: [
37048
37109
  /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_material21.Box, { children: [
37049
37110
  /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_material21.Typography, { variant: "body2", sx: { mb: 1, fontWeight: 600 }, children: [
37050
- "\u{1F4CB} Preview (",
37111
+ "Preview (",
37051
37112
  LOGO_OUTPUT_SIZES[outputSize],
37052
37113
  "px)"
37053
37114
  ] }),
@@ -37067,7 +37128,7 @@ var LogoCropper = ({
37067
37128
  ) })
37068
37129
  ] }),
37069
37130
  /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_material21.Box, { children: [
37070
- /* @__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" }),
37071
37132
  /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
37072
37133
  import_material21.ToggleButtonGroup,
37073
37134
  {
@@ -37094,7 +37155,7 @@ var LogoCropper = ({
37094
37155
  )
37095
37156
  ] }),
37096
37157
  /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_material21.Box, { children: [
37097
- /* @__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" }),
37098
37159
  /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
37099
37160
  import_material21.ToggleButtonGroup,
37100
37161
  {
@@ -37113,7 +37174,7 @@ var LogoCropper = ({
37113
37174
  ] }),
37114
37175
  /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_material21.Box, { children: [
37115
37176
  /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_material21.Typography, { variant: "body2", sx: { mb: 1, fontWeight: 600 }, children: [
37116
- "\u{1F50D} Zoom: ",
37177
+ "Zoom: ",
37117
37178
  Math.round(cropSettings.scale * 100),
37118
37179
  "%"
37119
37180
  ] }),
@@ -37150,7 +37211,7 @@ var LogoCropper = ({
37150
37211
  ] })
37151
37212
  ] }),
37152
37213
  /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_material21.Box, { children: [
37153
- /* @__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" }),
37154
37215
  /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_material21.Box, { sx: { display: "flex", gap: 1 }, children: [
37155
37216
  /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
37156
37217
  import_material21.Button,
@@ -37185,26 +37246,7 @@ var LogoCropper = ({
37185
37246
  }
37186
37247
  )
37187
37248
  ] }),
37188
- /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_material21.Alert, { severity: "success", sx: { borderRadius: 2 }, children: [
37189
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_material21.Typography, { variant: "body2", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("strong", { children: "\u2728 Logo Features:" }) }),
37190
- /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_material21.Typography, { variant: "body2", sx: { mt: 0.5, fontSize: "0.8rem" }, children: [
37191
- "\u2022 ",
37192
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("strong", { children: "Transparency preserved" }),
37193
- " for clean logos",
37194
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("br", {}),
37195
- "\u2022 ",
37196
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("strong", { children: "High quality PNG" }),
37197
- " output",
37198
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("br", {}),
37199
- "\u2022 ",
37200
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("strong", { children: "Multiple sizes" }),
37201
- " for different uses",
37202
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("br", {}),
37203
- "\u2022 ",
37204
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("strong", { children: "Perfect for branding" }),
37205
- " across platforms"
37206
- ] })
37207
- ] })
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." }) })
37208
37250
  ] })
37209
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..." }) })
37210
37252
  ] }) }),
@@ -37220,7 +37262,7 @@ var LogoCropper = ({
37220
37262
  px: 3,
37221
37263
  fontWeight: 600
37222
37264
  },
37223
- children: "\u2702\uFE0F Crop Logo"
37265
+ children: "Apply Crop"
37224
37266
  }
37225
37267
  )
37226
37268
  ] })
@@ -37240,6 +37282,8 @@ var BrandingTab = ({
37240
37282
  logoBase64,
37241
37283
  brandingText,
37242
37284
  setBrandingText,
37285
+ headerMode,
37286
+ setHeaderMode,
37243
37287
  theme,
37244
37288
  setTheme,
37245
37289
  predefinedThemes: predefinedThemes2,
@@ -37422,10 +37466,9 @@ var BrandingTab = ({
37422
37466
  import_material22.Box,
37423
37467
  {
37424
37468
  sx: {
37425
- width: { xs: "100%", md: "26%" },
37469
+ width: { xs: "100%", md: "34%" },
37426
37470
  display: "flex",
37427
37471
  flexDirection: "column",
37428
- height: { xs: "auto", md: 260 },
37429
37472
  gap: { xs: 1.5, md: 0 }
37430
37473
  },
37431
37474
  children: [
@@ -37536,22 +37579,47 @@ var BrandingTab = ({
37536
37579
  )
37537
37580
  ] })
37538
37581
  ] }),
37539
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_material22.Box, { sx: { mt: 1.5, flex: "0 0 auto" }, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
37540
- import_material22.TextField,
37541
- {
37542
- label: "Custom Branding Text",
37543
- variant: "outlined",
37544
- value: brandingText,
37545
- onChange: (e) => setBrandingText(e.target.value),
37546
- fullWidth: true,
37547
- placeholder: "e.g., Powered by YourCompany",
37548
- size: "small",
37549
- sx: {
37550
- "& .MuiInputBase-root": { fontSize: "0.85rem" },
37551
- "& .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
+ }
37552
37597
  }
37553
- }
37554
- ) })
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
+ ] })
37555
37623
  ]
37556
37624
  }
37557
37625
  ),
@@ -37561,79 +37629,65 @@ var BrandingTab = ({
37561
37629
  import_material22.Box,
37562
37630
  {
37563
37631
  sx: {
37564
- height: { xs: 220, md: 260 },
37632
+ height: { xs: 180, md: 200 },
37565
37633
  display: "flex",
37566
37634
  flexDirection: "column",
37567
37635
  position: "relative",
37568
37636
  bgcolor: "background.default",
37569
37637
  borderRadius: 2,
37570
37638
  overflow: "hidden",
37639
+ border: "1px solid",
37640
+ borderColor: "divider",
37571
37641
  px: 2,
37572
- py: 2
37642
+ py: 1.5
37573
37643
  },
37574
37644
  children: [
37575
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_material22.Box, { sx: {
37645
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_material22.Box, { sx: {
37576
37646
  display: "flex",
37577
37647
  justifyContent: "center",
37578
37648
  alignItems: "center",
37579
37649
  flex: "1 1 auto",
37580
37650
  minHeight: 0
37581
- }, children: logoBase64 || getDefaultLogo() ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
37582
- "img",
37583
- {
37584
- src: logoBase64 || getDefaultLogo(),
37585
- alt: "Logo Preview",
37586
- style: {
37587
- maxWidth: "320px",
37588
- height: "auto",
37589
- imageRendering: "auto",
37590
- objectFit: "contain",
37591
- filter: "contrast(1.1) saturate(1.05)"
37592
- }
37593
- }
37594
- ) : /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_material22.Box, { sx: {
37595
- display: "flex",
37596
- flexDirection: "column",
37597
- alignItems: "center",
37598
- gap: 0.5
37599
37651
  }, children: [
37600
- /* @__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)(
37601
37667
  import_material22.Skeleton,
37602
37668
  {
37603
37669
  variant: "rectangular",
37604
- width: 160,
37605
- height: 40,
37670
+ width: 140,
37671
+ height: 36,
37606
37672
  sx: {
37607
37673
  borderRadius: 2,
37608
37674
  bgcolor: (theme2) => theme2.palette.mode === "dark" ? "rgba(255,255,255,0.08)" : "rgba(0,0,0,0.08)"
37609
37675
  }
37610
37676
  }
37611
- ),
37612
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_material22.Typography, { variant: "caption", color: "text.disabled", sx: { fontSize: "0.7rem" }, children: "Logo preview" })
37613
- ] }) }),
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
+ ] }),
37614
37681
  /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_material22.Box, { sx: {
37615
37682
  display: "flex",
37616
37683
  flexDirection: "column",
37617
37684
  alignItems: "center",
37618
37685
  width: "100%",
37619
37686
  flex: "0 0 auto",
37620
- gap: 1
37687
+ gap: 0.75
37621
37688
  }, children: [
37622
- /* @__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)(
37623
- import_material22.Skeleton,
37624
- {
37625
- variant: "rectangular",
37626
- width: 80,
37627
- height: 24,
37628
- sx: {
37629
- borderRadius: 2,
37630
- bgcolor: (theme2) => theme2.palette.mode === "dark" ? "rgba(255,255,255,0.05)" : "rgba(0,0,0,0.05)"
37631
- }
37632
- },
37633
- i
37634
- )) }),
37635
- /* @__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?" }) }),
37636
- /* @__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: [
37637
37691
  brandingText ? `${brandingText} \u2022 ` : "Bandit AI \u2022 ",
37638
37692
  "may be wrong \u2014 double-check important info."
37639
37693
  ] })
@@ -37794,7 +37848,7 @@ var BrandingTab = ({
37794
37848
  disabled: saveStatus === "saving",
37795
37849
  color: saveStatus === "saved" ? "success" : saveStatus === "error" ? "error" : "primary",
37796
37850
  sx: { height: 36, fontSize: "0.8rem" },
37797
- 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"
37798
37852
  }
37799
37853
  ) }),
37800
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)(
@@ -43732,6 +43786,7 @@ var Management = () => {
43732
43786
  const [logoFile, setLogoFile] = (0, import_react62.useState)(null);
43733
43787
  const [logoBase64, setLogoBase64] = (0, import_react62.useState)(null);
43734
43788
  const [brandingText, setBrandingText] = (0, import_react62.useState)("");
43789
+ const [headerMode, setHeaderMode] = (0, import_react62.useState)("logo");
43735
43790
  const [theme, setTheme] = (0, import_react62.useState)("bandit-dark");
43736
43791
  const [customAvatarBase64, setCustomAvatarBase64] = (0, import_react62.useState)(null);
43737
43792
  const [presetAvatar, setPresetAvatar] = (0, import_react62.useState)(null);
@@ -43825,6 +43880,7 @@ var Management = () => {
43825
43880
  hasCustomTheme: !!(brandingConfig?.theme && brandingConfig.theme !== "bandit-dark")
43826
43881
  });
43827
43882
  setBrandingText(brandingConfig?.brandingText || "");
43883
+ setHeaderMode(brandingConfig?.headerMode || "logo");
43828
43884
  setTheme(brandingConfig?.theme || "bandit-dark");
43829
43885
  setLogoBase64(brandingConfig?.logoBase64 || null);
43830
43886
  if (brandingConfig?.hasTransparentLogo !== void 0) {
@@ -43850,6 +43906,7 @@ var Management = () => {
43850
43906
  if (cdnBranding) {
43851
43907
  debugLogger.info("Applying CDN branding");
43852
43908
  setBrandingText(cdnBranding.brandingText || "");
43909
+ setHeaderMode(cdnBranding.headerMode || "logo");
43853
43910
  setTheme(cdnBranding.theme || "bandit-dark");
43854
43911
  setLogoBase64(cdnBranding.logoBase64 || null);
43855
43912
  if (cdnBranding.hasTransparentLogo !== void 0) {
@@ -44048,6 +44105,7 @@ var Management = () => {
44048
44105
  branding: {
44049
44106
  logoBase64,
44050
44107
  brandingText,
44108
+ headerMode,
44051
44109
  theme,
44052
44110
  hasTransparentLogo: finalHasTransparentLogo,
44053
44111
  userSaved: true
@@ -44106,6 +44164,7 @@ var Management = () => {
44106
44164
  branding: {
44107
44165
  logoBase64: logoBase64 || "",
44108
44166
  brandingText: brandingText || "",
44167
+ headerMode,
44109
44168
  theme,
44110
44169
  hasTransparentLogo: hasLogo ? await detectTransparency(logoBase64) : false
44111
44170
  },
@@ -44150,6 +44209,7 @@ var Management = () => {
44150
44209
  if (cdnBranding) {
44151
44210
  setLogoBase64(cdnBranding.logoBase64 || null);
44152
44211
  setBrandingText(cdnBranding.brandingText || "");
44212
+ setHeaderMode(cdnBranding.headerMode || "logo");
44153
44213
  setTheme(cdnBranding.theme || "bandit-dark");
44154
44214
  if (cdnBranding.hasTransparentLogo !== void 0) {
44155
44215
  setHasTransparentLogo(cdnBranding.hasTransparentLogo);
@@ -44160,6 +44220,7 @@ var Management = () => {
44160
44220
  } else {
44161
44221
  setLogoBase64(null);
44162
44222
  setBrandingText("");
44223
+ setHeaderMode("logo");
44163
44224
  setTheme("bandit-dark");
44164
44225
  setHasTransparentLogo(true);
44165
44226
  debugLogger.info("Applied Bandit default branding");
@@ -44184,6 +44245,7 @@ var Management = () => {
44184
44245
  } : {
44185
44246
  logoBase64: null,
44186
44247
  brandingText: "",
44248
+ headerMode: "logo",
44187
44249
  theme: "bandit-dark",
44188
44250
  hasTransparentLogo: true,
44189
44251
  userSaved: false
@@ -44283,6 +44345,7 @@ var Management = () => {
44283
44345
  const data = JSON.parse(e.target?.result);
44284
44346
  if (data.branding) {
44285
44347
  setBrandingText(data.branding.brandingText || "");
44348
+ setHeaderMode(data.branding.headerMode || "logo");
44286
44349
  setTheme(data.branding.theme || "Dark");
44287
44350
  setLogoBase64(data.branding.logoBase64 || null);
44288
44351
  setLogoFile(null);
@@ -44927,6 +44990,8 @@ var Management = () => {
44927
44990
  logoBase64,
44928
44991
  brandingText,
44929
44992
  setBrandingText,
44993
+ headerMode,
44994
+ setHeaderMode,
44930
44995
  theme,
44931
44996
  setTheme,
44932
44997
  predefinedThemes,