{"ast":null,"code":"import _typeof from \"@babel/runtime/helpers/esm/typeof\";\n/* eslint-disable no-param-reassign */\n\nimport { isValidElement } from 'react';\nimport { ForwardRef, isFragment, isMemo } from 'react-is';\nimport useMemo from \"./hooks/useMemo\";\nexport function fillRef(ref, node) {\n  if (typeof ref === 'function') {\n    ref(node);\n  } else if (_typeof(ref) === 'object' && ref && 'current' in ref) {\n    ref.current = node;\n  }\n}\n\n/**\n * Merge refs into one ref function to support ref passing.\n */\nexport function composeRef() {\n  for (var _len = arguments.length, refs = new Array(_len), _key = 0; _key < _len; _key++) {\n    refs[_key] = arguments[_key];\n  }\n  var refList = refs.filter(function (ref) {\n    return ref;\n  });\n  if (refList.length <= 1) {\n    return refList[0];\n  }\n  return function (node) {\n    refs.forEach(function (ref) {\n      fillRef(ref, node);\n    });\n  };\n}\nexport function useComposeRef() {\n  for (var _len2 = arguments.length, refs = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n    refs[_key2] = arguments[_key2];\n  }\n  return useMemo(function () {\n    return composeRef.apply(void 0, refs);\n  }, refs, function (prev, next) {\n    return prev.length !== next.length || prev.every(function (ref, i) {\n      return ref !== next[i];\n    });\n  });\n}\nexport function supportRef(nodeOrComponent) {\n  var _type$prototype, _nodeOrComponent$prot;\n  var type = isMemo(nodeOrComponent) ? nodeOrComponent.type.type : nodeOrComponent.type;\n\n  // Function component node\n  if (typeof type === 'function' && !((_type$prototype = type.prototype) !== null && _type$prototype !== void 0 && _type$prototype.render) && type.$$typeof !== ForwardRef) {\n    return false;\n  }\n\n  // Class component\n  if (typeof nodeOrComponent === 'function' && !((_nodeOrComponent$prot = nodeOrComponent.prototype) !== null && _nodeOrComponent$prot !== void 0 && _nodeOrComponent$prot.render) && nodeOrComponent.$$typeof !== ForwardRef) {\n    return false;\n  }\n  return true;\n}\nexport function supportNodeRef(node) {\n  if (! /*#__PURE__*/isValidElement(node)) {\n    return false;\n  }\n  if (isFragment(node)) {\n    return false;\n  }\n  return supportRef(node);\n}\n/* eslint-enable */","map":{"version":3,"names":["_typeof","isValidElement","ForwardRef","isFragment","isMemo","useMemo","fillRef","ref","node","current","composeRef","_len","arguments","length","refs","Array","_key","refList","filter","forEach","useComposeRef","_len2","_key2","apply","prev","next","every","i","supportRef","nodeOrComponent","_type$prototype","_nodeOrComponent$prot","type","prototype","render","$$typeof","supportNodeRef"],"sources":["D:/Project/UC_Trains_Voice/react-demo/node_modules/rc-util/es/ref.js"],"sourcesContent":["import _typeof from \"@babel/runtime/helpers/esm/typeof\";\n/* eslint-disable no-param-reassign */\n\nimport { isValidElement } from 'react';\nimport { ForwardRef, isFragment, isMemo } from 'react-is';\nimport useMemo from \"./hooks/useMemo\";\nexport function fillRef(ref, node) {\n  if (typeof ref === 'function') {\n    ref(node);\n  } else if (_typeof(ref) === 'object' && ref && 'current' in ref) {\n    ref.current = node;\n  }\n}\n\n/**\n * Merge refs into one ref function to support ref passing.\n */\nexport function composeRef() {\n  for (var _len = arguments.length, refs = new Array(_len), _key = 0; _key < _len; _key++) {\n    refs[_key] = arguments[_key];\n  }\n  var refList = refs.filter(function (ref) {\n    return ref;\n  });\n  if (refList.length <= 1) {\n    return refList[0];\n  }\n  return function (node) {\n    refs.forEach(function (ref) {\n      fillRef(ref, node);\n    });\n  };\n}\nexport function useComposeRef() {\n  for (var _len2 = arguments.length, refs = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n    refs[_key2] = arguments[_key2];\n  }\n  return useMemo(function () {\n    return composeRef.apply(void 0, refs);\n  }, refs, function (prev, next) {\n    return prev.length !== next.length || prev.every(function (ref, i) {\n      return ref !== next[i];\n    });\n  });\n}\nexport function supportRef(nodeOrComponent) {\n  var _type$prototype, _nodeOrComponent$prot;\n  var type = isMemo(nodeOrComponent) ? nodeOrComponent.type.type : nodeOrComponent.type;\n\n  // Function component node\n  if (typeof type === 'function' && !((_type$prototype = type.prototype) !== null && _type$prototype !== void 0 && _type$prototype.render) && type.$$typeof !== ForwardRef) {\n    return false;\n  }\n\n  // Class component\n  if (typeof nodeOrComponent === 'function' && !((_nodeOrComponent$prot = nodeOrComponent.prototype) !== null && _nodeOrComponent$prot !== void 0 && _nodeOrComponent$prot.render) && nodeOrComponent.$$typeof !== ForwardRef) {\n    return false;\n  }\n  return true;\n}\nexport function supportNodeRef(node) {\n  if (! /*#__PURE__*/isValidElement(node)) {\n    return false;\n  }\n  if (isFragment(node)) {\n    return false;\n  }\n  return supportRef(node);\n}\n/* eslint-enable */"],"mappings":"AAAA,OAAOA,OAAO,MAAM,mCAAmC;AACvD;;AAEA,SAASC,cAAc,QAAQ,OAAO;AACtC,SAASC,UAAU,EAAEC,UAAU,EAAEC,MAAM,QAAQ,UAAU;AACzD,OAAOC,OAAO,MAAM,iBAAiB;AACrC,OAAO,SAASC,OAAOA,CAACC,GAAG,EAAEC,IAAI,EAAE;EACjC,IAAI,OAAOD,GAAG,KAAK,UAAU,EAAE;IAC7BA,GAAG,CAACC,IAAI,CAAC;EACX,CAAC,MAAM,IAAIR,OAAO,CAACO,GAAG,CAAC,KAAK,QAAQ,IAAIA,GAAG,IAAI,SAAS,IAAIA,GAAG,EAAE;IAC/DA,GAAG,CAACE,OAAO,GAAGD,IAAI;EACpB;AACF;;AAEA;AACA;AACA;AACA,OAAO,SAASE,UAAUA,CAAA,EAAG;EAC3B,KAAK,IAAIC,IAAI,GAAGC,SAAS,CAACC,MAAM,EAAEC,IAAI,GAAG,IAAIC,KAAK,CAACJ,IAAI,CAAC,EAAEK,IAAI,GAAG,CAAC,EAAEA,IAAI,GAAGL,IAAI,EAAEK,IAAI,EAAE,EAAE;IACvFF,IAAI,CAACE,IAAI,CAAC,GAAGJ,SAAS,CAACI,IAAI,CAAC;EAC9B;EACA,IAAIC,OAAO,GAAGH,IAAI,CAACI,MAAM,CAAC,UAAUX,GAAG,EAAE;IACvC,OAAOA,GAAG;EACZ,CAAC,CAAC;EACF,IAAIU,OAAO,CAACJ,MAAM,IAAI,CAAC,EAAE;IACvB,OAAOI,OAAO,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