'use strict';
import { apiPathNames } from '../api/api-path-names.js';
import { logSeverities } from '../../fd-toolbox-core/enums/log-severities.js';
import { isBrowser } from '../lib/environments.js';
import { apiPost } from '../api/api-client.js';
import { pushStatuses } from '../../base-repo/constants/push-statuses.js';

var __defProp=Object['defineProperty'],__name=(_0x5d3eb0,_0xedcc16)=>__defProp(_0x5d3eb0,'name',{'value':_0xedcc16,'configurable':!![]});function logErrorRaw(_0x451b3c){createAndPostLog(logSeverities['error'],_0x451b3c['name'],_0x451b3c['message']),console['error'](_0x451b3c);}__name(logErrorRaw,'logErrorRaw');function logStringError(_0x4efe7e,_0x56adaa){const _0x555c8f=isError(_0x56adaa)?_0x56adaa['name']:pushStatuses['Error'],_0x8eee75=isError(_0x56adaa)?_0x4efe7e+'\x20'+_0x56adaa['message']:_0x4efe7e;createAndPostLog(logSeverities['error'],_0x555c8f,_0x8eee75),console['error'](_0x4efe7e,_0x56adaa);}__name(logStringError,'logStringError');function logWarningRaw(_0x13047d){createAndPostLog(logSeverities['warning'],_0x13047d),console['warn'](_0x13047d);}__name(logWarningRaw,'logWarningRaw');function logInfoRaw(_0x1a9ea9){createAndPostLog(logSeverities['info'],_0x1a9ea9),console['info'](_0x1a9ea9);}__name(logInfoRaw,'logInfoRaw');function logDebugRaw(_0x57f37c){createAndPostLog(logSeverities['debug'],_0x57f37c),console['debug'](_0x57f37c);}__name(logDebugRaw,'logDebugRaw');function createAndPostLog(_0x3d761b,_0x578e9b,_0x20b5fa){let _0x4febcf={'severity':_0x3d761b,'message':_0x578e9b,'errorMessage':_0x20b5fa};postLog(_0x4febcf);}__name(createAndPostLog,'createAndPostLog');function postLog(_0x1b0f86){isBrowser()&&apiPost(apiPathNames['log'],_0x1b0f86);}__name(postLog,'postLog');function isError(_0x2a76c2){return _0x2a76c2 instanceof Error;}__name(isError,'isError');

export { logDebugRaw, logErrorRaw, logInfoRaw, logStringError, logWarningRaw };
