{"ast":null,"code":"\"use client\";\n\nimport * as React from 'react';\nimport classNames from 'classnames';\nimport { Circle as RCCircle } from 'rc-progress';\nimport Tooltip from '../tooltip';\nimport { getPercentage, getSize, getStrokeColor } from './utils';\nconst CIRCLE_MIN_STROKE_WIDTH = 3;\nconst getMinPercent = width => CIRCLE_MIN_STROKE_WIDTH / width * 100;\nconst Circle = props => {\n  const {\n    prefixCls,\n    trailColor = null,\n    strokeLinecap = 'round',\n    gapPosition,\n    gapDegree,\n    width: originWidth = 120,\n    type,\n    children,\n    success,\n    size = originWidth,\n    steps\n  } = props;\n  const [width, height] = getSize(size, 'circle');\n  let {\n    strokeWidth\n  } = props;\n  if (strokeWidth === undefined) {\n    strokeWidth = Math.max(getMinPercent(width), 6);\n  }\n  const circleStyle = {\n    width,\n    height,\n    fontSize: width * 0.15 + 6\n  };\n  const realGapDegree = React.useMemo(() => {\n    // Support gapDeg = 0 when type = 'dashboard'\n    if (gapDegree || gapDegree === 0) {\n      return gapDegree;\n    }\n    if (type === 'dashboard') {\n      return 75;\n    }\n    return undefined;\n  }, [gapDegree, type]);\n  const percentArray = getPercentage(props);\n  const gapPos = gapPosition || type === 'dashboard' && 'bottom' || undefined;\n  // using className to style stroke color\n  const isGradient = Object.prototype.toString.call(props.strokeColor) === '[object Object]';\n  const strokeColor = getStrokeColor({\n    success,\n    strokeColor: props.strokeColor\n  });\n  const wrapperClassName = classNames(`${prefixCls}-inner`, {\n    [`${prefixCls}-circle-gradient`]: isGradient\n  });\n  const circleContent = /*#__PURE__*/React.createElement(RCCircle, {\n    steps: steps,\n    percent: steps ? percentArray[1] : percentArray,\n    strokeWidth: strokeWidth,\n    trailWidth: strokeWidth,\n    strokeColor: steps ? strokeColor[1] : strokeColor,\n    strokeLinecap: strokeLinecap,\n    trailColor: trailColor,\n    prefixCls: prefixCls,\n    gapDegree: realGapDegree,\n    gapPosition: gapPos\n  });\n  return /*#__PURE__*/React.createElement(\"div\", {\n    className: wrapperClassName,\n    style: circleStyle\n  }, width <= 20 ? ( /*#__PURE__*/React.createElement(Tooltip, {\n    title: children\n  }, /*#__PURE__*/React.createElement(\"span\", null, circleContent))) : ( /*#__PURE__*/React.createElement(React.Fragment, null, circleContent, children)));\n};\nexport default Circle;","map":{"version":3,"names":["React","classNames","Circle","RCCircle","Tooltip","getPercentage","getSize","getStrokeColor","CIRCLE_MIN_STROKE_WIDTH","getMinPercent","width","props","prefixCls","trailColor","strokeLinecap","gapPosition","gapDegree","originWidth","type","children","success","size","steps","height","strokeWidth","undefined","Math","max","circleStyle","fontSize","realGapDegree","useMemo","percentArray","gapPos","isGradient","Object","prototype","toString","call","strokeColor","wrapperClassName","circleContent","createElement","percent","trailWidth","className","style","title","Fragment"],"sources":["/Users/shanyi/Desktop/Projects/UC_Trains_Voice/react-demo/node_modules/antd/es/progress/Circle.js"],"sourcesContent":["\"use client\";\n\nimport * as React from 'react';\nimport classNames from 'classnames';\nimport { Circle as RCCircle } from 'rc-progress';\nimport Tooltip from '../tooltip';\nimport { getPercentage, getSize, getStrokeColor } from './utils';\nconst CIRCLE_MIN_STROKE_WIDTH = 3;\nconst getMinPercent = width => CIRCLE_MIN_STROKE_WIDTH / width * 100;\nconst Circle = props => {\n  const {\n    prefixCls,\n    trailColor = null,\n    strokeLinecap = 'round',\n    gapPosition,\n    gapDegree,\n    width: originWidth = 120,\n    type,\n    children,\n    success,\n    size = originWidth,\n    steps\n  } = props;\n  const [width, height] = getSize(size, 'circle');\n  let {\n    strokeWidth\n  } = props;\n  if (strokeWidth === undefined) {\n    strokeWidth = Math.max(getMinPercent(width), 6);\n  }\n  const circleStyle = {\n    width,\n    height,\n    fontSize: width * 0.15 + 6\n  };\n  const realGapDegree = React.useMemo(() => {\n    // Support gapDeg = 0 when type = 'dashboard'\n    if (gapDegree || gapDegree === 0) {\n      return gapDegree;\n    }\n    if (type === 'dashboard') {\n      return 75;\n    }\n    return undefined;\n  }, [gapDegree, type]);\n  const percentArray = getPercentage(props);\n  const gapPos = gapPosition || type === 'dashboard' && 'bottom' || undefined;\n  // using className to style stroke color\n  const isGradient = Object.prototype.toString.call(props.strokeColor) === '[object Object]';\n  const strokeColor = getStrokeColor({\n    success,\n    strokeColor: props.strokeColor\n  });\n  const wrapperClassName = classNames(`${prefixCls}-inner`, {\n    [`${prefixCls}-circle-gradient`]: isGradient\n  });\n  const circleContent = /*#__PURE__*/React.createElement(RCCircle, {\n    steps: steps,\n    percent: steps ? percentArray[1] : percentArray,\n    strokeWidth: strokeWidth,\n    trailWidth: strokeWidth,\n    strokeColor: steps ? strokeColor[1] : strokeColor,\n    strokeLinecap: strokeLinecap,\n    trailColor: trailColor,\n    prefixCls: prefixCls,\n    gapDegree: realGapDegree,\n    gapPosition: gapPos\n  });\n  return /*#__PURE__*/React.createElement(\"div\", {\n    className: wrapperClassName,\n    style: circleStyle\n  }, width <= 20 ? ( /*#__PURE__*/React.createElement(Tooltip, {\n    title: children\n  }, /*#__PURE__*/React.createElement(\"span\", null, circleContent))) : ( /*#__PURE__*/React.createElement(React.Fragment, null, circleContent, children)));\n};\nexport default Circle;"],"mappings":"AAAA,YAAY;;AAEZ,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,OAAOC,UAAU,MAAM,YAAY;AACnC,SAASC,MAAM,IAAIC,QAAQ,QAAQ,aAAa;AAChD,OAAOC,OAAO,MAAM,YAAY;AAChC,SAASC,aAAa,EAAEC,OAAO,EAAEC,cAAc,QAAQ,SAAS;AAChE,MAAMC,uBAAuB,GAAG,CAAC;AACjC,MAAMC,aAAa,GAAGC,KAAK,IAAIF,uBAAuB,GAAGE,KAAK,GAAG,GAAG;AACpE,MAAMR,MAAM,GAAGS,KAAK,IAAI;EACtB,MAAM;IACJC,SAAS;IACTC,UAAU,GAAG,IAAI;IACjBC,aAAa,GAAG,OAAO;IACvBC,WAAW;IACXC,SAAS;IACTN,KAAK,EAAEO,WAAW,GAAG,GAAG;IACxBC,IAAI;IACJC,QAAQ;IACRC,OAAO;IACPC,IAAI,GAAGJ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