local-operator-ui 0.1.0 → 0.1.1

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.
@@ -5434,7 +5434,7 @@ const useThemePropsDefault = (inProps) => useThemeProps({
5434
5434
  name: "MuiContainer",
5435
5435
  defaultTheme: defaultTheme$2
5436
5436
  });
5437
- const useUtilityClasses$U = (ownerState, componentName) => {
5437
+ const useUtilityClasses$V = (ownerState, componentName) => {
5438
5438
  const getContainerUtilityClass = (slot) => {
5439
5439
  return generateUtilityClass(componentName, slot);
5440
5440
  };
@@ -5524,7 +5524,7 @@ function createContainer(options = {}) {
5524
5524
  fixed,
5525
5525
  maxWidth: maxWidth2
5526
5526
  };
5527
- const classes = useUtilityClasses$U(ownerState, componentName);
5527
+ const classes = useUtilityClasses$V(ownerState, componentName);
5528
5528
  return (
5529
5529
  // @ts-ignore theme is injected by the styled util
5530
5530
  /* @__PURE__ */ jsxRuntimeExports.jsx(ContainerRoot, {
@@ -6723,7 +6723,7 @@ function getSvgIconUtilityClass(slot) {
6723
6723
  return generateUtilityClass("MuiSvgIcon", slot);
6724
6724
  }
6725
6725
  generateUtilityClasses("MuiSvgIcon", ["root", "colorPrimary", "colorSecondary", "colorAction", "colorError", "colorDisabled", "fontSizeInherit", "fontSizeSmall", "fontSizeMedium", "fontSizeLarge"]);
6726
- const useUtilityClasses$T = (ownerState) => {
6726
+ const useUtilityClasses$U = (ownerState) => {
6727
6727
  const {
6728
6728
  color: color2,
6729
6729
  fontSize,
@@ -6862,7 +6862,7 @@ const SvgIcon = /* @__PURE__ */ reactExports.forwardRef(function SvgIcon2(inProp
6862
6862
  if (!inheritViewBox) {
6863
6863
  more.viewBox = viewBox;
6864
6864
  }
6865
- const classes = useUtilityClasses$T(ownerState);
6865
+ const classes = useUtilityClasses$U(ownerState);
6866
6866
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(SvgIconRoot, {
6867
6867
  as: component,
6868
6868
  className: clsx(classes.root, className),
@@ -14104,7 +14104,7 @@ function getCollapseUtilityClass(slot) {
14104
14104
  return generateUtilityClass("MuiCollapse", slot);
14105
14105
  }
14106
14106
  generateUtilityClasses("MuiCollapse", ["root", "horizontal", "vertical", "entered", "hidden", "wrapper", "wrapperInner"]);
14107
- const useUtilityClasses$S = (ownerState) => {
14107
+ const useUtilityClasses$T = (ownerState) => {
14108
14108
  const {
14109
14109
  orientation,
14110
14110
  classes
@@ -14232,7 +14232,7 @@ const Collapse = /* @__PURE__ */ reactExports.forwardRef(function Collapse2(inPr
14232
14232
  orientation,
14233
14233
  collapsedSize: collapsedSizeProp
14234
14234
  };
14235
- const classes = useUtilityClasses$S(ownerState);
14235
+ const classes = useUtilityClasses$T(ownerState);
14236
14236
  const theme2 = useTheme();
14237
14237
  const timer = useTimeout();
14238
14238
  const wrapperRef = reactExports.useRef(null);
@@ -14393,7 +14393,7 @@ function getPaperUtilityClass(slot) {
14393
14393
  return generateUtilityClass("MuiPaper", slot);
14394
14394
  }
14395
14395
  generateUtilityClasses("MuiPaper", ["root", "rounded", "outlined", "elevation", "elevation0", "elevation1", "elevation2", "elevation3", "elevation4", "elevation5", "elevation6", "elevation7", "elevation8", "elevation9", "elevation10", "elevation11", "elevation12", "elevation13", "elevation14", "elevation15", "elevation16", "elevation17", "elevation18", "elevation19", "elevation20", "elevation21", "elevation22", "elevation23", "elevation24"]);
14396
- const useUtilityClasses$R = (ownerState) => {
14396
+ const useUtilityClasses$S = (ownerState) => {
14397
14397
  const {
14398
14398
  square,
14399
14399
  elevation,
@@ -14465,7 +14465,7 @@ const Paper = /* @__PURE__ */ reactExports.forwardRef(function Paper2(inProps, r
14465
14465
  square,
14466
14466
  variant
14467
14467
  };
14468
- const classes = useUtilityClasses$R(ownerState);
14468
+ const classes = useUtilityClasses$S(ownerState);
14469
14469
  return /* @__PURE__ */ jsxRuntimeExports.jsx(PaperRoot, {
14470
14470
  as: component,
14471
14471
  ownerState,
@@ -14917,7 +14917,7 @@ function getButtonBaseUtilityClass(slot) {
14917
14917
  return generateUtilityClass("MuiButtonBase", slot);
14918
14918
  }
14919
14919
  const buttonBaseClasses = generateUtilityClasses("MuiButtonBase", ["root", "disabled", "focusVisible"]);
14920
- const useUtilityClasses$Q = (ownerState) => {
14920
+ const useUtilityClasses$R = (ownerState) => {
14921
14921
  const {
14922
14922
  disabled: disabled2,
14923
14923
  focusVisible,
@@ -15134,7 +15134,7 @@ const ButtonBase = /* @__PURE__ */ reactExports.forwardRef(function ButtonBase2(
15134
15134
  tabIndex,
15135
15135
  focusVisible
15136
15136
  };
15137
- const classes = useUtilityClasses$Q(ownerState);
15137
+ const classes = useUtilityClasses$R(ownerState);
15138
15138
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(ButtonBaseRoot, {
15139
15139
  as: ComponentProp,
15140
15140
  className: clsx(classes.root, className),
@@ -15232,7 +15232,7 @@ const rotateAnimation = typeof circularRotateKeyframe !== "string" ? css$1`
15232
15232
  const dashAnimation = typeof circularDashKeyframe !== "string" ? css$1`
15233
15233
  animation: ${circularDashKeyframe} 1.4s ease-in-out infinite;
15234
15234
  ` : null;
15235
- const useUtilityClasses$P = (ownerState) => {
15235
+ const useUtilityClasses$Q = (ownerState) => {
15236
15236
  const {
15237
15237
  classes,
15238
15238
  variant,
@@ -15355,7 +15355,7 @@ const CircularProgress = /* @__PURE__ */ reactExports.forwardRef(function Circul
15355
15355
  value,
15356
15356
  variant
15357
15357
  };
15358
- const classes = useUtilityClasses$P(ownerState);
15358
+ const classes = useUtilityClasses$Q(ownerState);
15359
15359
  const circleStyle = {};
15360
15360
  const rootStyle = {};
15361
15361
  const rootProps = {};
@@ -15400,7 +15400,7 @@ function getIconButtonUtilityClass(slot) {
15400
15400
  return generateUtilityClass("MuiIconButton", slot);
15401
15401
  }
15402
15402
  const iconButtonClasses = generateUtilityClasses("MuiIconButton", ["root", "disabled", "colorInherit", "colorPrimary", "colorSecondary", "colorError", "colorInfo", "colorSuccess", "colorWarning", "edgeStart", "edgeEnd", "sizeSmall", "sizeMedium", "sizeLarge", "loading", "loadingIndicator", "loadingWrapper"]);
15403
- const useUtilityClasses$O = (ownerState) => {
15403
+ const useUtilityClasses$P = (ownerState) => {
15404
15404
  const {
15405
15405
  classes,
15406
15406
  disabled: disabled2,
@@ -15586,7 +15586,7 @@ const IconButton = /* @__PURE__ */ reactExports.forwardRef(function IconButton2(
15586
15586
  loadingIndicator,
15587
15587
  size
15588
15588
  };
15589
- const classes = useUtilityClasses$O(ownerState);
15589
+ const classes = useUtilityClasses$P(ownerState);
15590
15590
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(IconButtonRoot, {
15591
15591
  id: loading ? loadingId : idProp,
15592
15592
  className: clsx(classes.root, className),
@@ -15625,7 +15625,7 @@ const InfoOutlinedIcon = createSvgIcon(/* @__PURE__ */ jsxRuntimeExports.jsx("pa
15625
15625
  const ClearIcon = createSvgIcon(/* @__PURE__ */ jsxRuntimeExports.jsx("path", {
15626
15626
  d: "M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"
15627
15627
  }), "Close");
15628
- const useUtilityClasses$N = (ownerState) => {
15628
+ const useUtilityClasses$O = (ownerState) => {
15629
15629
  const {
15630
15630
  variant,
15631
15631
  color: color2,
@@ -15780,7 +15780,7 @@ const Alert = /* @__PURE__ */ reactExports.forwardRef(function Alert2(inProps, r
15780
15780
  variant,
15781
15781
  colorSeverity: color2 || severity
15782
15782
  };
15783
- const classes = useUtilityClasses$N(ownerState);
15783
+ const classes = useUtilityClasses$O(ownerState);
15784
15784
  const externalForwardedProps = {
15785
15785
  slots: {
15786
15786
  closeButton: components.CloseButton,
@@ -15867,7 +15867,7 @@ function getTypographyUtilityClass(slot) {
15867
15867
  return generateUtilityClass("MuiTypography", slot);
15868
15868
  }
15869
15869
  const typographyClasses = generateUtilityClasses("MuiTypography", ["root", "h1", "h2", "h3", "h4", "h5", "h6", "subtitle1", "subtitle2", "body1", "body2", "inherit", "button", "caption", "overline", "alignLeft", "alignRight", "alignCenter", "alignJustify", "noWrap", "gutterBottom", "paragraph"]);
15870
- const v6Colors = {
15870
+ const v6Colors$1 = {
15871
15871
  primary: true,
15872
15872
  secondary: true,
15873
15873
  error: true,
@@ -15879,7 +15879,7 @@ const v6Colors = {
15879
15879
  textDisabled: true
15880
15880
  };
15881
15881
  const extendSxProp = internal_createExtendSxProp();
15882
- const useUtilityClasses$M = (ownerState) => {
15882
+ const useUtilityClasses$N = (ownerState) => {
15883
15883
  const {
15884
15884
  align,
15885
15885
  gutterBottom,
@@ -15988,7 +15988,7 @@ const Typography = /* @__PURE__ */ reactExports.forwardRef(function Typography2(
15988
15988
  props: inProps,
15989
15989
  name: "MuiTypography"
15990
15990
  });
15991
- const isSxColor = !v6Colors[color2];
15991
+ const isSxColor = !v6Colors$1[color2];
15992
15992
  const props = extendSxProp({
15993
15993
  ...themeProps,
15994
15994
  ...isSxColor && {
@@ -16019,7 +16019,7 @@ const Typography = /* @__PURE__ */ reactExports.forwardRef(function Typography2(
16019
16019
  variantMapping
16020
16020
  };
16021
16021
  const Component = component || (paragraph2 ? "p" : variantMapping[variant] || defaultVariantMapping[variant]) || "span";
16022
- const classes = useUtilityClasses$M(ownerState);
16022
+ const classes = useUtilityClasses$N(ownerState);
16023
16023
  return /* @__PURE__ */ jsxRuntimeExports.jsx(TypographyRoot, {
16024
16024
  as: Component,
16025
16025
  ref,
@@ -18304,7 +18304,7 @@ function resolveAnchorEl$1(anchorEl) {
18304
18304
  function isHTMLElement(element2) {
18305
18305
  return element2.nodeType !== void 0;
18306
18306
  }
18307
- const useUtilityClasses$L = (ownerState) => {
18307
+ const useUtilityClasses$M = (ownerState) => {
18308
18308
  const {
18309
18309
  classes
18310
18310
  } = ownerState;
@@ -18405,7 +18405,7 @@ const PopperTooltip = /* @__PURE__ */ reactExports.forwardRef(function PopperToo
18405
18405
  if (TransitionProps !== null) {
18406
18406
  childProps.TransitionProps = TransitionProps;
18407
18407
  }
18408
- const classes = useUtilityClasses$L(props);
18408
+ const classes = useUtilityClasses$M(props);
18409
18409
  const Root = slots.root ?? "div";
18410
18410
  const rootProps = useSlotProps({
18411
18411
  elementType: Root,
@@ -18553,7 +18553,7 @@ function getListSubheaderUtilityClass(slot) {
18553
18553
  return generateUtilityClass("MuiListSubheader", slot);
18554
18554
  }
18555
18555
  generateUtilityClasses("MuiListSubheader", ["root", "colorPrimary", "colorInherit", "gutters", "inset", "sticky"]);
18556
- const useUtilityClasses$K = (ownerState) => {
18556
+ const useUtilityClasses$L = (ownerState) => {
18557
18557
  const {
18558
18558
  classes,
18559
18559
  color: color2,
@@ -18648,7 +18648,7 @@ const ListSubheader = /* @__PURE__ */ reactExports.forwardRef(function ListSubhe
18648
18648
  disableSticky,
18649
18649
  inset
18650
18650
  };
18651
- const classes = useUtilityClasses$K(ownerState);
18651
+ const classes = useUtilityClasses$L(ownerState);
18652
18652
  return /* @__PURE__ */ jsxRuntimeExports.jsx(ListSubheaderRoot, {
18653
18653
  as: component,
18654
18654
  className: clsx(classes.root, className),
@@ -18667,7 +18667,7 @@ function getChipUtilityClass(slot) {
18667
18667
  return generateUtilityClass("MuiChip", slot);
18668
18668
  }
18669
18669
  const chipClasses = generateUtilityClasses("MuiChip", ["root", "sizeSmall", "sizeMedium", "colorDefault", "colorError", "colorInfo", "colorPrimary", "colorSecondary", "colorSuccess", "colorWarning", "disabled", "clickable", "clickableColorPrimary", "clickableColorSecondary", "deletable", "deletableColorPrimary", "deletableColorSecondary", "outlined", "filled", "outlinedPrimary", "outlinedSecondary", "filledPrimary", "filledSecondary", "avatar", "avatarSmall", "avatarMedium", "avatarColorPrimary", "avatarColorSecondary", "icon", "iconSmall", "iconMedium", "iconColorPrimary", "iconColorSecondary", "label", "labelSmall", "labelMedium", "deleteIcon", "deleteIconSmall", "deleteIconMedium", "deleteIconColorPrimary", "deleteIconColorSecondary", "deleteIconOutlinedColorPrimary", "deleteIconOutlinedColorSecondary", "deleteIconFilledColorPrimary", "deleteIconFilledColorSecondary", "focusVisible"]);
18670
- const useUtilityClasses$J = (ownerState) => {
18670
+ const useUtilityClasses$K = (ownerState) => {
18671
18671
  const {
18672
18672
  classes,
18673
18673
  disabled: disabled2,
@@ -19058,7 +19058,7 @@ const Chip = /* @__PURE__ */ reactExports.forwardRef(function Chip2(inProps, ref
19058
19058
  clickable,
19059
19059
  variant
19060
19060
  };
19061
- const classes = useUtilityClasses$J(ownerState);
19061
+ const classes = useUtilityClasses$K(ownerState);
19062
19062
  const moreProps = component === ButtonBase ? {
19063
19063
  component: ComponentProp || "div",
19064
19064
  focusVisibleClassName: classes.focusVisible,
@@ -19315,7 +19315,7 @@ const inputOverridesResolver = (props, styles2) => {
19315
19315
  } = props;
19316
19316
  return [styles2.input, ownerState.size === "small" && styles2.inputSizeSmall, ownerState.multiline && styles2.inputMultiline, ownerState.type === "search" && styles2.inputTypeSearch, ownerState.startAdornment && styles2.inputAdornedStart, ownerState.endAdornment && styles2.inputAdornedEnd, ownerState.hiddenLabel && styles2.inputHiddenLabel];
19317
19317
  };
19318
- const useUtilityClasses$I = (ownerState) => {
19318
+ const useUtilityClasses$J = (ownerState) => {
19319
19319
  const {
19320
19320
  classes,
19321
19321
  color: color2,
@@ -19701,7 +19701,7 @@ const InputBase = /* @__PURE__ */ reactExports.forwardRef(function InputBase2(in
19701
19701
  startAdornment,
19702
19702
  type
19703
19703
  };
19704
- const classes = useUtilityClasses$I(ownerState);
19704
+ const classes = useUtilityClasses$J(ownerState);
19705
19705
  const Root = slots.root || components.Root || InputBaseRoot;
19706
19706
  const rootProps = slotProps.root || componentsProps.root || {};
19707
19707
  const Input3 = slots.input || components.Input || InputBaseInput;
@@ -19794,7 +19794,7 @@ function getAutocompleteUtilityClass(slot) {
19794
19794
  }
19795
19795
  const autocompleteClasses = generateUtilityClasses("MuiAutocomplete", ["root", "expanded", "fullWidth", "focused", "focusVisible", "tag", "tagSizeSmall", "tagSizeMedium", "hasPopupIcon", "hasClearIcon", "inputRoot", "input", "inputFocused", "endAdornment", "clearIndicator", "popupIndicator", "popupIndicatorOpen", "popper", "popperDisablePortal", "paper", "listbox", "loading", "noOptions", "option", "groupLabel", "groupUl"]);
19796
19796
  var _ClearIcon, _ArrowDropDownIcon;
19797
- const useUtilityClasses$H = (ownerState) => {
19797
+ const useUtilityClasses$I = (ownerState) => {
19798
19798
  const {
19799
19799
  classes,
19800
19800
  disablePortal,
@@ -20290,7 +20290,7 @@ const Autocomplete = /* @__PURE__ */ reactExports.forwardRef(function Autocomple
20290
20290
  popupOpen,
20291
20291
  size
20292
20292
  };
20293
- const classes = useUtilityClasses$H(ownerState);
20293
+ const classes = useUtilityClasses$I(ownerState);
20294
20294
  const externalForwardedProps = {
20295
20295
  slots: {
20296
20296
  paper: PaperComponentProp,
@@ -20505,7 +20505,7 @@ function getAvatarUtilityClass(slot) {
20505
20505
  return generateUtilityClass("MuiAvatar", slot);
20506
20506
  }
20507
20507
  generateUtilityClasses("MuiAvatar", ["root", "colorDefault", "circular", "rounded", "square", "img", "fallback"]);
20508
- const useUtilityClasses$G = (ownerState) => {
20508
+ const useUtilityClasses$H = (ownerState) => {
20509
20509
  const {
20510
20510
  classes,
20511
20511
  variant,
@@ -20670,7 +20670,7 @@ const Avatar = /* @__PURE__ */ reactExports.forwardRef(function Avatar2(inProps,
20670
20670
  const hasImgNotFailing = hasImg && loaded2 !== "error";
20671
20671
  ownerState.colorDefault = !hasImgNotFailing;
20672
20672
  delete ownerState.ownerState;
20673
- const classes = useUtilityClasses$G(ownerState);
20673
+ const classes = useUtilityClasses$H(ownerState);
20674
20674
  const [ImgSlot, imgSlotProps] = useSlot("img", {
20675
20675
  className: classes.img,
20676
20676
  elementType: AvatarImg,
@@ -20831,7 +20831,7 @@ function getBackdropUtilityClass(slot) {
20831
20831
  return generateUtilityClass("MuiBackdrop", slot);
20832
20832
  }
20833
20833
  generateUtilityClasses("MuiBackdrop", ["root", "invisible"]);
20834
- const useUtilityClasses$F = (ownerState) => {
20834
+ const useUtilityClasses$G = (ownerState) => {
20835
20835
  const {
20836
20836
  classes,
20837
20837
  invisible
@@ -20894,7 +20894,7 @@ const Backdrop = /* @__PURE__ */ reactExports.forwardRef(function Backdrop2(inPr
20894
20894
  component,
20895
20895
  invisible
20896
20896
  };
20897
- const classes = useUtilityClasses$F(ownerState);
20897
+ const classes = useUtilityClasses$G(ownerState);
20898
20898
  const backwardCompatibleSlots = {
20899
20899
  transition: TransitionComponentProp,
20900
20900
  root: components.Root,
@@ -20947,7 +20947,7 @@ function getButtonUtilityClass(slot) {
20947
20947
  const buttonClasses = generateUtilityClasses("MuiButton", ["root", "text", "textInherit", "textPrimary", "textSecondary", "textSuccess", "textError", "textInfo", "textWarning", "outlined", "outlinedInherit", "outlinedPrimary", "outlinedSecondary", "outlinedSuccess", "outlinedError", "outlinedInfo", "outlinedWarning", "contained", "containedInherit", "containedPrimary", "containedSecondary", "containedSuccess", "containedError", "containedInfo", "containedWarning", "disableElevation", "focusVisible", "disabled", "colorInherit", "colorPrimary", "colorSecondary", "colorSuccess", "colorError", "colorInfo", "colorWarning", "textSizeSmall", "textSizeMedium", "textSizeLarge", "outlinedSizeSmall", "outlinedSizeMedium", "outlinedSizeLarge", "containedSizeSmall", "containedSizeMedium", "containedSizeLarge", "sizeMedium", "sizeSmall", "sizeLarge", "fullWidth", "startIcon", "endIcon", "icon", "iconSizeSmall", "iconSizeMedium", "iconSizeLarge", "loading", "loadingWrapper", "loadingIconPlaceholder", "loadingIndicator", "loadingPositionCenter", "loadingPositionStart", "loadingPositionEnd"]);
20948
20948
  const ButtonGroupContext = /* @__PURE__ */ reactExports.createContext({});
20949
20949
  const ButtonGroupButtonContext = /* @__PURE__ */ reactExports.createContext(void 0);
20950
- const useUtilityClasses$E = (ownerState) => {
20950
+ const useUtilityClasses$F = (ownerState) => {
20951
20951
  const {
20952
20952
  color: color2,
20953
20953
  disableElevation,
@@ -21449,7 +21449,7 @@ const Button = /* @__PURE__ */ reactExports.forwardRef(function Button2(inProps,
21449
21449
  type,
21450
21450
  variant
21451
21451
  };
21452
- const classes = useUtilityClasses$E(ownerState);
21452
+ const classes = useUtilityClasses$F(ownerState);
21453
21453
  const startIcon = (startIconProp || loading && loadingPosition === "start") && /* @__PURE__ */ jsxRuntimeExports.jsx(ButtonStartIcon, {
21454
21454
  className: classes.startIcon,
21455
21455
  ownerState,
@@ -21500,7 +21500,7 @@ function getCardUtilityClass(slot) {
21500
21500
  return generateUtilityClass("MuiCard", slot);
21501
21501
  }
21502
21502
  generateUtilityClasses("MuiCard", ["root"]);
21503
- const useUtilityClasses$D = (ownerState) => {
21503
+ const useUtilityClasses$E = (ownerState) => {
21504
21504
  const {
21505
21505
  classes
21506
21506
  } = ownerState;
@@ -21530,7 +21530,7 @@ const Card = /* @__PURE__ */ reactExports.forwardRef(function Card2(inProps, ref
21530
21530
  ...props,
21531
21531
  raised
21532
21532
  };
21533
- const classes = useUtilityClasses$D(ownerState);
21533
+ const classes = useUtilityClasses$E(ownerState);
21534
21534
  return /* @__PURE__ */ jsxRuntimeExports.jsx(CardRoot, {
21535
21535
  className: clsx(classes.root, className),
21536
21536
  elevation: raised ? 8 : void 0,
@@ -21543,7 +21543,7 @@ function getCardContentUtilityClass(slot) {
21543
21543
  return generateUtilityClass("MuiCardContent", slot);
21544
21544
  }
21545
21545
  generateUtilityClasses("MuiCardContent", ["root"]);
21546
- const useUtilityClasses$C = (ownerState) => {
21546
+ const useUtilityClasses$D = (ownerState) => {
21547
21547
  const {
21548
21548
  classes
21549
21549
  } = ownerState;
@@ -21576,7 +21576,7 @@ const CardContent = /* @__PURE__ */ reactExports.forwardRef(function CardContent
21576
21576
  ...props,
21577
21577
  component
21578
21578
  };
21579
- const classes = useUtilityClasses$C(ownerState);
21579
+ const classes = useUtilityClasses$D(ownerState);
21580
21580
  return /* @__PURE__ */ jsxRuntimeExports.jsx(CardContentRoot, {
21581
21581
  as: component,
21582
21582
  className: clsx(classes.root, className),
@@ -21589,7 +21589,7 @@ function getSwitchBaseUtilityClass(slot) {
21589
21589
  return generateUtilityClass("PrivateSwitchBase", slot);
21590
21590
  }
21591
21591
  generateUtilityClasses("PrivateSwitchBase", ["root", "checked", "disabled", "input", "edgeStart", "edgeEnd"]);
21592
- const useUtilityClasses$B = (ownerState) => {
21592
+ const useUtilityClasses$C = (ownerState) => {
21593
21593
  const {
21594
21594
  classes,
21595
21595
  checked,
@@ -21726,7 +21726,7 @@ const SwitchBase = /* @__PURE__ */ reactExports.forwardRef(function SwitchBase2(
21726
21726
  disableFocusRipple,
21727
21727
  edge
21728
21728
  };
21729
- const classes = useUtilityClasses$B(ownerState);
21729
+ const classes = useUtilityClasses$C(ownerState);
21730
21730
  const externalForwardedProps = {
21731
21731
  slots,
21732
21732
  slotProps: {
@@ -22594,7 +22594,7 @@ function getModalUtilityClass(slot) {
22594
22594
  return generateUtilityClass("MuiModal", slot);
22595
22595
  }
22596
22596
  generateUtilityClasses("MuiModal", ["root", "hidden", "backdrop"]);
22597
- const useUtilityClasses$A = (ownerState) => {
22597
+ const useUtilityClasses$B = (ownerState) => {
22598
22598
  const {
22599
22599
  open,
22600
22600
  exited,
@@ -22705,7 +22705,7 @@ const Modal = /* @__PURE__ */ reactExports.forwardRef(function Modal2(inProps, r
22705
22705
  ...propsWithDefaults,
22706
22706
  exited
22707
22707
  };
22708
- const classes = useUtilityClasses$A(ownerState);
22708
+ const classes = useUtilityClasses$B(ownerState);
22709
22709
  const childProps = {};
22710
22710
  if (children.props.tabIndex === void 0) {
22711
22711
  childProps.tabIndex = "-1";
@@ -22798,7 +22798,7 @@ const DialogBackdrop = styled(Backdrop, {
22798
22798
  // Improve scrollable dialog support.
22799
22799
  zIndex: -1
22800
22800
  });
22801
- const useUtilityClasses$z = (ownerState) => {
22801
+ const useUtilityClasses$A = (ownerState) => {
22802
22802
  const {
22803
22803
  classes,
22804
22804
  scroll,
@@ -23003,7 +23003,7 @@ const Dialog = /* @__PURE__ */ reactExports.forwardRef(function Dialog2(inProps,
23003
23003
  maxWidth: maxWidth2,
23004
23004
  scroll
23005
23005
  };
23006
- const classes = useUtilityClasses$z(ownerState);
23006
+ const classes = useUtilityClasses$A(ownerState);
23007
23007
  const backdropClick = reactExports.useRef();
23008
23008
  const handleMouseDown = (event) => {
23009
23009
  backdropClick.current = event.target === event.currentTarget;
@@ -23125,7 +23125,7 @@ function getDialogActionsUtilityClass(slot) {
23125
23125
  return generateUtilityClass("MuiDialogActions", slot);
23126
23126
  }
23127
23127
  generateUtilityClasses("MuiDialogActions", ["root", "spacing"]);
23128
- const useUtilityClasses$y = (ownerState) => {
23128
+ const useUtilityClasses$z = (ownerState) => {
23129
23129
  const {
23130
23130
  classes,
23131
23131
  disableSpacing
@@ -23175,7 +23175,7 @@ const DialogActions = /* @__PURE__ */ reactExports.forwardRef(function DialogAct
23175
23175
  ...props,
23176
23176
  disableSpacing
23177
23177
  };
23178
- const classes = useUtilityClasses$y(ownerState);
23178
+ const classes = useUtilityClasses$z(ownerState);
23179
23179
  return /* @__PURE__ */ jsxRuntimeExports.jsx(DialogActionsRoot, {
23180
23180
  className: clsx(classes.root, className),
23181
23181
  ownerState,
@@ -23191,7 +23191,7 @@ function getDialogTitleUtilityClass(slot) {
23191
23191
  return generateUtilityClass("MuiDialogTitle", slot);
23192
23192
  }
23193
23193
  const dialogTitleClasses = generateUtilityClasses("MuiDialogTitle", ["root"]);
23194
- const useUtilityClasses$x = (ownerState) => {
23194
+ const useUtilityClasses$y = (ownerState) => {
23195
23195
  const {
23196
23196
  classes,
23197
23197
  dividers
@@ -23252,7 +23252,7 @@ const DialogContent = /* @__PURE__ */ reactExports.forwardRef(function DialogCon
23252
23252
  ...props,
23253
23253
  dividers
23254
23254
  };
23255
- const classes = useUtilityClasses$x(ownerState);
23255
+ const classes = useUtilityClasses$y(ownerState);
23256
23256
  return /* @__PURE__ */ jsxRuntimeExports.jsx(DialogContentRoot, {
23257
23257
  className: clsx(classes.root, className),
23258
23258
  ownerState,
@@ -23264,7 +23264,7 @@ function getDialogContentTextUtilityClass(slot) {
23264
23264
  return generateUtilityClass("MuiDialogContentText", slot);
23265
23265
  }
23266
23266
  generateUtilityClasses("MuiDialogContentText", ["root"]);
23267
- const useUtilityClasses$w = (ownerState) => {
23267
+ const useUtilityClasses$x = (ownerState) => {
23268
23268
  const {
23269
23269
  classes
23270
23270
  } = ownerState;
@@ -23294,7 +23294,7 @@ const DialogContentText = /* @__PURE__ */ reactExports.forwardRef(function Dialo
23294
23294
  className,
23295
23295
  ...ownerState
23296
23296
  } = props;
23297
- const classes = useUtilityClasses$w(ownerState);
23297
+ const classes = useUtilityClasses$x(ownerState);
23298
23298
  return /* @__PURE__ */ jsxRuntimeExports.jsx(DialogContentTextRoot, {
23299
23299
  component: "p",
23300
23300
  variant: "body1",
@@ -23306,7 +23306,7 @@ const DialogContentText = /* @__PURE__ */ reactExports.forwardRef(function Dialo
23306
23306
  classes
23307
23307
  });
23308
23308
  });
23309
- const useUtilityClasses$v = (ownerState) => {
23309
+ const useUtilityClasses$w = (ownerState) => {
23310
23310
  const {
23311
23311
  classes
23312
23312
  } = ownerState;
@@ -23334,7 +23334,7 @@ const DialogTitle = /* @__PURE__ */ reactExports.forwardRef(function DialogTitle
23334
23334
  ...other
23335
23335
  } = props;
23336
23336
  const ownerState = props;
23337
- const classes = useUtilityClasses$v(ownerState);
23337
+ const classes = useUtilityClasses$w(ownerState);
23338
23338
  const {
23339
23339
  titleId = idProp
23340
23340
  } = reactExports.useContext(DialogContext);
@@ -23352,7 +23352,7 @@ function getDividerUtilityClass(slot) {
23352
23352
  return generateUtilityClass("MuiDivider", slot);
23353
23353
  }
23354
23354
  const dividerClasses = generateUtilityClasses("MuiDivider", ["root", "absolute", "fullWidth", "inset", "middle", "flexItem", "light", "vertical", "withChildren", "withChildrenVertical", "textAlignRight", "textAlignLeft", "wrapper", "wrapperVertical"]);
23355
- const useUtilityClasses$u = (ownerState) => {
23355
+ const useUtilityClasses$v = (ownerState) => {
23356
23356
  const {
23357
23357
  absolute,
23358
23358
  children,
@@ -23566,7 +23566,7 @@ const Divider = /* @__PURE__ */ reactExports.forwardRef(function Divider2(inProp
23566
23566
  textAlign,
23567
23567
  variant
23568
23568
  };
23569
- const classes = useUtilityClasses$u(ownerState);
23569
+ const classes = useUtilityClasses$v(ownerState);
23570
23570
  return /* @__PURE__ */ jsxRuntimeExports.jsx(DividerRoot, {
23571
23571
  as: component,
23572
23572
  className: clsx(classes.root, className),
@@ -23799,7 +23799,7 @@ const overridesResolver$4 = (props, styles2) => {
23799
23799
  } = props;
23800
23800
  return [styles2.root, (ownerState.variant === "permanent" || ownerState.variant === "persistent") && styles2.docked, styles2.modal];
23801
23801
  };
23802
- const useUtilityClasses$t = (ownerState) => {
23802
+ const useUtilityClasses$u = (ownerState) => {
23803
23803
  const {
23804
23804
  classes,
23805
23805
  anchor,
@@ -23989,7 +23989,7 @@ const Drawer = /* @__PURE__ */ reactExports.forwardRef(function Drawer2(inProps,
23989
23989
  variant,
23990
23990
  ...other
23991
23991
  };
23992
- const classes = useUtilityClasses$t(ownerState);
23992
+ const classes = useUtilityClasses$u(ownerState);
23993
23993
  const externalForwardedProps = {
23994
23994
  slots: {
23995
23995
  transition: TransitionComponent,
@@ -24086,7 +24086,7 @@ const Drawer = /* @__PURE__ */ reactExports.forwardRef(function Drawer2(inProps,
24086
24086
  children: slidingDrawer
24087
24087
  });
24088
24088
  });
24089
- const useUtilityClasses$s = (ownerState) => {
24089
+ const useUtilityClasses$t = (ownerState) => {
24090
24090
  const {
24091
24091
  classes,
24092
24092
  disableUnderline,
@@ -24365,7 +24365,7 @@ const FilledInput = /* @__PURE__ */ reactExports.forwardRef(function FilledInput
24365
24365
  multiline,
24366
24366
  type
24367
24367
  };
24368
- const classes = useUtilityClasses$s(props);
24368
+ const classes = useUtilityClasses$t(props);
24369
24369
  const filledInputComponentsProps = {
24370
24370
  root: {
24371
24371
  ownerState
@@ -24397,7 +24397,7 @@ function getFormControlUtilityClasses(slot) {
24397
24397
  return generateUtilityClass("MuiFormControl", slot);
24398
24398
  }
24399
24399
  generateUtilityClasses("MuiFormControl", ["root", "marginNone", "marginNormal", "marginDense", "fullWidth", "disabled"]);
24400
- const useUtilityClasses$r = (ownerState) => {
24400
+ const useUtilityClasses$s = (ownerState) => {
24401
24401
  const {
24402
24402
  classes,
24403
24403
  margin: margin2,
@@ -24487,7 +24487,7 @@ const FormControl = /* @__PURE__ */ reactExports.forwardRef(function FormControl
24487
24487
  size,
24488
24488
  variant
24489
24489
  };
24490
- const classes = useUtilityClasses$r(ownerState);
24490
+ const classes = useUtilityClasses$s(ownerState);
24491
24491
  const [adornedStart, setAdornedStart] = reactExports.useState(() => {
24492
24492
  let initialAdornedStart = false;
24493
24493
  if (children) {
@@ -24572,7 +24572,7 @@ function getFormHelperTextUtilityClasses(slot) {
24572
24572
  }
24573
24573
  const formHelperTextClasses = generateUtilityClasses("MuiFormHelperText", ["root", "error", "disabled", "sizeSmall", "sizeMedium", "contained", "focused", "filled", "required"]);
24574
24574
  var _span$3;
24575
- const useUtilityClasses$q = (ownerState) => {
24575
+ const useUtilityClasses$r = (ownerState) => {
24576
24576
  const {
24577
24577
  classes,
24578
24578
  contained,
@@ -24667,7 +24667,7 @@ const FormHelperText = /* @__PURE__ */ reactExports.forwardRef(function FormHelp
24667
24667
  required: fcs.required
24668
24668
  };
24669
24669
  delete ownerState.ownerState;
24670
- const classes = useUtilityClasses$q(ownerState);
24670
+ const classes = useUtilityClasses$r(ownerState);
24671
24671
  return /* @__PURE__ */ jsxRuntimeExports.jsx(FormHelperTextRoot, {
24672
24672
  as: component,
24673
24673
  className: clsx(classes.root, className),
@@ -24688,7 +24688,7 @@ function getFormLabelUtilityClasses(slot) {
24688
24688
  return generateUtilityClass("MuiFormLabel", slot);
24689
24689
  }
24690
24690
  const formLabelClasses = generateUtilityClasses("MuiFormLabel", ["root", "colorSecondary", "focused", "disabled", "error", "filled", "required", "asterisk"]);
24691
- const useUtilityClasses$p = (ownerState) => {
24691
+ const useUtilityClasses$q = (ownerState) => {
24692
24692
  const {
24693
24693
  classes,
24694
24694
  color: color2,
@@ -24786,7 +24786,7 @@ const FormLabel = /* @__PURE__ */ reactExports.forwardRef(function FormLabel2(in
24786
24786
  focused: fcs.focused,
24787
24787
  required: fcs.required
24788
24788
  };
24789
- const classes = useUtilityClasses$p(ownerState);
24789
+ const classes = useUtilityClasses$q(ownerState);
24790
24790
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(FormLabelRoot, {
24791
24791
  as: component,
24792
24792
  ownerState,
@@ -25114,7 +25114,7 @@ function resolveSpacingClasses(spacing, breakpoints) {
25114
25114
  });
25115
25115
  return classes;
25116
25116
  }
25117
- const useUtilityClasses$o = (ownerState) => {
25117
+ const useUtilityClasses$p = (ownerState) => {
25118
25118
  const {
25119
25119
  classes,
25120
25120
  container,
@@ -25192,7 +25192,7 @@ const Grid = /* @__PURE__ */ reactExports.forwardRef(function Grid2(inProps, ref
25192
25192
  ...breakpointsValues,
25193
25193
  breakpoints: breakpoints.keys
25194
25194
  };
25195
- const classes = useUtilityClasses$o(ownerState);
25195
+ const classes = useUtilityClasses$p(ownerState);
25196
25196
  return /* @__PURE__ */ jsxRuntimeExports.jsx(GridContext.Provider, {
25197
25197
  value: columns,
25198
25198
  children: /* @__PURE__ */ jsxRuntimeExports.jsx(GridRoot, {
@@ -25364,7 +25364,7 @@ const Grow = /* @__PURE__ */ reactExports.forwardRef(function Grow2(props, ref)
25364
25364
  if (Grow) {
25365
25365
  Grow.muiSupportAuto = true;
25366
25366
  }
25367
- const useUtilityClasses$n = (ownerState) => {
25367
+ const useUtilityClasses$o = (ownerState) => {
25368
25368
  const {
25369
25369
  classes,
25370
25370
  disableUnderline
@@ -25497,7 +25497,7 @@ const Input = /* @__PURE__ */ reactExports.forwardRef(function Input2(inProps, r
25497
25497
  type = "text",
25498
25498
  ...other
25499
25499
  } = props;
25500
- const classes = useUtilityClasses$n(props);
25500
+ const classes = useUtilityClasses$o(props);
25501
25501
  const ownerState = {
25502
25502
  disableUnderline
25503
25503
  };
@@ -25536,7 +25536,7 @@ const overridesResolver$3 = (props, styles2) => {
25536
25536
  } = props;
25537
25537
  return [styles2.root, styles2[`position${capitalize$1(ownerState.position)}`], ownerState.disablePointerEvents === true && styles2.disablePointerEvents, styles2[ownerState.variant]];
25538
25538
  };
25539
- const useUtilityClasses$m = (ownerState) => {
25539
+ const useUtilityClasses$n = (ownerState) => {
25540
25540
  const {
25541
25541
  classes,
25542
25542
  disablePointerEvents,
@@ -25623,7 +25623,7 @@ const InputAdornment = /* @__PURE__ */ reactExports.forwardRef(function InputAdo
25623
25623
  position: position2,
25624
25624
  variant
25625
25625
  };
25626
- const classes = useUtilityClasses$m(ownerState);
25626
+ const classes = useUtilityClasses$n(ownerState);
25627
25627
  return /* @__PURE__ */ jsxRuntimeExports.jsx(FormControlContext.Provider, {
25628
25628
  value: null,
25629
25629
  children: /* @__PURE__ */ jsxRuntimeExports.jsx(InputAdornmentRoot, {
@@ -25652,7 +25652,7 @@ function getInputLabelUtilityClasses(slot) {
25652
25652
  return generateUtilityClass("MuiInputLabel", slot);
25653
25653
  }
25654
25654
  generateUtilityClasses("MuiInputLabel", ["root", "focused", "disabled", "error", "required", "asterisk", "formControl", "sizeSmall", "shrink", "animated", "standard", "filled", "outlined"]);
25655
- const useUtilityClasses$l = (ownerState) => {
25655
+ const useUtilityClasses$m = (ownerState) => {
25656
25656
  const {
25657
25657
  classes,
25658
25658
  formControl,
@@ -25841,7 +25841,7 @@ const InputLabel = /* @__PURE__ */ reactExports.forwardRef(function InputLabel2(
25841
25841
  required: fcs.required,
25842
25842
  focused: fcs.focused
25843
25843
  };
25844
- const classes = useUtilityClasses$l(ownerState);
25844
+ const classes = useUtilityClasses$m(ownerState);
25845
25845
  return /* @__PURE__ */ jsxRuntimeExports.jsx(InputLabelRoot, {
25846
25846
  "data-shrink": shrink,
25847
25847
  ref,
@@ -25851,6 +25851,229 @@ const InputLabel = /* @__PURE__ */ reactExports.forwardRef(function InputLabel2(
25851
25851
  classes
25852
25852
  });
25853
25853
  });
25854
+ function getLinkUtilityClass(slot) {
25855
+ return generateUtilityClass("MuiLink", slot);
25856
+ }
25857
+ const linkClasses = generateUtilityClasses("MuiLink", ["root", "underlineNone", "underlineHover", "underlineAlways", "button", "focusVisible"]);
25858
+ const getTextDecoration = ({
25859
+ theme: theme2,
25860
+ ownerState
25861
+ }) => {
25862
+ const transformedColor = ownerState.color;
25863
+ const color2 = getPath(theme2, `palette.${transformedColor}.main`, false) || getPath(theme2, `palette.${transformedColor}`, false) || ownerState.color;
25864
+ const channelColor = getPath(theme2, `palette.${transformedColor}.mainChannel`) || getPath(theme2, `palette.${transformedColor}Channel`);
25865
+ if ("vars" in theme2 && channelColor) {
25866
+ return `rgba(${channelColor} / 0.4)`;
25867
+ }
25868
+ return alpha(color2, 0.4);
25869
+ };
25870
+ const v6Colors = {
25871
+ primary: true,
25872
+ secondary: true,
25873
+ error: true,
25874
+ info: true,
25875
+ success: true,
25876
+ warning: true,
25877
+ textPrimary: true,
25878
+ textSecondary: true,
25879
+ textDisabled: true
25880
+ };
25881
+ const useUtilityClasses$l = (ownerState) => {
25882
+ const {
25883
+ classes,
25884
+ component,
25885
+ focusVisible,
25886
+ underline
25887
+ } = ownerState;
25888
+ const slots = {
25889
+ root: ["root", `underline${capitalize$1(underline)}`, component === "button" && "button", focusVisible && "focusVisible"]
25890
+ };
25891
+ return composeClasses(slots, getLinkUtilityClass, classes);
25892
+ };
25893
+ const LinkRoot = styled(Typography, {
25894
+ name: "MuiLink",
25895
+ slot: "Root",
25896
+ overridesResolver: (props, styles2) => {
25897
+ const {
25898
+ ownerState
25899
+ } = props;
25900
+ return [styles2.root, styles2[`underline${capitalize$1(ownerState.underline)}`], ownerState.component === "button" && styles2.button];
25901
+ }
25902
+ })(memoTheme(({
25903
+ theme: theme2
25904
+ }) => {
25905
+ return {
25906
+ variants: [{
25907
+ props: {
25908
+ underline: "none"
25909
+ },
25910
+ style: {
25911
+ textDecoration: "none"
25912
+ }
25913
+ }, {
25914
+ props: {
25915
+ underline: "hover"
25916
+ },
25917
+ style: {
25918
+ textDecoration: "none",
25919
+ "&:hover": {
25920
+ textDecoration: "underline"
25921
+ }
25922
+ }
25923
+ }, {
25924
+ props: {
25925
+ underline: "always"
25926
+ },
25927
+ style: {
25928
+ textDecoration: "underline",
25929
+ "&:hover": {
25930
+ textDecorationColor: "inherit"
25931
+ }
25932
+ }
25933
+ }, {
25934
+ props: ({
25935
+ underline,
25936
+ ownerState
25937
+ }) => underline === "always" && ownerState.color !== "inherit",
25938
+ style: {
25939
+ textDecorationColor: "var(--Link-underlineColor)"
25940
+ }
25941
+ }, ...Object.entries(theme2.palette).filter(createSimplePaletteValueFilter()).map(([color2]) => ({
25942
+ props: {
25943
+ underline: "always",
25944
+ color: color2
25945
+ },
25946
+ style: {
25947
+ "--Link-underlineColor": theme2.vars ? `rgba(${theme2.vars.palette[color2].mainChannel} / 0.4)` : alpha(theme2.palette[color2].main, 0.4)
25948
+ }
25949
+ })), {
25950
+ props: {
25951
+ underline: "always",
25952
+ color: "textPrimary"
25953
+ },
25954
+ style: {
25955
+ "--Link-underlineColor": theme2.vars ? `rgba(${theme2.vars.palette.text.primaryChannel} / 0.4)` : alpha(theme2.palette.text.primary, 0.4)
25956
+ }
25957
+ }, {
25958
+ props: {
25959
+ underline: "always",
25960
+ color: "textSecondary"
25961
+ },
25962
+ style: {
25963
+ "--Link-underlineColor": theme2.vars ? `rgba(${theme2.vars.palette.text.secondaryChannel} / 0.4)` : alpha(theme2.palette.text.secondary, 0.4)
25964
+ }
25965
+ }, {
25966
+ props: {
25967
+ underline: "always",
25968
+ color: "textDisabled"
25969
+ },
25970
+ style: {
25971
+ "--Link-underlineColor": (theme2.vars || theme2).palette.text.disabled
25972
+ }
25973
+ }, {
25974
+ props: {
25975
+ component: "button"
25976
+ },
25977
+ style: {
25978
+ position: "relative",
25979
+ WebkitTapHighlightColor: "transparent",
25980
+ backgroundColor: "transparent",
25981
+ // Reset default value
25982
+ // We disable the focus ring for mouse, touch and keyboard users.
25983
+ outline: 0,
25984
+ border: 0,
25985
+ margin: 0,
25986
+ // Remove the margin in Safari
25987
+ borderRadius: 0,
25988
+ padding: 0,
25989
+ // Remove the padding in Firefox
25990
+ cursor: "pointer",
25991
+ userSelect: "none",
25992
+ verticalAlign: "middle",
25993
+ MozAppearance: "none",
25994
+ // Reset
25995
+ WebkitAppearance: "none",
25996
+ // Reset
25997
+ "&::-moz-focus-inner": {
25998
+ borderStyle: "none"
25999
+ // Remove Firefox dotted outline.
26000
+ },
26001
+ [`&.${linkClasses.focusVisible}`]: {
26002
+ outline: "auto"
26003
+ }
26004
+ }
26005
+ }]
26006
+ };
26007
+ }));
26008
+ const Link = /* @__PURE__ */ reactExports.forwardRef(function Link2(inProps, ref) {
26009
+ const props = useDefaultProps({
26010
+ props: inProps,
26011
+ name: "MuiLink"
26012
+ });
26013
+ const theme2 = useTheme();
26014
+ const {
26015
+ className,
26016
+ color: color2 = "primary",
26017
+ component = "a",
26018
+ onBlur,
26019
+ onFocus,
26020
+ TypographyClasses,
26021
+ underline = "always",
26022
+ variant = "inherit",
26023
+ sx,
26024
+ ...other
26025
+ } = props;
26026
+ const [focusVisible, setFocusVisible] = reactExports.useState(false);
26027
+ const handleBlur = (event) => {
26028
+ if (!isFocusVisible(event.target)) {
26029
+ setFocusVisible(false);
26030
+ }
26031
+ if (onBlur) {
26032
+ onBlur(event);
26033
+ }
26034
+ };
26035
+ const handleFocus = (event) => {
26036
+ if (isFocusVisible(event.target)) {
26037
+ setFocusVisible(true);
26038
+ }
26039
+ if (onFocus) {
26040
+ onFocus(event);
26041
+ }
26042
+ };
26043
+ const ownerState = {
26044
+ ...props,
26045
+ color: color2,
26046
+ component,
26047
+ focusVisible,
26048
+ underline,
26049
+ variant
26050
+ };
26051
+ const classes = useUtilityClasses$l(ownerState);
26052
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(LinkRoot, {
26053
+ color: color2,
26054
+ className: clsx(classes.root, className),
26055
+ classes: TypographyClasses,
26056
+ component,
26057
+ onBlur: handleBlur,
26058
+ onFocus: handleFocus,
26059
+ ref,
26060
+ ownerState,
26061
+ variant,
26062
+ ...other,
26063
+ sx: [...v6Colors[color2] === void 0 ? [{
26064
+ color: color2
26065
+ }] : [], ...Array.isArray(sx) ? sx : [sx]],
26066
+ style: {
26067
+ ...other.style,
26068
+ ...underline === "always" && color2 !== "inherit" && !v6Colors[color2] && {
26069
+ "--Link-underlineColor": getTextDecoration({
26070
+ theme: theme2,
26071
+ ownerState
26072
+ })
26073
+ }
26074
+ }
26075
+ });
26076
+ });
25854
26077
  const ListContext = /* @__PURE__ */ reactExports.createContext({});
25855
26078
  function getListUtilityClass(slot) {
25856
26079
  return generateUtilityClass("MuiList", slot);
@@ -52564,6 +52787,18 @@ const ModelsApi = {
52564
52787
  listProviders,
52565
52788
  listModels
52566
52789
  };
52790
+ const getImageUrl = (baseUrl, imagePath) => {
52791
+ const normalizedBaseUrl = baseUrl.endsWith("/") ? baseUrl.slice(0, -1) : baseUrl;
52792
+ let normalizedPath = imagePath;
52793
+ if (normalizedPath.startsWith("file://")) {
52794
+ normalizedPath = normalizedPath.substring(7);
52795
+ }
52796
+ const encodedPath = encodeURIComponent(normalizedPath);
52797
+ return `${normalizedBaseUrl}/v1/static/images?path=${encodedPath}`;
52798
+ };
52799
+ const StaticApi = {
52800
+ getImageUrl
52801
+ };
52567
52802
  class LocalOperatorClient {
52568
52803
  baseUrl;
52569
52804
  /**
@@ -52616,6 +52851,12 @@ class LocalOperatorClient {
52616
52851
  get models() {
52617
52852
  return this.bindBaseUrlToApi(ModelsApi);
52618
52853
  }
52854
+ /**
52855
+ * Get the Static API client with methods bound to the base URL
52856
+ */
52857
+ get static() {
52858
+ return this.bindBaseUrlToApi(StaticApi);
52859
+ }
52619
52860
  /**
52620
52861
  * Bind the base URL to all methods of an API client
52621
52862
  *
@@ -56959,7 +57200,8 @@ const convertToMessage = (record) => {
56959
57200
  stdout: record.stdout,
56960
57201
  stderr: record.stderr,
56961
57202
  logging: record.logging,
56962
- timestamp: record.timestamp ? new Date(record.timestamp) : /* @__PURE__ */ new Date()
57203
+ timestamp: record.timestamp ? new Date(record.timestamp) : /* @__PURE__ */ new Date(),
57204
+ files: record.files
56963
57205
  };
56964
57206
  };
56965
57207
  const useConversationMessages = (conversationId, pageSize2 = 20) => {
@@ -57368,13 +57610,14 @@ const useJobPolling = ({
57368
57610
  checkForActiveJobs
57369
57611
  };
57370
57612
  };
57371
- const useScrollToBottom = (dependencies = [], threshold = 300, screenHeightThreshold = 1) => {
57613
+ const useScrollToBottom = (dependencies = [], threshold = 300, buttonThreshold = 50) => {
57372
57614
  const ref = reactExports.useRef(null);
57373
57615
  const containerRef = reactExports.useRef(null);
57374
57616
  const [shouldScrollToBottom, setShouldScrollToBottom] = reactExports.useState(true);
57375
57617
  const [isFarFromBottom, setIsFarFromBottom] = reactExports.useState(false);
57376
57618
  const lastScrollPositionRef = reactExports.useRef(0);
57377
57619
  const scrollTimeoutRef = reactExports.useRef(null);
57620
+ const isProcessingScrollRef = reactExports.useRef(false);
57378
57621
  const scrollToBottom = reactExports.useCallback(() => {
57379
57622
  if (!ref.current) return;
57380
57623
  requestAnimationFrame(() => {
@@ -57383,36 +57626,48 @@ const useScrollToBottom = (dependencies = [], threshold = 300, screenHeightThres
57383
57626
  }
57384
57627
  });
57385
57628
  }, []);
57629
+ const checkScrollPosition = reactExports.useCallback(() => {
57630
+ if (!containerRef.current || isProcessingScrollRef.current) return;
57631
+ isProcessingScrollRef.current = true;
57632
+ const { scrollTop, scrollHeight, clientHeight } = containerRef.current;
57633
+ const distanceFromBottom = scrollHeight - scrollTop - clientHeight;
57634
+ const currentShouldScroll = distanceFromBottom <= threshold;
57635
+ const shouldShowButton = distanceFromBottom > buttonThreshold;
57636
+ if (Math.abs(lastScrollPositionRef.current - scrollTop) > 20 || currentShouldScroll !== shouldScrollToBottom || shouldShowButton !== isFarFromBottom) {
57637
+ lastScrollPositionRef.current = scrollTop;
57638
+ setShouldScrollToBottom(currentShouldScroll);
57639
+ setIsFarFromBottom(shouldShowButton);
57640
+ }
57641
+ isProcessingScrollRef.current = false;
57642
+ }, [threshold, buttonThreshold, shouldScrollToBottom, isFarFromBottom]);
57386
57643
  const handleScroll = reactExports.useCallback(() => {
57387
57644
  if (!containerRef.current) return;
57388
57645
  if (scrollTimeoutRef.current !== null) {
57389
57646
  window.clearTimeout(scrollTimeoutRef.current);
57390
57647
  }
57391
57648
  scrollTimeoutRef.current = window.setTimeout(() => {
57392
- if (!containerRef.current) return;
57393
- const { scrollTop, scrollHeight, clientHeight } = containerRef.current;
57394
- const distanceFromBottom = scrollHeight - scrollTop - clientHeight;
57395
- const currentShouldScroll = distanceFromBottom <= threshold;
57396
- const isFarEnough = distanceFromBottom > clientHeight;
57397
- if (Math.abs(lastScrollPositionRef.current - scrollTop) > 50 || currentShouldScroll !== shouldScrollToBottom || isFarEnough !== isFarFromBottom) {
57398
- lastScrollPositionRef.current = scrollTop;
57399
- setShouldScrollToBottom(currentShouldScroll);
57400
- setIsFarFromBottom(isFarEnough);
57401
- }
57649
+ checkScrollPosition();
57402
57650
  scrollTimeoutRef.current = null;
57403
- }, 100);
57404
- }, [threshold, shouldScrollToBottom, isFarFromBottom, screenHeightThreshold]);
57651
+ }, 50);
57652
+ }, [checkScrollPosition]);
57405
57653
  reactExports.useEffect(() => {
57406
57654
  const container = containerRef.current;
57407
57655
  if (!container) return;
57408
57656
  container.addEventListener("scroll", handleScroll, { passive: true });
57657
+ checkScrollPosition();
57409
57658
  return () => {
57410
57659
  if (scrollTimeoutRef.current !== null) {
57411
57660
  window.clearTimeout(scrollTimeoutRef.current);
57412
57661
  }
57413
57662
  container.removeEventListener("scroll", handleScroll);
57414
57663
  };
57415
- }, [handleScroll]);
57664
+ }, [handleScroll, checkScrollPosition]);
57665
+ reactExports.useEffect(() => {
57666
+ const animationFrame = requestAnimationFrame(() => {
57667
+ checkScrollPosition();
57668
+ });
57669
+ return () => cancelAnimationFrame(animationFrame);
57670
+ }, [...dependencies, checkScrollPosition]);
57416
57671
  reactExports.useEffect(() => {
57417
57672
  if (!shouldScrollToBottom || !ref.current) return;
57418
57673
  const animationFrame = requestAnimationFrame(() => {
@@ -57429,13 +57684,15 @@ const useScrollToBottom = (dependencies = [], threshold = 300, screenHeightThres
57429
57684
  const { overflow, overflowY } = window.getComputedStyle(parent);
57430
57685
  if (overflow === "auto" || overflow === "scroll" || overflowY === "auto" || overflowY === "scroll") {
57431
57686
  containerRef.current = parent;
57687
+ checkScrollPosition();
57432
57688
  break;
57433
57689
  }
57434
57690
  parent = parent.parentElement;
57435
57691
  }
57436
- }, []);
57692
+ }, [checkScrollPosition]);
57437
57693
  return {
57438
57694
  ref,
57695
+ containerRef,
57439
57696
  isNearBottom: shouldScrollToBottom,
57440
57697
  isFarFromBottom,
57441
57698
  scrollToBottom
@@ -58294,6 +58551,14 @@ const StyledDialog = styled(Dialog)(({ theme: theme2 }) => ({
58294
58551
  backgroundColor: theme2.palette.background.default,
58295
58552
  "&:first-of-type": {
58296
58553
  paddingTop: 16
58554
+ },
58555
+ overflow: "auto",
58556
+ "&::-webkit-scrollbar": {
58557
+ width: "8px"
58558
+ },
58559
+ "&::-webkit-scrollbar-thumb": {
58560
+ backgroundColor: "rgba(255, 255, 255, 0.1)",
58561
+ borderRadius: "4px"
58297
58562
  }
58298
58563
  },
58299
58564
  "& .MuiDialogActions-root": {
@@ -58370,7 +58635,7 @@ const DangerButton = styled(DialogButton)(({ theme: theme2 }) => ({
58370
58635
  },
58371
58636
  transition: "all 0.2s ease-in-out"
58372
58637
  }));
58373
- const FormContainer$1 = styled(Box)({
58638
+ const FormContainer$2 = styled(Box)({
58374
58639
  display: "flex",
58375
58640
  flexDirection: "column",
58376
58641
  gap: 20
@@ -58452,7 +58717,7 @@ const SidebarContent = styled(Box)({
58452
58717
  borderRadius: "4px"
58453
58718
  }
58454
58719
  });
58455
- const SectionTitle$4 = styled(Typography)(({ theme: theme2 }) => ({
58720
+ const SectionTitle$5 = styled(Typography)(({ theme: theme2 }) => ({
58456
58721
  fontWeight: 600,
58457
58722
  marginBottom: theme2.spacing(2),
58458
58723
  marginTop: theme2.spacing(3),
@@ -59096,7 +59361,7 @@ const GenerationSettingsSection = ({
59096
59361
  updateAgentMutation
59097
59362
  }) => {
59098
59363
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
59099
- /* @__PURE__ */ jsxRuntimeExports.jsxs(SectionTitle$4, { variant: "subtitle1", children: [
59364
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(SectionTitle$5, { variant: "subtitle1", children: [
59100
59365
  /* @__PURE__ */ jsxRuntimeExports.jsx(TitleIcon$3, { icon: faSliders }),
59101
59366
  "Generation Settings",
59102
59367
  /* @__PURE__ */ jsxRuntimeExports.jsx(
@@ -59850,6 +60115,49 @@ const HostingSelect = ({
59850
60115
  )
59851
60116
  ] });
59852
60117
  };
60118
+ const useModels = ({ autoFetch = true } = {}) => {
60119
+ const baseUrl = apiConfig.baseUrl;
60120
+ const {
60121
+ providers: providers2,
60122
+ models,
60123
+ isLoading,
60124
+ error,
60125
+ lastFetched,
60126
+ isInitialized,
60127
+ fetchModels,
60128
+ getModelsForProvider
60129
+ } = useModelsStore();
60130
+ reactExports.useEffect(() => {
60131
+ if (autoFetch) {
60132
+ fetchModels(baseUrl);
60133
+ const intervalId = setInterval(
60134
+ () => {
60135
+ fetchModels(baseUrl);
60136
+ },
60137
+ 15 * 60 * 1e3
60138
+ );
60139
+ return () => clearInterval(intervalId);
60140
+ }
60141
+ return void 0;
60142
+ }, [autoFetch, baseUrl, fetchModels]);
60143
+ const refreshModels = async () => {
60144
+ await fetchModels(baseUrl, true);
60145
+ };
60146
+ const getModelById = (modelId) => {
60147
+ return models.find((model) => model.id === modelId);
60148
+ };
60149
+ return {
60150
+ providers: providers2,
60151
+ models,
60152
+ isLoading,
60153
+ error,
60154
+ lastFetched,
60155
+ isInitialized,
60156
+ getModelsForProvider,
60157
+ getModelById,
60158
+ refreshModels
60159
+ };
60160
+ };
59853
60161
  function ok$1() {
59854
60162
  }
59855
60163
  function unreachable() {
@@ -69544,6 +69852,18 @@ const ModelSelect = ({
69544
69852
  const models = getModelsForHostingProvider(hostingId);
69545
69853
  return models;
69546
69854
  }, [hostingId]);
69855
+ const { refreshModels } = useModels();
69856
+ const previousHostingIdRef = reactExports.useRef(null);
69857
+ reactExports.useEffect(() => {
69858
+ if (hostingId && previousHostingIdRef.current !== hostingId) {
69859
+ previousHostingIdRef.current = hostingId;
69860
+ const timeoutId = setTimeout(() => {
69861
+ refreshModels();
69862
+ }, 0);
69863
+ return () => clearTimeout(timeoutId);
69864
+ }
69865
+ return void 0;
69866
+ }, [hostingId, refreshModels]);
69547
69867
  const modelOptions = reactExports.useMemo(() => {
69548
69868
  const options = [
69549
69869
  {
@@ -69677,8 +69997,12 @@ const ModelSelect = ({
69677
69997
  }
69678
69998
  };
69679
69999
  const getProviderFromId = (id) => {
69680
- const providerMatch = id.match(/^([^/]+)\//);
69681
- return providerMatch ? providerMatch[1] : "";
70000
+ if (!id || typeof id !== "string") return "";
70001
+ const slashIndex = id.indexOf("/");
70002
+ if (slashIndex > 0) {
70003
+ return id.substring(0, slashIndex);
70004
+ }
70005
+ return "";
69682
70006
  };
69683
70007
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(FieldContainer, { children: [
69684
70008
  /* @__PURE__ */ jsxRuntimeExports.jsxs(FieldLabel, { variant: "subtitle2", children: [
@@ -69765,49 +70089,6 @@ const ModelSelect = ({
69765
70089
  )
69766
70090
  ] });
69767
70091
  };
69768
- const useModels = ({ autoFetch = true } = {}) => {
69769
- const baseUrl = apiConfig.baseUrl;
69770
- const {
69771
- providers: providers2,
69772
- models,
69773
- isLoading,
69774
- error,
69775
- lastFetched,
69776
- isInitialized,
69777
- fetchModels,
69778
- getModelsForProvider
69779
- } = useModelsStore();
69780
- reactExports.useEffect(() => {
69781
- if (autoFetch) {
69782
- fetchModels(baseUrl);
69783
- const intervalId = setInterval(
69784
- () => {
69785
- fetchModels(baseUrl);
69786
- },
69787
- 15 * 60 * 1e3
69788
- );
69789
- return () => clearInterval(intervalId);
69790
- }
69791
- return void 0;
69792
- }, [autoFetch, baseUrl, fetchModels]);
69793
- const refreshModels = async () => {
69794
- await fetchModels(baseUrl, true);
69795
- };
69796
- const getModelById = (modelId) => {
69797
- return models.find((model) => model.id === modelId);
69798
- };
69799
- return {
69800
- providers: providers2,
69801
- models,
69802
- isLoading,
69803
- error,
69804
- lastFetched,
69805
- isInitialized,
69806
- getModelsForProvider,
69807
- getModelById,
69808
- refreshModels
69809
- };
69810
- };
69811
70092
  const ModelHostingSection = ({
69812
70093
  agent,
69813
70094
  savingField,
@@ -69817,7 +70098,7 @@ const ModelHostingSection = ({
69817
70098
  updateAgentMutation
69818
70099
  }) => {
69819
70100
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
69820
- /* @__PURE__ */ jsxRuntimeExports.jsxs(SectionTitle$4, { variant: "subtitle1", children: [
70101
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(SectionTitle$5, { variant: "subtitle1", children: [
69821
70102
  /* @__PURE__ */ jsxRuntimeExports.jsx(TitleIcon$3, { icon: faServer }),
69822
70103
  "Model & Hosting",
69823
70104
  /* @__PURE__ */ jsxRuntimeExports.jsx(
@@ -70533,6 +70814,242 @@ const ChatUtilities = ({
70533
70814
  ) }) })
70534
70815
  ] });
70535
70816
  };
70817
+ const AttachmentsContainer = styled(Box)(({ theme: theme2 }) => ({
70818
+ display: "flex",
70819
+ flexWrap: "wrap",
70820
+ gap: theme2.spacing(1.5),
70821
+ padding: theme2.spacing(2),
70822
+ borderTop: `1px solid ${alpha(theme2.palette.divider, 0.1)}`,
70823
+ backgroundColor: alpha(theme2.palette.background.paper, 0.4)
70824
+ }));
70825
+ const AttachmentItem = styled(Paper)(({ theme: theme2 }) => ({
70826
+ position: "relative",
70827
+ borderRadius: theme2.shape.borderRadius,
70828
+ overflow: "hidden",
70829
+ width: 100,
70830
+ height: 100,
70831
+ display: "flex",
70832
+ flexDirection: "column",
70833
+ alignItems: "center",
70834
+ justifyContent: "center",
70835
+ border: `1px solid ${alpha(theme2.palette.divider, 0.2)}`,
70836
+ backgroundColor: alpha(theme2.palette.background.paper, 0.6),
70837
+ transition: "all 0.2s ease-in-out",
70838
+ "&:hover": {
70839
+ transform: "translateY(-2px)",
70840
+ boxShadow: theme2.shadows[3]
70841
+ }
70842
+ }));
70843
+ const AttachmentImage$1 = styled("img")({
70844
+ width: "100%",
70845
+ height: "100%",
70846
+ objectFit: "cover"
70847
+ });
70848
+ const AttachmentName = styled(Typography)(({ theme: theme2 }) => ({
70849
+ position: "absolute",
70850
+ bottom: 0,
70851
+ left: 0,
70852
+ right: 0,
70853
+ padding: theme2.spacing(0.5),
70854
+ backgroundColor: alpha(theme2.palette.background.paper, 0.8),
70855
+ fontSize: "0.7rem",
70856
+ textAlign: "center",
70857
+ whiteSpace: "nowrap",
70858
+ overflow: "hidden",
70859
+ textOverflow: "ellipsis"
70860
+ }));
70861
+ const RemoveButton = styled(IconButton)(({ theme: theme2 }) => ({
70862
+ position: "absolute",
70863
+ top: 2,
70864
+ right: -4,
70865
+ width: 24,
70866
+ height: 24,
70867
+ padding: 4,
70868
+ backgroundColor: alpha(theme2.palette.background.paper, 0.8),
70869
+ color: theme2.palette.error.main,
70870
+ "&:hover": {
70871
+ backgroundColor: alpha(theme2.palette.background.paper, 0.9)
70872
+ }
70873
+ }));
70874
+ const LargePreview = styled(Box)(({ theme: theme2 }) => ({
70875
+ position: "absolute",
70876
+ top: -320,
70877
+ width: 300,
70878
+ height: 300,
70879
+ backgroundColor: theme2.palette.background.paper,
70880
+ borderRadius: theme2.shape.borderRadius,
70881
+ boxShadow: theme2.shadows[10],
70882
+ padding: theme2.spacing(1),
70883
+ zIndex: 1e3,
70884
+ opacity: 0,
70885
+ visibility: "hidden",
70886
+ transform: "translateY(20px)",
70887
+ transition: "opacity 0.3s ease-in-out, transform 0.3s ease-in-out, visibility 0s linear 1.5s",
70888
+ "& img": {
70889
+ width: "100%",
70890
+ height: "100%",
70891
+ objectFit: "contain"
70892
+ }
70893
+ }));
70894
+ const AttachmentWrapper = styled(Box)({
70895
+ position: "relative",
70896
+ "&:hover .large-preview": {
70897
+ opacity: 1,
70898
+ visibility: "visible",
70899
+ transform: "translateY(0)",
70900
+ transitionDelay: "1.5s"
70901
+ }
70902
+ });
70903
+ const FileIcon$1 = styled(Box)(({ theme: theme2 }) => ({
70904
+ width: "100%",
70905
+ height: "100%",
70906
+ display: "flex",
70907
+ alignItems: "center",
70908
+ justifyContent: "center",
70909
+ backgroundColor: alpha(theme2.palette.primary.main, 0.1),
70910
+ color: theme2.palette.primary.main,
70911
+ fontSize: "0.8rem",
70912
+ fontWeight: 500,
70913
+ padding: theme2.spacing(1),
70914
+ textAlign: "center"
70915
+ }));
70916
+ const AttachmentsPreview = ({
70917
+ attachments,
70918
+ onRemoveAttachment,
70919
+ disabled: disabled2 = false
70920
+ }) => {
70921
+ const client2 = reactExports.useMemo(() => {
70922
+ return createLocalOperatorClient(apiConfig.baseUrl);
70923
+ }, []);
70924
+ const isImage2 = reactExports.useCallback((path) => {
70925
+ const imageExtensions = [
70926
+ ".jpg",
70927
+ ".jpeg",
70928
+ ".png",
70929
+ ".gif",
70930
+ ".webp",
70931
+ ".bmp",
70932
+ ".svg"
70933
+ ];
70934
+ const lowerPath = path.toLowerCase();
70935
+ return imageExtensions.some((ext) => lowerPath.endsWith(ext));
70936
+ }, []);
70937
+ const getFileName2 = reactExports.useCallback((path) => {
70938
+ const parts = path.split(/[/\\]/);
70939
+ return parts[parts.length - 1];
70940
+ }, []);
70941
+ const getAttachmentUrl2 = reactExports.useCallback(
70942
+ (path) => {
70943
+ if (isImage2(path) && !path.startsWith("http")) {
70944
+ const normalizedPath = path.startsWith("file://") ? path : `file://${path}`;
70945
+ return client2.static.getImageUrl(normalizedPath);
70946
+ }
70947
+ return path;
70948
+ },
70949
+ [client2, isImage2]
70950
+ );
70951
+ const handleRemove = reactExports.useCallback(
70952
+ (index2) => (event) => {
70953
+ event.stopPropagation();
70954
+ if (!disabled2) {
70955
+ onRemoveAttachment(index2);
70956
+ }
70957
+ },
70958
+ [onRemoveAttachment, disabled2]
70959
+ );
70960
+ if (!attachments.length) {
70961
+ return null;
70962
+ }
70963
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(AttachmentsContainer, { children: attachments.map((attachment, index2) => /* @__PURE__ */ jsxRuntimeExports.jsxs(AttachmentWrapper, { children: [
70964
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(AttachmentItem, { elevation: 1, children: [
70965
+ isImage2(attachment) ? /* @__PURE__ */ jsxRuntimeExports.jsx(
70966
+ AttachmentImage$1,
70967
+ {
70968
+ src: getAttachmentUrl2(attachment),
70969
+ alt: getFileName2(attachment)
70970
+ }
70971
+ ) : /* @__PURE__ */ jsxRuntimeExports.jsx(FileIcon$1, { children: getFileName2(attachment) }),
70972
+ /* @__PURE__ */ jsxRuntimeExports.jsx(AttachmentName, { variant: "caption", noWrap: true, children: getFileName2(attachment) }),
70973
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip, { title: "Remove attachment", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
70974
+ RemoveButton,
70975
+ {
70976
+ size: "small",
70977
+ onClick: handleRemove(index2),
70978
+ disabled: disabled2,
70979
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(FontAwesomeIcon, { icon: faTimes, size: "xs" })
70980
+ }
70981
+ ) })
70982
+ ] }),
70983
+ isImage2(attachment) && /* @__PURE__ */ jsxRuntimeExports.jsx(LargePreview, { className: "large-preview", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
70984
+ "img",
70985
+ {
70986
+ src: getAttachmentUrl2(attachment),
70987
+ alt: getFileName2(attachment)
70988
+ }
70989
+ ) })
70990
+ ] }, `${index2}-${attachment}`)) });
70991
+ };
70992
+ const ButtonContainer$1 = styled(Box)(() => ({
70993
+ position: "absolute",
70994
+ top: -60,
70995
+ // Position above the message input
70996
+ right: 20,
70997
+ zIndex: 2e3,
70998
+ display: "flex",
70999
+ justifyContent: "center",
71000
+ alignItems: "center",
71001
+ pointerEvents: "none"
71002
+ // Prevent container from blocking clicks
71003
+ }));
71004
+ const StyledButton = styled(IconButton)(({ theme: theme2 }) => ({
71005
+ backgroundColor: theme2.palette.background.paper,
71006
+ color: theme2.palette.text.secondary,
71007
+ width: 44,
71008
+ height: 44,
71009
+ backdropFilter: "blur(8px)",
71010
+ WebkitBackdropFilter: "blur(8px)",
71011
+ borderRadius: "12px",
71012
+ pointerEvents: "auto",
71013
+ boxShadow: "0 2px 12px rgba(0, 0, 0, 0.15)",
71014
+ border: "1px solid rgba(255, 255, 255, 0.1)",
71015
+ transform: "translateY(0)",
71016
+ transition: "all 0.2s cubic-bezier(0.4, 0, 0.2, 1)",
71017
+ "&:hover": {
71018
+ backgroundColor: theme2.palette.background.paper,
71019
+ transform: "translateY(-2px)",
71020
+ boxShadow: "0 4px 16px rgba(0, 0, 0, 0.2)",
71021
+ color: theme2.palette.primary.main,
71022
+ "& svg": {
71023
+ transform: "translateY(1px)"
71024
+ }
71025
+ },
71026
+ "&:active": {
71027
+ transform: "translateY(0)",
71028
+ boxShadow: "0 2px 8px rgba(0, 0, 0, 0.15)"
71029
+ },
71030
+ "& svg": {
71031
+ fontSize: "1rem",
71032
+ transition: "transform 0.2s ease"
71033
+ }
71034
+ }));
71035
+ const ScrollToBottomButton = ({
71036
+ visible,
71037
+ onClick,
71038
+ className
71039
+ }) => {
71040
+ const handleClick = reactExports.useCallback(() => {
71041
+ onClick();
71042
+ }, [onClick]);
71043
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(Fade, { in: visible, timeout: 200, children: /* @__PURE__ */ jsxRuntimeExports.jsx(ButtonContainer$1, { className, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
71044
+ StyledButton,
71045
+ {
71046
+ "aria-label": "Scroll to bottom",
71047
+ onClick: handleClick,
71048
+ size: "small",
71049
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(FontAwesomeIcon, { icon: faArrowDown })
71050
+ }
71051
+ ) }) });
71052
+ };
70536
71053
  const useMessageInput = ({
70537
71054
  conversationId,
70538
71055
  messages,
@@ -70645,14 +71162,16 @@ const useMessageInput = ({
70645
71162
  textareaRef
70646
71163
  };
70647
71164
  };
70648
- const FormContainer = styled("form")(({ theme: theme2 }) => ({
71165
+ const FormContainer$1 = styled("form")(({ theme: theme2 }) => ({
70649
71166
  padding: theme2.spacing(3),
70650
71167
  display: "flex",
70651
71168
  alignItems: "center",
70652
71169
  gap: theme2.spacing(2),
70653
71170
  borderTop: `1px solid ${alpha(theme2.palette.divider, 0.1)}`,
70654
71171
  backgroundColor: alpha(theme2.palette.background.paper, 0.4),
70655
- minHeight: 100
71172
+ minHeight: 100,
71173
+ position: "relative"
71174
+ // Add position relative for the scroll button
70656
71175
  }));
70657
71176
  const AttachmentButton = styled(IconButton)(({ theme: theme2 }) => ({
70658
71177
  backgroundColor: alpha(theme2.palette.primary.main, 0.08),
@@ -70693,34 +71212,6 @@ const StyledTextField$2 = styled(TextField)(({ theme: theme2 }) => ({
70693
71212
  alignItems: "center"
70694
71213
  }
70695
71214
  }));
70696
- const FilePreviewContainer = styled(Box)(({ theme: theme2 }) => ({
70697
- display: "flex",
70698
- alignItems: "center",
70699
- justifyContent: "center",
70700
- backgroundColor: alpha(theme2.palette.primary.main, 0.08),
70701
- borderRadius: theme2.shape.borderRadius,
70702
- padding: theme2.spacing(1, 2),
70703
- border: `1px solid ${alpha(theme2.palette.primary.main, 0.2)}`,
70704
- height: 48,
70705
- margin: theme2.spacing(0, 1)
70706
- }));
70707
- const FileNameText = styled(Typography)({
70708
- maxWidth: 150,
70709
- fontWeight: 500,
70710
- color: "primary.main",
70711
- display: "flex",
70712
- alignItems: "center"
70713
- });
70714
- const RemoveFileButton = styled(IconButton)(({ theme: theme2 }) => ({
70715
- marginLeft: theme2.spacing(1),
70716
- color: "primary.main",
70717
- display: "flex",
70718
- alignItems: "center",
70719
- justifyContent: "center",
70720
- "&:hover": {
70721
- backgroundColor: alpha(theme2.palette.primary.main, 0.15)
70722
- }
70723
- }));
70724
71215
  const SendButton = styled(Button)(({ theme: theme2 }) => ({
70725
71216
  borderRadius: theme2.shape.borderRadius * 1.5,
70726
71217
  minWidth: "auto",
@@ -70750,9 +71241,12 @@ const MessageInput = ({
70750
71241
  conversationId,
70751
71242
  messages,
70752
71243
  currentJobId,
70753
- onCancelJob
71244
+ onCancelJob,
71245
+ isFarFromBottom = false,
71246
+ scrollToBottom = () => {
71247
+ }
70754
71248
  }) => {
70755
- const [selectedFile, setSelectedFile] = reactExports.useState(null);
71249
+ const [attachments, setAttachments] = reactExports.useState([]);
70756
71250
  const fileInputRef = reactExports.useRef(null);
70757
71251
  const {
70758
71252
  inputValue: newMessage,
@@ -70764,96 +71258,121 @@ const MessageInput = ({
70764
71258
  conversationId,
70765
71259
  messages,
70766
71260
  onSubmit: (message2) => {
70767
- onSendMessage(message2, selectedFile);
70768
- setSelectedFile(null);
71261
+ onSendMessage(message2, attachments);
71262
+ setAttachments([]);
70769
71263
  }
70770
71264
  });
70771
71265
  const handleSubmit = (e) => {
70772
71266
  e.preventDefault();
70773
- if (!newMessage.trim() && !selectedFile) return;
71267
+ if (!newMessage.trim() && attachments.length === 0) return;
70774
71268
  submitMessage();
70775
71269
  };
70776
71270
  const handleFileSelect = (e) => {
70777
71271
  if (e.target.files && e.target.files.length > 0) {
70778
- setSelectedFile(e.target.files[0]);
71272
+ const newAttachments = Array.from(e.target.files).map((file) => {
71273
+ const filePath = file.path;
71274
+ if (filePath) {
71275
+ return filePath;
71276
+ }
71277
+ return URL.createObjectURL(file);
71278
+ });
71279
+ setAttachments((prev2) => [...prev2, ...newAttachments]);
71280
+ if (fileInputRef.current) {
71281
+ fileInputRef.current.value = "";
71282
+ }
70779
71283
  }
70780
71284
  };
71285
+ const handleRemoveAttachment = (index2) => {
71286
+ setAttachments((prev2) => {
71287
+ const newAttachments = [...prev2];
71288
+ if (newAttachments[index2].startsWith("blob:")) {
71289
+ URL.revokeObjectURL(newAttachments[index2]);
71290
+ }
71291
+ newAttachments.splice(index2, 1);
71292
+ return newAttachments;
71293
+ });
71294
+ };
70781
71295
  const triggerFileInput = () => {
70782
71296
  fileInputRef.current?.click();
70783
71297
  };
70784
71298
  const isInputDisabled = Boolean(isLoading && currentJobId);
70785
- return /* @__PURE__ */ jsxRuntimeExports.jsxs(FormContainer, { onSubmit: handleSubmit, children: [
70786
- /* @__PURE__ */ jsxRuntimeExports.jsx(
70787
- "input",
70788
- {
70789
- type: "file",
70790
- ref: fileInputRef,
70791
- onChange: handleFileSelect,
70792
- style: { display: "none" },
70793
- accept: "image/*,.pdf,.doc,.docx,.txt",
70794
- disabled: isInputDisabled
70795
- }
70796
- ),
70797
- /* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip, { title: "Attach file", children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
70798
- AttachmentButton,
70799
- {
70800
- onClick: triggerFileInput,
70801
- color: "primary",
70802
- size: "medium",
70803
- "aria-label": "Attach file",
70804
- disabled: isInputDisabled,
70805
- children: /* @__PURE__ */ jsxRuntimeExports.jsx(FontAwesomeIcon, { icon: faPaperclip })
70806
- }
70807
- ) }) }),
70808
- /* @__PURE__ */ jsxRuntimeExports.jsx(
70809
- StyledTextField$2,
70810
- {
70811
- fullWidth: true,
70812
- placeholder: isInputDisabled ? "⌛ Agent is busy..." : "✨ Type to Chat! Press ↵ to send, Shift+↵ for new line 📝",
70813
- value: newMessage,
70814
- onChange: (e) => setNewMessage(e.target.value),
70815
- onKeyDown: handleKeyDown,
70816
- multiline: true,
70817
- maxRows: 4,
70818
- variant: "outlined",
70819
- inputRef: textareaRef,
70820
- disabled: isInputDisabled
70821
- }
70822
- ),
70823
- selectedFile && /* @__PURE__ */ jsxRuntimeExports.jsxs(FilePreviewContainer, { children: [
70824
- /* @__PURE__ */ jsxRuntimeExports.jsx(FileNameText, { variant: "caption", noWrap: true, children: selectedFile.name }),
71299
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
71300
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(FormContainer$1, { onSubmit: handleSubmit, children: [
70825
71301
  /* @__PURE__ */ jsxRuntimeExports.jsx(
70826
- RemoveFileButton,
71302
+ ScrollToBottomButton,
70827
71303
  {
70828
- size: "small",
70829
- onClick: () => setSelectedFile(null),
70830
- "aria-label": "Remove file",
71304
+ visible: isFarFromBottom,
71305
+ onClick: scrollToBottom
71306
+ }
71307
+ ),
71308
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
71309
+ "input",
71310
+ {
71311
+ type: "file",
71312
+ ref: fileInputRef,
71313
+ onChange: handleFileSelect,
71314
+ style: { display: "none" },
71315
+ accept: "image/*,.pdf,.doc,.docx,.txt",
70831
71316
  disabled: isInputDisabled,
70832
- children: /* @__PURE__ */ jsxRuntimeExports.jsx(FontAwesomeIcon, { icon: faTimes, size: "xs" })
71317
+ multiple: true
70833
71318
  }
70834
- )
71319
+ ),
71320
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip, { title: "Attach file", children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
71321
+ AttachmentButton,
71322
+ {
71323
+ onClick: triggerFileInput,
71324
+ color: "primary",
71325
+ size: "medium",
71326
+ "aria-label": "Attach file",
71327
+ disabled: isInputDisabled,
71328
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(FontAwesomeIcon, { icon: faPaperclip })
71329
+ }
71330
+ ) }) }),
71331
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
71332
+ StyledTextField$2,
71333
+ {
71334
+ fullWidth: true,
71335
+ placeholder: isInputDisabled ? "⌛ Agent is busy..." : "✨ Type to Chat! Press ↵ to send, Shift+↵ for new line 📝",
71336
+ value: newMessage,
71337
+ onChange: (e) => setNewMessage(e.target.value),
71338
+ onKeyDown: handleKeyDown,
71339
+ multiline: true,
71340
+ maxRows: 4,
71341
+ variant: "outlined",
71342
+ inputRef: textareaRef,
71343
+ disabled: isInputDisabled
71344
+ }
71345
+ ),
71346
+ isLoading && currentJobId ? /* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip, { title: "Stop agent", children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
71347
+ SendButton,
71348
+ {
71349
+ type: "button",
71350
+ variant: "contained",
71351
+ color: "error",
71352
+ onClick: () => onCancelJob?.(currentJobId),
71353
+ "aria-label": "Stop agent",
71354
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(FontAwesomeIcon, { icon: faStop })
71355
+ }
71356
+ ) }) }) : /* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip, { title: "Send message", children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
71357
+ SendButton,
71358
+ {
71359
+ type: "submit",
71360
+ variant: "contained",
71361
+ color: "primary",
71362
+ disabled: isLoading || !newMessage.trim() && attachments.length === 0,
71363
+ "aria-label": "Send message",
71364
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(FontAwesomeIcon, { icon: faPaperPlane })
71365
+ }
71366
+ ) }) })
70835
71367
  ] }),
70836
- isLoading && currentJobId ? /* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip, { title: "Stop agent", children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
70837
- SendButton,
71368
+ attachments.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx(
71369
+ AttachmentsPreview,
70838
71370
  {
70839
- type: "button",
70840
- variant: "contained",
70841
- color: "error",
70842
- onClick: () => onCancelJob?.(currentJobId),
70843
- "aria-label": "Stop agent",
70844
- children: /* @__PURE__ */ jsxRuntimeExports.jsx(FontAwesomeIcon, { icon: faStop })
70845
- }
70846
- ) }) }) : /* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip, { title: "Send message", children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
70847
- SendButton,
70848
- {
70849
- type: "submit",
70850
- variant: "contained",
70851
- color: "primary",
70852
- disabled: isLoading || !newMessage.trim() && !selectedFile,
70853
- "aria-label": "Send message",
70854
- children: /* @__PURE__ */ jsxRuntimeExports.jsx(FontAwesomeIcon, { icon: faPaperPlane })
71371
+ attachments,
71372
+ onRemoveAttachment: handleRemoveAttachment,
71373
+ disabled: isInputDisabled
70855
71374
  }
70856
- ) }) })
71375
+ )
70857
71376
  ] });
70858
71377
  };
70859
71378
  const LoadingIndicator = ({ status, agentName = "Agent" }) => {
@@ -108371,8 +108890,89 @@ const AttachmentImage = styled("img")({
108371
108890
  maxHeight: 200,
108372
108891
  borderRadius: 8,
108373
108892
  marginBottom: 8,
108374
- boxShadow: "0 2px 8px rgba(0, 0, 0, 0.15)"
108893
+ boxShadow: "0 2px 8px rgba(0, 0, 0, 0.15)",
108894
+ cursor: "pointer",
108895
+ transition: "transform 0.2s ease, box-shadow 0.2s ease",
108896
+ "&:hover": {
108897
+ transform: "scale(1.02)",
108898
+ boxShadow: "0 4px 12px rgba(0, 0, 0, 0.25)"
108899
+ }
108375
108900
  });
108901
+ const FileAttachment = styled(Box)(() => ({
108902
+ display: "flex",
108903
+ alignItems: "center",
108904
+ padding: "8px 12px",
108905
+ marginTop: 8,
108906
+ backgroundColor: "rgba(0, 0, 0, 0.1)",
108907
+ borderRadius: 8,
108908
+ boxShadow: "0 1px 4px rgba(0, 0, 0, 0.1)",
108909
+ width: "fit-content",
108910
+ maxWidth: "100%",
108911
+ cursor: "pointer",
108912
+ transition: "all 0.2s ease",
108913
+ "&:hover": {
108914
+ backgroundColor: "rgba(0, 0, 0, 0.15)",
108915
+ transform: "translateY(-1px)",
108916
+ boxShadow: "0 2px 5px rgba(0, 0, 0, 0.15)"
108917
+ },
108918
+ "&:active": {
108919
+ transform: "translateY(0)",
108920
+ boxShadow: "0 1px 3px rgba(0, 0, 0, 0.1)"
108921
+ }
108922
+ }));
108923
+ const FileIcon = styled(Box)(({ theme: theme2 }) => ({
108924
+ marginRight: 8,
108925
+ color: theme2.palette.primary.main,
108926
+ display: "flex",
108927
+ alignItems: "center"
108928
+ }));
108929
+ const FileName = styled(Typography)({
108930
+ fontSize: "0.85rem",
108931
+ overflow: "hidden",
108932
+ textOverflow: "ellipsis",
108933
+ whiteSpace: "nowrap",
108934
+ maxWidth: "100%",
108935
+ textDecoration: "none",
108936
+ "&:hover": {
108937
+ textDecoration: "underline"
108938
+ }
108939
+ });
108940
+ const isWebUrl = (path) => {
108941
+ return path.startsWith("http://") || path.startsWith("https://");
108942
+ };
108943
+ const isImage = (path) => {
108944
+ const imageExtensions = [
108945
+ ".jpg",
108946
+ ".jpeg",
108947
+ ".png",
108948
+ ".gif",
108949
+ ".webp",
108950
+ ".bmp",
108951
+ ".svg",
108952
+ ".tiff",
108953
+ ".tif",
108954
+ ".ico",
108955
+ ".heic",
108956
+ ".heif",
108957
+ ".avif",
108958
+ ".jfif",
108959
+ ".pjpeg",
108960
+ ".pjp"
108961
+ ];
108962
+ const lowerPath = path.toLowerCase();
108963
+ return imageExtensions.some((ext) => lowerPath.endsWith(ext));
108964
+ };
108965
+ const getFileName = (path) => {
108966
+ const parts = path.split(/[/\\]/);
108967
+ return parts[parts.length - 1];
108968
+ };
108969
+ const getAttachmentUrl = (client2, path) => {
108970
+ if (isImage(path) && !path.startsWith("http")) {
108971
+ const normalizedPath = path.startsWith("file://") ? path : `file://${path}`;
108972
+ return client2.static.getImageUrl(normalizedPath);
108973
+ }
108974
+ return path;
108975
+ };
108376
108976
  const SectionLabel = styled(Typography)(({ theme: theme2 }) => ({
108377
108977
  display: "block",
108378
108978
  marginBottom: 4,
@@ -108483,22 +109083,49 @@ const Timestamp = styled(Typography, {
108483
109083
  const MessageItem = reactExports.memo(
108484
109084
  ({ message: message2 }) => {
108485
109085
  const isUser = message2.role === "user";
109086
+ const client2 = reactExports.useMemo(() => {
109087
+ return createLocalOperatorClient(apiConfig.baseUrl);
109088
+ }, []);
108486
109089
  const formattedTimestamp = reactExports.useMemo(() => {
108487
109090
  return message2.timestamp.toLocaleTimeString([], {
108488
109091
  hour: "2-digit",
108489
109092
  minute: "2-digit"
108490
109093
  });
108491
109094
  }, [message2.timestamp]);
109095
+ const getUrl = reactExports.useCallback(
109096
+ (path) => getAttachmentUrl(client2, path),
109097
+ [client2]
109098
+ );
109099
+ const handleFileClick = reactExports.useCallback((filePath) => {
109100
+ try {
109101
+ if (isWebUrl(filePath)) {
109102
+ window.api.openExternal(filePath);
109103
+ } else {
109104
+ const normalizedPath = filePath.startsWith("file://") ? filePath.substring(7) : filePath;
109105
+ window.api.openFile(normalizedPath);
109106
+ }
109107
+ } catch (error) {
109108
+ console.error("Error opening file:", error);
109109
+ }
109110
+ }, []);
109111
+ const handleImageClick = reactExports.useCallback(
109112
+ (filePath) => {
109113
+ handleFileClick(filePath);
109114
+ },
109115
+ [handleFileClick]
109116
+ );
108492
109117
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(MessageContainer, { isUser, children: [
108493
109118
  /* @__PURE__ */ jsxRuntimeExports.jsx(UserAvatar$1, { isUser, children: /* @__PURE__ */ jsxRuntimeExports.jsx(FontAwesomeIcon, { icon: isUser ? faUser : faRobot, size: "sm" }) }),
108494
109119
  /* @__PURE__ */ jsxRuntimeExports.jsxs(MessagePaper, { elevation: isUser ? 2 : 1, isUser, children: [
108495
- message2.attachments && message2.attachments.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx(Box, { sx: { mb: 2 }, children: message2.attachments.map((attachment) => /* @__PURE__ */ jsxRuntimeExports.jsx(
109120
+ message2.files && message2.files.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx(Box, { sx: { mb: 2 }, children: message2.files.filter((file) => isImage(file)).map((file) => /* @__PURE__ */ jsxRuntimeExports.jsx(
108496
109121
  AttachmentImage,
108497
109122
  {
108498
- src: attachment,
108499
- alt: "Attachment"
109123
+ src: getUrl(file),
109124
+ alt: getFileName(file),
109125
+ onClick: () => handleImageClick(file),
109126
+ title: `Click to open ${getFileName(file)}`
108500
109127
  },
108501
- `${message2.id}-${attachment}`
109128
+ `${message2.id}-${file}`
108502
109129
  )) }),
108503
109130
  message2.message && /* @__PURE__ */ jsxRuntimeExports.jsx(
108504
109131
  Box,
@@ -108570,6 +109197,18 @@ const MessageItem = reactExports.memo(
108570
109197
  /* @__PURE__ */ jsxRuntimeExports.jsx(LogContainer, { isUser, children: message2.logging })
108571
109198
  ] }),
108572
109199
  message2.status && /* @__PURE__ */ jsxRuntimeExports.jsx(StatusIndicator, { status: message2.status, children: message2.status }),
109200
+ message2.files && message2.files.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx(Box, { sx: { mt: 2 }, children: message2.files.filter((file) => !isImage(file)).map((file) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
109201
+ FileAttachment,
109202
+ {
109203
+ onClick: () => handleFileClick(file),
109204
+ title: `Click to open ${getFileName(file)}`,
109205
+ children: [
109206
+ /* @__PURE__ */ jsxRuntimeExports.jsx(FileIcon, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(FontAwesomeIcon, { icon: faFile, size: "sm" }) }),
109207
+ /* @__PURE__ */ jsxRuntimeExports.jsx(FileName, { variant: "body2", children: getFileName(file) })
109208
+ ]
109209
+ },
109210
+ `${message2.id}-${file}`
109211
+ )) }),
108573
109212
  /* @__PURE__ */ jsxRuntimeExports.jsx(Timestamp, { variant: "caption", isUser, children: formattedTimestamp })
108574
109213
  ] })
108575
109214
  ] });
@@ -108682,65 +109321,6 @@ const RawInfoView = ({ content: content2 }) => {
108682
109321
  /* @__PURE__ */ jsxRuntimeExports.jsx(RawInfoContent, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(Typography, { variant: "body2", component: "pre", sx: { fontSize: "0.8rem" }, children: content2 }) })
108683
109322
  ] });
108684
109323
  };
108685
- const ButtonContainer$1 = styled(Box)(() => ({
108686
- position: "fixed",
108687
- bottom: 200,
108688
- right: 20,
108689
- zIndex: 1e3,
108690
- display: "flex",
108691
- justifyContent: "center",
108692
- alignItems: "center",
108693
- pointerEvents: "none"
108694
- // Prevent container from blocking clicks
108695
- }));
108696
- const StyledButton = styled(IconButton)(({ theme: theme2 }) => ({
108697
- backgroundColor: theme2.palette.background.paper,
108698
- color: theme2.palette.text.secondary,
108699
- width: 44,
108700
- height: 44,
108701
- backdropFilter: "blur(8px)",
108702
- WebkitBackdropFilter: "blur(8px)",
108703
- borderRadius: "12px",
108704
- pointerEvents: "auto",
108705
- boxShadow: "0 2px 12px rgba(0, 0, 0, 0.15)",
108706
- border: "1px solid rgba(255, 255, 255, 0.1)",
108707
- transform: "translateY(0)",
108708
- transition: "all 0.2s cubic-bezier(0.4, 0, 0.2, 1)",
108709
- "&:hover": {
108710
- backgroundColor: theme2.palette.background.paper,
108711
- transform: "translateY(-2px)",
108712
- boxShadow: "0 4px 16px rgba(0, 0, 0, 0.2)",
108713
- color: theme2.palette.primary.main,
108714
- "& svg": {
108715
- transform: "translateY(1px)"
108716
- }
108717
- },
108718
- "&:active": {
108719
- transform: "translateY(0)",
108720
- boxShadow: "0 2px 8px rgba(0, 0, 0, 0.15)"
108721
- },
108722
- "& svg": {
108723
- fontSize: "1rem",
108724
- transition: "transform 0.2s ease"
108725
- }
108726
- }));
108727
- const ScrollToBottomButton = ({
108728
- visible,
108729
- onClick
108730
- }) => {
108731
- const handleClick = reactExports.useCallback(() => {
108732
- onClick();
108733
- }, [onClick]);
108734
- return /* @__PURE__ */ jsxRuntimeExports.jsx(Fade, { in: visible, timeout: 200, children: /* @__PURE__ */ jsxRuntimeExports.jsx(ButtonContainer$1, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
108735
- StyledButton,
108736
- {
108737
- "aria-label": "Scroll to bottom",
108738
- onClick: handleClick,
108739
- size: "small",
108740
- children: /* @__PURE__ */ jsxRuntimeExports.jsx(FontAwesomeIcon, { icon: faArrowDown })
108741
- }
108742
- ) }) });
108743
- };
108744
109324
  const ChatContainer = styled(Paper)({
108745
109325
  display: "flex",
108746
109326
  flexDirection: "column",
@@ -108773,13 +109353,6 @@ const ChatContent = ({
108773
109353
  agentData
108774
109354
  }) => {
108775
109355
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(ChatContainer, { elevation: 0, children: [
108776
- /* @__PURE__ */ jsxRuntimeExports.jsx(
108777
- ScrollToBottomButton,
108778
- {
108779
- visible: isFarFromBottom,
108780
- onClick: scrollToBottom
108781
- }
108782
- ),
108783
109356
  /* @__PURE__ */ jsxRuntimeExports.jsx(
108784
109357
  ChatHeader,
108785
109358
  {
@@ -108825,7 +109398,9 @@ const ChatContent = ({
108825
109398
  conversationId: agentId,
108826
109399
  messages,
108827
109400
  currentJobId,
108828
- onCancelJob
109401
+ onCancelJob,
109402
+ isFarFromBottom,
109403
+ scrollToBottom
108829
109404
  }
108830
109405
  ),
108831
109406
  /* @__PURE__ */ jsxRuntimeExports.jsx(ChatUtilities, { agentId, agentData })
@@ -109217,7 +109792,7 @@ const CreateAgentDialog = ({
109217
109792
  maxWidth: "sm",
109218
109793
  children: [
109219
109794
  /* @__PURE__ */ jsxRuntimeExports.jsx(Subtitle, { children: "Configure your new AI assistant with a name and optional description" }),
109220
- /* @__PURE__ */ jsxRuntimeExports.jsx("form", { id: "create-agent-form", onSubmit: handleSubmit, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(FormContainer$1, { children: [
109795
+ /* @__PURE__ */ jsxRuntimeExports.jsx("form", { id: "create-agent-form", onSubmit: handleSubmit, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(FormContainer$2, { children: [
109221
109796
  /* @__PURE__ */ jsxRuntimeExports.jsx(
109222
109797
  NameField,
109223
109798
  {
@@ -111348,14 +111923,14 @@ const ChatPage = () => {
111348
111923
  [addMessage, conversationId, setCurrentJobId, setIsLoading]
111349
111924
  );
111350
111925
  const handleSendMessage = reactExports.useCallback(
111351
- async (content2, file) => {
111926
+ async (content2, attachments) => {
111352
111927
  if (!conversationId) return;
111353
111928
  const userMessage = {
111354
111929
  id: v4(),
111355
111930
  role: "user",
111356
111931
  message: content2,
111357
111932
  timestamp: /* @__PURE__ */ new Date(),
111358
- attachments: file ? [URL.createObjectURL(file)] : void 0
111933
+ files: attachments.length > 0 ? attachments : void 0
111359
111934
  };
111360
111935
  addMessage(conversationId, userMessage);
111361
111936
  setIsLoading(true);
@@ -111386,7 +111961,8 @@ const ChatPage = () => {
111386
111961
  persist_conversation: true,
111387
111962
  // Persist conversation history
111388
111963
  user_message_id: userMessage.id,
111389
- options: Object.keys(filteredOptions).length > 0 ? filteredOptions : void 0
111964
+ options: Object.keys(filteredOptions).length > 0 ? filteredOptions : void 0,
111965
+ attachments: attachments.length > 0 ? attachments : void 0
111390
111966
  }
111391
111967
  );
111392
111968
  if (jobDetails.result?.id) {
@@ -111560,7 +112136,7 @@ const PageHeader = ({
111560
112136
  children
111561
112137
  ] });
111562
112138
  };
111563
- const SectionTitle$3 = styled(Typography)(({ theme: theme2 }) => ({
112139
+ const SectionTitle$4 = styled(Typography)(({ theme: theme2 }) => ({
111564
112140
  fontWeight: 600,
111565
112141
  marginBottom: theme2.spacing(2),
111566
112142
  display: "flex",
@@ -111664,7 +112240,7 @@ const ChatSettings = ({
111664
112240
  setLocalAgent(selectedAgent);
111665
112241
  }, [selectedAgent]);
111666
112242
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(Box, { sx: { mt: 4, mb: 3 }, children: [
111667
- /* @__PURE__ */ jsxRuntimeExports.jsxs(SectionTitle$3, { variant: "subtitle1", children: [
112243
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(SectionTitle$4, { variant: "subtitle1", children: [
111668
112244
  /* @__PURE__ */ jsxRuntimeExports.jsx(TitleIcon$2, { icon: faComments }),
111669
112245
  "Chat Settings",
111670
112246
  /* @__PURE__ */ jsxRuntimeExports.jsx(
@@ -112193,7 +112769,7 @@ const HeaderContainer = styled(Box)(({ theme: theme2 }) => ({
112193
112769
  marginBottom: theme2.spacing(2),
112194
112770
  gap: theme2.spacing(2)
112195
112771
  }));
112196
- const SectionTitle$2 = styled(Typography)(({ theme: theme2 }) => ({
112772
+ const SectionTitle$3 = styled(Typography)(({ theme: theme2 }) => ({
112197
112773
  fontWeight: 600,
112198
112774
  marginBottom: theme2.spacing(2),
112199
112775
  display: "flex",
@@ -112331,7 +112907,7 @@ const GeneralSettings = ({
112331
112907
  ] }),
112332
112908
  /* @__PURE__ */ jsxRuntimeExports.jsx(Divider, { sx: { mb: 3 } }),
112333
112909
  /* @__PURE__ */ jsxRuntimeExports.jsxs(Box, { sx: { mb: 3 }, children: [
112334
- /* @__PURE__ */ jsxRuntimeExports.jsxs(SectionTitle$2, { variant: "subtitle1", children: [
112910
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(SectionTitle$3, { variant: "subtitle1", children: [
112335
112911
  /* @__PURE__ */ jsxRuntimeExports.jsx(TitleIcon$1, { icon: faInfoCircle }),
112336
112912
  "Agent Information"
112337
112913
  ] }),
@@ -112396,7 +112972,7 @@ const GeneralSettings = ({
112396
112972
  ] })
112397
112973
  ] });
112398
112974
  };
112399
- const SectionTitle$1 = styled(Typography)(({ theme: theme2 }) => ({
112975
+ const SectionTitle$2 = styled(Typography)(({ theme: theme2 }) => ({
112400
112976
  fontWeight: 600,
112401
112977
  marginBottom: theme2.spacing(2),
112402
112978
  display: "flex",
@@ -112423,7 +112999,7 @@ const SecuritySettings = ({
112423
112999
  initialSelectedAgentId
112424
113000
  }) => {
112425
113001
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(Box, { sx: { mt: 1 }, children: [
112426
- /* @__PURE__ */ jsxRuntimeExports.jsxs(SectionTitle$1, { variant: "subtitle1", children: [
113002
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(SectionTitle$2, { variant: "subtitle1", children: [
112427
113003
  /* @__PURE__ */ jsxRuntimeExports.jsx(TitleIcon, { icon: faShieldAlt }),
112428
113004
  "Security Prompt",
112429
113005
  /* @__PURE__ */ jsxRuntimeExports.jsx(
@@ -112968,7 +113544,7 @@ const ModelsInitializer = () => {
112968
113544
  return null;
112969
113545
  };
112970
113546
  const localOperatorIcon = "" + new URL("icon-ngVHF_bZ.png", import.meta.url).href;
112971
- const pulse = keyframes`
113547
+ const pulse$1 = keyframes`
112972
113548
  0% {
112973
113549
  box-shadow: 0 0 0 0 rgba(56, 201, 106, 0.4);
112974
113550
  }
@@ -113002,7 +113578,7 @@ const LogoImage = styled("img", {
113002
113578
  "&:hover": {
113003
113579
  transform: "scale(1.12) rotate(5deg)",
113004
113580
  filter: "drop-shadow(0 0 12px rgba(56, 201, 106, 0.5))",
113005
- animation: `${pulse} 1.5s infinite`
113581
+ animation: `${pulse$1} 1.5s infinite`
113006
113582
  }
113007
113583
  }));
113008
113584
  const LogoText = styled(Typography)({
@@ -113466,6 +114042,268 @@ const SidebarNavigation = () => {
113466
114042
  ] })
113467
114043
  ] });
113468
114044
  };
114045
+ var OnboardingStep = /* @__PURE__ */ ((OnboardingStep2) => {
114046
+ OnboardingStep2["WELCOME"] = "welcome";
114047
+ OnboardingStep2["USER_PROFILE"] = "user_profile";
114048
+ OnboardingStep2["MODEL_CREDENTIAL"] = "model_credential";
114049
+ OnboardingStep2["SEARCH_API"] = "search_api";
114050
+ OnboardingStep2["DEFAULT_MODEL"] = "default_model";
114051
+ OnboardingStep2["CREATE_AGENT"] = "create_agent";
114052
+ OnboardingStep2["CONGRATULATIONS"] = "congratulations";
114053
+ return OnboardingStep2;
114054
+ })(OnboardingStep || {});
114055
+ const useOnboardingStore = create$1()(
114056
+ persist(
114057
+ (set) => ({
114058
+ isComplete: false,
114059
+ currentStep: "welcome",
114060
+ isActive: false,
114061
+ completeOnboarding: () => {
114062
+ set({
114063
+ isComplete: true,
114064
+ isActive: false
114065
+ });
114066
+ },
114067
+ setCurrentStep: (step) => {
114068
+ set({ currentStep: step });
114069
+ },
114070
+ activateOnboarding: () => {
114071
+ set({ isActive: true });
114072
+ },
114073
+ deactivateOnboarding: () => {
114074
+ set({ isActive: false });
114075
+ },
114076
+ resetOnboarding: () => {
114077
+ set({
114078
+ isComplete: false,
114079
+ currentStep: "welcome",
114080
+ isActive: false
114081
+ });
114082
+ }
114083
+ }),
114084
+ {
114085
+ name: "onboarding-storage"
114086
+ }
114087
+ )
114088
+ );
114089
+ const fadeIn = keyframes`
114090
+ from {
114091
+ opacity: 0;
114092
+ transform: translateY(10px);
114093
+ }
114094
+ to {
114095
+ opacity: 1;
114096
+ transform: translateY(0);
114097
+ }
114098
+ `;
114099
+ const pulse = keyframes`
114100
+ 0% {
114101
+ transform: scale(1);
114102
+ }
114103
+ 50% {
114104
+ transform: scale(1.05);
114105
+ }
114106
+ 100% {
114107
+ transform: scale(1);
114108
+ }
114109
+ `;
114110
+ styled(Dialog)(({ theme: theme2 }) => ({
114111
+ "& .MuiBackdrop-root": {
114112
+ backdropFilter: "blur(12px)",
114113
+ backgroundColor: alpha(theme2.palette.background.default, 0.7)
114114
+ },
114115
+ "& .MuiDialog-paper": {
114116
+ borderRadius: 16,
114117
+ maxWidth: 700,
114118
+ width: "100%",
114119
+ backgroundColor: alpha(theme2.palette.background.paper, 0.95),
114120
+ boxShadow: `0 15px 50px ${alpha(theme2.palette.primary.main, 0.2)}, 0 10px 40px ${alpha(theme2.palette.common.black, 0.4)}`,
114121
+ border: `1px solid ${alpha(theme2.palette.primary.main, 0.1)}`,
114122
+ overflow: "hidden",
114123
+ animation: `${fadeIn} 0.4s ease-out`
114124
+ }
114125
+ }));
114126
+ styled(DialogTitle)(({ theme: theme2 }) => ({
114127
+ padding: "24px 28px 16px 28px",
114128
+ fontSize: "1.35rem",
114129
+ fontWeight: 700,
114130
+ textAlign: "center",
114131
+ borderBottom: `1px solid ${alpha(theme2.palette.divider, 0.1)}`,
114132
+ background: `linear-gradient(to right, ${alpha(theme2.palette.primary.main, 0.05)}, ${alpha(theme2.palette.background.default, 0.8)}, ${alpha(theme2.palette.primary.main, 0.05)})`,
114133
+ color: theme2.palette.primary.main
114134
+ }));
114135
+ styled(DialogContent)(({ theme: theme2 }) => ({
114136
+ padding: "20px 28px",
114137
+ display: "flex",
114138
+ flexDirection: "column",
114139
+ gap: theme2.spacing(3),
114140
+ backgroundColor: theme2.palette.background.default,
114141
+ animation: `${fadeIn} 0.5s ease-out`
114142
+ }));
114143
+ styled(DialogActions)(({ theme: theme2 }) => ({
114144
+ padding: "16px 28px 24px 28px",
114145
+ justifyContent: "space-between",
114146
+ gap: 16,
114147
+ borderTop: `1px solid ${alpha(theme2.palette.divider, 0.1)}`,
114148
+ background: `linear-gradient(to right, ${alpha(theme2.palette.primary.main, 0.05)}, ${alpha(theme2.palette.background.default, 0.8)}, ${alpha(theme2.palette.primary.main, 0.05)})`
114149
+ }));
114150
+ styled(Button)(({ theme: theme2 }) => ({
114151
+ borderRadius: 8,
114152
+ padding: "10px 24px",
114153
+ fontWeight: 600,
114154
+ textTransform: "none",
114155
+ minWidth: 120,
114156
+ backgroundColor: theme2.palette.primary.main,
114157
+ color: theme2.palette.primary.contrastText,
114158
+ "&:hover": {
114159
+ backgroundColor: theme2.palette.primary.dark,
114160
+ boxShadow: `0 6px 16px ${alpha(theme2.palette.primary.main, 0.5)}`,
114161
+ transform: "translateY(-2px)"
114162
+ },
114163
+ "&:active": {
114164
+ transform: "translateY(0)"
114165
+ },
114166
+ transition: "all 0.2s ease-in-out"
114167
+ }));
114168
+ styled(Button)(({ theme: theme2 }) => ({
114169
+ borderRadius: 8,
114170
+ padding: "10px 24px",
114171
+ fontWeight: 500,
114172
+ textTransform: "none",
114173
+ minWidth: 120,
114174
+ borderColor: alpha(theme2.palette.divider, 0.5),
114175
+ color: theme2.palette.text.secondary,
114176
+ "&:hover": {
114177
+ backgroundColor: alpha(theme2.palette.action.hover, 0.1),
114178
+ color: theme2.palette.text.primary,
114179
+ borderColor: theme2.palette.primary.light,
114180
+ boxShadow: `0 4px 12px ${alpha(theme2.palette.common.black, 0.08)}`
114181
+ },
114182
+ transition: "all 0.2s ease-in-out"
114183
+ }));
114184
+ const SkipButton = styled(Button)(({ theme: theme2 }) => ({
114185
+ color: theme2.palette.text.secondary,
114186
+ textTransform: "none",
114187
+ fontWeight: 500,
114188
+ "&:hover": {
114189
+ backgroundColor: "transparent",
114190
+ textDecoration: "underline",
114191
+ color: theme2.palette.primary.light
114192
+ },
114193
+ transition: "all 0.2s ease-in-out"
114194
+ }));
114195
+ const StepIndicatorContainer = styled(Box)(({ theme: theme2 }) => ({
114196
+ display: "flex",
114197
+ justifyContent: "center",
114198
+ gap: theme2.spacing(1.5),
114199
+ marginBottom: theme2.spacing(3),
114200
+ padding: theme2.spacing(1, 0)
114201
+ }));
114202
+ const StepDot = styled(Box, {
114203
+ shouldForwardProp: (prop) => prop !== "active"
114204
+ })(({ theme: theme2, active }) => ({
114205
+ width: active ? 12 : 10,
114206
+ height: active ? 12 : 10,
114207
+ borderRadius: "50%",
114208
+ backgroundColor: active ? theme2.palette.primary.main : alpha(theme2.palette.primary.main, 0.25),
114209
+ boxShadow: active ? `0 0 10px ${alpha(theme2.palette.primary.main, 0.5)}` : "none",
114210
+ transition: "all 0.3s ease-in-out",
114211
+ animation: active ? `${pulse} 2s infinite ease-in-out` : "none"
114212
+ }));
114213
+ const SectionContainer = styled(Paper)(({ theme: theme2 }) => ({
114214
+ padding: theme2.spacing(3.5),
114215
+ borderRadius: 12,
114216
+ boxShadow: `0 4px 20px ${alpha(theme2.palette.common.black, 0.08)}`,
114217
+ border: `1px solid ${alpha(theme2.palette.primary.main, 0.1)}`,
114218
+ background: `linear-gradient(135deg, ${alpha(theme2.palette.background.paper, 0.95)} 0%, ${alpha(theme2.palette.background.paper, 0.85)} 100%)`,
114219
+ animation: `${fadeIn} 0.5s ease-out`,
114220
+ transition: "transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out",
114221
+ "&:hover": {
114222
+ boxShadow: `0 6px 25px ${alpha(theme2.palette.primary.main, 0.15)}`,
114223
+ transform: "translateY(-2px)"
114224
+ }
114225
+ }));
114226
+ const SectionTitle$1 = styled(Typography)(({ theme: theme2 }) => ({
114227
+ fontSize: "1.25rem",
114228
+ fontWeight: 700,
114229
+ marginBottom: theme2.spacing(1.5),
114230
+ color: theme2.palette.primary.main,
114231
+ display: "flex",
114232
+ alignItems: "center",
114233
+ gap: theme2.spacing(1)
114234
+ }));
114235
+ const SectionDescription$1 = styled(Typography)(({ theme: theme2 }) => ({
114236
+ fontSize: "1rem",
114237
+ color: theme2.palette.text.secondary,
114238
+ marginBottom: theme2.spacing(2.5),
114239
+ lineHeight: 1.6
114240
+ }));
114241
+ const FormContainer = styled(Box)(() => ({
114242
+ display: "flex",
114243
+ flexDirection: "column",
114244
+ gap: 24,
114245
+ "& .MuiTextField-root": {
114246
+ transition: "transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out",
114247
+ "&:focus-within": {
114248
+ transform: "translateY(-2px)"
114249
+ }
114250
+ }
114251
+ }));
114252
+ styled(Typography)(({ theme: theme2 }) => ({
114253
+ fontSize: "0.95rem",
114254
+ color: theme2.palette.primary.main,
114255
+ cursor: "pointer",
114256
+ fontWeight: 500,
114257
+ display: "inline-flex",
114258
+ alignItems: "center",
114259
+ gap: theme2.spacing(0.5),
114260
+ "&:hover": {
114261
+ textDecoration: "underline",
114262
+ color: theme2.palette.primary.dark
114263
+ },
114264
+ transition: "all 0.2s ease-in-out"
114265
+ }));
114266
+ const CongratulationsContainer = styled(Box)(({ theme: theme2 }) => ({
114267
+ display: "flex",
114268
+ flexDirection: "column",
114269
+ alignItems: "center",
114270
+ textAlign: "center",
114271
+ padding: theme2.spacing(5, 3),
114272
+ animation: `${fadeIn} 0.6s ease-out`
114273
+ }));
114274
+ const CongratulationsIcon = styled(Box)(({ theme: theme2 }) => ({
114275
+ fontSize: "4rem",
114276
+ color: theme2.palette.success.main,
114277
+ marginBottom: theme2.spacing(3),
114278
+ animation: `${pulse} 2s infinite ease-in-out`,
114279
+ display: "flex",
114280
+ alignItems: "center",
114281
+ justifyContent: "center",
114282
+ background: `radial-gradient(circle, ${alpha(theme2.palette.success.main, 0.15)} 0%, transparent 70%)`,
114283
+ borderRadius: "50%",
114284
+ padding: theme2.spacing(2)
114285
+ }));
114286
+ const CongratulationsTitle = styled(Typography)(({ theme: theme2 }) => ({
114287
+ fontSize: "2rem",
114288
+ fontWeight: 700,
114289
+ marginBottom: theme2.spacing(2),
114290
+ color: theme2.palette.primary.main,
114291
+ background: `linear-gradient(90deg, ${theme2.palette.primary.main} 0%, ${theme2.palette.success.main} 100%)`,
114292
+ WebkitBackgroundClip: "text",
114293
+ WebkitTextFillColor: "transparent"
114294
+ }));
114295
+ const CongratulationsMessage = styled(Typography)(({ theme: theme2 }) => ({
114296
+ fontSize: "1.1rem",
114297
+ color: theme2.palette.text.secondary,
114298
+ marginBottom: theme2.spacing(4),
114299
+ maxWidth: 550,
114300
+ lineHeight: 1.6
114301
+ }));
114302
+ const EmojiContainer = styled(Box)(({ theme: theme2 }) => ({
114303
+ display: "inline-flex",
114304
+ marginRight: theme2.spacing(1),
114305
+ fontSize: "1em"
114306
+ }));
113469
114307
  const configQueryKey = ["config"];
113470
114308
  const useConfig = () => {
113471
114309
  return useQuery({
@@ -113490,6 +114328,235 @@ const useConfig = () => {
113490
114328
  staleTime: 5e3
113491
114329
  });
113492
114330
  };
114331
+ const CreateAgentStep = () => {
114332
+ const [name2, setName] = reactExports.useState("");
114333
+ const [description, setDescription] = reactExports.useState("");
114334
+ const [nameError, setNameError] = reactExports.useState("");
114335
+ const [isSaving, setIsSaving] = reactExports.useState(false);
114336
+ const [saveSuccess, setSaveSuccess] = reactExports.useState(false);
114337
+ const successTimeoutRef = reactExports.useRef(null);
114338
+ const { data: configData } = useConfig();
114339
+ const { setCurrentStep } = useOnboardingStore();
114340
+ const createAgentMutation = useCreateAgent();
114341
+ const { setLastChatAgentId } = useAgentSelectionStore();
114342
+ const handleNameChange = (e) => {
114343
+ const value = e.target.value;
114344
+ setName(value);
114345
+ if (!value.trim()) {
114346
+ setNameError("Agent name is required");
114347
+ } else {
114348
+ setNameError("");
114349
+ }
114350
+ };
114351
+ const handleDescriptionChange = (e) => {
114352
+ setDescription(e.target.value);
114353
+ };
114354
+ const handleCreateAgent = async () => {
114355
+ if (name2.trim() && !nameError && configData?.values.hosting && configData?.values.model_name && !isSaving) {
114356
+ try {
114357
+ setIsSaving(true);
114358
+ setSaveSuccess(false);
114359
+ const result = await createAgentMutation.mutateAsync({
114360
+ name: name2.trim(),
114361
+ description: description.trim() || void 0,
114362
+ hosting: configData.values.hosting,
114363
+ model: configData.values.model_name
114364
+ });
114365
+ if (result?.id) {
114366
+ setLastChatAgentId(result.id);
114367
+ sessionStorage.setItem("onboarding_created_agent_id", result.id);
114368
+ }
114369
+ setSaveSuccess(true);
114370
+ if (successTimeoutRef.current) {
114371
+ clearTimeout(successTimeoutRef.current);
114372
+ }
114373
+ successTimeoutRef.current = setTimeout(() => {
114374
+ setSaveSuccess(false);
114375
+ setCurrentStep(OnboardingStep.CONGRATULATIONS);
114376
+ }, 1500);
114377
+ } catch (err) {
114378
+ console.error("Failed to create agent:", err);
114379
+ } finally {
114380
+ setIsSaving(false);
114381
+ }
114382
+ }
114383
+ };
114384
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(SectionContainer, { children: [
114385
+ /* @__PURE__ */ jsxRuntimeExports.jsx(SectionTitle$1, { children: "Create Your First AI Assistant" }),
114386
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(SectionDescription$1, { children: [
114387
+ /* @__PURE__ */ jsxRuntimeExports.jsx(EmojiContainer, { children: "🤖" }),
114388
+ " It's time to create your very first AI assistant! Give it a name and personality that reflects what you want it to help you with. This is where the magic begins!"
114389
+ ] }),
114390
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(
114391
+ Box,
114392
+ {
114393
+ sx: {
114394
+ p: 2,
114395
+ mb: 3,
114396
+ borderRadius: 2,
114397
+ background: (theme2) => `linear-gradient(135deg, ${alpha(theme2.palette.primary.main, 0.05)} 0%, ${alpha(theme2.palette.secondary.main, 0.05)} 100%)`,
114398
+ border: (theme2) => `1px solid ${alpha(theme2.palette.primary.main, 0.1)}`,
114399
+ display: "flex",
114400
+ alignItems: "center"
114401
+ },
114402
+ children: [
114403
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
114404
+ FontAwesomeIcon,
114405
+ {
114406
+ icon: faLightbulb,
114407
+ style: {
114408
+ fontSize: "1.5rem",
114409
+ marginRight: "12px",
114410
+ color: "#ff9800"
114411
+ }
114412
+ }
114413
+ ),
114414
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(Typography, { variant: "body2", children: [
114415
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Box, { component: "span", sx: { fontWeight: 600 }, children: "Pro tip!" }),
114416
+ " ",
114417
+ `Give your agent a descriptive name and purpose. For example, "Research Assistant" or "Creative Writing Partner" will help you remember what it's designed to do.`
114418
+ ] })
114419
+ ]
114420
+ }
114421
+ ),
114422
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(FormContainer, { children: [
114423
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Box, { sx: { position: "relative" }, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
114424
+ TextField,
114425
+ {
114426
+ label: "Agent Name",
114427
+ variant: "outlined",
114428
+ fullWidth: true,
114429
+ value: name2,
114430
+ onChange: handleNameChange,
114431
+ error: !!nameError,
114432
+ helperText: nameError || "Give your AI assistant a memorable name",
114433
+ placeholder: "My Awesome Assistant",
114434
+ required: true,
114435
+ disabled: isSaving,
114436
+ InputProps: {
114437
+ startAdornment: /* @__PURE__ */ jsxRuntimeExports.jsx(
114438
+ FontAwesomeIcon,
114439
+ {
114440
+ icon: faRobot,
114441
+ style: { marginRight: "10px", color: "#666" }
114442
+ }
114443
+ )
114444
+ },
114445
+ sx: {
114446
+ "& .MuiOutlinedInput-root": {
114447
+ "&.Mui-focused fieldset": {
114448
+ borderColor: "primary.main",
114449
+ borderWidth: 2
114450
+ }
114451
+ }
114452
+ }
114453
+ }
114454
+ ) }),
114455
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Box, { sx: { position: "relative" }, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
114456
+ TextField,
114457
+ {
114458
+ label: "Description (Optional)",
114459
+ variant: "outlined",
114460
+ fullWidth: true,
114461
+ value: description,
114462
+ onChange: handleDescriptionChange,
114463
+ helperText: "Describe what your AI assistant will help you with",
114464
+ placeholder: "A helpful assistant for research, writing, coding...",
114465
+ multiline: true,
114466
+ rows: 3,
114467
+ disabled: isSaving,
114468
+ InputProps: {
114469
+ startAdornment: /* @__PURE__ */ jsxRuntimeExports.jsx(
114470
+ FontAwesomeIcon,
114471
+ {
114472
+ icon: faLightbulb,
114473
+ style: {
114474
+ marginRight: "10px",
114475
+ marginTop: "16px",
114476
+ color: "#666"
114477
+ }
114478
+ }
114479
+ )
114480
+ },
114481
+ sx: {
114482
+ "& .MuiOutlinedInput-root": {
114483
+ "&.Mui-focused fieldset": {
114484
+ borderColor: "primary.main",
114485
+ borderWidth: 2
114486
+ }
114487
+ }
114488
+ }
114489
+ }
114490
+ ) }),
114491
+ saveSuccess && /* @__PURE__ */ jsxRuntimeExports.jsx(
114492
+ Alert,
114493
+ {
114494
+ severity: "success",
114495
+ icon: /* @__PURE__ */ jsxRuntimeExports.jsx(FontAwesomeIcon, { icon: faCheck }),
114496
+ sx: {
114497
+ mt: 2,
114498
+ mb: 2,
114499
+ animation: "fadeIn 0.5s ease-out",
114500
+ border: (theme2) => `1px solid ${alpha(theme2.palette.success.main, 0.5)}`
114501
+ },
114502
+ children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Box, { sx: { display: "flex", alignItems: "center" }, children: [
114503
+ /* @__PURE__ */ jsxRuntimeExports.jsx(EmojiContainer, { children: "🎉" }),
114504
+ " Your AI assistant has been created successfully! Get ready for amazing conversations!"
114505
+ ] })
114506
+ }
114507
+ ),
114508
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
114509
+ Button,
114510
+ {
114511
+ variant: "contained",
114512
+ color: "primary",
114513
+ fullWidth: true,
114514
+ onClick: handleCreateAgent,
114515
+ disabled: !name2.trim() || !!nameError || isSaving,
114516
+ startIcon: /* @__PURE__ */ jsxRuntimeExports.jsx(FontAwesomeIcon, { icon: faMagicWandSparkles }),
114517
+ sx: {
114518
+ mt: 3,
114519
+ py: 1.5,
114520
+ fontSize: "1rem",
114521
+ fontWeight: 600,
114522
+ borderRadius: 2,
114523
+ background: (theme2) => `linear-gradient(90deg, ${theme2.palette.primary.main}, ${theme2.palette.secondary.main})`,
114524
+ boxShadow: (theme2) => `0 4px 15px ${alpha(theme2.palette.primary.main, 0.4)}`,
114525
+ "&:hover": {
114526
+ background: (theme2) => `linear-gradient(90deg, ${theme2.palette.primary.dark}, ${theme2.palette.secondary.dark})`,
114527
+ boxShadow: (theme2) => `0 6px 20px ${alpha(theme2.palette.primary.main, 0.6)}`,
114528
+ transform: "translateY(-2px)"
114529
+ },
114530
+ transition: "all 0.3s ease"
114531
+ },
114532
+ children: isSaving ? /* @__PURE__ */ jsxRuntimeExports.jsx(CircularProgress, { size: 24 }) : "Create My AI Assistant"
114533
+ }
114534
+ ),
114535
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(
114536
+ Box,
114537
+ {
114538
+ sx: {
114539
+ mt: 2,
114540
+ display: "flex",
114541
+ alignItems: "center",
114542
+ justifyContent: "center"
114543
+ },
114544
+ children: [
114545
+ /* @__PURE__ */ jsxRuntimeExports.jsx(EmojiContainer, { children: "💫" }),
114546
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
114547
+ Typography,
114548
+ {
114549
+ variant: "body2",
114550
+ sx: { color: "text.secondary", fontStyle: "italic" },
114551
+ children: "This is the final step before your AI journey begins!"
114552
+ }
114553
+ )
114554
+ ]
114555
+ }
114556
+ )
114557
+ ] })
114558
+ ] });
114559
+ };
113493
114560
  const useUpdateConfig = () => {
113494
114561
  const queryClient2 = useQueryClient();
113495
114562
  const client2 = createLocalOperatorClient(apiConfig.baseUrl);
@@ -113535,6 +114602,1338 @@ const useUpdateConfig = () => {
113535
114602
  }
113536
114603
  });
113537
114604
  };
114605
+ const DefaultModelStep = () => {
114606
+ const {
114607
+ providers: providers2,
114608
+ models,
114609
+ isLoading: isLoadingModels,
114610
+ refreshModels
114611
+ } = useModels({ autoFetch: false });
114612
+ const { data: credentialsData, isLoading: isLoadingCredentials } = useCredentials();
114613
+ const { isLoading: isLoadingConfig } = useConfig();
114614
+ const updateConfigMutation = useUpdateConfig();
114615
+ const [selectedProvider, setSelectedProvider] = reactExports.useState("");
114616
+ const [selectedModel, setSelectedModel] = reactExports.useState("");
114617
+ const [isSaving, setIsSaving] = reactExports.useState(false);
114618
+ const [saveSuccess, setSaveSuccess] = reactExports.useState(false);
114619
+ const successTimeoutRef = reactExports.useRef(null);
114620
+ const hasRefreshedModelsRef = reactExports.useRef(false);
114621
+ const availableProviders = reactExports.useMemo(() => {
114622
+ if (!providers2 || !credentialsData) return [];
114623
+ return providers2.filter((provider) => {
114624
+ const providerKey = `${provider.id.toUpperCase()}_API_KEY`;
114625
+ return credentialsData.keys.includes(providerKey);
114626
+ });
114627
+ }, [providers2, credentialsData]);
114628
+ const availableModels = reactExports.useMemo(() => {
114629
+ if (!models || !selectedProvider) return [];
114630
+ return models.filter((model) => model.provider === selectedProvider);
114631
+ }, [models, selectedProvider]);
114632
+ const handleProviderChange = (event) => {
114633
+ const newProvider = event.target.value;
114634
+ setSelectedProvider(newProvider);
114635
+ setSelectedModel("");
114636
+ setSaveSuccess(false);
114637
+ };
114638
+ const handleModelChange = (event) => {
114639
+ const newModel = event.target.value;
114640
+ setSelectedModel(newModel);
114641
+ setSaveSuccess(false);
114642
+ if (selectedProvider && newModel) {
114643
+ saveModelConfig(selectedProvider, newModel);
114644
+ }
114645
+ };
114646
+ const saveModelConfig = reactExports.useCallback(
114647
+ async (provider, model) => {
114648
+ if (provider && model && !isSaving) {
114649
+ try {
114650
+ setIsSaving(true);
114651
+ setSaveSuccess(false);
114652
+ await updateConfigMutation.mutateAsync({
114653
+ hosting: provider,
114654
+ model_name: model
114655
+ });
114656
+ setSaveSuccess(true);
114657
+ if (successTimeoutRef.current) {
114658
+ clearTimeout(successTimeoutRef.current);
114659
+ }
114660
+ successTimeoutRef.current = setTimeout(() => {
114661
+ setSaveSuccess(false);
114662
+ }, 3e3);
114663
+ } catch (err) {
114664
+ console.error("Failed to update default model:", err);
114665
+ setSaveSuccess(false);
114666
+ } finally {
114667
+ setIsSaving(false);
114668
+ }
114669
+ }
114670
+ },
114671
+ [isSaving, updateConfigMutation]
114672
+ );
114673
+ reactExports.useEffect(() => {
114674
+ return () => {
114675
+ if (successTimeoutRef.current) {
114676
+ clearTimeout(successTimeoutRef.current);
114677
+ }
114678
+ };
114679
+ }, []);
114680
+ reactExports.useEffect(() => {
114681
+ if (credentialsData && !isLoadingCredentials && !hasRefreshedModelsRef.current) {
114682
+ refreshModels();
114683
+ hasRefreshedModelsRef.current = true;
114684
+ }
114685
+ }, [credentialsData, isLoadingCredentials, refreshModels]);
114686
+ reactExports.useEffect(() => {
114687
+ if (isLoadingModels || isLoadingCredentials || isLoadingConfig || !credentialsData || !providers2 || availableProviders.length === 0)
114688
+ return;
114689
+ if (selectedProvider) return;
114690
+ let provider = availableProviders[0].id;
114691
+ for (const p2 of availableProviders) {
114692
+ const providerKey = `${p2.id.toUpperCase()}_API_KEY`;
114693
+ if (credentialsData.keys.includes(providerKey)) {
114694
+ provider = p2.id;
114695
+ break;
114696
+ }
114697
+ }
114698
+ setSelectedProvider(provider);
114699
+ }, [
114700
+ availableProviders,
114701
+ providers2,
114702
+ isLoadingModels,
114703
+ isLoadingCredentials,
114704
+ isLoadingConfig,
114705
+ credentialsData,
114706
+ selectedProvider
114707
+ ]);
114708
+ reactExports.useEffect(() => {
114709
+ if (availableModels.length > 0 && !selectedModel) {
114710
+ setSelectedModel(availableModels[0].id);
114711
+ if (selectedProvider && availableModels[0].id) {
114712
+ saveModelConfig(selectedProvider, availableModels[0].id);
114713
+ }
114714
+ }
114715
+ }, [availableModels, selectedModel, selectedProvider, saveModelConfig]);
114716
+ const isLoading = isLoadingModels || isLoadingCredentials || isLoadingConfig;
114717
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(SectionContainer, { children: [
114718
+ /* @__PURE__ */ jsxRuntimeExports.jsx(SectionTitle$1, { children: "Choose Your Default Model" }),
114719
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(SectionDescription$1, { children: [
114720
+ /* @__PURE__ */ jsxRuntimeExports.jsx(EmojiContainer, { children: "✨" }),
114721
+ " Select your preferred AI model and provider that will power all your agents. Don't worry, you can always customize this for individual agents later!"
114722
+ ] }),
114723
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(
114724
+ Box,
114725
+ {
114726
+ sx: {
114727
+ p: 2,
114728
+ mb: 3,
114729
+ borderRadius: 2,
114730
+ background: (theme2) => `linear-gradient(135deg, ${alpha(theme2.palette.primary.main, 0.05)} 0%, ${alpha(theme2.palette.secondary.main, 0.05)} 100%)`,
114731
+ border: (theme2) => `1px solid ${alpha(theme2.palette.primary.main, 0.1)}`,
114732
+ display: "flex",
114733
+ alignItems: "center"
114734
+ },
114735
+ children: [
114736
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
114737
+ FontAwesomeIcon,
114738
+ {
114739
+ icon: faBrain,
114740
+ style: {
114741
+ fontSize: "1.5rem",
114742
+ marginRight: "12px",
114743
+ color: "#7e57c2"
114744
+ }
114745
+ }
114746
+ ),
114747
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(Typography, { variant: "body2", children: [
114748
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Box, { component: "span", sx: { fontWeight: 600 }, children: "Choose wisely!" }),
114749
+ " ",
114750
+ "Different models have different capabilities, strengths, and specialties. Pick the one that best suits your needs."
114751
+ ] })
114752
+ ]
114753
+ }
114754
+ ),
114755
+ /* @__PURE__ */ jsxRuntimeExports.jsx(FormContainer, { children: isLoading ? /* @__PURE__ */ jsxRuntimeExports.jsx(Box, { sx: { display: "flex", justifyContent: "center", p: 3 }, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Typography, { sx: { display: "flex", alignItems: "center" }, children: [
114756
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
114757
+ EmojiContainer,
114758
+ {
114759
+ style: {
114760
+ marginRight: "8px",
114761
+ animation: "pulse 1.5s infinite ease-in-out"
114762
+ },
114763
+ children: "⏳"
114764
+ }
114765
+ ),
114766
+ "Loading available AI models..."
114767
+ ] }) }) : /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
114768
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(
114769
+ FormControl,
114770
+ {
114771
+ fullWidth: true,
114772
+ variant: "outlined",
114773
+ sx: {
114774
+ "& .MuiOutlinedInput-root": {
114775
+ "&.Mui-focused fieldset": {
114776
+ borderColor: "primary.main",
114777
+ borderWidth: 2
114778
+ }
114779
+ }
114780
+ },
114781
+ children: [
114782
+ /* @__PURE__ */ jsxRuntimeExports.jsx(InputLabel, { id: "provider-select-label", children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Box, { sx: { display: "flex", alignItems: "center", gap: 1 }, children: [
114783
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
114784
+ FontAwesomeIcon,
114785
+ {
114786
+ icon: faRobot,
114787
+ style: { fontSize: "0.9rem" }
114788
+ }
114789
+ ),
114790
+ "Model Provider"
114791
+ ] }) }),
114792
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
114793
+ Select,
114794
+ {
114795
+ labelId: "provider-select-label",
114796
+ id: "provider-select",
114797
+ value: selectedProvider,
114798
+ onChange: handleProviderChange,
114799
+ label: "Model Provider",
114800
+ children: availableProviders.map((provider) => /* @__PURE__ */ jsxRuntimeExports.jsx(MenuItem, { value: provider.id, children: provider.name }, provider.id))
114801
+ }
114802
+ ),
114803
+ /* @__PURE__ */ jsxRuntimeExports.jsx(FormHelperText, { children: "Choose your AI provider from the ones you've added credentials for" })
114804
+ ]
114805
+ }
114806
+ ),
114807
+ selectedProvider && /* @__PURE__ */ jsxRuntimeExports.jsxs(
114808
+ FormControl,
114809
+ {
114810
+ fullWidth: true,
114811
+ variant: "outlined",
114812
+ sx: {
114813
+ mt: 2,
114814
+ "& .MuiOutlinedInput-root": {
114815
+ "&.Mui-focused fieldset": {
114816
+ borderColor: "primary.main",
114817
+ borderWidth: 2
114818
+ }
114819
+ },
114820
+ animation: "fadeIn 0.5s ease-out"
114821
+ },
114822
+ children: [
114823
+ /* @__PURE__ */ jsxRuntimeExports.jsx(InputLabel, { id: "model-select-label", children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Box, { sx: { display: "flex", alignItems: "center", gap: 1 }, children: [
114824
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
114825
+ FontAwesomeIcon,
114826
+ {
114827
+ icon: faWandMagicSparkles,
114828
+ style: { fontSize: "0.9rem" }
114829
+ }
114830
+ ),
114831
+ "AI Model"
114832
+ ] }) }),
114833
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
114834
+ Select,
114835
+ {
114836
+ labelId: "model-select-label",
114837
+ id: "model-select",
114838
+ value: selectedModel,
114839
+ onChange: handleModelChange,
114840
+ label: "AI Model",
114841
+ children: availableModels.map((model) => /* @__PURE__ */ jsxRuntimeExports.jsx(MenuItem, { value: model.id, children: model.name }, model.id))
114842
+ }
114843
+ ),
114844
+ /* @__PURE__ */ jsxRuntimeExports.jsx(FormHelperText, { children: "Select the specific AI model you want to use" })
114845
+ ]
114846
+ }
114847
+ ),
114848
+ saveSuccess && /* @__PURE__ */ jsxRuntimeExports.jsx(
114849
+ Alert,
114850
+ {
114851
+ severity: "success",
114852
+ icon: /* @__PURE__ */ jsxRuntimeExports.jsx(FontAwesomeIcon, { icon: faCheck }),
114853
+ sx: {
114854
+ mt: 3,
114855
+ mb: 2,
114856
+ animation: "fadeIn 0.5s ease-out",
114857
+ border: (theme2) => `1px solid ${alpha(theme2.palette.success.main, 0.5)}`
114858
+ },
114859
+ children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Box, { sx: { display: "flex", alignItems: "center" }, children: [
114860
+ /* @__PURE__ */ jsxRuntimeExports.jsx(EmojiContainer, { children: "🎉" }),
114861
+ " Default model configuration saved successfully! Your AI is ready to go!"
114862
+ ] })
114863
+ }
114864
+ ),
114865
+ selectedProvider && selectedModel && /* @__PURE__ */ jsxRuntimeExports.jsx(
114866
+ Box,
114867
+ {
114868
+ sx: {
114869
+ mt: 3,
114870
+ p: 2.5,
114871
+ borderRadius: 2,
114872
+ background: (theme2) => alpha(theme2.palette.success.light, 0.1),
114873
+ border: (theme2) => `1px solid ${alpha(theme2.palette.success.main, 0.2)}`,
114874
+ animation: "fadeIn 0.5s ease-out"
114875
+ },
114876
+ children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Box, { sx: { display: "flex", alignItems: "flex-start" }, children: [
114877
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
114878
+ EmojiContainer,
114879
+ {
114880
+ style: {
114881
+ marginRight: "8px",
114882
+ fontSize: "1.2rem",
114883
+ flexShrink: 0
114884
+ },
114885
+ children: "🚀"
114886
+ }
114887
+ ),
114888
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(
114889
+ Typography,
114890
+ {
114891
+ variant: "body2",
114892
+ sx: {
114893
+ fontWeight: 500,
114894
+ whiteSpace: "normal"
114895
+ },
114896
+ children: [
114897
+ "Great choice! You've selected",
114898
+ " ",
114899
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
114900
+ Box,
114901
+ {
114902
+ component: "span",
114903
+ sx: {
114904
+ fontWeight: 700,
114905
+ color: "primary.main",
114906
+ display: "inline"
114907
+ },
114908
+ children: availableModels.find(
114909
+ (model) => model.id === selectedModel
114910
+ )?.name
114911
+ }
114912
+ ),
114913
+ " ",
114914
+ "from",
114915
+ " ",
114916
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
114917
+ Box,
114918
+ {
114919
+ component: "span",
114920
+ sx: {
114921
+ fontWeight: 700,
114922
+ color: "primary.main",
114923
+ display: "inline"
114924
+ },
114925
+ children: availableProviders.find(
114926
+ (provider) => provider.id === selectedProvider
114927
+ )?.name
114928
+ }
114929
+ ),
114930
+ " ",
114931
+ "as your default AI model."
114932
+ ]
114933
+ }
114934
+ )
114935
+ ] })
114936
+ }
114937
+ )
114938
+ ] }) })
114939
+ ] });
114940
+ };
114941
+ const CREDENTIAL_MANIFEST = [
114942
+ {
114943
+ key: "OPENAI_API_KEY",
114944
+ name: "OpenAI API Key",
114945
+ description: "API key for accessing OpenAI models like GPT-4o, o3-mini, and GPT-4.5.",
114946
+ url: "https://platform.openai.com/api-keys"
114947
+ },
114948
+ {
114949
+ key: "OPENROUTER_API_KEY",
114950
+ name: "OpenRouter API Key",
114951
+ description: "API key for OpenRouter, which provides access to various AI models from different providers. Getting an openrouter key allows you to simultaneously access many models from different providers.",
114952
+ url: "https://openrouter.ai/keys"
114953
+ },
114954
+ {
114955
+ key: "DEEPSEEK_API_KEY",
114956
+ name: "DeepSeek API Key",
114957
+ description: "API key for DeepSeek AI models, specialized in code generation and understanding.",
114958
+ url: "https://platform.deepseek.com/"
114959
+ },
114960
+ {
114961
+ key: "MISTRAL_API_KEY",
114962
+ name: "Mistral API Key",
114963
+ description: "API key for Mistral AI models, known for efficient and powerful language processing.",
114964
+ url: "https://console.mistral.ai/api-keys/"
114965
+ },
114966
+ {
114967
+ key: "KIMI_API_KEY",
114968
+ name: "Kimi API Key",
114969
+ description: "API key for Kimi AI, providing advanced language models with strong reasoning capabilities.",
114970
+ url: "https://kimi.moonshot.cn/"
114971
+ },
114972
+ {
114973
+ key: "ALIBABA_CLOUD_API_KEY",
114974
+ name: "Alibaba Cloud API Key",
114975
+ description: "API key for Alibaba Cloud AI models, offering a range of language and vision capabilities such as Qwen.",
114976
+ url: "https://www.alibabacloud.com/product/ai"
114977
+ },
114978
+ {
114979
+ key: "GOOGLE_AI_STUDIO_API_KEY",
114980
+ name: "Google AI Studio API Key",
114981
+ description: "API key for Google AI Studio, providing access to Gemini and other Google AI models.",
114982
+ url: "https://aistudio.google.com/"
114983
+ },
114984
+ {
114985
+ key: "ANTHROPIC_API_KEY",
114986
+ name: "Anthropic API Key",
114987
+ description: "API key for Anthropic's Claude models, known for agentic code generation capabilities.",
114988
+ url: "https://console.anthropic.com/settings/keys"
114989
+ },
114990
+ {
114991
+ key: "SERP_API_KEY",
114992
+ name: "SERP API Key",
114993
+ description: "API key for Search Engine Results Page API, allowing access to search engine data. Allows your agents to search the web for information.",
114994
+ url: "https://serpapi.com/dashboard"
114995
+ },
114996
+ {
114997
+ key: "TAVILY_API_KEY",
114998
+ name: "Tavily API Key",
114999
+ description: "API key for Tavily, a search API designed specifically for AI applications. Allows your agents to search the web for information.",
115000
+ url: "https://tavily.com/#api"
115001
+ }
115002
+ ];
115003
+ const getCredentialInfo = (key) => {
115004
+ return CREDENTIAL_MANIFEST.find((cred) => cred.key === key) || {
115005
+ key,
115006
+ name: key,
115007
+ description: "Custom credential",
115008
+ url: ""
115009
+ };
115010
+ };
115011
+ const useUpdateCredential = () => {
115012
+ const queryClient2 = useQueryClient();
115013
+ const client2 = createLocalOperatorClient(apiConfig.baseUrl);
115014
+ return useMutation({
115015
+ mutationFn: async (credentialUpdate) => {
115016
+ try {
115017
+ const response = await client2.credentials.updateCredential(credentialUpdate);
115018
+ if (response.status >= 400) {
115019
+ throw new Error(response.message || "Failed to update credential");
115020
+ }
115021
+ return response;
115022
+ } catch (error) {
115023
+ const errorMessage = error instanceof Error ? error.message : "An unknown error occurred while updating credential";
115024
+ y$1.error(errorMessage);
115025
+ throw error;
115026
+ }
115027
+ },
115028
+ onSuccess: async (_data, variables) => {
115029
+ await queryClient2.invalidateQueries({
115030
+ queryKey: credentialsQueryKey,
115031
+ refetchType: "none"
115032
+ // Don't automatically refetch
115033
+ });
115034
+ queryClient2.setQueryData(
115035
+ credentialsQueryKey,
115036
+ (oldData) => {
115037
+ if (!oldData) return oldData;
115038
+ if (!oldData.keys.includes(variables.key)) {
115039
+ return {
115040
+ ...oldData,
115041
+ keys: [...oldData.keys, variables.key]
115042
+ };
115043
+ }
115044
+ return oldData;
115045
+ }
115046
+ );
115047
+ await queryClient2.refetchQueries({
115048
+ queryKey: credentialsQueryKey,
115049
+ type: "all"
115050
+ // Refetch all related queries at once
115051
+ });
115052
+ y$1.success(`Credential "${variables.key}" updated successfully`);
115053
+ },
115054
+ onError: (error) => {
115055
+ console.error("Error updating credential:", error);
115056
+ }
115057
+ });
115058
+ };
115059
+ const ModelCredentialStep = () => {
115060
+ const modelProviderCredentials = CREDENTIAL_MANIFEST.filter(
115061
+ (cred) => cred.key !== "SERP_API_KEY" && cred.key !== "TAVILY_API_KEY"
115062
+ );
115063
+ const [selectedCredential, setSelectedCredential] = reactExports.useState(
115064
+ modelProviderCredentials[0]?.key || ""
115065
+ );
115066
+ const [credentialValue, setCredentialValue] = reactExports.useState("");
115067
+ const [error, setError] = reactExports.useState("");
115068
+ const [isSaving, setIsSaving] = reactExports.useState(false);
115069
+ const [saveSuccess, setSaveSuccess] = reactExports.useState(false);
115070
+ const { data: credentialsData } = useCredentials();
115071
+ const updateCredentialMutation = useUpdateCredential();
115072
+ const { refreshModels } = useModels();
115073
+ reactExports.useEffect(() => {
115074
+ if (credentialsData?.keys.includes(selectedCredential) && !saveSuccess) {
115075
+ setError("This credential is already set");
115076
+ } else {
115077
+ setError("");
115078
+ }
115079
+ }, [selectedCredential, credentialsData, saveSuccess]);
115080
+ const handleCredentialChange = (event) => {
115081
+ setSelectedCredential(event.target.value);
115082
+ setCredentialValue("");
115083
+ setError("");
115084
+ setSaveSuccess(false);
115085
+ };
115086
+ const handleCredentialValueChange = (event) => {
115087
+ setCredentialValue(event.target.value);
115088
+ if (!event.target.value.trim()) {
115089
+ setError("API key is required");
115090
+ } else {
115091
+ setError("");
115092
+ }
115093
+ setSaveSuccess(false);
115094
+ };
115095
+ const successTimeoutRef = reactExports.useRef(null);
115096
+ const handleSaveCredential = async () => {
115097
+ if (selectedCredential && credentialValue.trim() && !credentialsData?.keys.includes(selectedCredential) && !isSaving) {
115098
+ try {
115099
+ setIsSaving(true);
115100
+ setSaveSuccess(false);
115101
+ await updateCredentialMutation.mutateAsync({
115102
+ key: selectedCredential,
115103
+ value: credentialValue.trim()
115104
+ });
115105
+ setSaveSuccess(true);
115106
+ refreshModels();
115107
+ if (successTimeoutRef.current) {
115108
+ clearTimeout(successTimeoutRef.current);
115109
+ }
115110
+ successTimeoutRef.current = setTimeout(() => {
115111
+ setSaveSuccess(false);
115112
+ }, 3e3);
115113
+ } catch (err) {
115114
+ console.error("Failed to save credential:", err);
115115
+ setSaveSuccess(false);
115116
+ } finally {
115117
+ setIsSaving(false);
115118
+ }
115119
+ }
115120
+ };
115121
+ reactExports.useEffect(() => {
115122
+ return () => {
115123
+ if (successTimeoutRef.current) {
115124
+ clearTimeout(successTimeoutRef.current);
115125
+ }
115126
+ };
115127
+ }, []);
115128
+ const selectedCredentialInfo = CREDENTIAL_MANIFEST.find(
115129
+ (cred) => cred.key === selectedCredential
115130
+ );
115131
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(SectionContainer, { children: [
115132
+ /* @__PURE__ */ jsxRuntimeExports.jsx(SectionTitle$1, { children: "Add Model Provider Credential" }),
115133
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(SectionDescription$1, { children: [
115134
+ /* @__PURE__ */ jsxRuntimeExports.jsx(EmojiContainer, { children: "✨" }),
115135
+ " To unlock the power of AI models, you need to add at least one model provider API key. Your key will be securely stored on your device and used to access amazing AI capabilities!"
115136
+ ] }),
115137
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(FormContainer, { children: [
115138
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(
115139
+ FormControl,
115140
+ {
115141
+ fullWidth: true,
115142
+ variant: "outlined",
115143
+ sx: {
115144
+ "& .MuiOutlinedInput-root": {
115145
+ "&.Mui-focused fieldset": {
115146
+ borderColor: "primary.main",
115147
+ borderWidth: 2
115148
+ }
115149
+ }
115150
+ },
115151
+ children: [
115152
+ /* @__PURE__ */ jsxRuntimeExports.jsx(InputLabel, { id: "credential-select-label", children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Box, { sx: { display: "flex", alignItems: "center", gap: 1 }, children: [
115153
+ /* @__PURE__ */ jsxRuntimeExports.jsx(EmojiContainer, { children: "🤖" }),
115154
+ " Model Provider"
115155
+ ] }) }),
115156
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
115157
+ Select,
115158
+ {
115159
+ labelId: "credential-select-label",
115160
+ id: "credential-select",
115161
+ value: selectedCredential,
115162
+ onChange: handleCredentialChange,
115163
+ label: "🤖 Model Provider",
115164
+ children: modelProviderCredentials.map((cred) => /* @__PURE__ */ jsxRuntimeExports.jsx(MenuItem, { value: cred.key, children: cred.name }, cred.key))
115165
+ }
115166
+ ),
115167
+ /* @__PURE__ */ jsxRuntimeExports.jsx(FormHelperText, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Box, { sx: { display: "flex", alignItems: "center" }, children: [
115168
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
115169
+ FontAwesomeIcon,
115170
+ {
115171
+ icon: faShieldAlt,
115172
+ style: {
115173
+ marginRight: "6px",
115174
+ fontSize: "0.8rem",
115175
+ color: "#666"
115176
+ }
115177
+ }
115178
+ ),
115179
+ "Select your preferred AI model provider"
115180
+ ] }) })
115181
+ ]
115182
+ }
115183
+ ),
115184
+ selectedCredentialInfo && /* @__PURE__ */ jsxRuntimeExports.jsxs(
115185
+ Box,
115186
+ {
115187
+ sx: {
115188
+ mt: 2,
115189
+ p: 2,
115190
+ borderRadius: 2,
115191
+ border: (theme2) => `1px solid ${alpha(theme2.palette.primary.main, 0.2)}`,
115192
+ background: (theme2) => alpha(theme2.palette.background.paper, 0.5)
115193
+ },
115194
+ children: [
115195
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
115196
+ Typography,
115197
+ {
115198
+ variant: "body2",
115199
+ sx: { mb: 1, display: "flex", alignItems: "center" },
115200
+ children: selectedCredentialInfo.description
115201
+ }
115202
+ ),
115203
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(
115204
+ Link,
115205
+ {
115206
+ href: selectedCredentialInfo.url,
115207
+ target: "_blank",
115208
+ rel: "noopener noreferrer",
115209
+ sx: {
115210
+ display: "inline-flex",
115211
+ alignItems: "center",
115212
+ mb: 1,
115213
+ color: "primary.main",
115214
+ fontWeight: 500,
115215
+ "&:hover": {
115216
+ textDecoration: "none",
115217
+ color: "primary.dark"
115218
+ }
115219
+ },
115220
+ children: [
115221
+ /* @__PURE__ */ jsxRuntimeExports.jsx(EmojiContainer, { children: "🔗" }),
115222
+ " Get",
115223
+ " ",
115224
+ selectedCredentialInfo.name,
115225
+ " ",
115226
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
115227
+ FontAwesomeIcon,
115228
+ {
115229
+ icon: faExternalLinkAlt,
115230
+ style: { marginLeft: "4px", fontSize: "0.8rem" }
115231
+ }
115232
+ )
115233
+ ]
115234
+ }
115235
+ )
115236
+ ]
115237
+ }
115238
+ ),
115239
+ saveSuccess && /* @__PURE__ */ jsxRuntimeExports.jsx(
115240
+ Alert,
115241
+ {
115242
+ severity: "success",
115243
+ icon: /* @__PURE__ */ jsxRuntimeExports.jsx(FontAwesomeIcon, { icon: faCheck }),
115244
+ sx: {
115245
+ mb: 2,
115246
+ animation: "fadeIn 0.5s ease-out",
115247
+ border: (theme2) => `1px solid ${alpha(theme2.palette.success.main, 0.5)}`
115248
+ },
115249
+ children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Box, { sx: { display: "flex", alignItems: "center" }, children: [
115250
+ /* @__PURE__ */ jsxRuntimeExports.jsx(EmojiContainer, { children: "🎉" }),
115251
+ " Credential saved successfully! You're one step closer to AI magic!"
115252
+ ] })
115253
+ }
115254
+ ),
115255
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
115256
+ TextField,
115257
+ {
115258
+ label: "API Key",
115259
+ variant: "outlined",
115260
+ fullWidth: true,
115261
+ value: credentialValue,
115262
+ onChange: handleCredentialValueChange,
115263
+ error: !!error,
115264
+ helperText: error || "Enter your API key to connect with powerful AI models",
115265
+ placeholder: "Enter your API key here",
115266
+ required: true,
115267
+ type: "password",
115268
+ onBlur: handleSaveCredential,
115269
+ onKeyDown: (e) => {
115270
+ if (e.key === "Enter" && selectedCredential && credentialValue.trim() && !error && !isSaving) {
115271
+ handleSaveCredential();
115272
+ }
115273
+ },
115274
+ InputProps: {
115275
+ startAdornment: /* @__PURE__ */ jsxRuntimeExports.jsx(
115276
+ FontAwesomeIcon,
115277
+ {
115278
+ icon: faKey,
115279
+ style: { marginRight: "10px", color: "#666" }
115280
+ }
115281
+ ),
115282
+ endAdornment: isSaving ? /* @__PURE__ */ jsxRuntimeExports.jsx(CircularProgress, { size: 20 }) : null
115283
+ },
115284
+ disabled: isSaving,
115285
+ sx: {
115286
+ "& .MuiOutlinedInput-root": {
115287
+ "&.Mui-focused fieldset": {
115288
+ borderColor: "primary.main",
115289
+ borderWidth: 2
115290
+ }
115291
+ }
115292
+ }
115293
+ }
115294
+ ),
115295
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(
115296
+ Box,
115297
+ {
115298
+ sx: {
115299
+ mt: 2,
115300
+ display: "flex",
115301
+ alignItems: "center",
115302
+ p: 1.5,
115303
+ borderRadius: 1,
115304
+ background: (theme2) => alpha(theme2.palette.info.main, 0.05)
115305
+ },
115306
+ children: [
115307
+ /* @__PURE__ */ jsxRuntimeExports.jsx(EmojiContainer, { children: "🔒" }),
115308
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
115309
+ Typography,
115310
+ {
115311
+ variant: "body2",
115312
+ sx: { color: "text.secondary", fontStyle: "italic" },
115313
+ children: "Your API keys are stored securely on your device and are never shared with anyone."
115314
+ }
115315
+ )
115316
+ ]
115317
+ }
115318
+ )
115319
+ ] })
115320
+ ] });
115321
+ };
115322
+ const SearchApiStep = () => {
115323
+ const searchApiCredentials = CREDENTIAL_MANIFEST.filter(
115324
+ (cred) => cred.key === "SERP_API_KEY" || cred.key === "TAVILY_API_KEY"
115325
+ );
115326
+ const [selectedCredential, setSelectedCredential] = reactExports.useState(
115327
+ searchApiCredentials[0]?.key || ""
115328
+ );
115329
+ const [credentialValue, setCredentialValue] = reactExports.useState("");
115330
+ const [error, setError] = reactExports.useState("");
115331
+ const [isSaving, setIsSaving] = reactExports.useState(false);
115332
+ const [saveSuccess, setSaveSuccess] = reactExports.useState(false);
115333
+ const successTimeoutRef = reactExports.useRef(null);
115334
+ const { data: credentialsData } = useCredentials();
115335
+ const updateCredentialMutation = useUpdateCredential();
115336
+ reactExports.useEffect(() => {
115337
+ if (credentialsData?.keys.includes(selectedCredential) && !saveSuccess) {
115338
+ setError("This credential is already set");
115339
+ } else {
115340
+ setError("");
115341
+ }
115342
+ }, [selectedCredential, credentialsData, saveSuccess]);
115343
+ const handleCredentialChange = (event) => {
115344
+ setSelectedCredential(event.target.value);
115345
+ setCredentialValue("");
115346
+ setError("");
115347
+ setSaveSuccess(false);
115348
+ };
115349
+ const handleCredentialValueChange = (event) => {
115350
+ setCredentialValue(event.target.value);
115351
+ if (event.target.value.trim()) {
115352
+ setError("");
115353
+ }
115354
+ setSaveSuccess(false);
115355
+ };
115356
+ const handleSaveCredential = async () => {
115357
+ if (selectedCredential && credentialValue.trim() && !credentialsData?.keys.includes(selectedCredential) && !isSaving) {
115358
+ try {
115359
+ setIsSaving(true);
115360
+ setSaveSuccess(false);
115361
+ await updateCredentialMutation.mutateAsync({
115362
+ key: selectedCredential,
115363
+ value: credentialValue.trim()
115364
+ });
115365
+ setSaveSuccess(true);
115366
+ if (successTimeoutRef.current) {
115367
+ clearTimeout(successTimeoutRef.current);
115368
+ }
115369
+ successTimeoutRef.current = setTimeout(() => {
115370
+ setSaveSuccess(false);
115371
+ }, 3e3);
115372
+ } catch (err) {
115373
+ console.error("Failed to save credential:", err);
115374
+ setSaveSuccess(false);
115375
+ } finally {
115376
+ setIsSaving(false);
115377
+ }
115378
+ }
115379
+ };
115380
+ reactExports.useEffect(() => {
115381
+ return () => {
115382
+ if (successTimeoutRef.current) {
115383
+ clearTimeout(successTimeoutRef.current);
115384
+ }
115385
+ };
115386
+ }, []);
115387
+ const selectedCredentialInfo = CREDENTIAL_MANIFEST.find(
115388
+ (cred) => cred.key === selectedCredential
115389
+ );
115390
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(SectionContainer, { children: [
115391
+ /* @__PURE__ */ jsxRuntimeExports.jsx(SectionTitle$1, { children: "Enable Web Search (Optional)" }),
115392
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(SectionDescription$1, { children: [
115393
+ /* @__PURE__ */ jsxRuntimeExports.jsx(EmojiContainer, { children: "🌐" }),
115394
+ " Supercharge your AI agents with the ability to search the web for real-time information! This optional feature gives your AI assistants access to the latest data from across the internet."
115395
+ ] }),
115396
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(FormContainer, { children: [
115397
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(
115398
+ Box,
115399
+ {
115400
+ sx: {
115401
+ p: 2,
115402
+ mb: 3,
115403
+ borderRadius: 2,
115404
+ background: (theme2) => `linear-gradient(135deg, ${alpha(theme2.palette.primary.main, 0.05)} 0%, ${alpha(theme2.palette.info.main, 0.1)} 100%)`,
115405
+ border: (theme2) => `1px solid ${alpha(theme2.palette.primary.main, 0.1)}`,
115406
+ display: "flex",
115407
+ alignItems: "center"
115408
+ },
115409
+ children: [
115410
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
115411
+ FontAwesomeIcon,
115412
+ {
115413
+ icon: faGlobe,
115414
+ style: {
115415
+ fontSize: "1.5rem",
115416
+ marginRight: "12px",
115417
+ color: "#3f51b5"
115418
+ }
115419
+ }
115420
+ ),
115421
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(Typography, { variant: "body2", children: [
115422
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Box, { component: "span", sx: { fontWeight: 600 }, children: "Web-enabled AI is more powerful!" }),
115423
+ " ",
115424
+ "Your agents can find current information, research topics, and provide up-to-date answers."
115425
+ ] })
115426
+ ]
115427
+ }
115428
+ ),
115429
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(
115430
+ FormControl,
115431
+ {
115432
+ fullWidth: true,
115433
+ variant: "outlined",
115434
+ sx: {
115435
+ "& .MuiOutlinedInput-root": {
115436
+ "&.Mui-focused fieldset": {
115437
+ borderColor: "primary.main",
115438
+ borderWidth: 2
115439
+ }
115440
+ }
115441
+ },
115442
+ children: [
115443
+ /* @__PURE__ */ jsxRuntimeExports.jsx(InputLabel, { id: "search-api-select-label", children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Box, { sx: { display: "flex", alignItems: "center", gap: 1 }, children: [
115444
+ /* @__PURE__ */ jsxRuntimeExports.jsx(EmojiContainer, { children: "🔎" }),
115445
+ " Search API Provider"
115446
+ ] }) }),
115447
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
115448
+ Select,
115449
+ {
115450
+ labelId: "search-api-select-label",
115451
+ id: "search-api-select",
115452
+ value: selectedCredential,
115453
+ onChange: handleCredentialChange,
115454
+ label: "🔎 Search API Provider",
115455
+ children: searchApiCredentials.map((cred) => /* @__PURE__ */ jsxRuntimeExports.jsx(MenuItem, { value: cred.key, children: cred.name }, cred.key))
115456
+ }
115457
+ ),
115458
+ /* @__PURE__ */ jsxRuntimeExports.jsx(FormHelperText, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Box, { sx: { display: "flex", alignItems: "center" }, children: [
115459
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
115460
+ FontAwesomeIcon,
115461
+ {
115462
+ icon: faSearch,
115463
+ style: {
115464
+ marginRight: "6px",
115465
+ fontSize: "0.8rem",
115466
+ color: "#666"
115467
+ }
115468
+ }
115469
+ ),
115470
+ "Choose your preferred search provider"
115471
+ ] }) })
115472
+ ]
115473
+ }
115474
+ ),
115475
+ selectedCredentialInfo && /* @__PURE__ */ jsxRuntimeExports.jsxs(
115476
+ Box,
115477
+ {
115478
+ sx: {
115479
+ mt: 2,
115480
+ p: 2,
115481
+ borderRadius: 2,
115482
+ border: (theme2) => `1px solid ${alpha(theme2.palette.primary.main, 0.2)}`,
115483
+ background: (theme2) => alpha(theme2.palette.background.paper, 0.5)
115484
+ },
115485
+ children: [
115486
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(
115487
+ Typography,
115488
+ {
115489
+ variant: "body2",
115490
+ sx: { mb: 1, display: "flex", alignItems: "center" },
115491
+ children: [
115492
+ /* @__PURE__ */ jsxRuntimeExports.jsx(EmojiContainer, { children: "💡" }),
115493
+ " ",
115494
+ selectedCredentialInfo.description
115495
+ ]
115496
+ }
115497
+ ),
115498
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(
115499
+ Link,
115500
+ {
115501
+ href: selectedCredentialInfo.url,
115502
+ target: "_blank",
115503
+ rel: "noopener noreferrer",
115504
+ sx: {
115505
+ display: "inline-flex",
115506
+ alignItems: "center",
115507
+ mb: 1,
115508
+ color: "primary.main",
115509
+ fontWeight: 500,
115510
+ "&:hover": {
115511
+ textDecoration: "none",
115512
+ color: "primary.dark"
115513
+ }
115514
+ },
115515
+ children: [
115516
+ /* @__PURE__ */ jsxRuntimeExports.jsx(EmojiContainer, { children: "🔗" }),
115517
+ " Get",
115518
+ " ",
115519
+ selectedCredentialInfo.name,
115520
+ " ",
115521
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
115522
+ FontAwesomeIcon,
115523
+ {
115524
+ icon: faExternalLinkAlt,
115525
+ style: { marginLeft: "4px", fontSize: "0.8rem" }
115526
+ }
115527
+ )
115528
+ ]
115529
+ }
115530
+ )
115531
+ ]
115532
+ }
115533
+ ),
115534
+ saveSuccess && /* @__PURE__ */ jsxRuntimeExports.jsx(
115535
+ Alert,
115536
+ {
115537
+ severity: "success",
115538
+ icon: /* @__PURE__ */ jsxRuntimeExports.jsx(FontAwesomeIcon, { icon: faCheck }),
115539
+ sx: {
115540
+ mb: 2,
115541
+ animation: "fadeIn 0.5s ease-out",
115542
+ border: (theme2) => `1px solid ${alpha(theme2.palette.success.main, 0.5)}`
115543
+ },
115544
+ children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Box, { sx: { display: "flex", alignItems: "center" }, children: [
115545
+ /* @__PURE__ */ jsxRuntimeExports.jsx(EmojiContainer, { children: "🎉" }),
115546
+ " Search API credential saved successfully! Your AI can now explore the web!"
115547
+ ] })
115548
+ }
115549
+ ),
115550
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
115551
+ TextField,
115552
+ {
115553
+ label: "API Key",
115554
+ variant: "outlined",
115555
+ fullWidth: true,
115556
+ value: credentialValue,
115557
+ onChange: handleCredentialValueChange,
115558
+ error: !!error,
115559
+ helperText: error || "Enter your API key for the selected provider (optional)",
115560
+ placeholder: "Enter your API key here",
115561
+ type: "password",
115562
+ onBlur: handleSaveCredential,
115563
+ onKeyDown: (e) => {
115564
+ if (e.key === "Enter" && selectedCredential && credentialValue.trim() && !error && !isSaving) {
115565
+ handleSaveCredential();
115566
+ }
115567
+ },
115568
+ InputProps: {
115569
+ startAdornment: /* @__PURE__ */ jsxRuntimeExports.jsx(
115570
+ FontAwesomeIcon,
115571
+ {
115572
+ icon: faKey,
115573
+ style: { marginRight: "10px", color: "#666" }
115574
+ }
115575
+ ),
115576
+ endAdornment: isSaving ? /* @__PURE__ */ jsxRuntimeExports.jsx(CircularProgress, { size: 20 }) : null
115577
+ },
115578
+ disabled: isSaving,
115579
+ sx: {
115580
+ "& .MuiOutlinedInput-root": {
115581
+ "&.Mui-focused fieldset": {
115582
+ borderColor: "primary.main",
115583
+ borderWidth: 2
115584
+ }
115585
+ }
115586
+ }
115587
+ }
115588
+ ),
115589
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(
115590
+ Box,
115591
+ {
115592
+ sx: {
115593
+ mt: 3,
115594
+ p: 2,
115595
+ borderRadius: 2,
115596
+ background: (theme2) => alpha(theme2.palette.info.light, 0.1),
115597
+ border: (theme2) => `1px dashed ${alpha(theme2.palette.info.main, 0.3)}`,
115598
+ display: "flex",
115599
+ alignItems: "center"
115600
+ },
115601
+ children: [
115602
+ /* @__PURE__ */ jsxRuntimeExports.jsx(EmojiContainer, { style: { fontSize: "1.2rem", marginRight: "8px" }, children: "💫" }),
115603
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
115604
+ Typography,
115605
+ {
115606
+ variant: "body2",
115607
+ sx: { fontStyle: "italic", color: "text.secondary" },
115608
+ children: "This step is completely optional! You can skip it now and add search capabilities later in Settings if you prefer."
115609
+ }
115610
+ )
115611
+ ]
115612
+ }
115613
+ )
115614
+ ] })
115615
+ ] });
115616
+ };
115617
+ const UserProfileStep = () => {
115618
+ const { profile, updateProfile } = useUserStore();
115619
+ const [name2, setName] = reactExports.useState(profile.name === "User" ? "" : profile.name);
115620
+ const [email, setEmail] = reactExports.useState(
115621
+ profile.email === "user@example.com" ? "" : profile.email
115622
+ );
115623
+ const [nameError, setNameError] = reactExports.useState("");
115624
+ reactExports.useEffect(() => {
115625
+ if (name2.trim()) {
115626
+ updateProfile({ name: name2.trim() });
115627
+ }
115628
+ if (email.trim()) {
115629
+ updateProfile({ email: email.trim() });
115630
+ }
115631
+ }, [name2, email, updateProfile]);
115632
+ const handleNameChange = (e) => {
115633
+ const value = e.target.value;
115634
+ setName(value);
115635
+ if (!value.trim()) {
115636
+ setNameError("Name is required");
115637
+ } else {
115638
+ setNameError("");
115639
+ }
115640
+ };
115641
+ const handleEmailChange = (e) => {
115642
+ setEmail(e.target.value);
115643
+ };
115644
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(SectionContainer, { children: [
115645
+ /* @__PURE__ */ jsxRuntimeExports.jsx(SectionTitle$1, { children: "Your Profile Information" }),
115646
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(SectionDescription$1, { children: [
115647
+ /* @__PURE__ */ jsxRuntimeExports.jsx(EmojiContainer, { children: "🔒" }),
115648
+ " This information is stored locally and is only used to personalize your AI experience. It's never shared with any external services - your privacy matters to us!"
115649
+ ] }),
115650
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(FormContainer, { children: [
115651
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Box, { sx: { position: "relative" }, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
115652
+ TextField,
115653
+ {
115654
+ label: "Your Name",
115655
+ variant: "outlined",
115656
+ fullWidth: true,
115657
+ value: name2,
115658
+ onChange: handleNameChange,
115659
+ error: !!nameError,
115660
+ helperText: nameError || "This will be used to create a personalized AI experience",
115661
+ placeholder: "Enter your awesome name",
115662
+ required: true,
115663
+ InputProps: {
115664
+ startAdornment: /* @__PURE__ */ jsxRuntimeExports.jsx(EmojiContainer, { style: { marginRight: "8px" }, children: "😎" })
115665
+ },
115666
+ sx: {
115667
+ "& .MuiOutlinedInput-root": {
115668
+ "&.Mui-focused fieldset": {
115669
+ borderColor: "primary.main",
115670
+ borderWidth: 2
115671
+ }
115672
+ }
115673
+ }
115674
+ }
115675
+ ) }),
115676
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Box, { sx: { position: "relative" }, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
115677
+ TextField,
115678
+ {
115679
+ label: "Email Address",
115680
+ variant: "outlined",
115681
+ fullWidth: true,
115682
+ value: email,
115683
+ onChange: handleEmailChange,
115684
+ helperText: "Optional: This is only stored locally for your convenience",
115685
+ placeholder: "Enter your email address",
115686
+ type: "email",
115687
+ InputProps: {
115688
+ startAdornment: /* @__PURE__ */ jsxRuntimeExports.jsx(EmojiContainer, { style: { marginRight: "8px" }, children: "📧" })
115689
+ },
115690
+ sx: {
115691
+ "& .MuiOutlinedInput-root": {
115692
+ "&.Mui-focused fieldset": {
115693
+ borderColor: "primary.main",
115694
+ borderWidth: 2
115695
+ }
115696
+ }
115697
+ }
115698
+ }
115699
+ ) })
115700
+ ] }),
115701
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(Box, { sx: { mt: 3, display: "flex", alignItems: "center" }, children: [
115702
+ /* @__PURE__ */ jsxRuntimeExports.jsx(EmojiContainer, { children: "💡" }),
115703
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
115704
+ Box,
115705
+ {
115706
+ component: "span",
115707
+ sx: {
115708
+ fontSize: "0.9rem",
115709
+ fontStyle: "italic",
115710
+ color: "text.secondary"
115711
+ },
115712
+ children: "Personalizing your profile helps your AI assistants provide a more tailored experience!"
115713
+ }
115714
+ )
115715
+ ] })
115716
+ ] });
115717
+ };
115718
+ const WelcomeStep = () => {
115719
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(Box, { sx: { animation: "fadeIn 0.6s ease-out" }, children: [
115720
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(
115721
+ Typography,
115722
+ {
115723
+ variant: "body1",
115724
+ paragraph: true,
115725
+ sx: {
115726
+ fontSize: "1.1rem",
115727
+ fontWeight: 500,
115728
+ lineHeight: 1.6
115729
+ },
115730
+ children: [
115731
+ /* @__PURE__ */ jsxRuntimeExports.jsx(EmojiContainer, { children: "🚀" }),
115732
+ " Welcome to Local Operator! We're thrilled to have you here! Let's set up your AI environment so you can start creating amazing things with AI agents."
115733
+ ]
115734
+ }
115735
+ ),
115736
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
115737
+ Typography,
115738
+ {
115739
+ variant: "body1",
115740
+ paragraph: true,
115741
+ sx: {
115742
+ fontSize: "1.05rem",
115743
+ mb: 3
115744
+ },
115745
+ children: "This quick setup will guide you through:"
115746
+ }
115747
+ ),
115748
+ /* @__PURE__ */ jsxRuntimeExports.jsx(SectionContainer, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(SectionDescription$1, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Box, { sx: { mt: 0 }, children: [
115749
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(Box, { sx: { mb: 1.5, display: "flex", alignItems: "flex-start" }, children: [
115750
+ /* @__PURE__ */ jsxRuntimeExports.jsx(EmojiContainer, { children: "👤" }),
115751
+ " Setting up your personalized user profile"
115752
+ ] }),
115753
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(Box, { sx: { mb: 1.5, display: "flex", alignItems: "flex-start" }, children: [
115754
+ /* @__PURE__ */ jsxRuntimeExports.jsx(EmojiContainer, { children: "🔑" }),
115755
+ " Adding your first AI model provider credential"
115756
+ ] }),
115757
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(Box, { sx: { mb: 1.5, display: "flex", alignItems: "flex-start" }, children: [
115758
+ /* @__PURE__ */ jsxRuntimeExports.jsx(EmojiContainer, { children: "🔍" }),
115759
+ " Supercharging your AI with web search capabilities"
115760
+ ] }),
115761
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(Box, { sx: { mb: 1.5, display: "flex", alignItems: "flex-start" }, children: [
115762
+ /* @__PURE__ */ jsxRuntimeExports.jsx(EmojiContainer, { children: "🤖" }),
115763
+ " Selecting your perfect default AI model"
115764
+ ] }),
115765
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(Box, { sx: { display: "flex", alignItems: "flex-start" }, children: [
115766
+ /* @__PURE__ */ jsxRuntimeExports.jsx(EmojiContainer, { children: "✨" }),
115767
+ " Creating your first intelligent AI assistant"
115768
+ ] })
115769
+ ] }) }) }),
115770
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(
115771
+ Typography,
115772
+ {
115773
+ variant: "body2",
115774
+ sx: {
115775
+ mt: 3,
115776
+ fontStyle: "italic",
115777
+ display: "flex",
115778
+ alignItems: "center"
115779
+ },
115780
+ children: [
115781
+ /* @__PURE__ */ jsxRuntimeExports.jsx(EmojiContainer, { children: "💡" }),
115782
+ " Don't worry! You can always customize these settings later in the Settings page."
115783
+ ]
115784
+ }
115785
+ )
115786
+ ] });
115787
+ };
115788
+ const OnboardingModal = ({ open }) => {
115789
+ const { currentStep, setCurrentStep, completeOnboarding } = useOnboardingStore();
115790
+ const navigate = useNavigate();
115791
+ const stepTitle = reactExports.useMemo(() => {
115792
+ switch (currentStep) {
115793
+ case OnboardingStep.WELCOME:
115794
+ return "👋 Welcome to Local Operator";
115795
+ case OnboardingStep.USER_PROFILE:
115796
+ return "👤 Set Up Your Profile";
115797
+ case OnboardingStep.MODEL_CREDENTIAL:
115798
+ return "🔑 Add Model Provider Credential";
115799
+ case OnboardingStep.SEARCH_API:
115800
+ return "🔍 Enable Web Search (Optional)";
115801
+ case OnboardingStep.DEFAULT_MODEL:
115802
+ return "🤖 Choose Your Default Model";
115803
+ case OnboardingStep.CREATE_AGENT:
115804
+ return "✨ Create Your First Agent";
115805
+ case OnboardingStep.CONGRATULATIONS:
115806
+ return "🎉 Setup Complete!";
115807
+ default:
115808
+ return "🚀 First-Time Setup";
115809
+ }
115810
+ }, [currentStep]);
115811
+ const stepContent = reactExports.useMemo(() => {
115812
+ switch (currentStep) {
115813
+ case OnboardingStep.WELCOME:
115814
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(WelcomeStep, {});
115815
+ case OnboardingStep.USER_PROFILE:
115816
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(UserProfileStep, {});
115817
+ case OnboardingStep.MODEL_CREDENTIAL:
115818
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(ModelCredentialStep, {});
115819
+ case OnboardingStep.SEARCH_API:
115820
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(SearchApiStep, {});
115821
+ case OnboardingStep.DEFAULT_MODEL:
115822
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(DefaultModelStep, {});
115823
+ case OnboardingStep.CREATE_AGENT:
115824
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(CreateAgentStep, {});
115825
+ case OnboardingStep.CONGRATULATIONS:
115826
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(CongratulationsContainer, { children: [
115827
+ /* @__PURE__ */ jsxRuntimeExports.jsx(CongratulationsIcon, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(FontAwesomeIcon, { icon: faCheck }) }),
115828
+ /* @__PURE__ */ jsxRuntimeExports.jsx(CongratulationsTitle, { children: "🎉 You're all set! 🚀" }),
115829
+ /* @__PURE__ */ jsxRuntimeExports.jsx(CongratulationsMessage, { children: "Amazing! Your Local Operator is now configured and ready to use. You can start chatting with your new AI assistant right away or explore more exciting features in the settings. Get ready for an incredible AI experience!" })
115830
+ ] });
115831
+ default:
115832
+ return null;
115833
+ }
115834
+ }, [currentStep]);
115835
+ const handleNext = reactExports.useCallback(() => {
115836
+ switch (currentStep) {
115837
+ case OnboardingStep.WELCOME:
115838
+ setCurrentStep(OnboardingStep.USER_PROFILE);
115839
+ break;
115840
+ case OnboardingStep.USER_PROFILE:
115841
+ setCurrentStep(OnboardingStep.MODEL_CREDENTIAL);
115842
+ break;
115843
+ case OnboardingStep.MODEL_CREDENTIAL:
115844
+ setCurrentStep(OnboardingStep.SEARCH_API);
115845
+ break;
115846
+ case OnboardingStep.SEARCH_API:
115847
+ setCurrentStep(OnboardingStep.DEFAULT_MODEL);
115848
+ break;
115849
+ case OnboardingStep.DEFAULT_MODEL:
115850
+ setCurrentStep(OnboardingStep.CREATE_AGENT);
115851
+ break;
115852
+ case OnboardingStep.CREATE_AGENT:
115853
+ setCurrentStep(OnboardingStep.CONGRATULATIONS);
115854
+ break;
115855
+ case OnboardingStep.CONGRATULATIONS: {
115856
+ completeOnboarding();
115857
+ const createdAgentId = sessionStorage.getItem(
115858
+ "onboarding_created_agent_id"
115859
+ );
115860
+ if (createdAgentId) {
115861
+ navigate(`/chat/${createdAgentId}`);
115862
+ sessionStorage.removeItem("onboarding_created_agent_id");
115863
+ } else {
115864
+ navigate("/chat");
115865
+ }
115866
+ break;
115867
+ }
115868
+ }
115869
+ }, [currentStep, setCurrentStep, completeOnboarding, navigate]);
115870
+ const handleBack = reactExports.useCallback(() => {
115871
+ switch (currentStep) {
115872
+ case OnboardingStep.USER_PROFILE:
115873
+ setCurrentStep(OnboardingStep.WELCOME);
115874
+ break;
115875
+ case OnboardingStep.MODEL_CREDENTIAL:
115876
+ setCurrentStep(OnboardingStep.USER_PROFILE);
115877
+ break;
115878
+ case OnboardingStep.SEARCH_API:
115879
+ setCurrentStep(OnboardingStep.MODEL_CREDENTIAL);
115880
+ break;
115881
+ case OnboardingStep.DEFAULT_MODEL:
115882
+ setCurrentStep(OnboardingStep.SEARCH_API);
115883
+ break;
115884
+ case OnboardingStep.CREATE_AGENT:
115885
+ setCurrentStep(OnboardingStep.DEFAULT_MODEL);
115886
+ break;
115887
+ }
115888
+ }, [currentStep, setCurrentStep]);
115889
+ const handleSkip = reactExports.useCallback(() => {
115890
+ if (currentStep === OnboardingStep.SEARCH_API) {
115891
+ setCurrentStep(OnboardingStep.DEFAULT_MODEL);
115892
+ }
115893
+ }, [currentStep, setCurrentStep]);
115894
+ const canSkip = currentStep === OnboardingStep.SEARCH_API;
115895
+ const canGoBack = currentStep !== OnboardingStep.WELCOME && currentStep !== OnboardingStep.CONGRATULATIONS;
115896
+ const nextButtonText = currentStep === OnboardingStep.CONGRATULATIONS ? "🚀 Get Started" : "Next →";
115897
+ const renderStepIndicators = () => {
115898
+ const steps = [
115899
+ OnboardingStep.WELCOME,
115900
+ OnboardingStep.USER_PROFILE,
115901
+ OnboardingStep.MODEL_CREDENTIAL,
115902
+ OnboardingStep.SEARCH_API,
115903
+ OnboardingStep.DEFAULT_MODEL,
115904
+ OnboardingStep.CREATE_AGENT,
115905
+ OnboardingStep.CONGRATULATIONS
115906
+ ];
115907
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(StepIndicatorContainer, { children: steps.map((step) => /* @__PURE__ */ jsxRuntimeExports.jsx(StepDot, { active: currentStep === step }, step)) });
115908
+ };
115909
+ const dialogTitle = /* @__PURE__ */ jsxRuntimeExports.jsx(Typography, { variant: "h6", fontWeight: 600, children: stepTitle });
115910
+ const dialogActions = /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
115911
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Box, { children: canGoBack ? /* @__PURE__ */ jsxRuntimeExports.jsx(SecondaryButton, { onClick: handleBack, children: "Back" }) : /* @__PURE__ */ jsxRuntimeExports.jsx(Box, {}) }),
115912
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(Box, { sx: { display: "flex", gap: 2, alignItems: "center" }, children: [
115913
+ canSkip && /* @__PURE__ */ jsxRuntimeExports.jsx(SkipButton, { onClick: handleSkip, children: "Skip" }),
115914
+ /* @__PURE__ */ jsxRuntimeExports.jsx(PrimaryButton, { onClick: handleNext, children: nextButtonText })
115915
+ ] })
115916
+ ] });
115917
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(
115918
+ BaseDialog,
115919
+ {
115920
+ open,
115921
+ onClose: () => {
115922
+ },
115923
+ title: dialogTitle,
115924
+ actions: dialogActions,
115925
+ maxWidth: "md",
115926
+ fullWidth: true,
115927
+ dialogProps: {
115928
+ disableEscapeKeyDown: true
115929
+ },
115930
+ children: [
115931
+ renderStepIndicators(),
115932
+ stepContent
115933
+ ]
115934
+ }
115935
+ );
115936
+ };
113538
115937
  const SettingContainer = styled(Paper)(({ theme: theme2 }) => ({
113539
115938
  padding: theme2.spacing(2.5),
113540
115939
  borderRadius: theme2.shape.borderRadius * 2,
@@ -113619,124 +116018,6 @@ const ToggleSetting = ({
113619
116018
  ) })
113620
116019
  ] });
113621
116020
  };
113622
- const useUpdateCredential = () => {
113623
- const queryClient2 = useQueryClient();
113624
- const client2 = createLocalOperatorClient(apiConfig.baseUrl);
113625
- return useMutation({
113626
- mutationFn: async (credentialUpdate) => {
113627
- try {
113628
- const response = await client2.credentials.updateCredential(credentialUpdate);
113629
- if (response.status >= 400) {
113630
- throw new Error(response.message || "Failed to update credential");
113631
- }
113632
- return response;
113633
- } catch (error) {
113634
- const errorMessage = error instanceof Error ? error.message : "An unknown error occurred while updating credential";
113635
- y$1.error(errorMessage);
113636
- throw error;
113637
- }
113638
- },
113639
- onSuccess: async (_data, variables) => {
113640
- await queryClient2.invalidateQueries({
113641
- queryKey: credentialsQueryKey,
113642
- refetchType: "none"
113643
- // Don't automatically refetch
113644
- });
113645
- queryClient2.setQueryData(
113646
- credentialsQueryKey,
113647
- (oldData) => {
113648
- if (!oldData) return oldData;
113649
- if (!oldData.keys.includes(variables.key)) {
113650
- return {
113651
- ...oldData,
113652
- keys: [...oldData.keys, variables.key]
113653
- };
113654
- }
113655
- return oldData;
113656
- }
113657
- );
113658
- await queryClient2.refetchQueries({
113659
- queryKey: credentialsQueryKey,
113660
- type: "all"
113661
- // Refetch all related queries at once
113662
- });
113663
- y$1.success(`Credential "${variables.key}" updated successfully`);
113664
- },
113665
- onError: (error) => {
113666
- console.error("Error updating credential:", error);
113667
- }
113668
- });
113669
- };
113670
- const CREDENTIAL_MANIFEST = [
113671
- {
113672
- key: "OPENAI_API_KEY",
113673
- name: "OpenAI API Key",
113674
- description: "API key for accessing OpenAI models like GPT-4o, o3-mini, and GPT-4.5.",
113675
- url: "https://platform.openai.com/api-keys"
113676
- },
113677
- {
113678
- key: "OPENROUTER_API_KEY",
113679
- name: "OpenRouter API Key",
113680
- description: "API key for OpenRouter, which provides access to various AI models from different providers. Getting an openrouter key allows you to simultaneously access many models from different providers.",
113681
- url: "https://openrouter.ai/keys"
113682
- },
113683
- {
113684
- key: "DEEPSEEK_API_KEY",
113685
- name: "DeepSeek API Key",
113686
- description: "API key for DeepSeek AI models, specialized in code generation and understanding.",
113687
- url: "https://platform.deepseek.com/"
113688
- },
113689
- {
113690
- key: "MISTRAL_API_KEY",
113691
- name: "Mistral API Key",
113692
- description: "API key for Mistral AI models, known for efficient and powerful language processing.",
113693
- url: "https://console.mistral.ai/api-keys/"
113694
- },
113695
- {
113696
- key: "KIMI_API_KEY",
113697
- name: "Kimi API Key",
113698
- description: "API key for Kimi AI, providing advanced language models with strong reasoning capabilities.",
113699
- url: "https://kimi.moonshot.cn/"
113700
- },
113701
- {
113702
- key: "ALIBABA_CLOUD_API_KEY",
113703
- name: "Alibaba Cloud API Key",
113704
- description: "API key for Alibaba Cloud AI models, offering a range of language and vision capabilities such as Qwen.",
113705
- url: "https://www.alibabacloud.com/product/ai"
113706
- },
113707
- {
113708
- key: "GOOGLE_AI_STUDIO_API_KEY",
113709
- name: "Google AI Studio API Key",
113710
- description: "API key for Google AI Studio, providing access to Gemini and other Google AI models.",
113711
- url: "https://aistudio.google.com/"
113712
- },
113713
- {
113714
- key: "ANTHROPIC_API_KEY",
113715
- name: "Anthropic API Key",
113716
- description: "API key for Anthropic's Claude models, known for agentic code generation capabilities.",
113717
- url: "https://console.anthropic.com/settings/keys"
113718
- },
113719
- {
113720
- key: "SERP_API_KEY",
113721
- name: "SERP API Key",
113722
- description: "API key for Search Engine Results Page API, allowing access to search engine data. Allows your agents to search the web for information.",
113723
- url: "https://serpapi.com/dashboard"
113724
- },
113725
- {
113726
- key: "TAVILY_API_KEY",
113727
- name: "Tavily API Key",
113728
- description: "API key for Tavily, a search API designed specifically for AI applications. Allows your agents to search the web for information.",
113729
- url: "https://tavily.com/#api"
113730
- }
113731
- ];
113732
- const getCredentialInfo = (key) => {
113733
- return CREDENTIAL_MANIFEST.find((cred) => cred.key === key) || {
113734
- key,
113735
- name: key,
113736
- description: "Custom credential",
113737
- url: ""
113738
- };
113739
- };
113740
116021
  const CredentialCardContainer = styled(Paper)(({ theme: theme2 }) => ({
113741
116022
  padding: theme2.spacing(2),
113742
116023
  height: "100%",
@@ -113908,7 +116189,7 @@ const CredentialDialog = ({
113908
116189
  actions: dialogActions,
113909
116190
  maxWidth: "sm",
113910
116191
  fullWidth: true,
113911
- children: /* @__PURE__ */ jsxRuntimeExports.jsxs(FormContainer$1, { children: [
116192
+ children: /* @__PURE__ */ jsxRuntimeExports.jsxs(FormContainer$2, { children: [
113912
116193
  !initialKey && /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
113913
116194
  /* @__PURE__ */ jsxRuntimeExports.jsxs(FormControl, { fullWidth: true, children: [
113914
116195
  /* @__PURE__ */ jsxRuntimeExports.jsx(InputLabel, { id: "credential-key-label", children: "Credential Type" }),
@@ -114956,6 +117237,29 @@ const SettingsPage = () => {
114956
117237
  ] })
114957
117238
  ] });
114958
117239
  };
117240
+ const useCheckFirstTimeUser = () => {
117241
+ const { data: credentialsData, isLoading: isLoadingCredentials } = useCredentials();
117242
+ const {
117243
+ isComplete: isOnboardingComplete,
117244
+ isActive: isOnboardingActive,
117245
+ activateOnboarding,
117246
+ deactivateOnboarding,
117247
+ resetOnboarding
117248
+ } = useOnboardingStore();
117249
+ const isFirstTimeUser = !isOnboardingComplete && !isLoadingCredentials && (!credentialsData || credentialsData.keys.length === 0);
117250
+ reactExports.useEffect(() => {
117251
+ if (isFirstTimeUser && !isOnboardingActive) {
117252
+ activateOnboarding();
117253
+ }
117254
+ }, [isFirstTimeUser, isOnboardingActive, activateOnboarding]);
117255
+ return {
117256
+ isFirstTimeUser,
117257
+ isOnboardingActive,
117258
+ activateOnboarding,
117259
+ deactivateOnboarding,
117260
+ resetOnboarding
117261
+ };
117262
+ };
114959
117263
  library$1.add(icons, icons$1);
114960
117264
  const AppContainer = styled(Box)(() => ({
114961
117265
  display: "flex",
@@ -114969,9 +117273,11 @@ const MainContent = styled(Box)(() => ({
114969
117273
  flexDirection: "column"
114970
117274
  }));
114971
117275
  const App = () => {
117276
+ const { isOnboardingActive } = useCheckFirstTimeUser();
114972
117277
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(AppContainer, { children: [
114973
117278
  /* @__PURE__ */ jsxRuntimeExports.jsx(CssBaseline, {}),
114974
117279
  /* @__PURE__ */ jsxRuntimeExports.jsx(ModelsInitializer, {}),
117280
+ /* @__PURE__ */ jsxRuntimeExports.jsx(OnboardingModal, { open: isOnboardingActive }),
114975
117281
  /* @__PURE__ */ jsxRuntimeExports.jsx(SidebarNavigation, {}),
114976
117282
  /* @__PURE__ */ jsxRuntimeExports.jsx(MainContent, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Routes, { children: [
114977
117283
  /* @__PURE__ */ jsxRuntimeExports.jsx(Route, { path: "/", element: /* @__PURE__ */ jsxRuntimeExports.jsx(Navigate, { to: "/chat", replace: true }) }),