/**
 * Minified by jsDelivr using Terser v5.39.0.
 * Original file: /npm/@ledayun/pino-sentry-transport@1.0.5/build/cjs/index.js
 *
 * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
 */
var __create=Object.create,__defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__getProtoOf=Object.getPrototypeOf,__hasOwnProp=Object.prototype.hasOwnProperty,__export=(e,t)=>{for(var o in t)__defProp(e,o,{get:t[o],enumerable:!0})},__copyProps=(e,t,o,r)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let n of __getOwnPropNames(t))__hasOwnProp.call(e,n)||n===o||__defProp(e,n,{get:()=>t[n],enumerable:!(r=__getOwnPropDesc(t,n))||r.enumerable});return e},__toESM=(e,t,o)=>(o=null!=e?__create(__getProtoOf(e)):{},__copyProps(!t&&e&&e.__esModule?o:__defProp(o,"default",{value:e,enumerable:!0}),e)),__toCommonJS=e=>__copyProps(__defProp({},"__esModule",{value:!0}),e),src_exports={};__export(src_exports,{default:()=>src_default}),module.exports=__toCommonJS(src_exports);var import_node=require("@sentry/node"),import_lodash=__toESM(require("lodash.get")),import_pino_abstract_transport=__toESM(require("pino-abstract-transport"));const pinoLevelToSentryLevel=e=>60==e?"fatal":e>=50?"error":e>=40?"warning":e>=30?"log":e>=20?"info":"debug";function deserializePinoError(e){const{message:t,stack:o}=e,r=new Error(t);return r.stack=o,r}const defaultOptions={minLevel:10,withLogRecord:!1,skipSentryInitialization:!1};async function src_default(e){const t={...defaultOptions,...e};function o(e,o){if(e.setLevel(pinoLevelToSentryLevel(o.level)),t.withLogRecord&&e.setContext("pino-log-record",o),t.tags?.length&&t.tags.forEach((t=>e.setTag(t,(0,import_lodash.default)(o,t)))),t.context?.length){const r={};t.context.forEach((e=>r[e]=(0,import_lodash.default)(o,e))),e.setContext("pino-context",r)}return e}return t.skipSentryInitialization||(0,import_node.init)(t.sentry),(0,import_pino_abstract_transport.default)((async function(e){for await(const r of e){if(!r)return;const e=r?.err;r.level>=t.minLevel&&(e?(0,import_node.captureException)(deserializePinoError(e),(e=>o(e,r))):(0,import_node.captureMessage)(r?.msg,(e=>o(e,r))))}}))}
//# sourceMappingURL=/sm/dc95e047a60330c736f6d4995adffebe0cf465f86e38f3c22a027ea54ed35fb6.map