"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@babel/runtime/helpers/defineProperty"),r=require("react/jsx-runtime"),t=require("react"),n=require("lodash"),o=require("rollbar"),s=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 c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}require("../../../../GradientManager/configuration/constants.js");var i=c(e),u=c(o);function l(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,n)}return t}function p(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?l(Object(t),!0).forEach((function(r){i.default(e,r,t[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):l(Object(t)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}))}return e}var f=function(e){var o=e.children,a=e.rollbarManifestConfig,c=e.appKey,i=e.version,l=t.useMemo((function(){var e,r=window.parent.Rollbar,t={accessToken:!a.useGlobalInstance&&a.accessToken?a.accessToken:null==r||null===(e=r.options)||void 0===e?void 0:e.accessToken,payload:{context:a.contextPrefix?"".concat(a.contextPrefix,"#").concat(c):c,client:{javascript:{code_version:i}}}},o=n.merge({},null==r?void 0:r.options,t);return new u.default(o)}),[]);return r.jsx(s.Provider,{instance:l,children:o})};exports.RollbarWrapper=function(e){var t=e.children,n=e.rollbarManifestConfig,o=e.isCLIApp,s=e.companyId===a.CORVA_COMPANY_ID;return n&&n.enabled&&s&&!o?r.jsx(f,p(p({},e),{},{children:t})):t};
//# sourceMappingURL=RollbarWrapper.js.map
