"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require('./../../../../../ext-esm/tslib/tslib.es6.js'),r=require("react/jsx-runtime"),n=require("react"),s=require("lodash"),t=require("rollbar"),o=require("@rollbar/react");require("../../../../../constants/goals.js"),require("../../../../../constants/segment.js"),require("../../../../../constants/alerts.js"),require("../../../../../constants/apps.js"),require("../../../../../constants/drillstring.js"),require("../../../../../constants/completion.js"),require("../../../../../constants/appPackages.js"),require("../../../../../constants/notifications.js"),require("../../../../../constants/feed.js"),require("../../../../../constants/bha.js");var a=require("../../../../../constants/corvaCompanyId.js");function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}require("../../../../GradientManager/configuration/constants.js");var c=i(t),l=function(e){var t=e.children,a=e.rollbarManifestConfig,i=e.appKey,l=e.version,u=n.useMemo((function(){var e,r=window.parent.Rollbar,n={accessToken:!a.useGlobalInstance&&a.accessToken?a.accessToken:null===(e=null==r?void 0:r.options)||void 0===e?void 0:e.accessToken,payload:{context:a.contextPrefix?"".concat(a.contextPrefix,"#").concat(i):i,client:{javascript:{code_version:l}}}},t=s.merge({},null==r?void 0:r.options,n);return new c.default(t)}),[]);return r.jsx(o.Provider,{instance:u,children:t})};exports.RollbarWrapper=function(n){var s=n.children,t=n.rollbarManifestConfig,o=n.isCLIApp,i=n.companyId===a.CORVA_COMPANY_ID;return t&&t.enabled&&i&&!o?r.jsx(l,e.__assign({},n,{children:s})):s};
