{"ast":null,"code":"import { isFunction } from '@chakra-ui/utils';\nimport * as React from 'react';\n\n/**\n * Assigns a value to a ref function or object\n *\n * @param ref the ref to assign to\n * @param value the value\n */\nfunction assignRef(ref, value) {\n  if (ref == null) return;\n  if (isFunction(ref)) {\n    ref(value);\n    return;\n  }\n  try {\n    // @ts-ignore\n    ref.current = value;\n  } catch (error) {\n    throw new Error(\"Cannot assign value '\" + value + \"' to ref '\" + ref + \"'\");\n  }\n}\n/**\n * Combine multiple React refs into a single ref function.\n * This is used mostly when you need to allow consumers forward refs to\n * internal components\n *\n * @param refs refs to assign to value to\n */\n\nfunction mergeRefs() {\n  for (var _len = arguments.length, refs = new Array(_len), _key = 0; _key < _len; _key++) {\n    refs[_key] = arguments[_key];\n  }\n  return function (node) {\n    refs.forEach(function (ref) {\n      return assignRef(ref, node);\n    });\n  };\n}\n\n/**\n * Creates a named context, provider, and hook.\n *\n * @param options create context options\n */\nfunction createContext(options) {\n  if (options === void 0) {\n    options = {};\n  }\n  var _options = options,\n    _options$strict = _options.strict,\n    strict = _options$strict === void 0 ? true : _options$strict,\n    _options$errorMessage = _options.errorMessage,\n    errorMessage = _options$errorMessage === void 0 ? \"useContext: `context` is undefined. Seems you forgot to wrap component within the Provider\" : _options$errorMessage,\n    name = _options.name;\n  var Context = /*#__PURE__*/React.createContext(undefined);\n  Context.displayName = name;\n  function useContext() {\n    var context = React.useContext(Context);\n    if (!context && strict) {\n      var error = new Error(errorMessage);\n      error.name = \"ContextError\";\n      Error.captureStackTrace == null ? void 0 : Error.captureStackTrace(error, useContext);\n      throw error;\n    }\n    return context;\n  }\n  return [Context.Provider, useContext, Context];\n}\n\n/**\n * Gets only the valid children of a component,\n * and ignores any nullish or falsy child.\n *\n * @param children the children\n */\n\nfunction getValidChildren(children) {\n  return React.Children.toArray(children).filter(function (child) {\n    return /*#__PURE__*/React.isValidElement(child);\n  });\n}\nexport { assignRef, createContext, getValidChildren, mergeRefs };","map":{"version":3,"names":["isFunction","React","assignRef","ref","value","current","error","Error","mergeRefs","_len","arguments","length","refs","Array","_key","node","forEach","createContext","options","_options","_options$strict","strict","_options$errorMessage","errorMessage","name","Context","undefined","displayName","useContext","context","captureStackTrace","Provider","getValidChildren","children","Children","toArray","filter","child","isValidElement"],"sources":["C:/ldt/LDT/Safemate_Management/node_modules/@chakra-ui/react-utils/dist/chakra-ui-react-utils.esm.js"],"sourcesContent":["import { isFunction } from '@chakra-ui/utils';\nimport * as React from 'react';\n\n/**\n * Assigns a value to a ref function or object\n *\n * @param ref the ref to assign to\n * @param value the value\n */\nfunction assignRef(ref, value) {\n  if (ref == null) return;\n\n  if (isFunction(ref)) {\n    ref(value);\n    return;\n  }\n\n  try {\n    // @ts-ignore\n    ref.current = value;\n  } catch (error) {\n    throw new Error(\"Cannot assign value '\" + value + \"' to ref '\" + ref + \"'\");\n  }\n}\n/**\n * Combine multiple React refs into a single ref function.\n * This is used mostly when you need to allow consumers forward refs to\n * internal components\n *\n * @param refs refs to assign to value to\n */\n\nfunction mergeRefs() {\n  for (var _len = arguments.length, refs = new Array(_len), _key = 0; _key < _len; _key++) {\n    refs[_key] = arguments[_key];\n  }\n\n  return function (node) {\n    refs.forEach(function (ref) {\n      return assignRef(ref, node);\n    });\n  };\n}\n\n/**\n * Creates a named context, provider, and hook.\n *\n * @param options create context options\n */\nfunction createContext(options) {\n  if (options === void 0) {\n    options = {};\n  }\n\n  var _options = options,\n      _options$strict = _options.strict,\n      strict = _options$strict === void 0 ? true : _options$strict,\n      _options$errorMessage = _options.errorMessage,\n      errorMessage = _options$errorMessage === void 0 ? \"useContext: `context` is undefined. Seems you forgot to wrap component within the Provider\" : _options$errorMessage,\n      name = _options.name;\n  var Context = /*#__PURE__*/React.createContext(undefined);\n  Context.displayName = name;\n\n  function useContext() {\n    var context = React.useContext(Context);\n\n    if (!context && strict) {\n      var error = new Error(errorMessage);\n      error.name = \"ContextError\";\n      Error.captureStackTrace == null ? void 0 : Error.captureStackTrace(error, useContext);\n      throw error;\n    }\n\n    return context;\n  }\n\n  return [Context.Provider, useContext, Context];\n}\n\n/**\n * Gets only the valid children of a component,\n * and ignores any nullish or falsy child.\n *\n * @param children the children\n */\n\nfunction getValidChildren(children) {\n  return React.Children.toArray(children).filter(function (child) {\n    return /*#__PURE__*/React.isValidElement(child);\n  });\n}\n\nexport { assignRef, createContext, getValidChildren, mergeRefs };\n"],"mappings":"AAAA,SAASA,UAAU,QAAQ,kBAAkB;AAC7C,OAAO,KAAKC,KAAK,MAAM,OAAO;;AAE9B;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,SAASA,CAACC,GAAG,EAAEC,KAAK,EAAE;EAC7B,IAAID,GAAG,IAAI,IAAI,EAAE;EAEjB,IAAIH,UAAU,CAACG,GAAG,CAAC,EAAE;IACnBA,GAAG,CAACC,KAAK,CAAC;IACV;EACF;EAEA,IAAI;IACF;IACAD,GAAG,CAACE,OAAO,GAAGD,KAAK;EACrB,CAAC,CAAC,OAAOE,KAAK,EAAE;IACd,MAAM,IAAIC,KAAK,CAAC,uBAAuB,GAAGH,KAAK,GAAG,YAAY,GAAGD,GAAG,GAAG,GAAG,CAAC;EAC7E;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASK,SAASA,CAAA,EAAG;EACnB,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;EAEA,OAAO,UAAUC,IAAI,EAAE;IACrBH,IAAI,CAACI,OAAO,CAAC,UAAUb,GAAG,EAAE;MAC1B,OAAOD,SAAS,CAACC,GAAG,EAAEY,IAAI,CAAC;IAC7B,CAAC,CAAC;EACJ,CAAC;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA,SA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