import useEngineContext from "./useEngineContext";
import { isString } from "@pisell/utils";
var fallbackTranslationOriginal = function fallbackTranslationOriginal(value) {
  var _value$original;
  return isString(value) ? value : String((_value$original = value === null || value === void 0 ? void 0 : value.original) !== null && _value$original !== void 0 ? _value$original : '');
};
export var resolveTranslationOriginal = function resolveTranslationOriginal(value) {
  return typeof value === 'function' ? value : fallbackTranslationOriginal;
};
var useTranslationOriginal = function useTranslationOriginal() {
  var _context$appHelper;
  var context = useEngineContext();
  return resolveTranslationOriginal(context === null || context === void 0 || (_context$appHelper = context.appHelper) === null || _context$appHelper === void 0 || (_context$appHelper = _context$appHelper.utils) === null || _context$appHelper === void 0 ? void 0 : _context$appHelper.translationOriginal);
};
export default useTranslationOriginal;