"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = _default;

function _react() {
  const data = _interopRequireDefault(require("react"));

  _react = function _react() {
    return data;
  };

  return data;
}

function _assert() {
  const data = _interopRequireDefault(require("assert"));

  _assert = function _assert() {
    return data;
  };

  return data;
}

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function _default(api) {
  return {
    name: 'runtimePublicPath',

    validate(val) {
      (0, _assert().default)(typeof val === 'boolean' || typeof val === 'string', `Configure item runtimePublicPath should be Boolean or String, but got ${val}.`);
    },

    onChange() {
      api.service.restart(
      /* why */
      'Configure item runtimePublicPath Changed.');
    },

    default: false,
    title: {
      'zh-CN': '启用运行时 publicPath',
      'en-US': 'Enable Runtime publicPath'
    },
    description: {
      'zh-CN': '使用 HTML 里指定的 window.publicPath 作为动态加载资源的查找起点。',
      'en-US': 'Whether to use the window.publicPath specified in the HTML.'
    },
    type: 'boolean',
    group: 'deploy'
  };
}