{"ast":null,"code":"\"use client\";\n\nvar __rest = this && this.__rest || function (s, e) {\n  var t = {};\n  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];\n  if (s != null && typeof Object.getOwnPropertySymbols === \"function\") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n    if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];\n  }\n  return t;\n};\nimport * as React from 'react';\nimport classNames from 'classnames';\nimport toArray from \"rc-util/es/Children/toArray\";\nimport { isPresetSize, isValidGapNumber } from '../_util/gapSize';\nimport { useComponentConfig } from '../config-provider/context';\nimport Compact from './Compact';\nimport Addon from './Addon';\nimport { SpaceContextProvider } from './context';\nimport Item from './Item';\nimport useStyle from './style';\nexport { SpaceContext } from './context';\nconst InternalSpace = /*#__PURE__*/React.forwardRef((props, ref) => {\n  var _a;\n  const {\n    getPrefixCls,\n    direction: directionConfig,\n    size: contextSize,\n    className: contextClassName,\n    style: contextStyle,\n    classNames: contextClassNames,\n    styles: contextStyles\n  } = useComponentConfig('space');\n  const {\n      size = contextSize !== null && contextSize !== void 0 ? contextSize : 'small',\n      align,\n      className,\n      rootClassName,\n      children,\n      direction = 'horizontal',\n      prefixCls: customizePrefixCls,\n      split,\n      style,\n      wrap = false,\n      classNames: customClassNames,\n      styles\n    } = props,\n    otherProps = __rest(props, [\"size\", \"align\", \"className\", \"rootClassName\", \"children\", \"direction\", \"prefixCls\", \"split\", \"style\", \"wrap\", \"classNames\", \"styles\"]);\n  const [horizontalSize, verticalSize] = Array.isArray(size) ? size : [size, size];\n  const isPresetVerticalSize = isPresetSize(verticalSize);\n  const isPresetHorizontalSize = isPresetSize(horizontalSize);\n  const isValidVerticalSize = isValidGapNumber(verticalSize);\n  const isValidHorizontalSize = isValidGapNumber(horizontalSize);\n  const childNodes = toArray(children, {\n    keepEmpty: true\n  });\n  const mergedAlign = align === undefined && direction === 'horizontal' ? 'center' : align;\n  const prefixCls = getPrefixCls('space', customizePrefixCls);\n  const [wrapCSSVar, hashId, cssVarCls] = useStyle(prefixCls);\n  const cls = classNames(prefixCls, contextClassName, hashId, `${prefixCls}-${direction}`, {\n    [`${prefixCls}-rtl`]: directionConfig === 'rtl',\n    [`${prefixCls}-align-${mergedAlign}`]: mergedAlign,\n    [`${prefixCls}-gap-row-${verticalSize}`]: isPresetVerticalSize,\n    [`${prefixCls}-gap-col-${horizontalSize}`]: isPresetHorizontalSize\n  }, className, rootClassName, cssVarCls);\n  const itemClassName = classNames(`${prefixCls}-item`, (_a = customClassNames === null || customClassNames === void 0 ? void 0 : customClassNames.item) !== null && _a !== void 0 ? _a : contextClassNames.item);\n  const mergedItemStyle = Object.assign(Object.assign({}, contextStyles.item), styles === null || styles === void 0 ? void 0 : styles.item);\n  // Calculate latest one\n  const renderedItems = childNodes.map((child, i) => {\n    const key = (child === null || child === void 0 ? void 0 : child.key) || `${itemClassName}-${i}`;\n    return /*#__PURE__*/React.createElement(Item, {\n      className: itemClassName,\n      key: key,\n      index: i,\n      split: split,\n      style: mergedItemStyle\n    }, child);\n  });\n  const memoizedSpaceContext = React.useMemo(() => {\n    const calcLatestIndex = childNodes.reduce((latest, child, i) => child !== null && child !== undefined ? i : latest, 0);\n    return {\n      latestIndex: calcLatestIndex\n    };\n  }, [childNodes]);\n  // =========================== Render ===========================\n  if (childNodes.length === 0) {\n    return null;\n  }\n  const gapStyle = {};\n  if (wrap) {\n    gapStyle.flexWrap = 'wrap';\n  }\n  if (!isPresetHorizontalSize && isValidHorizontalSize) {\n    gapStyle.columnGap = horizontalSize;\n  }\n  if (!isPresetVerticalSize && isValidVerticalSize) {\n    gapStyle.rowGap = verticalSize;\n  }\n  return wrapCSSVar(/*#__PURE__*/React.createElement(\"div\", Object.assign({\n    ref: ref,\n    className: cls,\n    style: Object.assign(Object.assign(Object.assign({}, gapStyle), contextStyle), style)\n  }, otherProps), /*#__PURE__*/React.createElement(SpaceContextProvider, {\n    value: memoizedSpaceContext\n  }, renderedItems)));\n});\nconst Space = InternalSpace;\nSpace.Compact = Compact;\nSpace.Addon = Addon;\nif (process.env.NODE_ENV !== 'production') {\n  Space.displayName = 'Space';\n}\nexport default Space;","map":{"version":3,"names":["__rest","s","e","t","p","Object","prototype","hasOwnProperty","call","indexOf","getOwnPropertySymbols","i","length","propertyIsEnumerable","React","classNames","toArray","isPresetSize","isValidGapNumber","useComponentConfig","Compact","Addon","SpaceContextProvider","Item","useStyle","SpaceContext","InternalSpace","forwardRef","props","ref","_a","getPrefixCls","direction","directionConfig","size","contextSize","className","contextClassName","style","contextStyle","contextClassNames","styles","contextStyles","align","rootClassName","children","prefixCls","customizePrefixCls","split","wrap","customClassNames","otherProps","horizontalSize","verticalSize","Array","isArray","isPresetVerticalSize","isPresetHorizontalSize","isValidVerticalSize","isValidHorizontalSize","childNodes","keepEmpty","mergedAlign","undefined","wrapCSSVar","hashId","cssVarCls","cls","itemClassName","item","mergedItemStyle","assign","renderedItems","map","child","key","createElement","index","memoizedSpaceContext","useMemo","calcLatestIndex","reduce","latest","latestIndex","gapStyle","flexWrap","columnGap","rowGap","value","Space","process","env","NODE_ENV","displayName"],"sources":["/Users/nili/Documents/trae_projects/client/node_modules/antd/es/space/index.js"],"sourcesContent":["\"use client\";\n\nvar __rest = this && this.__rest || function (s, e) {\n  var t = {};\n  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];\n  if (s != null && typeof Object.getOwnPropertySymbols === \"function\") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n    if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];\n  }\n  return t;\n};\nimport * as React from 'react';\nimport classNames from 'classnames';\nimport toArray from \"rc-util/es/Children/toArray\";\nimport { isPresetSize, isValidGapNumber } from '../_util/gapSize';\nimport { useComponentConfig } from '../config-provider/context';\nimport Compact from './Compact';\nimport Addon from './Addon';\nimport { SpaceContextProvider } from './context';\nimport Item from './Item';\nimport useStyle from './style';\nexport { SpaceContext } from './context';\nconst InternalSpace = /*#__PURE__*/React.forwardRef((props, ref) => {\n  var _a;\n  const {\n    getPrefixCls,\n    direction: directionConfig,\n    size: contextSize,\n    className: contextClassName,\n    style: contextStyle,\n    classNames: contextClassNames,\n    styles: contextStyles\n  } = useComponentConfig('space');\n  const {\n      size = contextSize !== null && contextSize !== void 0 ? contextSize : 'small',\n      align,\n      className,\n      rootClassName,\n      children,\n      direction = 'horizontal',\n      prefixCls: customizePrefixCls,\n      split,\n      style,\n      wrap = false,\n      classNames: customClassNames,\n      styles\n    } = props,\n    otherProps = __rest(props, [\"size\", \"align\", \"className\", \"rootClassName\", \"children\", \"direction\", \"prefixCls\", \"split\", \"style\", \"wrap\", \"classNames\", \"styles\"]);\n  const [horizontalSize, verticalSize] = Array.isArray(size) ? size : [size, size];\n  const isPresetVerticalSize = isPresetSize(verticalSize);\n  const isPresetHorizontalSize = isPresetSize(horizontalSize);\n  const isValidVerticalSize = isValidGapNumber(verticalSize);\n  const isValidHorizontalSize = isValidGapNumber(horizontalSize);\n  const childNodes = toArray(children, {\n    keepEmpty: true\n  });\n  const mergedAlign = align === undefined && direction === 'horizontal' ? 'center' : align;\n  const prefixCls = getPrefixCls('space', customizePrefixCls);\n  const [wrapCSSVar, hashId, cssVarCls] = useStyle(prefixCls);\n  const cls = classNames(prefixCls, contextClassName, hashId, `${prefixCls}-${direction}`, {\n    [`${prefixCls}-rtl`]: directionConfig === 'rtl',\n    [`${prefixCls}-align-${mergedAlign}`]: mergedAlign,\n    [`${prefixCls}-gap-row-${verticalSize}`]: isPresetVerticalSize,\n    [`${prefixCls}-gap-col-${horizontalSize}`]: isPresetHorizontalSize\n  }, className, rootClassName, cssVarCls);\n  const itemClassName = classNames(`${prefixCls}-item`, (_a = customClassNames === null || customClassNames === void 0 ? void 0 : customClassNames.item) !== null && _a !== void 0 ? _a : contextClassNames.item);\n  const mergedItemStyle = Object.assign(Object.assign({}, contextStyles.item), styles === null || styles === void 0 ? void 0 : styles.item);\n  // Calculate latest one\n  const renderedItems = childNodes.map((child, i) => {\n    const key = (child === null || child === void 0 ? void 0 : child.key) || `${itemClassName}-${i}`;\n    return /*#__PURE__*/React.createElement(Item, {\n      className: itemClassName,\n      key: key,\n      index: i,\n      split: split,\n      style: mergedItemStyle\n    }, child);\n  });\n  const memoizedSpaceContext = React.useMemo(() => {\n    const calcLatestIndex = childNodes.reduce((latest, child, i) => child !== null && child !== undefined ? i : latest, 0);\n    return {\n      latestIndex: calcLatestIndex\n    };\n  }, [childNodes]);\n  // =========================== Render ===========================\n  if (childNodes.length === 0) {\n    return null;\n  }\n  const gapStyle = {};\n  if (wrap) {\n    gapStyle.flexWrap = 'wrap';\n  }\n  if (!isPresetHorizontalSize && isValidHorizontalSize) {\n    gapStyle.columnGap = horizontalSize;\n  }\n  if (!isPresetVerticalSize && isValidVerticalSize) {\n    gapStyle.rowGap = verticalSize;\n  }\n  return wrapCSSVar(/*#__PURE__*/React.createElement(\"div\", Object.assign({\n    ref: ref,\n    className: cls,\n    style: Object.assign(Object.assign(Object.assign({}, gapStyle), contextStyle), style)\n  }, otherProps), /*#__PURE__*/React.createElement(SpaceContextProvider, {\n    value: memoizedSpaceContext\n  }, renderedItems)));\n});\nconst Space = InternalSpace;\nSpace.Compact = Compact;\nSpace.Addon = Addon;\nif (process.env.NODE_ENV !== 'production') {\n  Space.displayName = 'Space';\n}\nexport default Space;"],"mappings":"AAAA,YAAY;;AAEZ,IAAIA,MAAM,GAAG,IAAI,IAAI,IAAI,CAACA,MAAM,IAAI,UAAUC,CAAC,EAAEC,CAAC,EAAE;EAClD,IAAIC,CAAC,GAAG,CAAC,CAAC;EACV,KAAK,IAAIC,CAAC,IAAIH,CAAC,EAAE,IAAII,MAAM,CAACC,SAAS,CAACC,cAAc,CAACC,IAAI,CAACP,CAAC,EAAEG,CAAC,CAAC,IAAIF,CAA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