text: "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  /*tslint:disable variable-name*/
  const t = require("io-ts");
  /**
   * Webpack module object interfaces.
   *
   * We use two "types" of interfaces here:
   * - `I<name>`: A standard TypeScript type/interface. Compiled away.
   * - `R<name>`: A outputted to `lib` `io-ts` data structure for runtime type
   *   checking.
   *
   * The webpack stats module objects have two "flavors":
   * - An object containing `source` with stringified source code.
   * - An object containing a modules array at the `modules` field.
   *
   * We bridge both with these compile + runtime types.
   */
  // Common
  const RWebpackStatsChunk = t.union([t.string, t.number]);
  // ----------------------------------------------------------------------------
  // Assets
  // ----------------------------------------------------------------------------
  const RWebpackStatsAsset = t.type({
      // Chunk identifiers.
      chunks: t.array(RWebpackStatsChunk),
      // Output file name.
      name: t.string,
      // Estimated byte size of module.
      size: t.number,
  });
  // ----------------------------------------------------------------------------
  // Array of assets.
  // ----------------------------------------------------------------------------
  const RWebpackStatsAssets = t.array(RWebpackStatsAsset);
  // ----------------------------------------------------------------------------
  // Module: Base type
  // ----------------------------------------------------------------------------
  const RWebpackStatsModuleBase = t.type({
      // Chunk identifiers.
      chunks: t.array(RWebpackStatsChunk),
      // Full path to file on disk (with extra hash stuff if `modules` module).
      identifier: t.string,
      // Estimated byte size of module.
      size: t.number,
  });
  // ----------------------------------------------------------------------------
  // Module: Single code **source**
  // ----------------------------------------------------------------------------
  exports.RWebpackStatsModuleSource = t.intersection([
      RWebpackStatsModuleBase,
      t.type({
          // Raw source, stringified
          source: t.string,
      }),
  ]);
  // ----------------------------------------------------------------------------
  // Module: Single "synthetic" module
  //
  // This is a module created from webpack-specific programming / macros. E.g.
  //
  // ```js
  // {
  //   "identifier": "/PATH/TO/PROJECT/node_modules/moment/locale /es/",
  //   "name": "../moment/locale es",
  //   "size": 235,
  // }
  // ```
  //
  // with no `source` or `modules`. This translates to bundle code of:
  //
  // ```js
  // /***/ (function(module, exports, __webpack_require__) {
  //
  //   var map = {
  //     "./es": 4,
  //     "./es-do": 5,
  //     "./es-do.js": 5,
  //     "./es-us": 6,
  //     "./es-us.js": 6,
  //     "./es.js": 4
  //   };
  //   // ... webpack boilerplate stuff to load the files ...
  // ```
  // ----------------------------------------------------------------------------
  // Just alias base.
  exports.RWebpackStatsModuleSynthetic = RWebpackStatsModuleBase;
  exports.RWebpackStatsModuleModules = t.recursion("RWebpackStatsModuleModules", (self) => t.intersection([
      RWebpackStatsModuleBase,
      t.type({
          // More levels of modules.
          // https://webpack.js.org/api/stats/#module-objects
          modules: t.array(t.union([
              exports.RWebpackStatsModuleSource,
              self,
          ])),
      }),
  ]));
  // ----------------------------------------------------------------------------
  // Module: Either `source` or `modules` types.
  // ----------------------------------------------------------------------------
  const RWebpackStatsModule = t.union([
      exports.RWebpackStatsModuleSource,
      exports.RWebpackStatsModuleSynthetic,
      exports.RWebpackStatsModuleModules,
  ]);
  // ----------------------------------------------------------------------------
  // Array of modules.
  // ----------------------------------------------------------------------------
  const RWebpackStatsModules = t.array(RWebpackStatsModule);
  // ----------------------------------------------------------------------------
  // The full webpack stats object.
  // ----------------------------------------------------------------------------
  // tslint:disable-next-line variable-name
  exports.RWebpackStats = t.interface({
      assets: RWebpackStatsAssets,
      modules: RWebpackStatsModules,
  });
  