'use strict';

/**
 * @type {Array<string>}
 */
const roots = ['goog', 'proto2', 'soy', 'soydata', 'svgpan'];

/**
 * @type {Object<string, string>}
 */
const replaceMap = {
  'goog.debug.GcDiagnostics_': 'goog.debug.GcDiagnostics',
  'goog.debug.Trace_': 'goog.debug.Trace',
  'goog.disposeAll': 'goog.dispose',
  'goog.dom.$F': 'goog.dom.forms.getValue',
  'goog.dom.BufferedViewportSizeMonitor.EventType': 'goog.dom.BufferedViewportSizeMonitor',
  'goog.ui.KeyboardShortcutHandler.Modifiers': 'goog.ui.KeyboardShortcutHandler',
};

/**
 * @type {Array<string>}
 */
const ignorePackages = ['goog'];

/**
 * @type {Array<string>}
 */
const namespaceMethods = [
  'goog.color.names',
  'goog.date.month',
  'goog.date.weekDay',
  'goog.debug.errorHandlerWeakDep',
  'goog.dispose',
  'goog.dom.query',
  'goog.ds.logger',
  'goog.events.actionEventWrapper',
  'goog.i18n.currencyCodeMap',
  'goog.i18n.currencyCodeMapTier2',
  'goog.i18n.mime.encode',
  'goog.labs.mock',
  'goog.labs.testing.assertThat',
  'goog.locale.countries',
  'goog.locale.defaultLocaleNameConstants',
  'goog.locale.genericFontNamesData',
  'goog.locale.nativeNameConstants',
  'goog.locale.scriptToLanguages',
  'goog.memoize',
  'goog.net.cookies',
  'goog.string.format',
  'goog.string.html.htmlSanitize',
  'goog.testing.recordConstructor',
  'goog.testing.recordFunction',
  'goog.ui.decorate',
  'goog.userAgent.product.isVersion',
];

/**
 * @return {Object<string, string>}
 */
exports.getReplaceMap = () => ({...replaceMap});

/**
 * @return {Object<string, boolean>}
 */
exports.getNamespaceMethods = () =>
  namespaceMethods.reduce((prev, item) => {
    prev[item] = true;
    return prev;
  }, {});

/**
 * @return {Object<string, boolean>}
 */
exports.getRoots = () =>
  roots.reduce((prev, item) => {
    prev[item] = true;
    return prev;
  }, {});

/**
 * @return {Object<string, boolean>}
 */
exports.getIgnorePackages = () =>
  ignorePackages.reduce((prev, item) => {
    prev[item] = true;
    return prev;
  }, {});

@@ -167,16 +167,123 @@
 Map = %7B%0A
+  'goog.Disposable.MonitoringMode': 'goog.Disposable',%0A  'goog.Promise.CancellationError': 'goog.Promise',%0A
   'goog.
@@ -329,24 +329,24 @@
 agnostics',%0A
-
   'goog.debu
@@ -545,24 +545,73 @@
 zeMonitor',%0A
+  'goog.editor.Plugin.Op': 'goog.editor.Plugin',%0A
   'goog.ui.K
@@ -680,16 +680,70 @@
 ndler',%0A
+  'goog.ui.SplitPane.EventType': 'goog.ui.SplitPane',%0A
 %7D;%0A%0A/**%0A

improve default replaceMap