"use strict";

exports.__esModule = true;
exports.buildWixPatternsEssentials = buildWixPatternsEssentials;
var _yoshiFlowBm = require("@wix/yoshi-flow-bm");
var _bexCore = require("@wix/bex-core");
function buildWixPatternsEssentials(essentials, {
  overrides
} = {}) {
  const {
    errorMonitor,
    httpClient,
    environment: essentialsEnvironment,
    errorHandler
  } = essentials;
  const environment = {
    ...essentialsEnvironment,
    ...(overrides == null ? void 0 : overrides.environment),
    providerType: 'giza'
  };
  return {
    createEssentials: options => essentials.createChildEssentials({
      ...options,
      experiments: {
        bag: (0, _bexCore.getWixPatternsWindowExperiments)() ?? {}
      }
    }),
    errorMonitor: errorMonitor ?? {
      captureException: () => {}
    },
    errorHandler: errorHandler.v2,
    useTranslation: _yoshiFlowBm.useTranslation,
    biLogger: process.env.NODE_ENV !== 'test' ? essentials.asPartial.biLogger : undefined,
    Trans: _yoshiFlowBm.Trans,
    useExperiments: () => (0, _yoshiFlowBm.useExperiments)({
      readOnly: true
    }),
    showToast: () => ({
      remove: () => {}
    }),
    httpClient,
    experiments: (0, _bexCore.getExperimentsCompat)(essentials),
    createComponentSettings: _bexCore.createAccountComponentSettings,
    ...overrides,
    user: {
      permissions: [],
      ...(overrides == null ? void 0 : overrides.user)
    },
    environment,
    environmentBI: {
      artifactId: essentials.environment.artifactId,
      componentId: essentials.environment.componentId
    }
  };
}
//# sourceMappingURL=buildWixPatternsEssentials.js.map