function prepareEvent(
  options,
  event,
  hint,
  scope$1,
  client,
  isolationScope,
) {
  const { normalizeDepth = 3, normalizeMaxBreadth = 1000 } = options;
  const prepared = {
    ...event,
    event_id: event.event_id || hint.event_id || utils.uuid4(),
    timestamp: event.timestamp || utils.dateTimestampInSeconds(),
  };
  const integrations = hint.integrations || options.integrations.map(i => i.name);

  applyClientOptions(prepared, options);
  applyIntegrationsMetadata(prepared, integrations);

  // Only put debug IDs onto frames for error events.
  if (event.type === undefined) {
    applyDebugIds(prepared, options.stackParser);
  }

  // If we have scope given to us, use it as the base for further modifications.
  // This allows us to prevent unnecessary copying of data if `captureContext` is not provided.
  const finalScope = getFinalScope(scope$1, hint.captureContext);

  if (hint.mechanism) {
    utils.addExceptionMechanism(prepared, hint.mechanism);
  }

  const clientEventProcessors = client && client.getEventProcessors ? client.getEventProcessors() : [];

  // This should be the last thing called, since we want that
  // {@link Hub.addEventProcessor} gets the finished prepared event.
  // Merge scope data together
  const data = scope.getGlobalScope().getScopeData();

  if (isolationScope) {
    const isolationData = isolationScope.getScopeData();
    applyScopeDataToEvent.mergeScopeData(data, isolationData);
  }

  if (finalScope) {
    const finalScopeData = finalScope.getScopeData();
    applyScopeDataToEvent.mergeScopeData(data, finalScopeData);
  }

  const attachments = [...(hint.attachments || []), ...data.attachments];
  if (attachments.length) {
    hint.attachments = attachments;
  }

  applyScopeDataToEvent.applyScopeDataToEvent(prepared, data);

  // TODO (v8): Update this order to be: Global > Client > Scope
  const eventProcessors$1 = [
    ...clientEventProcessors,
    // eslint-disable-next-line deprecation/deprecation
    ...eventProcessors.getGlobalEventProcessors(),
    // Run scope event processors _after_ all other processors
    ...data.eventProcessors,
  ];

  const result = eventProcessors.notifyEventProcessors(eventProcessors$1, prepared, hint);

  return result.then(evt => {
    if (evt) {
      // We apply the debug_meta field only after all event processors have ran, so that if any event processors modified
      // file names (e.g.the RewriteFrames integration) the filename -> debug ID relationship isn't destroyed.
      // This should not cause any PII issues, since we're only moving data that is already on the event and not adding
      // any new data
      applyDebugMeta(evt);
    }

    if (typeof normalizeDepth === 'number' && normalizeDepth > 0) {
      return normalizeEvent(evt, normalizeDepth, normalizeMaxBreadth);
    }
    return evt;
  });
}
Adds common information to events.

The information includes release and environment from `options`,
breadcrumbs and context (extra, tags and user) from the scope.

Information that is already present in the event is never overwritten. For
nested objects, such as the context, keys are merged.

Note: This also triggers callbacks for `addGlobalEventProcessor`, but not `beforeSend`.

@param event The original event.
@param hint May contain additional information about the original exception.
@param scope A scope containing event metadata.
@returns A new event with more information.
@hidden