宜搭+

宜搭插件升级工具

目前为 2023-11-07 提交的版本。查看 最新版本

// ==UserScript==
// @name       宜搭+
// @namespace  npm/vite-plugin-monkey
// @version    2.2.2
// @author     Navcoo.Li
// @icon       https://www.google.com/s2/favicons?sz=64&domain=aliwork.com
// @match      https://*.aliwork.com/alibaba/web/*/design/*
// @require    https://cdn.jsdelivr.net/npm/[email protected]/umd/react.production.min.js
// @require    https://cdn.jsdelivr.net/npm/[email protected]/umd/react-dom.production.min.js
// @grant      GM_addStyle
// @grant      GM_setClipboard
// @grant      unsafeWindow
// @description 宜搭插件升级工具
// ==/UserScript==

(e=>{if(typeof GM_addStyle=="function"){GM_addStyle(e);return}const o=document.createElement("style");o.textContent=e,document.head.append(o)})(" .box-grid-1{display:grid;grid-template-columns:repeat(1,minmax(0,1fr));gap:4px}.jsApiItemTitle{font-size:14px}.jsApiItemTitle_Box{display:flex;align-items:center;gap:8px}.jsApiItemDescription{font-size:12px;color:#1f385866}.jsApiItemIcon{cursor:pointer}.jsApiItem_Box{border-radius:4px;padding:4px}.jsApiItem_Box:hover{background-color:#1f38580a}.jsApiIcon_Box{cursor:pointer;height:14px}.box-grid-2{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:4px}.DataSourceApi-title{display:flex;align-items:center;gap:4px}.DataSourceApi-content{width:600px;max-height:350px;overflow-y:auto;background:#ffffff;border:1px solid #ccc;border-radius:4px;padding:16px}.DataSourceApi-content-apiName{font-size:14px;font-weight:600;line-height:2em}.DataSourceApi-content-InterfacePath{font-size:14px;margin-bottom:4px;display:flex;align-items:center;gap:4px}.DataSourceApi-content-requestType{border-style:solid;border-width:1px;border-radius:4px;padding:1px 4px;display:inline;background-color:#1f38581a;border-color:#1f38580f}.about_box{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));padding:20px;gap:16px;border-style:solid;border-width:1px;border-color:#1f38580f;border-radius:4px}:root{font-family:Inter,Avenir,Helvetica,Arial,sans-serif;font-size:16px;line-height:24px;font-weight:400;color-scheme:light dark;color:#ffffffde;background-color:#242424;font-synthesis:none;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-webkit-text-size-adjust:100%}a{font-weight:500;color:#646cff;text-decoration:inherit}a:hover{color:#535bf2}body{margin:0;display:flex;place-items:center;min-width:320px;min-height:100vh}h1{font-size:3.2em;line-height:1.1}button{border-radius:8px;border:1px solid transparent;padding:.6em 1.2em;font-size:1em;font-weight:500;font-family:inherit;background-color:#1a1a1a;cursor:pointer;transition:border-color .25s}button:hover{border-color:#646cff}button:focus,button:focus-visible{outline:4px auto -webkit-focus-ring-color}@media (prefers-color-scheme: light){:root{color:#213547;background-color:#fff}a:hover{color:#747bff}button{background-color:#f9f9f9}} ");

(function (React, ReactDOM) {
  'use strict';

  var __defProp = Object.defineProperty;
  var __defNormalProp = (obj2, key, value) => key in obj2 ? __defProp(obj2, key, { enumerable: true, configurable: true, writable: true, value }) : obj2[key] = value;
  var __publicField = (obj2, key, value) => {
    __defNormalProp(obj2, typeof key !== "symbol" ? key + "" : key, value);
    return value;
  };
  var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
  function getDefaultExportFromCjs(x2) {
    return x2 && x2.__esModule && Object.prototype.hasOwnProperty.call(x2, "default") ? x2["default"] : x2;
  }
  function getAugmentedNamespace(n2) {
    if (n2.__esModule)
      return n2;
    var f2 = n2.default;
    if (typeof f2 == "function") {
      var a = function a2() {
        if (this instanceof a2) {
          return Reflect.construct(f2, arguments, this.constructor);
        }
        return f2.apply(this, arguments);
      };
      a.prototype = f2.prototype;
    } else
      a = {};
    Object.defineProperty(a, "__esModule", { value: true });
    Object.keys(n2).forEach(function(k2) {
      var d2 = Object.getOwnPropertyDescriptor(n2, k2);
      Object.defineProperty(a, k2, d2.get ? d2 : {
        enumerable: true,
        get: function() {
          return n2[k2];
        }
      });
    });
    return a;
  }
  var jsxRuntime = { exports: {} };
  var reactJsxRuntime_production_min = {};
  /**
   * @license React
   * react-jsx-runtime.production.min.js
   *
   * Copyright (c) Facebook, Inc. and its affiliates.
   *
   * This source code is licensed under the MIT license found in the
   * LICENSE file in the root directory of this source tree.
   */
  var f$1 = React, k$2 = Symbol.for("react.element"), l$1 = Symbol.for("react.fragment"), m$2 = Object.prototype.hasOwnProperty, n$1 = f$1.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, p$1 = { key: true, ref: true, __self: true, __source: true };
  function q$1(c2, a, g2) {
    var b2, d2 = {}, e2 = null, h2 = null;
    void 0 !== g2 && (e2 = "" + g2);
    void 0 !== a.key && (e2 = "" + a.key);
    void 0 !== a.ref && (h2 = a.ref);
    for (b2 in a)
      m$2.call(a, b2) && !p$1.hasOwnProperty(b2) && (d2[b2] = a[b2]);
    if (c2 && c2.defaultProps)
      for (b2 in a = c2.defaultProps, a)
        void 0 === d2[b2] && (d2[b2] = a[b2]);
    return { $$typeof: k$2, type: c2, key: e2, ref: h2, props: d2, _owner: n$1.current };
  }
  reactJsxRuntime_production_min.Fragment = l$1;
  reactJsxRuntime_production_min.jsx = q$1;
  reactJsxRuntime_production_min.jsxs = q$1;
  {
    jsxRuntime.exports = reactJsxRuntime_production_min;
  }
  var jsxRuntimeExports = jsxRuntime.exports;
  var client = {};
  var m$1 = ReactDOM;
  {
    client.createRoot = m$1.createRoot;
    client.hydrateRoot = m$1.hydrateRoot;
  }
  var _GM_addStyle = /* @__PURE__ */ (() => typeof GM_addStyle != "undefined" ? GM_addStyle : void 0)();
  var _GM_setClipboard = /* @__PURE__ */ (() => typeof GM_setClipboard != "undefined" ? GM_setClipboard : void 0)();
  var _unsafeWindow = /* @__PURE__ */ (() => typeof unsafeWindow != "undefined" ? unsafeWindow : void 0)();
  var _global = { exports: {} };
  var global$6 = _global.exports = typeof window != "undefined" && window.Math == Math ? window : typeof self != "undefined" && self.Math == Math ? self : Function("return this")();
  if (typeof __g == "number")
    __g = global$6;
  var _globalExports = _global.exports;
  var _core = { exports: {} };
  var core$3 = _core.exports = { version: "2.6.12" };
  if (typeof __e == "number")
    __e = core$3;
  var _coreExports = _core.exports;
  var _aFunction = function(it) {
    if (typeof it != "function")
      throw TypeError(it + " is not a function!");
    return it;
  };
  var aFunction = _aFunction;
  var _ctx = function(fn, that, length2) {
    aFunction(fn);
    if (that === void 0)
      return fn;
    switch (length2) {
      case 1:
        return function(a) {
          return fn.call(that, a);
        };
      case 2:
        return function(a, b2) {
          return fn.call(that, a, b2);
        };
      case 3:
        return function(a, b2, c2) {
          return fn.call(that, a, b2, c2);
        };
    }
    return function() {
      return fn.apply(that, arguments);
    };
  };
  var _objectDp = {};
  var _isObject = function(it) {
    return typeof it === "object" ? it !== null : typeof it === "function";
  };
  var isObject$4 = _isObject;
  var _anObject = function(it) {
    if (!isObject$4(it))
      throw TypeError(it + " is not an object!");
    return it;
  };
  var _fails = function(exec) {
    try {
      return !!exec();
    } catch (e2) {
      return true;
    }
  };
  var _descriptors = !_fails(function() {
    return Object.defineProperty({}, "a", { get: function() {
      return 7;
    } }).a != 7;
  });
  var _domCreate;
  var hasRequired_domCreate;
  function require_domCreate() {
    if (hasRequired_domCreate)
      return _domCreate;
    hasRequired_domCreate = 1;
    var isObject2 = _isObject;
    var document2 = _globalExports.document;
    var is = isObject2(document2) && isObject2(document2.createElement);
    _domCreate = function(it) {
      return is ? document2.createElement(it) : {};
    };
    return _domCreate;
  }
  var _ie8DomDefine = !_descriptors && !_fails(function() {
    return Object.defineProperty(require_domCreate()("div"), "a", { get: function() {
      return 7;
    } }).a != 7;
  });
  var isObject$3 = _isObject;
  var _toPrimitive = function(it, S) {
    if (!isObject$3(it))
      return it;
    var fn, val;
    if (S && typeof (fn = it.toString) == "function" && !isObject$3(val = fn.call(it)))
      return val;
    if (typeof (fn = it.valueOf) == "function" && !isObject$3(val = fn.call(it)))
      return val;
    if (!S && typeof (fn = it.toString) == "function" && !isObject$3(val = fn.call(it)))
      return val;
    throw TypeError("Can't convert object to primitive value");
  };
  var anObject$3 = _anObject;
  var IE8_DOM_DEFINE$1 = _ie8DomDefine;
  var toPrimitive$3 = _toPrimitive;
  var dP$3 = Object.defineProperty;
  _objectDp.f = _descriptors ? Object.defineProperty : function defineProperty(O, P, Attributes) {
    anObject$3(O);
    P = toPrimitive$3(P, true);
    anObject$3(Attributes);
    if (IE8_DOM_DEFINE$1)
      try {
        return dP$3(O, P, Attributes);
      } catch (e2) {
      }
    if ("get" in Attributes || "set" in Attributes)
      throw TypeError("Accessors not supported!");
    if ("value" in Attributes)
      O[P] = Attributes.value;
    return O;
  };
  var _propertyDesc = function(bitmap, value) {
    return {
      enumerable: !(bitmap & 1),
      configurable: !(bitmap & 2),
      writable: !(bitmap & 4),
      value
    };
  };
  var dP$2 = _objectDp;
  var createDesc$2 = _propertyDesc;
  var _hide = _descriptors ? function(object, key, value) {
    return dP$2.f(object, key, createDesc$2(1, value));
  } : function(object, key, value) {
    object[key] = value;
    return object;
  };
  var hasOwnProperty$2 = {}.hasOwnProperty;
  var _has = function(it, key) {
    return hasOwnProperty$2.call(it, key);
  };
  var global$5 = _globalExports;
  var core$2 = _coreExports;
  var ctx = _ctx;
  var hide$3 = _hide;
  var has$6 = _has;
  var PROTOTYPE$2 = "prototype";
  var $export$6 = function(type2, name, source) {
    var IS_FORCED = type2 & $export$6.F;
    var IS_GLOBAL = type2 & $export$6.G;
    var IS_STATIC = type2 & $export$6.S;
    var IS_PROTO = type2 & $export$6.P;
    var IS_BIND = type2 & $export$6.B;
    var IS_WRAP = type2 & $export$6.W;
    var exports = IS_GLOBAL ? core$2 : core$2[name] || (core$2[name] = {});
    var expProto = exports[PROTOTYPE$2];
    var target = IS_GLOBAL ? global$5 : IS_STATIC ? global$5[name] : (global$5[name] || {})[PROTOTYPE$2];
    var key, own, out;
    if (IS_GLOBAL)
      source = name;
    for (key in source) {
      own = !IS_FORCED && target && target[key] !== void 0;
      if (own && has$6(exports, key))
        continue;
      out = own ? target[key] : source[key];
      exports[key] = IS_GLOBAL && typeof target[key] != "function" ? source[key] : IS_BIND && own ? ctx(out, global$5) : IS_WRAP && target[key] == out ? function(C) {
        var F = function(a, b2, c2) {
          if (this instanceof C) {
            switch (arguments.length) {
              case 0:
                return new C();
              case 1:
                return new C(a);
              case 2:
                return new C(a, b2);
            }
            return new C(a, b2, c2);
          }
          return C.apply(this, arguments);
        };
        F[PROTOTYPE$2] = C[PROTOTYPE$2];
        return F;
      }(out) : IS_PROTO && typeof out == "function" ? ctx(Function.call, out) : out;
      if (IS_PROTO) {
        (exports.virtual || (exports.virtual = {}))[key] = out;
        if (type2 & $export$6.R && expProto && !expProto[key])
          hide$3(expProto, key, out);
      }
    }
  };
  $export$6.F = 1;
  $export$6.G = 2;
  $export$6.S = 4;
  $export$6.P = 8;
  $export$6.B = 16;
  $export$6.W = 32;
  $export$6.U = 64;
  $export$6.R = 128;
  var _export = $export$6;
  var toString$1 = {}.toString;
  var _cof = function(it) {
    return toString$1.call(it).slice(8, -1);
  };
  var cof$1 = _cof;
  var _iobject = Object("z").propertyIsEnumerable(0) ? Object : function(it) {
    return cof$1(it) == "String" ? it.split("") : Object(it);
  };
  var _defined = function(it) {
    if (it == void 0)
      throw TypeError("Can't call method on  " + it);
    return it;
  };
  var IObject = _iobject;
  var defined$2 = _defined;
  var _toIobject = function(it) {
    return IObject(defined$2(it));
  };
  var ceil = Math.ceil;
  var floor = Math.floor;
  var _toInteger = function(it) {
    return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it);
  };
  var toInteger$2 = _toInteger;
  var min$1 = Math.min;
  var _toLength = function(it) {
    return it > 0 ? min$1(toInteger$2(it), 9007199254740991) : 0;
  };
  var toInteger$1 = _toInteger;
  var max = Math.max;
  var min = Math.min;
  var _toAbsoluteIndex = function(index2, length2) {
    index2 = toInteger$1(index2);
    return index2 < 0 ? max(index2 + length2, 0) : min(index2, length2);
  };
  var toIObject$5 = _toIobject;
  var toLength = _toLength;
  var toAbsoluteIndex = _toAbsoluteIndex;
  var _arrayIncludes = function(IS_INCLUDES) {
    return function($this, el, fromIndex) {
      var O = toIObject$5($this);
      var length2 = toLength(O.length);
      var index2 = toAbsoluteIndex(fromIndex, length2);
      var value;
      if (IS_INCLUDES && el != el)
        while (length2 > index2) {
          value = O[index2++];
          if (value != value)
            return true;
        }
      else
        for (; length2 > index2; index2++)
          if (IS_INCLUDES || index2 in O) {
            if (O[index2] === el)
              return IS_INCLUDES || index2 || 0;
          }
      return !IS_INCLUDES && -1;
    };
  };
  var _shared = { exports: {} };
  var _library = true;
  var core$1 = _coreExports;
  var global$4 = _globalExports;
  var SHARED = "__core-js_shared__";
  var store$1 = global$4[SHARED] || (global$4[SHARED] = {});
  (_shared.exports = function(key, value) {
    return store$1[key] || (store$1[key] = value !== void 0 ? value : {});
  })("versions", []).push({
    version: core$1.version,
    mode: "pure",
    copyright: "© 2020 Denis Pushkarev (zloirock.ru)"
  });
  var _sharedExports = _shared.exports;
  var id$1 = 0;
  var px = Math.random();
  var _uid = function(key) {
    return "Symbol(".concat(key === void 0 ? "" : key, ")_", (++id$1 + px).toString(36));
  };
  var shared$1 = _sharedExports("keys");
  var uid$2 = _uid;
  var _sharedKey = function(key) {
    return shared$1[key] || (shared$1[key] = uid$2(key));
  };
  var has$5 = _has;
  var toIObject$4 = _toIobject;
  var arrayIndexOf = _arrayIncludes(false);
  var IE_PROTO$2 = _sharedKey("IE_PROTO");
  var _objectKeysInternal = function(object, names) {
    var O = toIObject$4(object);
    var i = 0;
    var result = [];
    var key;
    for (key in O)
      if (key != IE_PROTO$2)
        has$5(O, key) && result.push(key);
    while (names.length > i)
      if (has$5(O, key = names[i++])) {
        ~arrayIndexOf(result, key) || result.push(key);
      }
    return result;
  };
  var _enumBugKeys = "constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",");
  var $keys$2 = _objectKeysInternal;
  var enumBugKeys$1 = _enumBugKeys;
  var _objectKeys = Object.keys || function keys(O) {
    return $keys$2(O, enumBugKeys$1);
  };
  var _objectGops = {};
  _objectGops.f = Object.getOwnPropertySymbols;
  var _objectPie = {};
  _objectPie.f = {}.propertyIsEnumerable;
  var defined$1 = _defined;
  var _toObject = function(it) {
    return Object(defined$1(it));
  };
  var _objectAssign;
  var hasRequired_objectAssign;
  function require_objectAssign() {
    if (hasRequired_objectAssign)
      return _objectAssign;
    hasRequired_objectAssign = 1;
    var DESCRIPTORS2 = _descriptors;
    var getKeys2 = _objectKeys;
    var gOPS2 = _objectGops;
    var pIE2 = _objectPie;
    var toObject2 = _toObject;
    var IObject2 = _iobject;
    var $assign = Object.assign;
    _objectAssign = !$assign || _fails(function() {
      var A2 = {};
      var B = {};
      var S = Symbol();
      var K = "abcdefghijklmnopqrst";
      A2[S] = 7;
      K.split("").forEach(function(k2) {
        B[k2] = k2;
      });
      return $assign({}, A2)[S] != 7 || Object.keys($assign({}, B)).join("") != K;
    }) ? function assign2(target, source) {
      var T = toObject2(target);
      var aLen = arguments.length;
      var index2 = 1;
      var getSymbols = gOPS2.f;
      var isEnum2 = pIE2.f;
      while (aLen > index2) {
        var S = IObject2(arguments[index2++]);
        var keys3 = getSymbols ? getKeys2(S).concat(getSymbols(S)) : getKeys2(S);
        var length2 = keys3.length;
        var j = 0;
        var key;
        while (length2 > j) {
          key = keys3[j++];
          if (!DESCRIPTORS2 || isEnum2.call(S, key))
            T[key] = S[key];
        }
      }
      return T;
    } : $assign;
    return _objectAssign;
  }
  var $export$5 = _export;
  $export$5($export$5.S + $export$5.F, "Object", { assign: require_objectAssign() });
  var assign$1 = _coreExports.Object.assign;
  var assign = { "default": assign$1, __esModule: true };
  var _assign = assign;
  var _assign2 = _interopRequireDefault$7(_assign);
  function _interopRequireDefault$7(obj2) {
    return obj2 && obj2.__esModule ? obj2 : { default: obj2 };
  }
  var _default$8 = _assign2.default || function(target) {
    for (var i = 1; i < arguments.length; i++) {
      var source = arguments[i];
      for (var key in source) {
        if (Object.prototype.hasOwnProperty.call(source, key)) {
          target[key] = source[key];
        }
      }
    }
    return target;
  };
  var _default$7 = function(instance2, Constructor) {
    if (!(instance2 instanceof Constructor)) {
      throw new TypeError("Cannot call a class as a function");
    }
  };
  var _typeof$2 = {};
  var toInteger = _toInteger;
  var defined = _defined;
  var _stringAt = function(TO_STRING) {
    return function(that, pos) {
      var s = String(defined(that));
      var i = toInteger(pos);
      var l2 = s.length;
      var a, b2;
      if (i < 0 || i >= l2)
        return TO_STRING ? "" : void 0;
      a = s.charCodeAt(i);
      return a < 55296 || a > 56319 || i + 1 === l2 || (b2 = s.charCodeAt(i + 1)) < 56320 || b2 > 57343 ? TO_STRING ? s.charAt(i) : a : TO_STRING ? s.slice(i, i + 2) : (a - 55296 << 10) + (b2 - 56320) + 65536;
    };
  };
  var _redefine = _hide;
  var _iterators = {};
  var dP$1 = _objectDp;
  var anObject$2 = _anObject;
  var getKeys$1 = _objectKeys;
  var _objectDps = _descriptors ? Object.defineProperties : function defineProperties(O, Properties) {
    anObject$2(O);
    var keys3 = getKeys$1(Properties);
    var length2 = keys3.length;
    var i = 0;
    var P;
    while (length2 > i)
      dP$1.f(O, P = keys3[i++], Properties[P]);
    return O;
  };
  var _html;
  var hasRequired_html;
  function require_html() {
    if (hasRequired_html)
      return _html;
    hasRequired_html = 1;
    var document2 = _globalExports.document;
    _html = document2 && document2.documentElement;
    return _html;
  }
  var anObject$1 = _anObject;
  var dPs = _objectDps;
  var enumBugKeys = _enumBugKeys;
  var IE_PROTO$1 = _sharedKey("IE_PROTO");
  var Empty = function() {
  };
  var PROTOTYPE$1 = "prototype";
  var createDict = function() {
    var iframe = require_domCreate()("iframe");
    var i = enumBugKeys.length;
    var lt = "<";
    var gt = ">";
    var iframeDocument;
    iframe.style.display = "none";
    require_html().appendChild(iframe);
    iframe.src = "javascript:";
    iframeDocument = iframe.contentWindow.document;
    iframeDocument.open();
    iframeDocument.write(lt + "script" + gt + "document.F=Object" + lt + "/script" + gt);
    iframeDocument.close();
    createDict = iframeDocument.F;
    while (i--)
      delete createDict[PROTOTYPE$1][enumBugKeys[i]];
    return createDict();
  };
  var _objectCreate = Object.create || function create(O, Properties) {
    var result;
    if (O !== null) {
      Empty[PROTOTYPE$1] = anObject$1(O);
      result = new Empty();
      Empty[PROTOTYPE$1] = null;
      result[IE_PROTO$1] = O;
    } else
      result = createDict();
    return Properties === void 0 ? result : dPs(result, Properties);
  };
  var _wks = { exports: {} };
  var store = _sharedExports("wks");
  var uid$1 = _uid;
  var Symbol$1 = _globalExports.Symbol;
  var USE_SYMBOL = typeof Symbol$1 == "function";
  var $exports = _wks.exports = function(name) {
    return store[name] || (store[name] = USE_SYMBOL && Symbol$1[name] || (USE_SYMBOL ? Symbol$1 : uid$1)("Symbol." + name));
  };
  $exports.store = store;
  var _wksExports = _wks.exports;
  var def = _objectDp.f;
  var has$4 = _has;
  var TAG = _wksExports("toStringTag");
  var _setToStringTag = function(it, tag, stat) {
    if (it && !has$4(it = stat ? it : it.prototype, TAG))
      def(it, TAG, { configurable: true, value: tag });
  };
  var create$4 = _objectCreate;
  var descriptor = _propertyDesc;
  var setToStringTag$2 = _setToStringTag;
  var IteratorPrototype = {};
  _hide(IteratorPrototype, _wksExports("iterator"), function() {
    return this;
  });
  var _iterCreate = function(Constructor, NAME, next) {
    Constructor.prototype = create$4(IteratorPrototype, { next: descriptor(1, next) });
    setToStringTag$2(Constructor, NAME + " Iterator");
  };
  var has$3 = _has;
  var toObject$1 = _toObject;
  var IE_PROTO = _sharedKey("IE_PROTO");
  var ObjectProto$1 = Object.prototype;
  var _objectGpo = Object.getPrototypeOf || function(O) {
    O = toObject$1(O);
    if (has$3(O, IE_PROTO))
      return O[IE_PROTO];
    if (typeof O.constructor == "function" && O instanceof O.constructor) {
      return O.constructor.prototype;
    }
    return O instanceof Object ? ObjectProto$1 : null;
  };
  var $export$4 = _export;
  var redefine$1 = _redefine;
  var hide$2 = _hide;
  var Iterators$2 = _iterators;
  var $iterCreate = _iterCreate;
  var setToStringTag$1 = _setToStringTag;
  var getPrototypeOf$1 = _objectGpo;
  var ITERATOR = _wksExports("iterator");
  var BUGGY = !([].keys && "next" in [].keys());
  var FF_ITERATOR = "@@iterator";
  var KEYS = "keys";
  var VALUES = "values";
  var returnThis = function() {
    return this;
  };
  var _iterDefine = function(Base2, NAME, Constructor, next, DEFAULT, IS_SET, FORCED) {
    $iterCreate(Constructor, NAME, next);
    var getMethod = function(kind) {
      if (!BUGGY && kind in proto)
        return proto[kind];
      switch (kind) {
        case KEYS:
          return function keys3() {
            return new Constructor(this, kind);
          };
        case VALUES:
          return function values2() {
            return new Constructor(this, kind);
          };
      }
      return function entries() {
        return new Constructor(this, kind);
      };
    };
    var TAG2 = NAME + " Iterator";
    var DEF_VALUES = DEFAULT == VALUES;
    var VALUES_BUG = false;
    var proto = Base2.prototype;
    var $native = proto[ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT];
    var $default = $native || getMethod(DEFAULT);
    var $entries = DEFAULT ? !DEF_VALUES ? $default : getMethod("entries") : void 0;
    var $anyNative = NAME == "Array" ? proto.entries || $native : $native;
    var methods, key, IteratorPrototype2;
    if ($anyNative) {
      IteratorPrototype2 = getPrototypeOf$1($anyNative.call(new Base2()));
      if (IteratorPrototype2 !== Object.prototype && IteratorPrototype2.next) {
        setToStringTag$1(IteratorPrototype2, TAG2, true);
      }
    }
    if (DEF_VALUES && $native && $native.name !== VALUES) {
      VALUES_BUG = true;
      $default = function values2() {
        return $native.call(this);
      };
    }
    if (FORCED && (BUGGY || VALUES_BUG || !proto[ITERATOR])) {
      hide$2(proto, ITERATOR, $default);
    }
    Iterators$2[NAME] = $default;
    Iterators$2[TAG2] = returnThis;
    if (DEFAULT) {
      methods = {
        values: DEF_VALUES ? $default : getMethod(VALUES),
        keys: IS_SET ? $default : getMethod(KEYS),
        entries: $entries
      };
      if (FORCED)
        for (key in methods) {
          if (!(key in proto))
            redefine$1(proto, key, methods[key]);
        }
      else
        $export$4($export$4.P + $export$4.F * (BUGGY || VALUES_BUG), NAME, methods);
    }
    return methods;
  };
  var $at = _stringAt(true);
  _iterDefine(String, "String", function(iterated) {
    this._t = String(iterated);
    this._i = 0;
  }, function() {
    var O = this._t;
    var index2 = this._i;
    var point;
    if (index2 >= O.length)
      return { value: void 0, done: true };
    point = $at(O, index2);
    this._i += point.length;
    return { value: point, done: false };
  });
  var _iterStep = function(done, value) {
    return { value, done: !!done };
  };
  var step = _iterStep;
  var Iterators$1 = _iterators;
  var toIObject$3 = _toIobject;
  _iterDefine(Array, "Array", function(iterated, kind) {
    this._t = toIObject$3(iterated);
    this._i = 0;
    this._k = kind;
  }, function() {
    var O = this._t;
    var kind = this._k;
    var index2 = this._i++;
    if (!O || index2 >= O.length) {
      this._t = void 0;
      return step(1);
    }
    if (kind == "keys")
      return step(0, index2);
    if (kind == "values")
      return step(0, O[index2]);
    return step(0, [index2, O[index2]]);
  }, "values");
  Iterators$1.Arguments = Iterators$1.Array;
  var global$3 = _globalExports;
  var hide$1 = _hide;
  var Iterators = _iterators;
  var TO_STRING_TAG = _wksExports("toStringTag");
  var DOMIterables = "CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,TextTrackList,TouchList".split(",");
  for (var i = 0; i < DOMIterables.length; i++) {
    var NAME = DOMIterables[i];
    var Collection = global$3[NAME];
    var proto = Collection && Collection.prototype;
    if (proto && !proto[TO_STRING_TAG])
      hide$1(proto, TO_STRING_TAG, NAME);
    Iterators[NAME] = Iterators.Array;
  }
  var _wksExt = {};
  _wksExt.f = _wksExports;
  var iterator$1 = _wksExt.f("iterator");
  var iterator = { "default": iterator$1, __esModule: true };
  var _meta = { exports: {} };
  var META$1 = _uid("meta");
  var isObject$2 = _isObject;
  var has$2 = _has;
  var setDesc = _objectDp.f;
  var id = 0;
  var isExtensible = Object.isExtensible || function() {
    return true;
  };
  var FREEZE = !_fails(function() {
    return isExtensible(Object.preventExtensions({}));
  });
  var setMeta = function(it) {
    setDesc(it, META$1, { value: {
      i: "O" + ++id,
      // object ID
      w: {}
      // weak collections IDs
    } });
  };
  var fastKey = function(it, create6) {
    if (!isObject$2(it))
      return typeof it == "symbol" ? it : (typeof it == "string" ? "S" : "P") + it;
    if (!has$2(it, META$1)) {
      if (!isExtensible(it))
        return "F";
      if (!create6)
        return "E";
      setMeta(it);
    }
    return it[META$1].i;
  };
  var getWeak = function(it, create6) {
    if (!has$2(it, META$1)) {
      if (!isExtensible(it))
        return true;
      if (!create6)
        return false;
      setMeta(it);
    }
    return it[META$1].w;
  };
  var onFreeze = function(it) {
    if (FREEZE && meta.NEED && isExtensible(it) && !has$2(it, META$1))
      setMeta(it);
    return it;
  };
  var meta = _meta.exports = {
    KEY: META$1,
    NEED: false,
    fastKey,
    getWeak,
    onFreeze
  };
  var _metaExports = _meta.exports;
  var core = _coreExports;
  var wksExt$1 = _wksExt;
  var defineProperty$4 = _objectDp.f;
  var _wksDefine = function(name) {
    var $Symbol2 = core.Symbol || (core.Symbol = {});
    if (name.charAt(0) != "_" && !(name in $Symbol2))
      defineProperty$4($Symbol2, name, { value: wksExt$1.f(name) });
  };
  var getKeys = _objectKeys;
  var gOPS = _objectGops;
  var pIE$1 = _objectPie;
  var _enumKeys = function(it) {
    var result = getKeys(it);
    var getSymbols = gOPS.f;
    if (getSymbols) {
      var symbols = getSymbols(it);
      var isEnum2 = pIE$1.f;
      var i = 0;
      var key;
      while (symbols.length > i)
        if (isEnum2.call(it, key = symbols[i++]))
          result.push(key);
    }
    return result;
  };
  var cof = _cof;
  var _isArray = Array.isArray || function isArray(arg) {
    return cof(arg) == "Array";
  };
  var _objectGopnExt = {};
  var _objectGopn = {};
  var $keys$1 = _objectKeysInternal;
  var hiddenKeys = _enumBugKeys.concat("length", "prototype");
  _objectGopn.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
    return $keys$1(O, hiddenKeys);
  };
  var toIObject$2 = _toIobject;
  var gOPN$1 = _objectGopn.f;
  var toString = {}.toString;
  var windowNames = typeof window == "object" && window && Object.getOwnPropertyNames ? Object.getOwnPropertyNames(window) : [];
  var getWindowNames = function(it) {
    try {
      return gOPN$1(it);
    } catch (e2) {
      return windowNames.slice();
    }
  };
  _objectGopnExt.f = function getOwnPropertyNames2(it) {
    return windowNames && toString.call(it) == "[object Window]" ? getWindowNames(it) : gOPN$1(toIObject$2(it));
  };
  var _objectGopd = {};
  var pIE = _objectPie;
  var createDesc$1 = _propertyDesc;
  var toIObject$1 = _toIobject;
  var toPrimitive$2 = _toPrimitive;
  var has$1 = _has;
  var IE8_DOM_DEFINE = _ie8DomDefine;
  var gOPD$1 = Object.getOwnPropertyDescriptor;
  _objectGopd.f = _descriptors ? gOPD$1 : function getOwnPropertyDescriptor(O, P) {
    O = toIObject$1(O);
    P = toPrimitive$2(P, true);
    if (IE8_DOM_DEFINE)
      try {
        return gOPD$1(O, P);
      } catch (e2) {
      }
    if (has$1(O, P))
      return createDesc$1(!pIE.f.call(O, P), O[P]);
  };
  var global$2 = _globalExports;
  var has = _has;
  var DESCRIPTORS = _descriptors;
  var $export$3 = _export;
  var redefine = _redefine;
  var META = _metaExports.KEY;
  var $fails = _fails;
  var shared = _sharedExports;
  var setToStringTag = _setToStringTag;
  var uid = _uid;
  var wks = _wksExports;
  var wksExt = _wksExt;
  var wksDefine = _wksDefine;
  var enumKeys = _enumKeys;
  var isArray2 = _isArray;
  var anObject = _anObject;
  var isObject$1 = _isObject;
  var toObject = _toObject;
  var toIObject = _toIobject;
  var toPrimitive$1 = _toPrimitive;
  var createDesc = _propertyDesc;
  var _create$1 = _objectCreate;
  var gOPNExt = _objectGopnExt;
  var $GOPD = _objectGopd;
  var $GOPS = _objectGops;
  var $DP = _objectDp;
  var $keys = _objectKeys;
  var gOPD = $GOPD.f;
  var dP = $DP.f;
  var gOPN = gOPNExt.f;
  var $Symbol = global$2.Symbol;
  var $JSON = global$2.JSON;
  var _stringify = $JSON && $JSON.stringify;
  var PROTOTYPE = "prototype";
  var HIDDEN = wks("_hidden");
  var TO_PRIMITIVE = wks("toPrimitive");
  var isEnum = {}.propertyIsEnumerable;
  var SymbolRegistry = shared("symbol-registry");
  var AllSymbols = shared("symbols");
  var OPSymbols = shared("op-symbols");
  var ObjectProto = Object[PROTOTYPE];
  var USE_NATIVE = typeof $Symbol == "function" && !!$GOPS.f;
  var QObject = global$2.QObject;
  var setter = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild;
  var setSymbolDesc = DESCRIPTORS && $fails(function() {
    return _create$1(dP({}, "a", {
      get: function() {
        return dP(this, "a", { value: 7 }).a;
      }
    })).a != 7;
  }) ? function(it, key, D) {
    var protoDesc = gOPD(ObjectProto, key);
    if (protoDesc)
      delete ObjectProto[key];
    dP(it, key, D);
    if (protoDesc && it !== ObjectProto)
      dP(ObjectProto, key, protoDesc);
  } : dP;
  var wrap = function(tag) {
    var sym = AllSymbols[tag] = _create$1($Symbol[PROTOTYPE]);
    sym._k = tag;
    return sym;
  };
  var isSymbol = USE_NATIVE && typeof $Symbol.iterator == "symbol" ? function(it) {
    return typeof it == "symbol";
  } : function(it) {
    return it instanceof $Symbol;
  };
  var $defineProperty = function defineProperty2(it, key, D) {
    if (it === ObjectProto)
      $defineProperty(OPSymbols, key, D);
    anObject(it);
    key = toPrimitive$1(key, true);
    anObject(D);
    if (has(AllSymbols, key)) {
      if (!D.enumerable) {
        if (!has(it, HIDDEN))
          dP(it, HIDDEN, createDesc(1, {}));
        it[HIDDEN][key] = true;
      } else {
        if (has(it, HIDDEN) && it[HIDDEN][key])
          it[HIDDEN][key] = false;
        D = _create$1(D, { enumerable: createDesc(0, false) });
      }
      return setSymbolDesc(it, key, D);
    }
    return dP(it, key, D);
  };
  var $defineProperties = function defineProperties2(it, P) {
    anObject(it);
    var keys3 = enumKeys(P = toIObject(P));
    var i = 0;
    var l2 = keys3.length;
    var key;
    while (l2 > i)
      $defineProperty(it, key = keys3[i++], P[key]);
    return it;
  };
  var $create = function create2(it, P) {
    return P === void 0 ? _create$1(it) : $defineProperties(_create$1(it), P);
  };
  var $propertyIsEnumerable = function propertyIsEnumerable(key) {
    var E = isEnum.call(this, key = toPrimitive$1(key, true));
    if (this === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key))
      return false;
    return E || !has(this, key) || !has(AllSymbols, key) || has(this, HIDDEN) && this[HIDDEN][key] ? E : true;
  };
  var $getOwnPropertyDescriptor = function getOwnPropertyDescriptor2(it, key) {
    it = toIObject(it);
    key = toPrimitive$1(key, true);
    if (it === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key))
      return;
    var D = gOPD(it, key);
    if (D && has(AllSymbols, key) && !(has(it, HIDDEN) && it[HIDDEN][key]))
      D.enumerable = true;
    return D;
  };
  var $getOwnPropertyNames = function getOwnPropertyNames3(it) {
    var names = gOPN(toIObject(it));
    var result = [];
    var i = 0;
    var key;
    while (names.length > i) {
      if (!has(AllSymbols, key = names[i++]) && key != HIDDEN && key != META)
        result.push(key);
    }
    return result;
  };
  var $getOwnPropertySymbols = function getOwnPropertySymbols(it) {
    var IS_OP = it === ObjectProto;
    var names = gOPN(IS_OP ? OPSymbols : toIObject(it));
    var result = [];
    var i = 0;
    var key;
    while (names.length > i) {
      if (has(AllSymbols, key = names[i++]) && (IS_OP ? has(ObjectProto, key) : true))
        result.push(AllSymbols[key]);
    }
    return result;
  };
  if (!USE_NATIVE) {
    $Symbol = function Symbol2() {
      if (this instanceof $Symbol)
        throw TypeError("Symbol is not a constructor!");
      var tag = uid(arguments.length > 0 ? arguments[0] : void 0);
      var $set = function(value) {
        if (this === ObjectProto)
          $set.call(OPSymbols, value);
        if (has(this, HIDDEN) && has(this[HIDDEN], tag))
          this[HIDDEN][tag] = false;
        setSymbolDesc(this, tag, createDesc(1, value));
      };
      if (DESCRIPTORS && setter)
        setSymbolDesc(ObjectProto, tag, { configurable: true, set: $set });
      return wrap(tag);
    };
    redefine($Symbol[PROTOTYPE], "toString", function toString2() {
      return this._k;
    });
    $GOPD.f = $getOwnPropertyDescriptor;
    $DP.f = $defineProperty;
    _objectGopn.f = gOPNExt.f = $getOwnPropertyNames;
    _objectPie.f = $propertyIsEnumerable;
    $GOPS.f = $getOwnPropertySymbols;
    if (DESCRIPTORS && !_library) {
      redefine(ObjectProto, "propertyIsEnumerable", $propertyIsEnumerable);
    }
    wksExt.f = function(name) {
      return wrap(wks(name));
    };
  }
  $export$3($export$3.G + $export$3.W + $export$3.F * !USE_NATIVE, { Symbol: $Symbol });
  for (var es6Symbols = (
    // 19.4.2.2, 19.4.2.3, 19.4.2.4, 19.4.2.6, 19.4.2.8, 19.4.2.9, 19.4.2.10, 19.4.2.11, 19.4.2.12, 19.4.2.13, 19.4.2.14
    "hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(",")
  ), j = 0; es6Symbols.length > j; )
    wks(es6Symbols[j++]);
  for (var wellKnownSymbols = $keys(wks.store), k$1 = 0; wellKnownSymbols.length > k$1; )
    wksDefine(wellKnownSymbols[k$1++]);
  $export$3($export$3.S + $export$3.F * !USE_NATIVE, "Symbol", {
    // 19.4.2.1 Symbol.for(key)
    "for": function(key) {
      return has(SymbolRegistry, key += "") ? SymbolRegistry[key] : SymbolRegistry[key] = $Symbol(key);
    },
    // 19.4.2.5 Symbol.keyFor(sym)
    keyFor: function keyFor(sym) {
      if (!isSymbol(sym))
        throw TypeError(sym + " is not a symbol!");
      for (var key in SymbolRegistry)
        if (SymbolRegistry[key] === sym)
          return key;
    },
    useSetter: function() {
      setter = true;
    },
    useSimple: function() {
      setter = false;
    }
  });
  $export$3($export$3.S + $export$3.F * !USE_NATIVE, "Object", {
    // 19.1.2.2 Object.create(O [, Properties])
    create: $create,
    // 19.1.2.4 Object.defineProperty(O, P, Attributes)
    defineProperty: $defineProperty,
    // 19.1.2.3 Object.defineProperties(O, Properties)
    defineProperties: $defineProperties,
    // 19.1.2.6 Object.getOwnPropertyDescriptor(O, P)
    getOwnPropertyDescriptor: $getOwnPropertyDescriptor,
    // 19.1.2.7 Object.getOwnPropertyNames(O)
    getOwnPropertyNames: $getOwnPropertyNames,
    // 19.1.2.8 Object.getOwnPropertySymbols(O)
    getOwnPropertySymbols: $getOwnPropertySymbols
  });
  var FAILS_ON_PRIMITIVES = $fails(function() {
    $GOPS.f(1);
  });
  $export$3($export$3.S + $export$3.F * FAILS_ON_PRIMITIVES, "Object", {
    getOwnPropertySymbols: function getOwnPropertySymbols2(it) {
      return $GOPS.f(toObject(it));
    }
  });
  $JSON && $export$3($export$3.S + $export$3.F * (!USE_NATIVE || $fails(function() {
    var S = $Symbol();
    return _stringify([S]) != "[null]" || _stringify({ a: S }) != "{}" || _stringify(Object(S)) != "{}";
  })), "JSON", {
    stringify: function stringify(it) {
      var args = [it];
      var i = 1;
      var replacer, $replacer;
      while (arguments.length > i)
        args.push(arguments[i++]);
      $replacer = replacer = args[1];
      if (!isObject$1(replacer) && it === void 0 || isSymbol(it))
        return;
      if (!isArray2(replacer))
        replacer = function(key, value) {
          if (typeof $replacer == "function")
            value = $replacer.call(this, key, value);
          if (!isSymbol(value))
            return value;
        };
      args[1] = replacer;
      return _stringify.apply($JSON, args);
    }
  });
  $Symbol[PROTOTYPE][TO_PRIMITIVE] || _hide($Symbol[PROTOTYPE], TO_PRIMITIVE, $Symbol[PROTOTYPE].valueOf);
  setToStringTag($Symbol, "Symbol");
  setToStringTag(Math, "Math", true);
  setToStringTag(global$2.JSON, "JSON", true);
  _wksDefine("asyncIterator");
  _wksDefine("observable");
  var symbol$1 = _coreExports.Symbol;
  var symbol = { "default": symbol$1, __esModule: true };
  _typeof$2.__esModule = true;
  var _iterator = iterator;
  var _iterator2 = _interopRequireDefault$6(_iterator);
  var _symbol = symbol;
  var _symbol2 = _interopRequireDefault$6(_symbol);
  var _typeof$1 = typeof _symbol2.default === "function" && typeof _iterator2.default === "symbol" ? function(obj2) {
    return typeof obj2;
  } : function(obj2) {
    return obj2 && typeof _symbol2.default === "function" && obj2.constructor === _symbol2.default && obj2 !== _symbol2.default.prototype ? "symbol" : typeof obj2;
  };
  function _interopRequireDefault$6(obj2) {
    return obj2 && obj2.__esModule ? obj2 : { default: obj2 };
  }
  var _default$6 = _typeof$2.default = typeof _symbol2.default === "function" && _typeof$1(_iterator2.default) === "symbol" ? function(obj2) {
    return typeof obj2 === "undefined" ? "undefined" : _typeof$1(obj2);
  } : function(obj2) {
    return obj2 && typeof _symbol2.default === "function" && obj2.constructor === _symbol2.default && obj2 !== _symbol2.default.prototype ? "symbol" : typeof obj2 === "undefined" ? "undefined" : _typeof$1(obj2);
  };
  var _typeof2$2 = _typeof$2;
  var _typeof3$1 = _interopRequireDefault$5(_typeof2$2);
  function _interopRequireDefault$5(obj2) {
    return obj2 && obj2.__esModule ? obj2 : { default: obj2 };
  }
  var _default$5 = function(self2, call) {
    if (!self2) {
      throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
    }
    return call && ((typeof call === "undefined" ? "undefined" : (0, _typeof3$1.default)(call)) === "object" || typeof call === "function") ? call : self2;
  };
  var _setProto;
  var hasRequired_setProto;
  function require_setProto() {
    if (hasRequired_setProto)
      return _setProto;
    hasRequired_setProto = 1;
    var isObject2 = _isObject;
    var anObject2 = _anObject;
    var check = function(O, proto) {
      anObject2(O);
      if (!isObject2(proto) && proto !== null)
        throw TypeError(proto + ": can't set as prototype!");
    };
    _setProto = {
      set: Object.setPrototypeOf || ("__proto__" in {} ? (
        // eslint-disable-line
        function(test, buggy, set) {
          try {
            set = _ctx(Function.call, _objectGopd.f(Object.prototype, "__proto__").set, 2);
            set(test, []);
            buggy = !(test instanceof Array);
          } catch (e2) {
            buggy = true;
          }
          return function setPrototypeOf2(O, proto) {
            check(O, proto);
            if (buggy)
              O.__proto__ = proto;
            else
              set(O, proto);
            return O;
          };
        }({}, false)
      ) : void 0),
      check
    };
    return _setProto;
  }
  var $export$2 = _export;
  $export$2($export$2.S, "Object", { setPrototypeOf: require_setProto().set });
  var setPrototypeOf$1 = _coreExports.Object.setPrototypeOf;
  var setPrototypeOf = { "default": setPrototypeOf$1, __esModule: true };
  var $export$1 = _export;
  $export$1($export$1.S, "Object", { create: _objectCreate });
  var $Object$1 = _coreExports.Object;
  var create$3 = function create3(P, D) {
    return $Object$1.create(P, D);
  };
  var create$2 = { "default": create$3, __esModule: true };
  var _setPrototypeOf$1 = setPrototypeOf;
  var _setPrototypeOf2 = _interopRequireDefault$4(_setPrototypeOf$1);
  var _create = create$2;
  var _create2 = _interopRequireDefault$4(_create);
  var _typeof2$1 = _typeof$2;
  var _typeof3 = _interopRequireDefault$4(_typeof2$1);
  function _interopRequireDefault$4(obj2) {
    return obj2 && obj2.__esModule ? obj2 : { default: obj2 };
  }
  var _default$4 = function(subClass, superClass) {
    if (typeof superClass !== "function" && superClass !== null) {
      throw new TypeError("Super expression must either be null or a function, not " + (typeof superClass === "undefined" ? "undefined" : (0, _typeof3.default)(superClass)));
    }
    subClass.prototype = (0, _create2.default)(superClass && superClass.prototype, {
      constructor: {
        value: subClass,
        enumerable: false,
        writable: true,
        configurable: true
      }
    });
    if (superClass)
      _setPrototypeOf2.default ? (0, _setPrototypeOf2.default)(subClass, superClass) : subClass.__proto__ = superClass;
  };
  var propTypes = { exports: {} };
  var ReactPropTypesSecret$1 = "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";
  var ReactPropTypesSecret_1 = ReactPropTypesSecret$1;
  var ReactPropTypesSecret = ReactPropTypesSecret_1;
  function emptyFunction() {
  }
  function emptyFunctionWithReset() {
  }
  emptyFunctionWithReset.resetWarningCache = emptyFunction;
  var factoryWithThrowingShims = function() {
    function shim(props, propName, componentName, location, propFullName, secret) {
      if (secret === ReactPropTypesSecret) {
        return;
      }
      var err = new Error(
        "Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types"
      );
      err.name = "Invariant Violation";
      throw err;
    }
    shim.isRequired = shim;
    function getShim() {
      return shim;
    }
    var ReactPropTypes = {
      array: shim,
      bigint: shim,
      bool: shim,
      func: shim,
      number: shim,
      object: shim,
      string: shim,
      symbol: shim,
      any: shim,
      arrayOf: getShim,
      element: shim,
      elementType: shim,
      instanceOf: getShim,
      node: shim,
      objectOf: getShim,
      oneOf: getShim,
      oneOfType: getShim,
      shape: getShim,
      exact: getShim,
      checkPropTypes: emptyFunctionWithReset,
      resetWarningCache: emptyFunction
    };
    ReactPropTypes.PropTypes = ReactPropTypes;
    return ReactPropTypes;
  };
  {
    propTypes.exports = factoryWithThrowingShims();
  }
  var propTypesExports = propTypes.exports;
  const PropTypes$1 = /* @__PURE__ */ getDefaultExportFromCjs(propTypesExports);
  var classnames$1 = { exports: {} };
  /*!
  	Copyright (c) 2018 Jed Watson.
  	Licensed under the MIT License (MIT), see
  	http://jedwatson.github.io/classnames
  */
  (function(module) {
    (function() {
      var hasOwn = {}.hasOwnProperty;
      function classNames() {
        var classes = [];
        for (var i = 0; i < arguments.length; i++) {
          var arg = arguments[i];
          if (!arg)
            continue;
          var argType = typeof arg;
          if (argType === "string" || argType === "number") {
            classes.push(arg);
          } else if (Array.isArray(arg)) {
            if (arg.length) {
              var inner = classNames.apply(null, arg);
              if (inner) {
                classes.push(inner);
              }
            }
          } else if (argType === "object") {
            if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes("[native code]")) {
              classes.push(arg.toString());
              continue;
            }
            for (var key in arg) {
              if (hasOwn.call(arg, key) && arg[key]) {
                classes.push(key);
              }
            }
          }
        }
        return classes.join(" ");
      }
      if (module.exports) {
        classNames.default = classNames;
        module.exports = classNames;
      } else {
        window.classNames = classNames;
      }
    })();
  })(classnames$1);
  var classnamesExports = classnames$1.exports;
  const classnames = /* @__PURE__ */ getDefaultExportFromCjs(classnamesExports);
  function componentWillMount() {
    var state = this.constructor.getDerivedStateFromProps(this.props, this.state);
    if (state !== null && state !== void 0) {
      this.setState(state);
    }
  }
  function componentWillReceiveProps(nextProps) {
    function updater(prevState) {
      var state = this.constructor.getDerivedStateFromProps(nextProps, prevState);
      return state !== null && state !== void 0 ? state : null;
    }
    this.setState(updater.bind(this));
  }
  function componentWillUpdate(nextProps, nextState) {
    try {
      var prevProps = this.props;
      var prevState = this.state;
      this.props = nextProps;
      this.state = nextState;
      this.__reactInternalSnapshotFlag = true;
      this.__reactInternalSnapshot = this.getSnapshotBeforeUpdate(
        prevProps,
        prevState
      );
    } finally {
      this.props = prevProps;
      this.state = prevState;
    }
  }
  componentWillMount.__suppressDeprecationWarning = true;
  componentWillReceiveProps.__suppressDeprecationWarning = true;
  componentWillUpdate.__suppressDeprecationWarning = true;
  function polyfill(Component2) {
    var prototype = Component2.prototype;
    if (!prototype || !prototype.isReactComponent) {
      throw new Error("Can only polyfill class components");
    }
    if (typeof Component2.getDerivedStateFromProps !== "function" && typeof prototype.getSnapshotBeforeUpdate !== "function") {
      return Component2;
    }
    var foundWillMountName = null;
    var foundWillReceivePropsName = null;
    var foundWillUpdateName = null;
    if (typeof prototype.componentWillMount === "function") {
      foundWillMountName = "componentWillMount";
    } else if (typeof prototype.UNSAFE_componentWillMount === "function") {
      foundWillMountName = "UNSAFE_componentWillMount";
    }
    if (typeof prototype.componentWillReceiveProps === "function") {
      foundWillReceivePropsName = "componentWillReceiveProps";
    } else if (typeof prototype.UNSAFE_componentWillReceiveProps === "function") {
      foundWillReceivePropsName = "UNSAFE_componentWillReceiveProps";
    }
    if (typeof prototype.componentWillUpdate === "function") {
      foundWillUpdateName = "componentWillUpdate";
    } else if (typeof prototype.UNSAFE_componentWillUpdate === "function") {
      foundWillUpdateName = "UNSAFE_componentWillUpdate";
    }
    if (foundWillMountName !== null || foundWillReceivePropsName !== null || foundWillUpdateName !== null) {
      var componentName = Component2.displayName || Component2.name;
      var newApiName = typeof Component2.getDerivedStateFromProps === "function" ? "getDerivedStateFromProps()" : "getSnapshotBeforeUpdate()";
      throw Error(
        "Unsafe legacy lifecycles will not be called for components using new component APIs.\n\n" + componentName + " uses " + newApiName + " but also contains the following legacy lifecycles:" + (foundWillMountName !== null ? "\n  " + foundWillMountName : "") + (foundWillReceivePropsName !== null ? "\n  " + foundWillReceivePropsName : "") + (foundWillUpdateName !== null ? "\n  " + foundWillUpdateName : "") + "\n\nThe above lifecycles should be removed. Learn more about this warning here:\nhttps://fb.me/react-async-component-lifecycle-hooks"
      );
    }
    if (typeof Component2.getDerivedStateFromProps === "function") {
      prototype.componentWillMount = componentWillMount;
      prototype.componentWillReceiveProps = componentWillReceiveProps;
    }
    if (typeof prototype.getSnapshotBeforeUpdate === "function") {
      if (typeof prototype.componentDidUpdate !== "function") {
        throw new Error(
          "Cannot polyfill getSnapshotBeforeUpdate() for components that do not define componentDidUpdate() on the prototype"
        );
      }
      prototype.componentWillUpdate = componentWillUpdate;
      var componentDidUpdate = prototype.componentDidUpdate;
      prototype.componentDidUpdate = function componentDidUpdatePolyfill(prevProps, prevState, maybeSnapshot) {
        var snapshot = this.__reactInternalSnapshotFlag ? this.__reactInternalSnapshot : maybeSnapshot;
        componentDidUpdate.call(this, prevProps, prevState, snapshot);
      };
    }
    return Component2;
  }
  const reactLifecyclesCompat_es = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    polyfill
  }, Symbol.toStringTag, { value: "Module" }));
  var MapShim = function() {
    if (typeof Map !== "undefined") {
      return Map;
    }
    function getIndex(arr, key) {
      var result = -1;
      arr.some(function(entry, index2) {
        if (entry[0] === key) {
          result = index2;
          return true;
        }
        return false;
      });
      return result;
    }
    return (
      /** @class */
      function() {
        function class_1() {
          this.__entries__ = [];
        }
        Object.defineProperty(class_1.prototype, "size", {
          /**
           * @returns {boolean}
           */
          get: function() {
            return this.__entries__.length;
          },
          enumerable: true,
          configurable: true
        });
        class_1.prototype.get = function(key) {
          var index2 = getIndex(this.__entries__, key);
          var entry = this.__entries__[index2];
          return entry && entry[1];
        };
        class_1.prototype.set = function(key, value) {
          var index2 = getIndex(this.__entries__, key);
          if (~index2) {
            this.__entries__[index2][1] = value;
          } else {
            this.__entries__.push([key, value]);
          }
        };
        class_1.prototype.delete = function(key) {
          var entries = this.__entries__;
          var index2 = getIndex(entries, key);
          if (~index2) {
            entries.splice(index2, 1);
          }
        };
        class_1.prototype.has = function(key) {
          return !!~getIndex(this.__entries__, key);
        };
        class_1.prototype.clear = function() {
          this.__entries__.splice(0);
        };
        class_1.prototype.forEach = function(callback, ctx2) {
          if (ctx2 === void 0) {
            ctx2 = null;
          }
          for (var _i = 0, _a = this.__entries__; _i < _a.length; _i++) {
            var entry = _a[_i];
            callback.call(ctx2, entry[1], entry[0]);
          }
        };
        return class_1;
      }()
    );
  }();
  var isBrowser = typeof window !== "undefined" && typeof document !== "undefined" && window.document === document;
  var global$1 = function() {
    if (typeof global !== "undefined" && global.Math === Math) {
      return global;
    }
    if (typeof self !== "undefined" && self.Math === Math) {
      return self;
    }
    if (typeof window !== "undefined" && window.Math === Math) {
      return window;
    }
    return Function("return this")();
  }();
  var requestAnimationFrame$1 = function() {
    if (typeof requestAnimationFrame === "function") {
      return requestAnimationFrame.bind(global$1);
    }
    return function(callback) {
      return setTimeout(function() {
        return callback(Date.now());
      }, 1e3 / 60);
    };
  }();
  var trailingTimeout = 2;
  function throttle$1(callback, delay) {
    var leadingCall = false, trailingCall = false, lastCallTime = 0;
    function resolvePending() {
      if (leadingCall) {
        leadingCall = false;
        callback();
      }
      if (trailingCall) {
        proxy();
      }
    }
    function timeoutCallback() {
      requestAnimationFrame$1(resolvePending);
    }
    function proxy() {
      var timeStamp = Date.now();
      if (leadingCall) {
        if (timeStamp - lastCallTime < trailingTimeout) {
          return;
        }
        trailingCall = true;
      } else {
        leadingCall = true;
        trailingCall = false;
        setTimeout(timeoutCallback, delay);
      }
      lastCallTime = timeStamp;
    }
    return proxy;
  }
  var REFRESH_DELAY = 20;
  var transitionKeys = ["top", "right", "bottom", "left", "width", "height", "size", "weight"];
  var mutationObserverSupported = typeof MutationObserver !== "undefined";
  var ResizeObserverController = (
    /** @class */
    function() {
      function ResizeObserverController2() {
        this.connected_ = false;
        this.mutationEventsAdded_ = false;
        this.mutationsObserver_ = null;
        this.observers_ = [];
        this.onTransitionEnd_ = this.onTransitionEnd_.bind(this);
        this.refresh = throttle$1(this.refresh.bind(this), REFRESH_DELAY);
      }
      ResizeObserverController2.prototype.addObserver = function(observer) {
        if (!~this.observers_.indexOf(observer)) {
          this.observers_.push(observer);
        }
        if (!this.connected_) {
          this.connect_();
        }
      };
      ResizeObserverController2.prototype.removeObserver = function(observer) {
        var observers2 = this.observers_;
        var index2 = observers2.indexOf(observer);
        if (~index2) {
          observers2.splice(index2, 1);
        }
        if (!observers2.length && this.connected_) {
          this.disconnect_();
        }
      };
      ResizeObserverController2.prototype.refresh = function() {
        var changesDetected = this.updateObservers_();
        if (changesDetected) {
          this.refresh();
        }
      };
      ResizeObserverController2.prototype.updateObservers_ = function() {
        var activeObservers = this.observers_.filter(function(observer) {
          return observer.gatherActive(), observer.hasActive();
        });
        activeObservers.forEach(function(observer) {
          return observer.broadcastActive();
        });
        return activeObservers.length > 0;
      };
      ResizeObserverController2.prototype.connect_ = function() {
        if (!isBrowser || this.connected_) {
          return;
        }
        document.addEventListener("transitionend", this.onTransitionEnd_);
        window.addEventListener("resize", this.refresh);
        if (mutationObserverSupported) {
          this.mutationsObserver_ = new MutationObserver(this.refresh);
          this.mutationsObserver_.observe(document, {
            attributes: true,
            childList: true,
            characterData: true,
            subtree: true
          });
        } else {
          document.addEventListener("DOMSubtreeModified", this.refresh);
          this.mutationEventsAdded_ = true;
        }
        this.connected_ = true;
      };
      ResizeObserverController2.prototype.disconnect_ = function() {
        if (!isBrowser || !this.connected_) {
          return;
        }
        document.removeEventListener("transitionend", this.onTransitionEnd_);
        window.removeEventListener("resize", this.refresh);
        if (this.mutationsObserver_) {
          this.mutationsObserver_.disconnect();
        }
        if (this.mutationEventsAdded_) {
          document.removeEventListener("DOMSubtreeModified", this.refresh);
        }
        this.mutationsObserver_ = null;
        this.mutationEventsAdded_ = false;
        this.connected_ = false;
      };
      ResizeObserverController2.prototype.onTransitionEnd_ = function(_a) {
        var _b = _a.propertyName, propertyName = _b === void 0 ? "" : _b;
        var isReflowProperty = transitionKeys.some(function(key) {
          return !!~propertyName.indexOf(key);
        });
        if (isReflowProperty) {
          this.refresh();
        }
      };
      ResizeObserverController2.getInstance = function() {
        if (!this.instance_) {
          this.instance_ = new ResizeObserverController2();
        }
        return this.instance_;
      };
      ResizeObserverController2.instance_ = null;
      return ResizeObserverController2;
    }()
  );
  var defineConfigurable = function(target, props) {
    for (var _i = 0, _a = Object.keys(props); _i < _a.length; _i++) {
      var key = _a[_i];
      Object.defineProperty(target, key, {
        value: props[key],
        enumerable: false,
        writable: false,
        configurable: true
      });
    }
    return target;
  };
  var getWindowOf = function(target) {
    var ownerGlobal = target && target.ownerDocument && target.ownerDocument.defaultView;
    return ownerGlobal || global$1;
  };
  var emptyRect = createRectInit(0, 0, 0, 0);
  function toFloat(value) {
    return parseFloat(value) || 0;
  }
  function getBordersSize(styles) {
    var positions = [];
    for (var _i = 1; _i < arguments.length; _i++) {
      positions[_i - 1] = arguments[_i];
    }
    return positions.reduce(function(size2, position) {
      var value = styles["border-" + position + "-width"];
      return size2 + toFloat(value);
    }, 0);
  }
  function getPaddings(styles) {
    var positions = ["top", "right", "bottom", "left"];
    var paddings = {};
    for (var _i = 0, positions_1 = positions; _i < positions_1.length; _i++) {
      var position = positions_1[_i];
      var value = styles["padding-" + position];
      paddings[position] = toFloat(value);
    }
    return paddings;
  }
  function getSVGContentRect(target) {
    var bbox = target.getBBox();
    return createRectInit(0, 0, bbox.width, bbox.height);
  }
  function getHTMLElementContentRect(target) {
    var clientWidth = target.clientWidth, clientHeight = target.clientHeight;
    if (!clientWidth && !clientHeight) {
      return emptyRect;
    }
    var styles = getWindowOf(target).getComputedStyle(target);
    var paddings = getPaddings(styles);
    var horizPad = paddings.left + paddings.right;
    var vertPad = paddings.top + paddings.bottom;
    var width = toFloat(styles.width), height = toFloat(styles.height);
    if (styles.boxSizing === "border-box") {
      if (Math.round(width + horizPad) !== clientWidth) {
        width -= getBordersSize(styles, "left", "right") + horizPad;
      }
      if (Math.round(height + vertPad) !== clientHeight) {
        height -= getBordersSize(styles, "top", "bottom") + vertPad;
      }
    }
    if (!isDocumentElement(target)) {
      var vertScrollbar = Math.round(width + horizPad) - clientWidth;
      var horizScrollbar = Math.round(height + vertPad) - clientHeight;
      if (Math.abs(vertScrollbar) !== 1) {
        width -= vertScrollbar;
      }
      if (Math.abs(horizScrollbar) !== 1) {
        height -= horizScrollbar;
      }
    }
    return createRectInit(paddings.left, paddings.top, width, height);
  }
  var isSVGGraphicsElement = function() {
    if (typeof SVGGraphicsElement !== "undefined") {
      return function(target) {
        return target instanceof getWindowOf(target).SVGGraphicsElement;
      };
    }
    return function(target) {
      return target instanceof getWindowOf(target).SVGElement && typeof target.getBBox === "function";
    };
  }();
  function isDocumentElement(target) {
    return target === getWindowOf(target).document.documentElement;
  }
  function getContentRect(target) {
    if (!isBrowser) {
      return emptyRect;
    }
    if (isSVGGraphicsElement(target)) {
      return getSVGContentRect(target);
    }
    return getHTMLElementContentRect(target);
  }
  function createReadOnlyRect(_a) {
    var x2 = _a.x, y2 = _a.y, width = _a.width, height = _a.height;
    var Constr = typeof DOMRectReadOnly !== "undefined" ? DOMRectReadOnly : Object;
    var rect = Object.create(Constr.prototype);
    defineConfigurable(rect, {
      x: x2,
      y: y2,
      width,
      height,
      top: y2,
      right: x2 + width,
      bottom: height + y2,
      left: x2
    });
    return rect;
  }
  function createRectInit(x2, y2, width, height) {
    return { x: x2, y: y2, width, height };
  }
  var ResizeObservation = (
    /** @class */
    function() {
      function ResizeObservation2(target) {
        this.broadcastWidth = 0;
        this.broadcastHeight = 0;
        this.contentRect_ = createRectInit(0, 0, 0, 0);
        this.target = target;
      }
      ResizeObservation2.prototype.isActive = function() {
        var rect = getContentRect(this.target);
        this.contentRect_ = rect;
        return rect.width !== this.broadcastWidth || rect.height !== this.broadcastHeight;
      };
      ResizeObservation2.prototype.broadcastRect = function() {
        var rect = this.contentRect_;
        this.broadcastWidth = rect.width;
        this.broadcastHeight = rect.height;
        return rect;
      };
      return ResizeObservation2;
    }()
  );
  var ResizeObserverEntry = (
    /** @class */
    function() {
      function ResizeObserverEntry2(target, rectInit) {
        var contentRect = createReadOnlyRect(rectInit);
        defineConfigurable(this, { target, contentRect });
      }
      return ResizeObserverEntry2;
    }()
  );
  var ResizeObserverSPI = (
    /** @class */
    function() {
      function ResizeObserverSPI2(callback, controller, callbackCtx) {
        this.activeObservations_ = [];
        this.observations_ = new MapShim();
        if (typeof callback !== "function") {
          throw new TypeError("The callback provided as parameter 1 is not a function.");
        }
        this.callback_ = callback;
        this.controller_ = controller;
        this.callbackCtx_ = callbackCtx;
      }
      ResizeObserverSPI2.prototype.observe = function(target) {
        if (!arguments.length) {
          throw new TypeError("1 argument required, but only 0 present.");
        }
        if (typeof Element === "undefined" || !(Element instanceof Object)) {
          return;
        }
        if (!(target instanceof getWindowOf(target).Element)) {
          throw new TypeError('parameter 1 is not of type "Element".');
        }
        var observations = this.observations_;
        if (observations.has(target)) {
          return;
        }
        observations.set(target, new ResizeObservation(target));
        this.controller_.addObserver(this);
        this.controller_.refresh();
      };
      ResizeObserverSPI2.prototype.unobserve = function(target) {
        if (!arguments.length) {
          throw new TypeError("1 argument required, but only 0 present.");
        }
        if (typeof Element === "undefined" || !(Element instanceof Object)) {
          return;
        }
        if (!(target instanceof getWindowOf(target).Element)) {
          throw new TypeError('parameter 1 is not of type "Element".');
        }
        var observations = this.observations_;
        if (!observations.has(target)) {
          return;
        }
        observations.delete(target);
        if (!observations.size) {
          this.controller_.removeObserver(this);
        }
      };
      ResizeObserverSPI2.prototype.disconnect = function() {
        this.clearActive();
        this.observations_.clear();
        this.controller_.removeObserver(this);
      };
      ResizeObserverSPI2.prototype.gatherActive = function() {
        var _this2 = this;
        this.clearActive();
        this.observations_.forEach(function(observation) {
          if (observation.isActive()) {
            _this2.activeObservations_.push(observation);
          }
        });
      };
      ResizeObserverSPI2.prototype.broadcastActive = function() {
        if (!this.hasActive()) {
          return;
        }
        var ctx2 = this.callbackCtx_;
        var entries = this.activeObservations_.map(function(observation) {
          return new ResizeObserverEntry(observation.target, observation.broadcastRect());
        });
        this.callback_.call(ctx2, entries, ctx2);
        this.clearActive();
      };
      ResizeObserverSPI2.prototype.clearActive = function() {
        this.activeObservations_.splice(0);
      };
      ResizeObserverSPI2.prototype.hasActive = function() {
        return this.activeObservations_.length > 0;
      };
      return ResizeObserverSPI2;
    }()
  );
  var observers = typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : new MapShim();
  var ResizeObserver = (
    /** @class */
    function() {
      function ResizeObserver2(callback) {
        if (!(this instanceof ResizeObserver2)) {
          throw new TypeError("Cannot call a class as a function.");
        }
        if (!arguments.length) {
          throw new TypeError("1 argument required, but only 0 present.");
        }
        var controller = ResizeObserverController.getInstance();
        var observer = new ResizeObserverSPI(callback, controller, this);
        observers.set(this, observer);
      }
      return ResizeObserver2;
    }()
  );
  [
    "observe",
    "unobserve",
    "disconnect"
  ].forEach(function(method) {
    ResizeObserver.prototype[method] = function() {
      var _a;
      return (_a = observers.get(this))[method].apply(_a, arguments);
    };
  });
  var index$2 = function() {
    if (typeof global$1.ResizeObserver !== "undefined") {
      return global$1.ResizeObserver;
    }
    return ResizeObserver;
  }();
  var ieVersion$4 = typeof document !== "undefined" ? document.documentMode : void 0;
  var isProduction = function isProduction2() {
    var PRODUCTION_ENV = "production";
    var result = false;
    try {
      if ("production" === PRODUCTION_ENV) {
        result = true;
      }
    } catch (err) {
    }
    return result;
  };
  const env$1 = {
    ieVersion: ieVersion$4,
    isProduction
  };
  const _env = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    default: env$1,
    ieVersion: ieVersion$4,
    isProduction
  }, Symbol.toStringTag, { value: "Module" }));
  function deprecated(props, instead, component) {
    if (!isProduction() && typeof console !== "undefined" && console.error) {
      return console.error("Warning: [ " + props + " ] is deprecated at [ " + component + " ], use [ " + instead + " ] instead of it.");
    }
  }
  function warning(msg) {
    if (!isProduction() && typeof console !== "undefined" && console.error) {
      return console.error("Warning: " + msg);
    }
  }
  const _log = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    deprecated,
    warning
  }, Symbol.toStringTag, { value: "Module" }));
  function typeOf(obj2) {
    return Object.prototype.toString.call(obj2).replace(/\[object\s|]/g, "");
  }
  function isArrayLike(obj2) {
    var length2 = !!obj2 && "length" in obj2 && obj2.length;
    var type2 = typeOf(obj2);
    return type2 === "Array" || length2 === 0 || typeof length2 === "number" && length2 > 0 && length2 - 1 in obj2;
  }
  function isPromise(obj2) {
    return !!obj2 && ((typeof obj2 === "undefined" ? "undefined" : _default$6(obj2)) === "object" || typeof obj2 === "function") && typeof obj2.then === "function";
  }
  function isPlainObject$1(obj2) {
    if (typeOf(obj2) !== "Object") {
      return false;
    }
    var ctor = obj2.constructor;
    if (typeof ctor !== "function") {
      return false;
    }
    var prot = ctor.prototype;
    if (typeOf(prot) !== "Object") {
      return false;
    }
    if (!prot.hasOwnProperty("isPrototypeOf")) {
      return false;
    }
    return true;
  }
  function shallowEqual$1(objA, objB, compare) {
    if (objA === objB) {
      return true;
    }
    if (!objA || !objB || (typeof objA === "undefined" ? "undefined" : _default$6(objA)) + (typeof objB === "undefined" ? "undefined" : _default$6(objB)) !== "objectobject") {
      return false;
    }
    var keyA = Object.keys(objA);
    var keyB = Object.keys(objB);
    var len = keyA.length;
    if (len !== keyB.length) {
      return false;
    }
    var hasCallback = typeof compare === "function";
    for (var i = 0; i < len; i++) {
      var key = keyA[i];
      if (!Object.prototype.hasOwnProperty.call(objB, key)) {
        return false;
      }
      var valA = objA[key];
      var valB = objB[key];
      var ret = hasCallback ? compare(valA, valB, key) : void 0;
      if (ret === false || ret === void 0 && valA !== valB) {
        return false;
      }
    }
    return true;
  }
  function each(obj2, callback, direction) {
    var reversed = direction === -1;
    var length2 = obj2.length;
    var value = void 0, i = reversed ? length2 - 1 : 0;
    if (isArrayLike(obj2)) {
      for (; i < length2 && i >= 0; reversed ? i-- : i++) {
        value = callback.call(obj2[i], obj2[i], i);
        if (value === false) {
          break;
        }
      }
    } else {
      for (i in obj2) {
        if (obj2.hasOwnProperty(i)) {
          value = callback.call(obj2[i], obj2[i], i);
          if (value === false) {
            break;
          }
        }
      }
    }
    return obj2;
  }
  var _isInObj = function _isInObj2(key, obj2, isArray3) {
    return isArray3 ? obj2.indexOf(key) > -1 : key in obj2;
  };
  function pickOthers$9(holdProps, props) {
    var others = {};
    var isArray3 = typeOf(holdProps) === "Array";
    for (var key in props) {
      if (!_isInObj(key, holdProps, isArray3)) {
        others[key] = props[key];
      }
    }
    return others;
  }
  function pickProps(holdProps, props) {
    var others = {};
    var isArray3 = typeOf(holdProps) === "Array";
    for (var key in props) {
      if (_isInObj(key, holdProps, isArray3)) {
        others[key] = props[key];
      }
    }
    return others;
  }
  function pickAttrsWith(holdProps, prefix) {
    var others = {};
    for (var key in holdProps) {
      if (key.match(prefix)) {
        others[key] = holdProps[key];
      }
    }
    return others;
  }
  function isNil$2(value) {
    return value == null;
  }
  function deepMerge(target) {
    for (var _len = arguments.length, sources = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
      sources[_key - 1] = arguments[_key];
    }
    if (!sources.length)
      return target;
    var source = sources.shift();
    if (!isPlainObject$1(target)) {
      target = {};
    }
    if (isPlainObject$1(target) && isPlainObject$1(source)) {
      for (var key in source) {
        if (isPlainObject$1(source[key]) && !React.isValidElement(source[key])) {
          var _extends2;
          if (!target[key])
            _default$8(target, (_extends2 = {}, _extends2[key] = {}, _extends2));
          if (!isPlainObject$1(target[key])) {
            target[key] = source[key];
          }
          deepMerge(target[key], source[key]);
        } else {
          var _extends3;
          _default$8(target, (_extends3 = {}, _extends3[key] = source[key], _extends3));
        }
      }
    }
    return deepMerge.apply(void 0, [target].concat(sources));
  }
  function isFunctionComponent(component) {
    return typeOf(component) === "Function" && component.prototype && component.prototype.isReactComponent === void 0;
  }
  function isClassComponent(component) {
    return typeOf(component) === "Function" && component.prototype && component.prototype.isReactComponent !== void 0;
  }
  function isReactFragment$1(component) {
    if (isNil$2(component)) {
      return false;
    }
    if (component.type) {
      return component.type === React.Fragment;
    }
    return component === React.Fragment;
  }
  function values(obj2) {
    if (Object.values) {
      return Object.values(obj2);
    }
    var vals = [];
    for (var key in obj2) {
      if (obj2.hasOwnProperty(key)) {
        vals.push(obj2[key]);
      }
    }
    return vals;
  }
  const _object = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    deepMerge,
    each,
    isArrayLike,
    isClassComponent,
    isFunctionComponent,
    isNil: isNil$2,
    isPlainObject: isPlainObject$1,
    isPromise,
    isReactFragment: isReactFragment$1,
    pickAttrsWith,
    pickOthers: pickOthers$9,
    pickProps,
    shallowEqual: shallowEqual$1,
    typeOf,
    values
  }, Symbol.toStringTag, { value: "Module" }));
  function camelcase(str) {
    if (!/-/.test(str)) {
      return str || "";
    }
    return str.toLowerCase().replace(/-([a-z])/g, function($0, $1) {
      return $1.toUpperCase();
    });
  }
  function hyphenate(str) {
    var strType = typeOf(str);
    if (strType !== "String") {
      warning("[ hyphenate(str: string): string ] " + ("Expected arguments[0] to be a string but get a " + strType + ".") + "It will return an empty string without any processing.");
      return "";
    }
    return str.replace(/([A-Z])/g, function($0) {
      return "-" + $0.toLowerCase();
    });
  }
  var hasDOM = typeof window !== "undefined" && !!window.document && !!document.createElement;
  function hasClass$1(node, className) {
    if (!hasDOM || !node) {
      return false;
    }
    if (node.classList) {
      return node.classList.contains(className);
    } else {
      return node.className.indexOf(className) > -1;
    }
  }
  function addClass$2(node, className, _force) {
    if (!hasDOM || !node) {
      return;
    }
    if (node.classList) {
      node.classList.add(className);
    } else if (_force === true || !hasClass$1(node, className)) {
      node.className += " " + className;
    }
  }
  function removeClass$2(node, className, _force) {
    if (!hasDOM || !node) {
      return;
    }
    if (node.classList) {
      node.classList.remove(className);
    } else if (_force === true || hasClass$1(node, className)) {
      node.className = node.className.replace(className, "").replace(/\s+/g, " ").trim();
    }
  }
  function toggleClass(node, className) {
    if (!hasDOM || !node) {
      return false;
    }
    if (node.classList) {
      return node.classList.toggle(className);
    } else {
      var flag = hasClass$1(node, className);
      flag ? removeClass$2(node, className, true) : addClass$2(node, className, true);
      return !flag;
    }
  }
  var matches = function() {
    var matchesFn = null;
    if (hasDOM) {
      var _body = document.body || document.head;
      matchesFn = _body.matches ? "matches" : _body.webkitMatchesSelector ? "webkitMatchesSelector" : _body.msMatchesSelector ? "msMatchesSelector" : _body.mozMatchesSelector ? "mozMatchesSelector" : null;
    }
    return function(node, selector) {
      if (!hasDOM || !node) {
        return false;
      }
      return matchesFn ? node[matchesFn](selector) : false;
    };
  }();
  function _getComputedStyle(node) {
    return node && node.nodeType === 1 ? window.getComputedStyle(node, null) : {};
  }
  var PIXEL_PATTERN$1 = /margin|padding|width|height|max|min|offset|size|top/i;
  var removePixel = { left: 1, top: 1, right: 1, bottom: 1 };
  function _getStyleValue(node, type2, value) {
    type2 = type2.toLowerCase();
    if (value === "auto") {
      if (type2 === "height") {
        return node.offsetHeight || 0;
      }
      if (type2 === "width") {
        return node.offsetWidth || 0;
      }
    }
    if (!(type2 in removePixel)) {
      removePixel[type2] = PIXEL_PATTERN$1.test(type2);
    }
    return removePixel[type2] ? parseFloat(value) || 0 : value;
  }
  var floatMap = { cssFloat: 1, styleFloat: 1, float: 1 };
  function getNodeHozWhitespace(node) {
    var paddingLeft = getStyle$5(node, "paddingLeft");
    var paddingRight = getStyle$5(node, "paddingRight");
    var marginLeft = getStyle$5(node, "marginLeft");
    var marginRight = getStyle$5(node, "marginRight");
    return paddingLeft + paddingRight + marginLeft + marginRight;
  }
  function getStyle$5(node, name) {
    if (!hasDOM || !node) {
      return null;
    }
    var style = _getComputedStyle(node);
    if (arguments.length === 1) {
      return style;
    }
    if (isPlainObject$1(style)) {
      return null;
    }
    name = floatMap[name] ? "cssFloat" in node.style ? "cssFloat" : "styleFloat" : name;
    return _getStyleValue(node, name, style.getPropertyValue(hyphenate(name)) || node.style[camelcase(name)]);
  }
  function setStyle$2(node, name, value) {
    if (!hasDOM || !node) {
      return false;
    }
    if ((typeof name === "undefined" ? "undefined" : _default$6(name)) === "object" && arguments.length === 2) {
      each(name, function(val, key) {
        return setStyle$2(node, key, val);
      });
    } else {
      name = floatMap[name] ? "cssFloat" in node.style ? "cssFloat" : "styleFloat" : name;
      if (typeof value === "number" && PIXEL_PATTERN$1.test(name)) {
        value = value + "px";
      }
      node.style[camelcase(name)] = value;
    }
  }
  var isScrollDisplay$1 = function isScrollDisplay(element) {
    try {
      var scrollbarStyle = window.getComputedStyle(element, "::-webkit-scrollbar");
      return !scrollbarStyle || scrollbarStyle.getPropertyValue("display") !== "none";
    } catch (e2) {
    }
    return true;
  };
  function scrollbar() {
    var scrollDiv = document.createElement("div");
    scrollDiv.className += "just-to-get-scrollbar-size";
    setStyle$2(scrollDiv, {
      position: "absolute",
      width: "100px",
      height: "100px",
      overflow: "scroll",
      top: "-9999px"
    });
    document.body && document.body.appendChild(scrollDiv);
    var scrollbarWidth = scrollDiv.offsetWidth - scrollDiv.clientWidth;
    var scrollbarHeight = scrollDiv.offsetHeight - scrollDiv.clientHeight;
    document.body.removeChild(scrollDiv);
    return {
      width: scrollbarWidth,
      height: scrollbarHeight
    };
  }
  function hasScroll$1(containerNode) {
    var overflow = getStyle$5(containerNode, "overflow");
    if (overflow === "hidden") {
      return false;
    }
    var parentNode = containerNode.parentNode;
    return parentNode && parentNode.scrollHeight > parentNode.clientHeight && scrollbar().width > 0 && isScrollDisplay$1(parentNode) && isScrollDisplay$1(containerNode);
  }
  function getOffset(node) {
    var rect = node.getBoundingClientRect();
    var win = node.ownerDocument.defaultView;
    return {
      top: rect.top + win.pageYOffset,
      left: rect.left + win.pageXOffset
    };
  }
  function getPixels(len) {
    var win = document.defaultView;
    if (typeof +len === "number" && !isNaN(+len)) {
      return +len;
    }
    if (typeof len === "string") {
      var PX_REG = /(\d+)px/;
      var VH_REG = /(\d+)vh/;
      if (Array.isArray(len.match(PX_REG))) {
        return +len.match(PX_REG)[1] || 0;
      }
      if (Array.isArray(len.match(VH_REG))) {
        var _1vh = win.innerHeight / 100;
        return +(len.match(VH_REG)[1] * _1vh) || 0;
      }
    }
    return 0;
  }
  function getClosest(dom2, selector) {
    if (!hasDOM || !dom2) {
      return null;
    }
    if (!Element.prototype.closest) {
      if (!document.documentElement.contains(dom2))
        return null;
      do {
        if (getMatches(dom2, selector))
          return dom2;
        dom2 = dom2.parentElement;
      } while (dom2 !== null);
    } else {
      return dom2.closest(selector);
    }
    return null;
  }
  function getMatches(dom2, selector) {
    if (!hasDOM || !dom2) {
      return null;
    }
    if (Element.prototype.matches) {
      return dom2.matches(selector);
    } else if (Element.prototype.msMatchesSelector) {
      return dom2.msMatchesSelector(selector);
    } else if (Element.prototype.webkitMatchesSelector) {
      return dom2.webkitMatchesSelector(selector);
    }
    return null;
  }
  function saveRef$1(ref) {
    if (!ref) {
      return null;
    }
    return function(element) {
      if (typeof ref === "string") {
        throw new Error("can not set ref string for " + ref);
      } else if (typeof ref === "function") {
        ref(element);
      } else if (Object.prototype.hasOwnProperty.call(ref, "current")) {
        ref.current = element;
      }
    };
  }
  const _dom = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    addClass: addClass$2,
    getClosest,
    getMatches,
    getNodeHozWhitespace,
    getOffset,
    getPixels,
    getStyle: getStyle$5,
    hasClass: hasClass$1,
    hasDOM,
    hasScroll: hasScroll$1,
    matches,
    removeClass: removeClass$2,
    saveRef: saveRef$1,
    scrollbar,
    setStyle: setStyle$2,
    toggleClass
  }, Symbol.toStringTag, { value: "Module" }));
  function _off(node, eventName, callback, useCapture) {
    if (node.removeEventListener) {
      node.removeEventListener(eventName, callback, useCapture || false);
    }
  }
  function on$1(node, eventName, callback, useCapture) {
    if (node.addEventListener) {
      node.addEventListener(eventName, callback, useCapture || false);
    }
    return {
      off: function off2() {
        return _off(node, eventName, callback, useCapture);
      }
    };
  }
  function once(node, eventName, callback, useCapture) {
    return on$1(node, eventName, function __fn() {
      for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
        args[_key] = arguments[_key];
      }
      callback.apply(this, args);
      _off(node, eventName, __fn, useCapture);
    }, useCapture);
  }
  const _events = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    off: _off,
    on: on$1,
    once
  }, Symbol.toStringTag, { value: "Module" }));
  var dayjs_min = { exports: {} };
  (function(module, exports) {
    !function(t2, e2) {
      module.exports = e2();
    }(commonjsGlobal, function() {
      var t2 = 1e3, e2 = 6e4, n2 = 36e5, r2 = "millisecond", i = "second", s = "minute", u = "hour", a = "day", o = "week", c2 = "month", f2 = "quarter", h2 = "year", d2 = "date", l2 = "Invalid Date", $2 = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, y2 = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, M = { name: "en", weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), ordinal: function(t3) {
        var e3 = ["th", "st", "nd", "rd"], n3 = t3 % 100;
        return "[" + t3 + (e3[(n3 - 20) % 10] || e3[n3] || e3[0]) + "]";
      } }, m2 = function(t3, e3, n3) {
        var r3 = String(t3);
        return !r3 || r3.length >= e3 ? t3 : "" + Array(e3 + 1 - r3.length).join(n3) + t3;
      }, v2 = { s: m2, z: function(t3) {
        var e3 = -t3.utcOffset(), n3 = Math.abs(e3), r3 = Math.floor(n3 / 60), i2 = n3 % 60;
        return (e3 <= 0 ? "+" : "-") + m2(r3, 2, "0") + ":" + m2(i2, 2, "0");
      }, m: function t3(e3, n3) {
        if (e3.date() < n3.date())
          return -t3(n3, e3);
        var r3 = 12 * (n3.year() - e3.year()) + (n3.month() - e3.month()), i2 = e3.clone().add(r3, c2), s2 = n3 - i2 < 0, u2 = e3.clone().add(r3 + (s2 ? -1 : 1), c2);
        return +(-(r3 + (n3 - i2) / (s2 ? i2 - u2 : u2 - i2)) || 0);
      }, a: function(t3) {
        return t3 < 0 ? Math.ceil(t3) || 0 : Math.floor(t3);
      }, p: function(t3) {
        return { M: c2, y: h2, w: o, d: a, D: d2, h: u, m: s, s: i, ms: r2, Q: f2 }[t3] || String(t3 || "").toLowerCase().replace(/s$/, "");
      }, u: function(t3) {
        return void 0 === t3;
      } }, g2 = "en", D = {};
      D[g2] = M;
      var p2 = "$isDayjsObject", S = function(t3) {
        return t3 instanceof _ || !(!t3 || !t3[p2]);
      }, w2 = function t3(e3, n3, r3) {
        var i2;
        if (!e3)
          return g2;
        if ("string" == typeof e3) {
          var s2 = e3.toLowerCase();
          D[s2] && (i2 = s2), n3 && (D[s2] = n3, i2 = s2);
          var u2 = e3.split("-");
          if (!i2 && u2.length > 1)
            return t3(u2[0]);
        } else {
          var a2 = e3.name;
          D[a2] = e3, i2 = a2;
        }
        return !r3 && i2 && (g2 = i2), i2 || !r3 && g2;
      }, O = function(t3, e3) {
        if (S(t3))
          return t3.clone();
        var n3 = "object" == typeof e3 ? e3 : {};
        return n3.date = t3, n3.args = arguments, new _(n3);
      }, b2 = v2;
      b2.l = w2, b2.i = S, b2.w = function(t3, e3) {
        return O(t3, { locale: e3.$L, utc: e3.$u, x: e3.$x, $offset: e3.$offset });
      };
      var _ = function() {
        function M2(t3) {
          this.$L = w2(t3.locale, null, true), this.parse(t3), this.$x = this.$x || t3.x || {}, this[p2] = true;
        }
        var m3 = M2.prototype;
        return m3.parse = function(t3) {
          this.$d = function(t4) {
            var e3 = t4.date, n3 = t4.utc;
            if (null === e3)
              return /* @__PURE__ */ new Date(NaN);
            if (b2.u(e3))
              return /* @__PURE__ */ new Date();
            if (e3 instanceof Date)
              return new Date(e3);
            if ("string" == typeof e3 && !/Z$/i.test(e3)) {
              var r3 = e3.match($2);
              if (r3) {
                var i2 = r3[2] - 1 || 0, s2 = (r3[7] || "0").substring(0, 3);
                return n3 ? new Date(Date.UTC(r3[1], i2, r3[3] || 1, r3[4] || 0, r3[5] || 0, r3[6] || 0, s2)) : new Date(r3[1], i2, r3[3] || 1, r3[4] || 0, r3[5] || 0, r3[6] || 0, s2);
              }
            }
            return new Date(e3);
          }(t3), this.init();
        }, m3.init = function() {
          var t3 = this.$d;
          this.$y = t3.getFullYear(), this.$M = t3.getMonth(), this.$D = t3.getDate(), this.$W = t3.getDay(), this.$H = t3.getHours(), this.$m = t3.getMinutes(), this.$s = t3.getSeconds(), this.$ms = t3.getMilliseconds();
        }, m3.$utils = function() {
          return b2;
        }, m3.isValid = function() {
          return !(this.$d.toString() === l2);
        }, m3.isSame = function(t3, e3) {
          var n3 = O(t3);
          return this.startOf(e3) <= n3 && n3 <= this.endOf(e3);
        }, m3.isAfter = function(t3, e3) {
          return O(t3) < this.startOf(e3);
        }, m3.isBefore = function(t3, e3) {
          return this.endOf(e3) < O(t3);
        }, m3.$g = function(t3, e3, n3) {
          return b2.u(t3) ? this[e3] : this.set(n3, t3);
        }, m3.unix = function() {
          return Math.floor(this.valueOf() / 1e3);
        }, m3.valueOf = function() {
          return this.$d.getTime();
        }, m3.startOf = function(t3, e3) {
          var n3 = this, r3 = !!b2.u(e3) || e3, f3 = b2.p(t3), l3 = function(t4, e4) {
            var i2 = b2.w(n3.$u ? Date.UTC(n3.$y, e4, t4) : new Date(n3.$y, e4, t4), n3);
            return r3 ? i2 : i2.endOf(a);
          }, $3 = function(t4, e4) {
            return b2.w(n3.toDate()[t4].apply(n3.toDate("s"), (r3 ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(e4)), n3);
          }, y3 = this.$W, M3 = this.$M, m4 = this.$D, v3 = "set" + (this.$u ? "UTC" : "");
          switch (f3) {
            case h2:
              return r3 ? l3(1, 0) : l3(31, 11);
            case c2:
              return r3 ? l3(1, M3) : l3(0, M3 + 1);
            case o:
              var g3 = this.$locale().weekStart || 0, D2 = (y3 < g3 ? y3 + 7 : y3) - g3;
              return l3(r3 ? m4 - D2 : m4 + (6 - D2), M3);
            case a:
            case d2:
              return $3(v3 + "Hours", 0);
            case u:
              return $3(v3 + "Minutes", 1);
            case s:
              return $3(v3 + "Seconds", 2);
            case i:
              return $3(v3 + "Milliseconds", 3);
            default:
              return this.clone();
          }
        }, m3.endOf = function(t3) {
          return this.startOf(t3, false);
        }, m3.$set = function(t3, e3) {
          var n3, o2 = b2.p(t3), f3 = "set" + (this.$u ? "UTC" : ""), l3 = (n3 = {}, n3[a] = f3 + "Date", n3[d2] = f3 + "Date", n3[c2] = f3 + "Month", n3[h2] = f3 + "FullYear", n3[u] = f3 + "Hours", n3[s] = f3 + "Minutes", n3[i] = f3 + "Seconds", n3[r2] = f3 + "Milliseconds", n3)[o2], $3 = o2 === a ? this.$D + (e3 - this.$W) : e3;
          if (o2 === c2 || o2 === h2) {
            var y3 = this.clone().set(d2, 1);
            y3.$d[l3]($3), y3.init(), this.$d = y3.set(d2, Math.min(this.$D, y3.daysInMonth())).$d;
          } else
            l3 && this.$d[l3]($3);
          return this.init(), this;
        }, m3.set = function(t3, e3) {
          return this.clone().$set(t3, e3);
        }, m3.get = function(t3) {
          return this[b2.p(t3)]();
        }, m3.add = function(r3, f3) {
          var d3, l3 = this;
          r3 = Number(r3);
          var $3 = b2.p(f3), y3 = function(t3) {
            var e3 = O(l3);
            return b2.w(e3.date(e3.date() + Math.round(t3 * r3)), l3);
          };
          if ($3 === c2)
            return this.set(c2, this.$M + r3);
          if ($3 === h2)
            return this.set(h2, this.$y + r3);
          if ($3 === a)
            return y3(1);
          if ($3 === o)
            return y3(7);
          var M3 = (d3 = {}, d3[s] = e2, d3[u] = n2, d3[i] = t2, d3)[$3] || 1, m4 = this.$d.getTime() + r3 * M3;
          return b2.w(m4, this);
        }, m3.subtract = function(t3, e3) {
          return this.add(-1 * t3, e3);
        }, m3.format = function(t3) {
          var e3 = this, n3 = this.$locale();
          if (!this.isValid())
            return n3.invalidDate || l2;
          var r3 = t3 || "YYYY-MM-DDTHH:mm:ssZ", i2 = b2.z(this), s2 = this.$H, u2 = this.$m, a2 = this.$M, o2 = n3.weekdays, c3 = n3.months, f3 = n3.meridiem, h3 = function(t4, n4, i3, s3) {
            return t4 && (t4[n4] || t4(e3, r3)) || i3[n4].slice(0, s3);
          }, d3 = function(t4) {
            return b2.s(s2 % 12 || 12, t4, "0");
          }, $3 = f3 || function(t4, e4, n4) {
            var r4 = t4 < 12 ? "AM" : "PM";
            return n4 ? r4.toLowerCase() : r4;
          };
          return r3.replace(y2, function(t4, r4) {
            return r4 || function(t5) {
              switch (t5) {
                case "YY":
                  return String(e3.$y).slice(-2);
                case "YYYY":
                  return b2.s(e3.$y, 4, "0");
                case "M":
                  return a2 + 1;
                case "MM":
                  return b2.s(a2 + 1, 2, "0");
                case "MMM":
                  return h3(n3.monthsShort, a2, c3, 3);
                case "MMMM":
                  return h3(c3, a2);
                case "D":
                  return e3.$D;
                case "DD":
                  return b2.s(e3.$D, 2, "0");
                case "d":
                  return String(e3.$W);
                case "dd":
                  return h3(n3.weekdaysMin, e3.$W, o2, 2);
                case "ddd":
                  return h3(n3.weekdaysShort, e3.$W, o2, 3);
                case "dddd":
                  return o2[e3.$W];
                case "H":
                  return String(s2);
                case "HH":
                  return b2.s(s2, 2, "0");
                case "h":
                  return d3(1);
                case "hh":
                  return d3(2);
                case "a":
                  return $3(s2, u2, true);
                case "A":
                  return $3(s2, u2, false);
                case "m":
                  return String(u2);
                case "mm":
                  return b2.s(u2, 2, "0");
                case "s":
                  return String(e3.$s);
                case "ss":
                  return b2.s(e3.$s, 2, "0");
                case "SSS":
                  return b2.s(e3.$ms, 3, "0");
                case "Z":
                  return i2;
              }
              return null;
            }(t4) || i2.replace(":", "");
          });
        }, m3.utcOffset = function() {
          return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
        }, m3.diff = function(r3, d3, l3) {
          var $3, y3 = this, M3 = b2.p(d3), m4 = O(r3), v3 = (m4.utcOffset() - this.utcOffset()) * e2, g3 = this - m4, D2 = function() {
            return b2.m(y3, m4);
          };
          switch (M3) {
            case h2:
              $3 = D2() / 12;
              break;
            case c2:
              $3 = D2();
              break;
            case f2:
              $3 = D2() / 3;
              break;
            case o:
              $3 = (g3 - v3) / 6048e5;
              break;
            case a:
              $3 = (g3 - v3) / 864e5;
              break;
            case u:
              $3 = g3 / n2;
              break;
            case s:
              $3 = g3 / e2;
              break;
            case i:
              $3 = g3 / t2;
              break;
            default:
              $3 = g3;
          }
          return l3 ? $3 : b2.a($3);
        }, m3.daysInMonth = function() {
          return this.endOf(c2).$D;
        }, m3.$locale = function() {
          return D[this.$L];
        }, m3.locale = function(t3, e3) {
          if (!t3)
            return this.$L;
          var n3 = this.clone(), r3 = w2(t3, e3, true);
          return r3 && (n3.$L = r3), n3;
        }, m3.clone = function() {
          return b2.w(this.$d, this);
        }, m3.toDate = function() {
          return new Date(this.valueOf());
        }, m3.toJSON = function() {
          return this.isValid() ? this.toISOString() : null;
        }, m3.toISOString = function() {
          return this.$d.toISOString();
        }, m3.toString = function() {
          return this.$d.toUTCString();
        }, M2;
      }(), k2 = _.prototype;
      return O.prototype = k2, [["$ms", r2], ["$s", i], ["$m", s], ["$H", u], ["$W", a], ["$M", c2], ["$y", h2], ["$D", d2]].forEach(function(t3) {
        k2[t3[1]] = function(e3) {
          return this.$g(e3, t3[0], t3[1]);
        };
      }), O.extend = function(t3, e3) {
        return t3.$i || (t3(e3, _, O), t3.$i = true), O;
      }, O.locale = w2, O.isDayjs = S, O.unix = function(t3) {
        return O(1e3 * t3);
      }, O.en = D[g2], O.Ls = D, O.p = {}, O;
    });
  })(dayjs_min);
  var dayjs_minExports = dayjs_min.exports;
  const dayjs = /* @__PURE__ */ getDefaultExportFromCjs(dayjs_minExports);
  var customParseFormat$1 = { exports: {} };
  (function(module, exports) {
    !function(e2, t2) {
      module.exports = t2();
    }(commonjsGlobal, function() {
      var e2 = { LTS: "h:mm:ss A", LT: "h:mm A", L: "MM/DD/YYYY", LL: "MMMM D, YYYY", LLL: "MMMM D, YYYY h:mm A", LLLL: "dddd, MMMM D, YYYY h:mm A" }, t2 = /(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|YYYY|YY?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g, n2 = /\d\d/, r2 = /\d\d?/, i = /\d*[^-_:/,()\s\d]+/, o = {}, s = function(e3) {
        return (e3 = +e3) + (e3 > 68 ? 1900 : 2e3);
      };
      var a = function(e3) {
        return function(t3) {
          this[e3] = +t3;
        };
      }, f2 = [/[+-]\d\d:?(\d\d)?|Z/, function(e3) {
        (this.zone || (this.zone = {})).offset = function(e4) {
          if (!e4)
            return 0;
          if ("Z" === e4)
            return 0;
          var t3 = e4.match(/([+-]|\d\d)/g), n3 = 60 * t3[1] + (+t3[2] || 0);
          return 0 === n3 ? 0 : "+" === t3[0] ? -n3 : n3;
        }(e3);
      }], h2 = function(e3) {
        var t3 = o[e3];
        return t3 && (t3.indexOf ? t3 : t3.s.concat(t3.f));
      }, u = function(e3, t3) {
        var n3, r3 = o.meridiem;
        if (r3) {
          for (var i2 = 1; i2 <= 24; i2 += 1)
            if (e3.indexOf(r3(i2, 0, t3)) > -1) {
              n3 = i2 > 12;
              break;
            }
        } else
          n3 = e3 === (t3 ? "pm" : "PM");
        return n3;
      }, d2 = { A: [i, function(e3) {
        this.afternoon = u(e3, false);
      }], a: [i, function(e3) {
        this.afternoon = u(e3, true);
      }], S: [/\d/, function(e3) {
        this.milliseconds = 100 * +e3;
      }], SS: [n2, function(e3) {
        this.milliseconds = 10 * +e3;
      }], SSS: [/\d{3}/, function(e3) {
        this.milliseconds = +e3;
      }], s: [r2, a("seconds")], ss: [r2, a("seconds")], m: [r2, a("minutes")], mm: [r2, a("minutes")], H: [r2, a("hours")], h: [r2, a("hours")], HH: [r2, a("hours")], hh: [r2, a("hours")], D: [r2, a("day")], DD: [n2, a("day")], Do: [i, function(e3) {
        var t3 = o.ordinal, n3 = e3.match(/\d+/);
        if (this.day = n3[0], t3)
          for (var r3 = 1; r3 <= 31; r3 += 1)
            t3(r3).replace(/\[|\]/g, "") === e3 && (this.day = r3);
      }], M: [r2, a("month")], MM: [n2, a("month")], MMM: [i, function(e3) {
        var t3 = h2("months"), n3 = (h2("monthsShort") || t3.map(function(e4) {
          return e4.slice(0, 3);
        })).indexOf(e3) + 1;
        if (n3 < 1)
          throw new Error();
        this.month = n3 % 12 || n3;
      }], MMMM: [i, function(e3) {
        var t3 = h2("months").indexOf(e3) + 1;
        if (t3 < 1)
          throw new Error();
        this.month = t3 % 12 || t3;
      }], Y: [/[+-]?\d+/, a("year")], YY: [n2, function(e3) {
        this.year = s(e3);
      }], YYYY: [/\d{4}/, a("year")], Z: f2, ZZ: f2 };
      function c2(n3) {
        var r3, i2;
        r3 = n3, i2 = o && o.formats;
        for (var s2 = (n3 = r3.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g, function(t3, n4, r4) {
          var o2 = r4 && r4.toUpperCase();
          return n4 || i2[r4] || e2[r4] || i2[o2].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g, function(e3, t4, n5) {
            return t4 || n5.slice(1);
          });
        })).match(t2), a2 = s2.length, f3 = 0; f3 < a2; f3 += 1) {
          var h3 = s2[f3], u2 = d2[h3], c3 = u2 && u2[0], l2 = u2 && u2[1];
          s2[f3] = l2 ? { regex: c3, parser: l2 } : h3.replace(/^\[|\]$/g, "");
        }
        return function(e3) {
          for (var t3 = {}, n4 = 0, r4 = 0; n4 < a2; n4 += 1) {
            var i3 = s2[n4];
            if ("string" == typeof i3)
              r4 += i3.length;
            else {
              var o2 = i3.regex, f4 = i3.parser, h4 = e3.slice(r4), u3 = o2.exec(h4)[0];
              f4.call(t3, u3), e3 = e3.replace(u3, "");
            }
          }
          return function(e4) {
            var t4 = e4.afternoon;
            if (void 0 !== t4) {
              var n5 = e4.hours;
              t4 ? n5 < 12 && (e4.hours += 12) : 12 === n5 && (e4.hours = 0), delete e4.afternoon;
            }
          }(t3), t3;
        };
      }
      return function(e3, t3, n3) {
        n3.p.customParseFormat = true, e3 && e3.parseTwoDigitYear && (s = e3.parseTwoDigitYear);
        var r3 = t3.prototype, i2 = r3.parse;
        r3.parse = function(e4) {
          var t4 = e4.date, r4 = e4.utc, s2 = e4.args;
          this.$u = r4;
          var a2 = s2[1];
          if ("string" == typeof a2) {
            var f3 = true === s2[2], h3 = true === s2[3], u2 = f3 || h3, d3 = s2[2];
            h3 && (d3 = s2[2]), o = this.$locale(), !f3 && d3 && (o = n3.Ls[d3]), this.$d = function(e5, t5, n4) {
              try {
                if (["x", "X"].indexOf(t5) > -1)
                  return new Date(("X" === t5 ? 1e3 : 1) * e5);
                var r5 = c2(t5)(e5), i3 = r5.year, o2 = r5.month, s3 = r5.day, a3 = r5.hours, f4 = r5.minutes, h4 = r5.seconds, u3 = r5.milliseconds, d4 = r5.zone, l3 = /* @__PURE__ */ new Date(), m3 = s3 || (i3 || o2 ? 1 : l3.getDate()), M2 = i3 || l3.getFullYear(), Y = 0;
                i3 && !o2 || (Y = o2 > 0 ? o2 - 1 : l3.getMonth());
                var p2 = a3 || 0, v2 = f4 || 0, D = h4 || 0, g2 = u3 || 0;
                return d4 ? new Date(Date.UTC(M2, Y, m3, p2, v2, D, g2 + 60 * d4.offset * 1e3)) : n4 ? new Date(Date.UTC(M2, Y, m3, p2, v2, D, g2)) : new Date(M2, Y, m3, p2, v2, D, g2);
              } catch (e6) {
                return /* @__PURE__ */ new Date("");
              }
            }(t4, a2, r4), this.init(), d3 && true !== d3 && (this.$L = this.locale(d3).$L), u2 && t4 != this.format(a2) && (this.$d = /* @__PURE__ */ new Date("")), o = {};
          } else if (a2 instanceof Array)
            for (var l2 = a2.length, m2 = 1; m2 <= l2; m2 += 1) {
              s2[1] = a2[m2 - 1];
              var M = n3.apply(this, s2);
              if (M.isValid()) {
                this.$d = M.$d, this.$L = M.$L, this.init();
                break;
              }
              m2 === l2 && (this.$d = /* @__PURE__ */ new Date(""));
            }
          else
            i2.call(this, e4);
        };
      };
    });
  })(customParseFormat$1);
  var customParseFormatExports = customParseFormat$1.exports;
  const customParseFormat = /* @__PURE__ */ getDefaultExportFromCjs(customParseFormatExports);
  var updateLocale$1 = { exports: {} };
  (function(module, exports) {
    !function(e2, n2) {
      module.exports = n2();
    }(commonjsGlobal, function() {
      return function(e2, n2, t2) {
        t2.updateLocale = function(e3, n3) {
          var o = t2.Ls[e3];
          if (o)
            return (n3 ? Object.keys(n3) : []).forEach(function(e4) {
              o[e4] = n3[e4];
            }), o;
        };
      };
    });
  })(updateLocale$1);
  var updateLocaleExports = updateLocale$1.exports;
  const updateLocale = /* @__PURE__ */ getDefaultExportFromCjs(updateLocaleExports);
  var localeData$1 = { exports: {} };
  (function(module, exports) {
    !function(n2, e2) {
      module.exports = e2();
    }(commonjsGlobal, function() {
      return function(n2, e2, t2) {
        var r2 = e2.prototype, o = function(n3) {
          return n3 && (n3.indexOf ? n3 : n3.s);
        }, u = function(n3, e3, t3, r3, u2) {
          var i2 = n3.name ? n3 : n3.$locale(), a2 = o(i2[e3]), s2 = o(i2[t3]), f2 = a2 || s2.map(function(n4) {
            return n4.slice(0, r3);
          });
          if (!u2)
            return f2;
          var d2 = i2.weekStart;
          return f2.map(function(n4, e4) {
            return f2[(e4 + (d2 || 0)) % 7];
          });
        }, i = function() {
          return t2.Ls[t2.locale()];
        }, a = function(n3, e3) {
          return n3.formats[e3] || function(n4) {
            return n4.replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g, function(n5, e4, t3) {
              return e4 || t3.slice(1);
            });
          }(n3.formats[e3.toUpperCase()]);
        }, s = function() {
          var n3 = this;
          return { months: function(e3) {
            return e3 ? e3.format("MMMM") : u(n3, "months");
          }, monthsShort: function(e3) {
            return e3 ? e3.format("MMM") : u(n3, "monthsShort", "months", 3);
          }, firstDayOfWeek: function() {
            return n3.$locale().weekStart || 0;
          }, weekdays: function(e3) {
            return e3 ? e3.format("dddd") : u(n3, "weekdays");
          }, weekdaysMin: function(e3) {
            return e3 ? e3.format("dd") : u(n3, "weekdaysMin", "weekdays", 2);
          }, weekdaysShort: function(e3) {
            return e3 ? e3.format("ddd") : u(n3, "weekdaysShort", "weekdays", 3);
          }, longDateFormat: function(e3) {
            return a(n3.$locale(), e3);
          }, meridiem: this.$locale().meridiem, ordinal: this.$locale().ordinal };
        };
        r2.localeData = function() {
          return s.bind(this)();
        }, t2.localeData = function() {
          var n3 = i();
          return { firstDayOfWeek: function() {
            return n3.weekStart || 0;
          }, weekdays: function() {
            return t2.weekdays();
          }, weekdaysShort: function() {
            return t2.weekdaysShort();
          }, weekdaysMin: function() {
            return t2.weekdaysMin();
          }, months: function() {
            return t2.months();
          }, monthsShort: function() {
            return t2.monthsShort();
          }, longDateFormat: function(e3) {
            return a(n3, e3);
          }, meridiem: n3.meridiem, ordinal: n3.ordinal };
        }, t2.months = function() {
          return u(i(), "months");
        }, t2.monthsShort = function() {
          return u(i(), "monthsShort", "months", 3);
        }, t2.weekdays = function(n3) {
          return u(i(), "weekdays", null, null, n3);
        }, t2.weekdaysShort = function(n3) {
          return u(i(), "weekdaysShort", "weekdays", 3, n3);
        }, t2.weekdaysMin = function(n3) {
          return u(i(), "weekdaysMin", "weekdays", 2, n3);
        };
      };
    });
  })(localeData$1);
  var localeDataExports = localeData$1.exports;
  const localeData = /* @__PURE__ */ getDefaultExportFromCjs(localeDataExports);
  var quarterOfYear$1 = { exports: {} };
  (function(module, exports) {
    !function(t2, n2) {
      module.exports = n2();
    }(commonjsGlobal, function() {
      var t2 = "month", n2 = "quarter";
      return function(e2, i) {
        var r2 = i.prototype;
        r2.quarter = function(t3) {
          return this.$utils().u(t3) ? Math.ceil((this.month() + 1) / 3) : this.month(this.month() % 3 + 3 * (t3 - 1));
        };
        var s = r2.add;
        r2.add = function(e3, i2) {
          return e3 = Number(e3), this.$utils().p(i2) === n2 ? this.add(3 * e3, t2) : s.bind(this)(e3, i2);
        };
        var u = r2.startOf;
        r2.startOf = function(e3, i2) {
          var r3 = this.$utils(), s2 = !!r3.u(i2) || i2;
          if (r3.p(e3) === n2) {
            var o = this.quarter() - 1;
            return s2 ? this.month(3 * o).startOf(t2).startOf("day") : this.month(3 * o + 2).endOf(t2).endOf("day");
          }
          return u.bind(this)(e3, i2);
        };
      };
    });
  })(quarterOfYear$1);
  var quarterOfYearExports = quarterOfYear$1.exports;
  const quarterOfYear = /* @__PURE__ */ getDefaultExportFromCjs(quarterOfYearExports);
  var advancedFormat$1 = { exports: {} };
  (function(module, exports) {
    !function(e2, t2) {
      module.exports = t2();
    }(commonjsGlobal, function() {
      return function(e2, t2) {
        var r2 = t2.prototype, n2 = r2.format;
        r2.format = function(e3) {
          var t3 = this, r3 = this.$locale();
          if (!this.isValid())
            return n2.bind(this)(e3);
          var s = this.$utils(), a = (e3 || "YYYY-MM-DDTHH:mm:ssZ").replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g, function(e4) {
            switch (e4) {
              case "Q":
                return Math.ceil((t3.$M + 1) / 3);
              case "Do":
                return r3.ordinal(t3.$D);
              case "gggg":
                return t3.weekYear();
              case "GGGG":
                return t3.isoWeekYear();
              case "wo":
                return r3.ordinal(t3.week(), "W");
              case "w":
              case "ww":
                return s.s(t3.week(), "w" === e4 ? 1 : 2, "0");
              case "W":
              case "WW":
                return s.s(t3.isoWeek(), "W" === e4 ? 1 : 2, "0");
              case "k":
              case "kk":
                return s.s(String(0 === t3.$H ? 24 : t3.$H), "k" === e4 ? 1 : 2, "0");
              case "X":
                return Math.floor(t3.$d.getTime() / 1e3);
              case "x":
                return t3.$d.getTime();
              case "z":
                return "[" + t3.offsetName() + "]";
              case "zzz":
                return "[" + t3.offsetName("long") + "]";
              default:
                return e4;
            }
          });
          return n2.bind(this)(a);
        };
      };
    });
  })(advancedFormat$1);
  var advancedFormatExports = advancedFormat$1.exports;
  const advancedFormat = /* @__PURE__ */ getDefaultExportFromCjs(advancedFormatExports);
  var weekOfYear$1 = { exports: {} };
  (function(module, exports) {
    !function(e2, t2) {
      module.exports = t2();
    }(commonjsGlobal, function() {
      var e2 = "week", t2 = "year";
      return function(i, n2, r2) {
        var f2 = n2.prototype;
        f2.week = function(i2) {
          if (void 0 === i2 && (i2 = null), null !== i2)
            return this.add(7 * (i2 - this.week()), "day");
          var n3 = this.$locale().yearStart || 1;
          if (11 === this.month() && this.date() > 25) {
            var f3 = r2(this).startOf(t2).add(1, t2).date(n3), s = r2(this).endOf(e2);
            if (f3.isBefore(s))
              return 1;
          }
          var a = r2(this).startOf(t2).date(n3).startOf(e2).subtract(1, "millisecond"), o = this.diff(a, e2, true);
          return o < 0 ? r2(this).startOf("week").week() : Math.ceil(o);
        }, f2.weeks = function(e3) {
          return void 0 === e3 && (e3 = null), this.week(e3);
        };
      };
    });
  })(weekOfYear$1);
  var weekOfYearExports = weekOfYear$1.exports;
  const weekOfYear = /* @__PURE__ */ getDefaultExportFromCjs(weekOfYearExports);
  var zhCn = { exports: {} };
  (function(module, exports) {
    !function(e2, _) {
      module.exports = _(dayjs_minExports);
    }(commonjsGlobal, function(e2) {
      function _(e3) {
        return e3 && "object" == typeof e3 && "default" in e3 ? e3 : { default: e3 };
      }
      var t2 = _(e2), d2 = { name: "zh-cn", weekdays: "星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"), weekdaysShort: "周日_周一_周二_周三_周四_周五_周六".split("_"), weekdaysMin: "日_一_二_三_四_五_六".split("_"), months: "一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"), monthsShort: "1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"), ordinal: function(e3, _2) {
        return "W" === _2 ? e3 + "周" : e3 + "日";
      }, weekStart: 1, yearStart: 4, formats: { LT: "HH:mm", LTS: "HH:mm:ss", L: "YYYY/MM/DD", LL: "YYYY年M月D日", LLL: "YYYY年M月D日Ah点mm分", LLLL: "YYYY年M月D日ddddAh点mm分", l: "YYYY/M/D", ll: "YYYY年M月D日", lll: "YYYY年M月D日 HH:mm", llll: "YYYY年M月D日dddd HH:mm" }, relativeTime: { future: "%s内", past: "%s前", s: "几秒", m: "1 分钟", mm: "%d 分钟", h: "1 小时", hh: "%d 小时", d: "1 天", dd: "%d 天", M: "1 个月", MM: "%d 个月", y: "1 年", yy: "%d 年" }, meridiem: function(e3, _2) {
        var t3 = 100 * e3 + _2;
        return t3 < 600 ? "凌晨" : t3 < 900 ? "早上" : t3 < 1100 ? "上午" : t3 < 1300 ? "中午" : t3 < 1800 ? "下午" : "晚上";
      } };
      return t2.default.locale(d2, null, true), d2;
    });
  })(zhCn);
  dayjs.extend(advancedFormat);
  dayjs.extend(quarterOfYear);
  dayjs.extend(customParseFormat);
  dayjs.extend(updateLocale);
  dayjs.extend(localeData);
  dayjs.extend(weekOfYear);
  dayjs.locale("zh-cn");
  var datejs = dayjs;
  datejs.isSelf = dayjs.isDayjs;
  dayjs.localeData();
  const datejs$1 = datejs;
  var noop$m = function noop() {
  };
  var prevent = function prevent2() {
    return false;
  };
  function makeChain$9() {
    for (var _len = arguments.length, fns = Array(_len), _key = 0; _key < _len; _key++) {
      fns[_key] = arguments[_key];
    }
    if (fns.length === 1) {
      return fns[0];
    }
    return function chainedFunction() {
      for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
        args[_key2] = arguments[_key2];
      }
      for (var i = 0, j = fns.length; i < j; i++) {
        if (fns[i] && fns[i].apply) {
          fns[i].apply(this, args);
        }
      }
    };
  }
  function bindCtx$b(ctx2, fns, ns) {
    if (typeof fns === "string") {
      fns = [fns];
    }
    ns = ns || ctx2;
    fns.forEach(function(fnName) {
      ns[fnName] = ns[fnName].bind(ctx2);
    });
  }
  function promiseCall(ret, success) {
    var failure = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : noop$m;
    if (isPromise(ret)) {
      return ret.then(function(result) {
        success(result);
        return result;
      }).catch(function(e2) {
        failure(e2);
      });
    }
    return ret !== false ? success(ret) : failure(ret);
  }
  function invoke(target, method, args) {
    var func2 = target && method in target ? target[method] : void 0;
    return func2 && func2.apply(void 0, args);
  }
  function renderNode(render2, defaultRender) {
    var renderProps = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : [];
    var r2 = render2 !== void 0 ? render2 : defaultRender;
    if (renderProps && !Array.isArray(renderProps)) {
      renderProps = [renderProps];
    }
    return typeof r2 === "function" ? r2.apply(void 0, renderProps) : r2;
  }
  function checkDate(value, format2) {
    if (value === void 0) {
      value = null;
    }
    value = format2 ? datejs$1(value, format2) : datejs$1(value);
    return value.isValid() ? value : null;
  }
  function checkRangeDate(value, inputType, disabled) {
    var strictly = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : true;
    var format2 = arguments[4];
    var _ref = Array.isArray(value) ? [0, 1].map(function(i) {
      return checkDate(value[i], format2);
    }) : [null, null], begin = _ref[0], end = _ref[1];
    var _ref2 = Array.isArray(disabled) ? disabled : [disabled, disabled], disabledBegin = _ref2[0], disabledEnd = _ref2[1];
    if (strictly && begin && end && begin.isAfter(end)) {
      if (!disabledBegin && disabledEnd || // 本来是 (!disabledBegin && !disabledBegin && inputType === DATE_INPUT_TYPE.END)
      !disabledBegin && !disabledBegin && inputType === 1) {
        return [null, end];
      }
      return [begin, null];
    }
    return [begin, end];
  }
  const _func = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    bindCtx: bindCtx$b,
    checkDate,
    checkRangeDate,
    invoke,
    makeChain: makeChain$9,
    noop: noop$m,
    prevent,
    promiseCall,
    renderNode
  }, Symbol.toStringTag, { value: "Module" }));
  var animationEndEventNames = {
    WebkitAnimation: "webkitAnimationEnd",
    OAnimation: "oAnimationEnd",
    animation: "animationend"
  };
  var transitionEventNames = {
    WebkitTransition: "webkitTransitionEnd",
    OTransition: "oTransitionEnd",
    transition: "transitionend"
  };
  function _supportEnd(names) {
    if (!hasDOM) {
      return false;
    }
    var el = document.createElement("div");
    var ret = false;
    each(names, function(val, key) {
      if (el.style[key] !== void 0) {
        ret = { end: val };
        return false;
      }
    });
    return ret;
  }
  function _supportCSS(names) {
    if (!hasDOM) {
      return false;
    }
    var el = document.createElement("div");
    var ret = false;
    each(names, function(val, key) {
      each(val, function(item) {
        try {
          el.style[key] = item;
          ret = ret || el.style[key] === item;
        } catch (e2) {
        }
        return !ret;
      });
      return !ret;
    });
    return ret;
  }
  var animation = _supportEnd(animationEndEventNames);
  var transition = _supportEnd(transitionEventNames);
  var flex = _supportCSS({
    display: ["flex", "-webkit-flex", "-moz-flex", "-ms-flexbox"]
  });
  const _support = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    animation,
    flex,
    transition
  }, Symbol.toStringTag, { value: "Module" }));
  const _KEYCODE = {
    BACKSPACE: 8,
    TAB: 9,
    ENTER: 13,
    SHIFT: 16,
    CTRL: 17,
    ALT: 18,
    ESC: 27,
    SPACE: 32,
    END: 35,
    HOME: 36,
    LEFT: 37,
    UP: 38,
    RIGHT: 39,
    DOWN: 40,
    PAGE_UP: 33,
    PAGE_DOWN: 34,
    // version 0.x
    ESCAPE: 27,
    LEFT_ARROW: 37,
    UP_ARROW: 38,
    RIGHT_ARROW: 39,
    DOWN_ARROW: 40,
    // MacOS
    CONTROL: 17,
    OPTION: 18,
    CMD: 91,
    COMMAND: 91,
    DELETE: 8
  };
  function _isVisible$1(node) {
    while (node) {
      var _node = node, nodeName = _node.nodeName;
      if (nodeName === "BODY" || nodeName === "HTML") {
        break;
      }
      if (node.style.display === "none" || node.style.visibility === "hidden") {
        return false;
      }
      node = node.parentNode;
    }
    return true;
  }
  function _isFocusable$1(node) {
    var nodeName = node.nodeName.toLowerCase();
    var tabIndex = parseInt(node.getAttribute("tabindex"), 10);
    var hasTabIndex = !isNaN(tabIndex) && tabIndex > -1;
    if (_isVisible$1(node)) {
      if (nodeName === "input") {
        return !node.disabled && node.type !== "hidden";
      } else if (["select", "textarea", "button"].indexOf(nodeName) > -1) {
        return !node.disabled;
      } else if (nodeName === "a") {
        return node.getAttribute("href") || hasTabIndex;
      } else {
        return hasTabIndex;
      }
    }
    return false;
  }
  function getFocusNodeList$2(node) {
    var res = [];
    var nodeList = node.querySelectorAll("*");
    each(nodeList, function(item) {
      if (_isFocusable$1(item)) {
        var method = item.getAttribute("data-auto-focus") ? "unshift" : "push";
        res[method](item);
      }
    });
    if (_isFocusable$1(node)) {
      res.unshift(node);
    }
    return res;
  }
  var lastFocusElement = null;
  function saveLastFocusNode$1() {
    lastFocusElement = document.activeElement;
  }
  function clearLastFocusNode() {
    lastFocusElement = null;
  }
  function backLastFocusNode$1() {
    if (lastFocusElement) {
      try {
        lastFocusElement.focus();
      } catch (e2) {
      }
    }
  }
  function limitTabRange(node, e2) {
    if (e2.keyCode === _KEYCODE.TAB) {
      var tabNodeList = getFocusNodeList$2(node);
      var maxIndex = tabNodeList.length - 1;
      var index2 = tabNodeList.indexOf(document.activeElement);
      if (index2 > -1) {
        var targetIndex = index2 + (e2.shiftKey ? -1 : 1);
        targetIndex < 0 && (targetIndex = maxIndex);
        targetIndex > maxIndex && (targetIndex = 0);
        tabNodeList[targetIndex].focus();
        e2.preventDefault();
      }
    }
  }
  function focusRef$1(ref) {
    if (ref && ref.focus && typeof ref.focus === "function") {
      for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
        args[_key - 1] = arguments[_key];
      }
      ref.focus.apply(ref, args);
    }
  }
  const _focus = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    backLastFocusNode: backLastFocusNode$1,
    clearLastFocusNode,
    focusRef: focusRef$1,
    getFocusNodeList: getFocusNodeList$2,
    limitTabRange,
    saveLastFocusNode: saveLastFocusNode$1
  }, Symbol.toStringTag, { value: "Module" }));
  function randomId(prefix) {
    var max2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 1e6;
    var rand = Math.ceil(Math.random() * max2);
    return prefix ? escapeForId(prefix) + "-" + rand : rand.toString(10);
  }
  function escapeForId(text) {
    if (!text) {
      return "";
    }
    if ((typeof text === "undefined" ? "undefined" : _default$6(text)) === "object") {
      text = JSON.stringify(text);
    } else if (typeof text !== "string") {
      text = String(text);
    }
    return text.replace(/['"]/gm, "").replace(/[\s'"]/gm, "-");
  }
  const _htmlId = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    escapeForId,
    randomId
  }, Symbol.toStringTag, { value: "Module" }));
  var timestamp = Date.now();
  function uuid(prefix) {
    prefix = prefix || "";
    return prefix + (timestamp++).toString(36);
  }
  var attributes = "accept acceptCharset accessKey action allowFullScreen allowTransparency\nalt async autoComplete autoFocus autoPlay capture cellPadding cellSpacing challenge\ncharSet checked classID className colSpan cols content contentEditable contextMenu\ncontrols coords crossOrigin data dateTime default defer dir disabled download draggable\nencType form formAction formEncType formMethod formNoValidate formTarget frameBorder\nheaders height hidden high href hrefLang htmlFor httpEquiv icon id inputMode integrity\nis keyParams keyType kind label lang list loop low manifest marginHeight marginWidth max maxLength media\nmediaGroup method min minLength multiple muted name noValidate nonce open\noptimum pattern placeholder poster preload radioGroup readOnly rel required\nreversed role rowSpan rows sandbox scope scoped scrolling seamless selected\nshape size sizes span spellCheck src srcDoc srcLang srcSet start step style\nsummary tabIndex target title type useMap value width wmode wrap".replace(/\s+/g, " ").replace(/\t|\n|\r/g, "").split(" ");
  var eventsName = "onCopy onCut onPaste onCompositionEnd onCompositionStart onCompositionUpdate onKeyDown\n    onKeyPress onKeyUp onFocus onBlur onChange onInput onSubmit onClick onContextMenu onDoubleClick\n    onDrag onDragEnd onDragEnter onDragExit onDragLeave onDragOver onDragStart onDrop onMouseDown\n    onMouseEnter onMouseLeave onMouseMove onMouseOut onMouseOver onMouseUp onSelect onTouchCancel\n    onTouchEnd onTouchMove onTouchStart onScroll onWheel onAbort onCanPlay onCanPlayThrough\n    onDurationChange onEmptied onEncrypted onEnded onError onLoadedData onLoadedMetadata\n    onLoadStart onPause onPlay onPlaying onProgress onRateChange onSeeked onSeeking onStalled onSuspend onTimeUpdate onVolumeChange onWaiting onLoad onError".replace(/\s+/g, " ").replace(/\t|\n|\r/g, "").split(" ");
  var attrsPrefix = ["data-", "aria-"];
  const _pickAttrs = function(props) {
    var attrs = {};
    var _loop = function _loop2(key2) {
      if (attributes.indexOf(key2) > -1 || eventsName.indexOf(key2) > -1) {
        attrs[key2] = props[key2];
      } else if (attrsPrefix.map(function(prefix) {
        return new RegExp("^" + prefix);
      }).some(function(reg) {
        return key2.replace(reg, "") !== key2;
      })) {
        attrs[key2] = props[key2];
      }
    };
    for (var key in props) {
      _loop(key);
    }
    return attrs;
  };
  var dom = _dom;
  var env = _env;
  var events = _events;
  var func = _func;
  var log = _log;
  var obj = _object;
  var support = _support;
  var focus = _focus;
  var guid = uuid;
  var KEYCODE = _KEYCODE;
  var htmlId = _htmlId;
  var pickAttrs = _pickAttrs;
  const defaultLocale = {
    momentLocale: "zh-cn",
    Timeline: {
      expand: "展开",
      fold: "收起"
    },
    Balloon: {
      close: "关闭"
    },
    Card: {
      expand: "展开",
      fold: "收起"
    },
    Calendar: {
      today: "今天",
      now: "此刻",
      ok: "确定",
      clear: "清除",
      month: "月",
      year: "年",
      prevYear: "上一年",
      nextYear: "下一年",
      prevMonth: "上个月",
      nextMonth: "下个月",
      prevDecade: "上十年",
      nextDecade: "后十年",
      yearSelectAriaLabel: "选择年份",
      monthSelectAriaLabel: "选择月份"
    },
    DatePicker: {
      placeholder: "请选择日期",
      datetimePlaceholder: "请选择日期和时间",
      monthPlaceholder: "请选择月",
      yearPlaceholder: "请选择年",
      weekPlaceholder: "请选择周",
      now: "此刻",
      selectTime: "选择时间",
      selectDate: "选择日期",
      ok: "确定",
      clear: "清除",
      startPlaceholder: "起始日期",
      endPlaceholder: "结束日期",
      hour: "时",
      minute: "分",
      second: "秒"
    },
    Dialog: {
      close: "关闭",
      ok: "确定",
      cancel: "取消"
    },
    Drawer: {
      close: "关闭"
    },
    Message: {
      closeAriaLabel: "关闭"
    },
    Pagination: {
      prev: "上一页",
      next: "下一页",
      goTo: "到第",
      page: "页",
      go: "确定",
      total: "第{current}页,共{total}页",
      labelPrev: "上一页,当前第{current}页",
      labelNext: "下一页,当前第{current}页",
      inputAriaLabel: "请输入跳转到第几页",
      selectAriaLabel: "请选择每页显示几条",
      pageSize: "每页显示:"
    },
    Input: {
      clear: "清除"
    },
    List: {
      empty: "没有数据"
    },
    Select: {
      selectPlaceholder: "请选择",
      autoCompletePlaceholder: "请输入",
      notFoundContent: "无选项",
      maxTagPlaceholder: "已选择 {selected}/{total} 项",
      selectAll: "全选"
    },
    TreeSelect: {
      maxTagPlaceholder: "已选择 {selected}/{total} 项",
      shortMaxTagPlaceholder: "已选择 {selected} 项"
    },
    Table: {
      empty: "没有数据",
      ok: "确认",
      reset: "重置",
      asc: "升序",
      desc: "降序",
      expanded: "已展开",
      folded: "已折叠",
      filter: "筛选",
      selectAll: "全选"
    },
    TimePicker: {
      placeholder: "请选择时间",
      clear: "清除",
      hour: "时",
      minute: "分",
      second: "秒",
      ok: "确定"
    },
    Transfer: {
      items: "项",
      item: "项",
      moveAll: "移动全部",
      searchPlaceholder: "请输入",
      moveToLeft: "撤销选中元素",
      moveToRight: "提交选中元素"
    },
    Upload: {
      card: {
        cancel: "取消",
        addPhoto: "上传图片",
        download: "下载",
        delete: "删除"
      },
      drag: {
        text: "点击或者拖动文件到虚线框内上传",
        hint: "支持 docx, xls, PDF, rar, zip, PNG, JPG 等类型的文件"
      },
      upload: {
        delete: "删除"
      }
    },
    Search: {
      buttonText: "搜索"
    },
    Tag: {
      delete: "删除"
    },
    Rating: {
      description: "评分选项"
    },
    Switch: {
      on: "已打开",
      off: "已关闭"
    },
    Tab: {
      closeAriaLabel: "关闭"
    },
    Form: {
      Validate: {
        default: "%s 校验失败",
        required: "%s 是必填字段",
        format: {
          number: "%s 不是合法的数字",
          email: "%s 不是合法的 email 地址",
          url: "%s 不是合法的 URL 地址",
          tel: "%s 不是合法的电话号码"
        },
        number: {
          length: "%s 长度必须是 %s",
          min: "%s 不得小于 %s",
          max: "%s 不得大于 %s",
          minLength: "%s 字段字符长度不得少于 %s",
          maxLength: "%s 字段字符长度不得超过 %s"
        },
        string: {
          length: "%s 长度必须是 %s",
          min: "%s 不得小于 %s",
          max: "%s 不得大于 %s",
          minLength: "%s 长度不得少于 %s",
          maxLength: "%s 长度不得超过 %s"
        },
        array: {
          length: "%s 个数必须是 %s",
          minLength: "%s 个数不得少于 %s",
          maxLength: "%s 个数不得超过 %s"
        },
        pattern: "%s 数值 %s 不匹配正则 %s"
      }
    }
  };
  var parseBoundary = function parseBoundary2(input) {
    var obj2 = void 0;
    if (input === void 0 || input === null) {
      return {};
    } else if (typeof input === "boolean") {
      obj2 = { open: input };
    } else {
      obj2 = _default$8({ open: true }, input);
    }
    return obj2;
  };
  function getContextProps$1(props, context, displayName) {
    var prefix = props.prefix, locale = props.locale;
    props.defaultPropsConfig;
    var pure = props.pure, rtl = props.rtl, device = props.device, popupContainer = props.popupContainer, errorBoundary = props.errorBoundary;
    var nextPrefix = context.nextPrefix, nextLocale = context.nextLocale, nextDefaultPropsConfig = context.nextDefaultPropsConfig, nextPure = context.nextPure, nextWarning = context.nextWarning, nextRtl = context.nextRtl, nextDevice = context.nextDevice, nextPopupContainer = context.nextPopupContainer, nextErrorBoundary = context.nextErrorBoundary;
    var newPrefix = prefix || nextPrefix;
    var localeFromContext = void 0;
    var newDisplayName = displayName;
    switch (displayName) {
      case "DatePicker2":
        newDisplayName = "DatePicker";
        break;
      case "Calendar2":
        newDisplayName = "Calendar";
        break;
      case "TimePicker2":
        newDisplayName = "TimePicker";
        break;
    }
    if (nextLocale) {
      localeFromContext = nextLocale[newDisplayName];
      if (localeFromContext) {
        localeFromContext.momentLocale = nextLocale.momentLocale;
      }
    }
    var newLocale = void 0;
    if (locale) {
      newLocale = obj.deepMerge({}, defaultLocale[newDisplayName], localeFromContext, locale);
    } else if (localeFromContext) {
      newLocale = obj.deepMerge({}, defaultLocale[newDisplayName], localeFromContext);
    }
    var newPure = typeof pure === "boolean" ? pure : nextPure;
    var newRtl = typeof rtl === "boolean" ? rtl : nextRtl;
    var newErrorBoundary = _default$8({}, parseBoundary(nextErrorBoundary), parseBoundary(errorBoundary));
    if (!("open" in newErrorBoundary)) {
      newErrorBoundary.open = false;
    }
    return {
      prefix: newPrefix,
      locale: newLocale,
      pure: newPure,
      rtl: newRtl,
      warning: nextWarning,
      defaultPropsConfig: nextDefaultPropsConfig || {},
      device: device || nextDevice || void 0,
      popupContainer: popupContainer || nextPopupContainer,
      errorBoundary: newErrorBoundary
    };
  }
  var _default$3 = function(obj2, keys3) {
    var target = {};
    for (var i in obj2) {
      if (keys3.indexOf(i) >= 0)
        continue;
      if (!Object.prototype.hasOwnProperty.call(obj2, i))
        continue;
      target[i] = obj2[i];
    }
    return target;
  };
  var reactIs$1 = { exports: {} };
  var reactIs_production_min = {};
  /** @license React v16.13.1
   * react-is.production.min.js
   *
   * Copyright (c) Facebook, Inc. and its affiliates.
   *
   * This source code is licensed under the MIT license found in the
   * LICENSE file in the root directory of this source tree.
   */
  var b = "function" === typeof Symbol && Symbol.for, c = b ? Symbol.for("react.element") : 60103, d = b ? Symbol.for("react.portal") : 60106, e = b ? Symbol.for("react.fragment") : 60107, f = b ? Symbol.for("react.strict_mode") : 60108, g = b ? Symbol.for("react.profiler") : 60114, h = b ? Symbol.for("react.provider") : 60109, k = b ? Symbol.for("react.context") : 60110, l = b ? Symbol.for("react.async_mode") : 60111, m = b ? Symbol.for("react.concurrent_mode") : 60111, n = b ? Symbol.for("react.forward_ref") : 60112, p = b ? Symbol.for("react.suspense") : 60113, q = b ? Symbol.for("react.suspense_list") : 60120, r = b ? Symbol.for("react.memo") : 60115, t = b ? Symbol.for("react.lazy") : 60116, v = b ? Symbol.for("react.block") : 60121, w = b ? Symbol.for("react.fundamental") : 60117, x = b ? Symbol.for("react.responder") : 60118, y = b ? Symbol.for("react.scope") : 60119;
  function z(a) {
    if ("object" === typeof a && null !== a) {
      var u = a.$$typeof;
      switch (u) {
        case c:
          switch (a = a.type, a) {
            case l:
            case m:
            case e:
            case g:
            case f:
            case p:
              return a;
            default:
              switch (a = a && a.$$typeof, a) {
                case k:
                case n:
                case t:
                case r:
                case h:
                  return a;
                default:
                  return u;
              }
          }
        case d:
          return u;
      }
    }
  }
  function A(a) {
    return z(a) === m;
  }
  reactIs_production_min.AsyncMode = l;
  reactIs_production_min.ConcurrentMode = m;
  reactIs_production_min.ContextConsumer = k;
  reactIs_production_min.ContextProvider = h;
  reactIs_production_min.Element = c;
  reactIs_production_min.ForwardRef = n;
  reactIs_production_min.Fragment = e;
  reactIs_production_min.Lazy = t;
  reactIs_production_min.Memo = r;
  reactIs_production_min.Portal = d;
  reactIs_production_min.Profiler = g;
  reactIs_production_min.StrictMode = f;
  reactIs_production_min.Suspense = p;
  reactIs_production_min.isAsyncMode = function(a) {
    return A(a) || z(a) === l;
  };
  reactIs_production_min.isConcurrentMode = A;
  reactIs_production_min.isContextConsumer = function(a) {
    return z(a) === k;
  };
  reactIs_production_min.isContextProvider = function(a) {
    return z(a) === h;
  };
  reactIs_production_min.isElement = function(a) {
    return "object" === typeof a && null !== a && a.$$typeof === c;
  };
  reactIs_production_min.isForwardRef = function(a) {
    return z(a) === n;
  };
  reactIs_production_min.isFragment = function(a) {
    return z(a) === e;
  };
  reactIs_production_min.isLazy = function(a) {
    return z(a) === t;
  };
  reactIs_production_min.isMemo = function(a) {
    return z(a) === r;
  };
  reactIs_production_min.isPortal = function(a) {
    return z(a) === d;
  };
  reactIs_production_min.isProfiler = function(a) {
    return z(a) === g;
  };
  reactIs_production_min.isStrictMode = function(a) {
    return z(a) === f;
  };
  reactIs_production_min.isSuspense = function(a) {
    return z(a) === p;
  };
  reactIs_production_min.isValidElementType = function(a) {
    return "string" === typeof a || "function" === typeof a || a === e || a === m || a === g || a === f || a === p || a === q || "object" === typeof a && null !== a && (a.$$typeof === t || a.$$typeof === r || a.$$typeof === h || a.$$typeof === k || a.$$typeof === n || a.$$typeof === w || a.$$typeof === x || a.$$typeof === y || a.$$typeof === v);
  };
  reactIs_production_min.typeOf = z;
  {
    reactIs$1.exports = reactIs_production_min;
  }
  var reactIsExports = reactIs$1.exports;
  var reactIs = reactIsExports;
  var REACT_STATICS = {
    childContextTypes: true,
    contextType: true,
    contextTypes: true,
    defaultProps: true,
    displayName: true,
    getDefaultProps: true,
    getDerivedStateFromError: true,
    getDerivedStateFromProps: true,
    mixins: true,
    propTypes: true,
    type: true
  };
  var KNOWN_STATICS = {
    name: true,
    length: true,
    prototype: true,
    caller: true,
    callee: true,
    arguments: true,
    arity: true
  };
  var FORWARD_REF_STATICS = {
    "$$typeof": true,
    render: true,
    defaultProps: true,
    displayName: true,
    propTypes: true
  };
  var MEMO_STATICS = {
    "$$typeof": true,
    compare: true,
    defaultProps: true,
    displayName: true,
    propTypes: true,
    type: true
  };
  var TYPE_STATICS = {};
  TYPE_STATICS[reactIs.ForwardRef] = FORWARD_REF_STATICS;
  TYPE_STATICS[reactIs.Memo] = MEMO_STATICS;
  function getStatics(component) {
    if (reactIs.isMemo(component)) {
      return MEMO_STATICS;
    }
    return TYPE_STATICS[component["$$typeof"]] || REACT_STATICS;
  }
  var defineProperty$3 = Object.defineProperty;
  var getOwnPropertyNames4 = Object.getOwnPropertyNames;
  var getOwnPropertySymbols3 = Object.getOwnPropertySymbols;
  var getOwnPropertyDescriptor3 = Object.getOwnPropertyDescriptor;
  var getPrototypeOf = Object.getPrototypeOf;
  var objectPrototype = Object.prototype;
  function hoistNonReactStatics(targetComponent, sourceComponent, blacklist) {
    if (typeof sourceComponent !== "string") {
      if (objectPrototype) {
        var inheritedComponent = getPrototypeOf(sourceComponent);
        if (inheritedComponent && inheritedComponent !== objectPrototype) {
          hoistNonReactStatics(targetComponent, inheritedComponent, blacklist);
        }
      }
      var keys3 = getOwnPropertyNames4(sourceComponent);
      if (getOwnPropertySymbols3) {
        keys3 = keys3.concat(getOwnPropertySymbols3(sourceComponent));
      }
      var targetStatics = getStatics(targetComponent);
      var sourceStatics = getStatics(sourceComponent);
      for (var i = 0; i < keys3.length; ++i) {
        var key = keys3[i];
        if (!KNOWN_STATICS[key] && !(blacklist && blacklist[key]) && !(sourceStatics && sourceStatics[key]) && !(targetStatics && targetStatics[key])) {
          var descriptor2 = getOwnPropertyDescriptor3(sourceComponent, key);
          try {
            defineProperty$3(targetComponent, key, descriptor2);
          } catch (e2) {
          }
        }
      }
    }
    return targetComponent;
  }
  var hoistNonReactStatics_cjs = hoistNonReactStatics;
  const hoistNonReactStatic = /* @__PURE__ */ getDefaultExportFromCjs(hoistNonReactStatics_cjs);
  var _class$1f, _temp$Z;
  DefaultUI.propTypes = {
    error: PropTypes$1.object,
    errorInfo: PropTypes$1.object
  };
  function DefaultUI() {
    return "";
  }
  var ErrorBoundary = (_temp$Z = _class$1f = function(_React$Component) {
    _default$4(ErrorBoundary2, _React$Component);
    function ErrorBoundary2(props) {
      _default$7(this, ErrorBoundary2);
      var _this2 = _default$5(this, _React$Component.call(this, props));
      _this2.state = { error: null, errorInfo: null };
      return _this2;
    }
    ErrorBoundary2.prototype.componentDidCatch = function componentDidCatch(error, errorInfo) {
      this.setState({
        error,
        errorInfo
      });
      var afterCatch = this.props.afterCatch;
      if ("afterCatch" in this.props && typeof afterCatch === "function") {
        this.props.afterCatch(error, errorInfo);
      }
    };
    ErrorBoundary2.prototype.render = function render2() {
      var _props$fallbackUI = this.props.fallbackUI, FallbackUI = _props$fallbackUI === void 0 ? DefaultUI : _props$fallbackUI;
      if (this.state.errorInfo) {
        return React.createElement(FallbackUI, { error: this.state.error, errorInfo: this.state.errorInfo });
      }
      return this.props.children;
    };
    return ErrorBoundary2;
  }(React.Component), _class$1f.propTypes = {
    children: PropTypes$1.element,
    /**
     * 捕获错误后的自定义处理, 比如埋点上传
     * @param {Object} error 错误
     * @param {Object} errorInfo 错误详细信息
     */
    afterCatch: PropTypes$1.func,
    /**
     * 捕获错误后的展现 自定义组件
     * @param {Object} error 错误
     * @param {Object} errorInfo 错误详细信息
     * @returns {Element} 捕获错误后的处理
     */
    fallbackUI: PropTypes$1.func
  }, _temp$Z);
  ErrorBoundary.displayName = "ErrorBoundary";
  var shallowEqual = obj.shallowEqual;
  function getDisplayName(Component2) {
    return Component2.displayName || Component2.name || "Component";
  }
  var globalLocales = void 0;
  var currentGlobalLanguage = "zh-cn";
  var currentGlobalLocale = {};
  var currentGlobalRtl = void 0;
  function initLocales(locales) {
    globalLocales = locales;
    if (locales) {
      currentGlobalLocale = locales[currentGlobalLanguage];
      if (typeof currentGlobalRtl !== "boolean") {
        currentGlobalRtl = currentGlobalLocale && currentGlobalLocale.rtl;
      }
    }
  }
  function setLanguage(language) {
    if (globalLocales) {
      currentGlobalLanguage = language;
      currentGlobalLocale = globalLocales[language];
      if (typeof currentGlobalRtl !== "boolean") {
        currentGlobalRtl = currentGlobalLocale && currentGlobalLocale.rtl;
      }
    }
  }
  function setLocale(locale) {
    currentGlobalLocale = _default$8({}, globalLocales ? globalLocales[currentGlobalLanguage] : {}, locale);
    if (typeof currentGlobalRtl !== "boolean") {
      currentGlobalRtl = currentGlobalLocale && currentGlobalLocale.rtl;
    }
  }
  function setDirection(dir) {
    currentGlobalRtl = dir === "rtl";
  }
  function getLocale() {
    return currentGlobalLocale;
  }
  function getLanguage() {
    return currentGlobalLanguage;
  }
  function getDirection() {
    return currentGlobalRtl;
  }
  function config$1(Component2) {
    var _class2, _temp3;
    var options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
    if (obj.isClassComponent(Component2) && Component2.prototype.shouldComponentUpdate === void 0) {
      Component2.prototype.shouldComponentUpdate = function shouldComponentUpdate(nextProps, nextState) {
        if (this.props.pure) {
          return !shallowEqual(this.props, nextProps) || !shallowEqual(this.state, nextState);
        }
        return true;
      };
    }
    var ConfigedComponent = (_temp3 = _class2 = function(_React$Component) {
      _default$4(ConfigedComponent2, _React$Component);
      function ConfigedComponent2(props, context) {
        _default$7(this, ConfigedComponent2);
        var _this2 = _default$5(this, _React$Component.call(this, props, context));
        _this2._getInstance = _this2._getInstance.bind(_this2);
        _this2._deprecated = _this2._deprecated.bind(_this2);
        return _this2;
      }
      ConfigedComponent2.prototype._getInstance = function _getInstance(ref) {
        var _this2 = this;
        this._instance = ref;
        if (this._instance && options.exportNames) {
          options.exportNames.forEach(function(name) {
            var field = _this2._instance[name];
            if (typeof field === "function") {
              _this2[name] = field.bind(_this2._instance);
            } else {
              _this2[name] = field;
            }
          });
        }
      };
      ConfigedComponent2.prototype._deprecated = function _deprecated() {
        if (this.context.nextWarning !== false) {
          log.deprecated.apply(log, arguments);
        }
      };
      ConfigedComponent2.prototype.getInstance = function getInstance() {
        return this._instance;
      };
      ConfigedComponent2.prototype.render = function render2() {
        var _props = this.props, prefix = _props.prefix, locale = _props.locale, defaultPropsConfig = _props.defaultPropsConfig, pure = _props.pure, rtl = _props.rtl, device = _props.device, popupContainer = _props.popupContainer, errorBoundary = _props.errorBoundary, others = _default$3(_props, ["prefix", "locale", "defaultPropsConfig", "pure", "rtl", "device", "popupContainer", "errorBoundary"]);
        var _context = this.context, nextPrefix = _context.nextPrefix, _context$nextLocale = _context.nextLocale, nextLocale = _context$nextLocale === void 0 ? {} : _context$nextLocale, _context$nextDefaultP = _context.nextDefaultPropsConfig, nextDefaultPropsConfig = _context$nextDefaultP === void 0 ? {} : _context$nextDefaultP, nextPure = _context.nextPure, nextRtl = _context.nextRtl, nextDevice = _context.nextDevice, nextPopupContainer = _context.nextPopupContainer, nextErrorBoundary = _context.nextErrorBoundary;
        var displayName = options.componentName || getDisplayName(Component2);
        var contextProps = getContextProps$1({
          prefix,
          locale,
          defaultPropsConfig,
          pure,
          device,
          popupContainer,
          rtl,
          errorBoundary
        }, {
          nextPrefix,
          nextLocale: _default$8({}, currentGlobalLocale, nextLocale),
          nextDefaultPropsConfig,
          nextPure,
          nextDevice,
          nextPopupContainer,
          nextRtl: typeof nextRtl === "boolean" ? nextRtl : currentGlobalRtl === true ? true : void 0,
          nextErrorBoundary
        }, displayName);
        var newContextProps = ["prefix", "locale", "pure", "rtl", "device", "popupContainer"].reduce(function(ret, name) {
          if (typeof contextProps[name] !== "undefined") {
            ret[name] = contextProps[name];
          }
          return ret;
        }, {});
        if ("pure" in newContextProps && newContextProps.pure) {
          log.warning("pure of ConfigProvider is deprecated, use Function Component or React.PureComponent");
        }
        if ("popupContainer" in newContextProps && this.props.container === void 0 && ["Overlay", "Popup"].indexOf(displayName) > -1) {
          newContextProps.container = newContextProps.popupContainer;
          delete newContextProps.popupContainer;
        }
        var newOthers = options.transform ? options.transform(others, this._deprecated) : others;
        var content = React.createElement(Component2, _default$8({}, contextProps.defaultPropsConfig[displayName], newOthers, newContextProps, {
          ref: this._getInstance
        }));
        var _contextProps$errorBo = contextProps.errorBoundary, open2 = _contextProps$errorBo.open, othersBoundary = _default$3(_contextProps$errorBo, ["open"]);
        return open2 ? React.createElement(
          ErrorBoundary,
          othersBoundary,
          content
        ) : content;
      };
      return ConfigedComponent2;
    }(React.Component), _class2.propTypes = _default$8({}, Component2.propTypes || {}, {
      prefix: PropTypes$1.string,
      locale: PropTypes$1.object,
      defaultPropsConfig: PropTypes$1.object,
      pure: PropTypes$1.bool,
      rtl: PropTypes$1.bool,
      device: PropTypes$1.oneOf(["tablet", "desktop", "phone"]),
      popupContainer: PropTypes$1.any,
      errorBoundary: PropTypes$1.oneOfType([PropTypes$1.bool, PropTypes$1.object])
    }), _class2.contextTypes = _default$8({}, Component2.contextTypes || {}, {
      nextPrefix: PropTypes$1.string,
      nextLocale: PropTypes$1.object,
      nextDefaultPropsConfig: PropTypes$1.object,
      nextPure: PropTypes$1.bool,
      nextRtl: PropTypes$1.bool,
      nextWarning: PropTypes$1.bool,
      nextDevice: PropTypes$1.oneOf(["tablet", "desktop", "phone"]),
      nextPopupContainer: PropTypes$1.any,
      nextErrorBoundary: PropTypes$1.oneOfType([PropTypes$1.bool, PropTypes$1.object])
    }), _temp3);
    ConfigedComponent.displayName = "ConfigedComponent";
    ConfigedComponent.displayName = "Config(" + getDisplayName(Component2) + ")";
    hoistNonReactStatic(ConfigedComponent, Component2);
    return ConfigedComponent;
  }
  var mapKeys = function mapKeys2(obj2, fn) {
    var result = {};
    for (var key in obj2) {
      if (Object.prototype.hasOwnProperty.call(obj2, key)) {
        var value = obj2[key];
        var newKey = fn(key, value);
        result[newKey] = value;
      }
    }
    return result;
  };
  var replaceKey = function replaceKey2(key) {
    return key.replace(/^(next)([A-Z])/, function(match, p1, p2) {
      return p2.toLowerCase();
    });
  };
  var transformContext = function transformContext2(source) {
    return mapKeys(source, replaceKey);
  };
  var Consumer = function Consumer2(_ref, context) {
    var children = _ref.children;
    return typeof children === "function" ? children(transformContext(context)) : null;
  };
  Consumer.propTypes = {
    // Render context as function
    // Function(context: object): ReactElement
    children: PropTypes$1.func
  };
  Consumer.contextTypes = {
    nextPrefix: PropTypes$1.string,
    nextLocale: PropTypes$1.object,
    nextPure: PropTypes$1.bool,
    newRtl: PropTypes$1.bool,
    nextWarning: PropTypes$1.bool,
    nextDevice: PropTypes$1.oneOf(["tablet", "desktop", "phone"]),
    nextPopupContainer: PropTypes$1.any
  };
  const Consumer$1 = Consumer;
  var Cache = function() {
    function Cache2() {
      _default$7(this, Cache2);
      this._root = null;
      this._store = /* @__PURE__ */ new Map();
    }
    Cache2.prototype.empty = function empty() {
      return this._store.size === 0;
    };
    Cache2.prototype.has = function has2(key) {
      return this._store.has(key);
    };
    Cache2.prototype.get = function get(key, defaultValue) {
      var res = this.has(key) ? this._store.get(key) : this.root();
      return typeof res === "undefined" || res === null ? defaultValue : res;
    };
    Cache2.prototype.add = function add(key, value) {
      if (this.empty()) {
        this._root = key;
      }
      this._store.set(key, value);
    };
    Cache2.prototype.update = function update(key, value) {
      if (this.has(key)) {
        this._store.set(key, value);
      }
    };
    Cache2.prototype.remove = function remove(key) {
      this._store.delete(key);
      if (key === this._root) {
        var maps = this._store.keys();
        var nextkey = maps.next().value;
        this._root = nextkey;
      }
    };
    Cache2.prototype.clear = function clear() {
      this._store.clear();
    };
    Cache2.prototype.root = function root() {
      return this._store.get(this._root);
    };
    return Cache2;
  }();
  const Cache$1 = Cache;
  var _class$1e, _temp$Y;
  var childContextCache = new Cache$1();
  var setMomentLocale = function setMomentLocale2(locale) {
    var moment = void 0;
    try {
      moment = require("moment");
      if (moment && moment.default && moment.default.isMoment)
        moment = moment.default;
    } catch (e2) {
    }
    if (moment && moment.locale && locale) {
      moment.locale(locale.momentLocale);
    }
  };
  var setDateLocale = function setDateLocale2(locale) {
    if (locale) {
      datejs$1.locale(locale.dateLocale || locale.momentLocale);
    }
  };
  var ConfigProvider = (_temp$Y = _class$1e = function(_Component) {
    _default$4(ConfigProvider2, _Component);
    function ConfigProvider2() {
      _default$7(this, ConfigProvider2);
      for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
        args[_key] = arguments[_key];
      }
      var _this2 = _default$5(this, _Component.call.apply(_Component, [this].concat(args)));
      childContextCache.add(_this2, _default$8({}, childContextCache.get(_this2, {}), _this2.getChildContext()));
      setMomentLocale(_this2.props.locale);
      setDateLocale(_this2.props.locale);
      _this2.state = {
        locale: _this2.props.locale
      };
      return _this2;
    }
    ConfigProvider2.prototype.getChildContext = function getChildContext() {
      var _props = this.props, prefix = _props.prefix, locale = _props.locale, defaultPropsConfig = _props.defaultPropsConfig, pure = _props.pure, warning2 = _props.warning, rtl = _props.rtl, device = _props.device, popupContainer = _props.popupContainer, errorBoundary = _props.errorBoundary;
      var _context = this.context, nextPrefix = _context.nextPrefix, nextDefaultPropsConfig = _context.nextDefaultPropsConfig, nextLocale = _context.nextLocale, nextPure = _context.nextPure, nextRtl = _context.nextRtl, nextWarning = _context.nextWarning, nextDevice = _context.nextDevice, nextPopupContainer = _context.nextPopupContainer, nextErrorBoundary = _context.nextErrorBoundary;
      return {
        nextPrefix: prefix || nextPrefix,
        nextDefaultPropsConfig: defaultPropsConfig || nextDefaultPropsConfig,
        nextLocale: locale || nextLocale,
        nextPure: typeof pure === "boolean" ? pure : nextPure,
        nextRtl: typeof rtl === "boolean" ? rtl : nextRtl,
        nextWarning: typeof warning2 === "boolean" ? warning2 : nextWarning,
        nextDevice: device || nextDevice,
        nextPopupContainer: popupContainer || nextPopupContainer,
        nextErrorBoundary: errorBoundary || nextErrorBoundary
      };
    };
    ConfigProvider2.getDerivedStateFromProps = function getDerivedStateFromProps(nextProps, prevState) {
      if (nextProps.locale !== prevState.locale) {
        setMomentLocale(nextProps.locale);
        setDateLocale(nextProps.locale);
        return {
          locale: nextProps.locale
        };
      }
      return null;
    };
    ConfigProvider2.prototype.componentDidUpdate = function componentDidUpdate() {
      childContextCache.add(this, _default$8({}, childContextCache.get(this, {}), this.getChildContext()));
    };
    ConfigProvider2.prototype.componentWillUnmount = function componentWillUnmount() {
      childContextCache.remove(this);
    };
    ConfigProvider2.prototype.render = function render2() {
      return React.Children.only(this.props.children);
    };
    return ConfigProvider2;
  }(React.Component), _class$1e.propTypes = {
    /**
     * 样式类名的品牌前缀
     */
    prefix: PropTypes$1.string,
    /**
     * 国际化文案对象,属性为组件的 displayName
     */
    locale: PropTypes$1.object,
    /**
     * 组件 API 的默认配置
     */
    defaultPropsConfig: PropTypes$1.object,
    /**
     * 是否开启错误捕捉 errorBoundary
     * 如需自定义参数,请传入对象 对象接受参数列表如下:
     *
     * fallbackUI `Function(error?: {}, errorInfo?: {}) => Element` 捕获错误后的展示
     * afterCatch `Function(error?: {}, errorInfo?: {})` 捕获错误后的行为, 比如埋点上传
     */
    errorBoundary: PropTypes$1.oneOfType([PropTypes$1.bool, PropTypes$1.object]),
    /**
     * 是否开启 Pure Render 模式,会提高性能,但是也会带来副作用
     */
    pure: PropTypes$1.bool,
    /**
     * 是否在开发模式下显示组件属性被废弃的 warning 提示
     */
    warning: PropTypes$1.bool,
    /**
     * 是否开启 rtl 模式
     */
    rtl: PropTypes$1.bool,
    /**
     * 设备类型,针对不同的设备类型组件做出对应的响应式变化
     */
    device: PropTypes$1.oneOf(["tablet", "desktop", "phone"]),
    /**
     * 组件树
     */
    children: PropTypes$1.any,
    /**
     * 指定浮层渲染的父节点, 可以为节点id的字符串,也可以返回节点的函数
     */
    popupContainer: PropTypes$1.any
  }, _class$1e.defaultProps = {
    warning: true,
    errorBoundary: false
  }, _class$1e.contextTypes = {
    nextPrefix: PropTypes$1.string,
    nextLocale: PropTypes$1.object,
    nextDefaultPropsConfig: PropTypes$1.object,
    nextPure: PropTypes$1.bool,
    nextRtl: PropTypes$1.bool,
    nextWarning: PropTypes$1.bool,
    nextDevice: PropTypes$1.oneOf(["tablet", "desktop", "phone"]),
    nextPopupContainer: PropTypes$1.any,
    nextErrorBoundary: PropTypes$1.oneOfType([PropTypes$1.bool, PropTypes$1.object])
  }, _class$1e.childContextTypes = {
    nextPrefix: PropTypes$1.string,
    nextLocale: PropTypes$1.object,
    nextDefaultPropsConfig: PropTypes$1.object,
    nextPure: PropTypes$1.bool,
    nextRtl: PropTypes$1.bool,
    nextWarning: PropTypes$1.bool,
    nextDevice: PropTypes$1.oneOf(["tablet", "desktop", "phone"]),
    nextPopupContainer: PropTypes$1.any,
    nextErrorBoundary: PropTypes$1.oneOfType([PropTypes$1.bool, PropTypes$1.object])
  }, _class$1e.config = function(Component2, options) {
    return config$1(Component2, options);
  }, _class$1e.getContextProps = function(props, displayName) {
    return getContextProps$1(props, childContextCache.root() || {}, displayName);
  }, _class$1e.clearCache = function() {
    childContextCache.clear();
  }, _class$1e.initLocales = initLocales, _class$1e.setLanguage = setLanguage, _class$1e.setLocale = setLocale, _class$1e.setDirection = setDirection, _class$1e.getLanguage = getLanguage, _class$1e.getLocale = getLocale, _class$1e.getDirection = getDirection, _class$1e.Consumer = Consumer$1, _class$1e.ErrorBoundary = ErrorBoundary, _class$1e.getContext = function() {
    var _ref = childContextCache.root() || {}, nextPrefix = _ref.nextPrefix, nextLocale = _ref.nextLocale, nextDefaultPropsConfig = _ref.nextDefaultPropsConfig, nextPure = _ref.nextPure, nextRtl = _ref.nextRtl, nextWarning = _ref.nextWarning, nextDevice = _ref.nextDevice, nextPopupContainer = _ref.nextPopupContainer, nextErrorBoundary = _ref.nextErrorBoundary;
    return {
      prefix: nextPrefix,
      locale: nextLocale,
      defaultPropsConfig: nextDefaultPropsConfig,
      pure: nextPure,
      rtl: nextRtl,
      warning: nextWarning,
      device: nextDevice,
      popupContainer: nextPopupContainer,
      errorBoundary: nextErrorBoundary
    };
  }, _temp$Y);
  ConfigProvider.displayName = "ConfigProvider";
  const ConfigProvider$1 = polyfill(ConfigProvider);
  function getScroll(node, isVertical) {
    if (typeof window === "undefined") {
      return 0;
    }
    var windowProp = isVertical ? "pageYOffset" : "pageXOffset";
    var elementProp = isVertical ? "scrollTop" : "scrollLeft";
    return node === window ? node[windowProp] : node[elementProp];
  }
  function getRect(node) {
    return node !== window ? node.getBoundingClientRect() : { top: 0, left: 0, bottom: 0 };
  }
  function getNodeHeight(node) {
    if (!node) {
      return 0;
    }
    if (node === window) {
      return window.innerHeight;
    }
    return node.clientHeight;
  }
  var _class$1d, _temp$X;
  var Affix = (_temp$X = _class$1d = function(_React$Component) {
    _default$4(Affix2, _React$Component);
    Affix2._getAffixMode = function _getAffixMode(nextProps) {
      var affixMode = {
        top: false,
        bottom: false,
        offset: 0
      };
      if (!nextProps) {
        return affixMode;
      }
      var offsetTop = nextProps.offsetTop, offsetBottom = nextProps.offsetBottom;
      if (typeof offsetTop !== "number" && typeof offsetBottom !== "number") {
        affixMode.top = true;
      } else if (typeof offsetTop === "number") {
        affixMode.top = true;
        affixMode.bottom = false;
        affixMode.offset = offsetTop;
      } else if (typeof offsetBottom === "number") {
        affixMode.bottom = true;
        affixMode.top = false;
        affixMode.offset = offsetBottom;
      }
      return affixMode;
    };
    function Affix2(props, context) {
      _default$7(this, Affix2);
      var _this2 = _default$5(this, _React$Component.call(this, props, context));
      _this2._clearContainerEvent = function() {
        if (_this2.timeout) {
          clearTimeout(_this2.timeout);
          _this2.timeout = null;
        }
        var container4 = _this2.props.container;
        _this2._removeEventHandlerForContainer(container4);
      };
      _this2.updatePosition = function() {
        _this2._updateNodePosition();
      };
      _this2._updateNodePosition = function() {
        var affixMode = _this2.state.affixMode;
        var _this$props = _this2.props, container4 = _this$props.container, useAbsolute = _this$props.useAbsolute;
        var affixContainer = container4();
        if (!affixContainer || !_this2.affixNode) {
          return false;
        }
        var containerScrollTop = getScroll(affixContainer, true);
        var affixOffset = _this2._getOffset(_this2.affixNode, affixContainer);
        var containerHeight = getNodeHeight(affixContainer);
        var affixHeight = _this2.affixNode.offsetHeight;
        var containerRect = getRect(affixContainer);
        var affixChildHeight = _this2.affixChildNode.offsetHeight;
        var affixStyle = {
          width: affixOffset.width
        };
        var containerStyle = {
          width: affixOffset.width,
          height: affixChildHeight
        };
        var positionStyle = null;
        if (affixMode.top && containerScrollTop > affixOffset.top - affixMode.offset) {
          if (useAbsolute) {
            affixStyle.position = "absolute";
            affixStyle.top = containerScrollTop - (affixOffset.top - affixMode.offset);
            positionStyle = "relative";
          } else {
            affixStyle.position = "fixed";
            affixStyle.top = affixMode.offset + containerRect.top;
          }
          _this2._setAffixStyle(affixStyle, true);
          _this2._setContainerStyle(containerStyle);
        } else if (affixMode.bottom && containerScrollTop < affixOffset.top + affixHeight + affixMode.offset - containerHeight) {
          affixStyle.height = affixHeight;
          if (useAbsolute) {
            affixStyle.position = "absolute";
            affixStyle.top = containerScrollTop - (affixOffset.top + affixHeight + affixMode.offset - containerHeight);
            positionStyle = "relative";
          } else {
            affixStyle.position = "fixed";
            affixStyle.bottom = affixMode.offset;
          }
          _this2._setAffixStyle(affixStyle, true);
          _this2._setContainerStyle(containerStyle);
        } else {
          _this2._setAffixStyle(null);
          _this2._setContainerStyle(null);
        }
        if (_this2.state.positionStyle !== positionStyle) {
          _this2.setState({ positionStyle });
        }
      };
      _this2._affixNodeRefHandler = function(ref) {
        _this2.affixNode = ref;
      };
      _this2._affixChildNodeRefHandler = function(ref) {
        _this2.affixChildNode = ref;
      };
      _this2.state = {
        style: null,
        containerStyle: null,
        positionStyle: null,
        affixMode: Affix2._getAffixMode(props)
      };
      _this2.resizeObserver = new index$2(_this2._updateNodePosition);
      return _this2;
    }
    Affix2.getDerivedStateFromProps = function getDerivedStateFromProps(nextProps, prevState) {
      if ("offsetTop" in nextProps || "offsetBottom" in nextProps) {
        return {
          affixMode: Affix2._getAffixMode(nextProps)
        };
      }
      return null;
    };
    Affix2.prototype.componentDidMount = function componentDidMount() {
      var _this2 = this;
      var container4 = this.props.container;
      this.timeout = setTimeout(function() {
        _this2._updateNodePosition();
        _this2._setEventHandlerForContainer(container4);
      });
    };
    Affix2.prototype.componentDidUpdate = function componentDidUpdate(prevProps, prevState, snapshot) {
      var _this3 = this;
      if (prevProps.container() !== this.props.container()) {
        this._clearContainerEvent();
        this.timeout = setTimeout(function() {
          _this3._setEventHandlerForContainer(_this3.props.container);
        });
      }
      setTimeout(this._updateNodePosition);
    };
    Affix2.prototype.componentWillUnmount = function componentWillUnmount() {
      this._clearContainerEvent();
    };
    Affix2.prototype._setEventHandlerForContainer = function _setEventHandlerForContainer(getContainer3) {
      var container4 = getContainer3();
      if (!container4) {
        return;
      }
      events.on(container4, "scroll", this._updateNodePosition, false);
      this.resizeObserver.observe(this.affixNode);
    };
    Affix2.prototype._removeEventHandlerForContainer = function _removeEventHandlerForContainer(getContainer3) {
      var container4 = getContainer3();
      if (container4) {
        events.off(container4, "scroll", this._updateNodePosition);
        this.resizeObserver.disconnect();
      }
    };
    Affix2.prototype._setAffixStyle = function _setAffixStyle(affixStyle) {
      var affixed = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
      if (obj.shallowEqual(affixStyle, this.state.style)) {
        return;
      }
      this.setState({
        style: affixStyle
      });
      var onAffix = this.props.onAffix;
      if (affixed) {
        setTimeout(function() {
          return onAffix(true);
        });
      } else if (!affixStyle) {
        setTimeout(function() {
          return onAffix(false);
        });
      }
    };
    Affix2.prototype._setContainerStyle = function _setContainerStyle(containerStyle) {
      if (obj.shallowEqual(containerStyle, this.state.containerStyle)) {
        return;
      }
      this.setState({ containerStyle });
    };
    Affix2.prototype._getOffset = function _getOffset(affixNode, affixContainer) {
      var affixRect = affixNode.getBoundingClientRect();
      var containerRect = getRect(affixContainer);
      var containerScrollTop = getScroll(affixContainer, true);
      var containerScrollLeft = getScroll(affixContainer, false);
      return {
        top: affixRect.top - containerRect.top + containerScrollTop,
        left: affixRect.left - containerRect.left + containerScrollLeft,
        width: affixRect.width,
        height: affixRect.height
      };
    };
    Affix2.prototype.render = function render2() {
      var _classnames;
      var _state = this.state, affixMode = _state.affixMode, positionStyle = _state.positionStyle;
      var _props = this.props, prefix = _props.prefix, className = _props.className, style = _props.style, children = _props.children;
      var state = this.state;
      var classNames = classnames((_classnames = {}, _classnames[prefix + "affix"] = state.style, _classnames[prefix + "affix-top"] = !state.style && affixMode.top, _classnames[prefix + "affix-bottom"] = !state.style && affixMode.bottom, _classnames[className] = className, _classnames));
      var wrapperStyle = _default$8({}, style, { position: positionStyle });
      return React.createElement(
        "div",
        { ref: this._affixNodeRefHandler, style: wrapperStyle },
        state.style && React.createElement("div", { style: state.containerStyle, "aria-hidden": "true" }),
        React.createElement(
          "div",
          { ref: this._affixChildNodeRefHandler, className: classNames, style: state.style },
          children
        )
      );
    };
    return Affix2;
  }(React.Component), _class$1d.propTypes = {
    prefix: PropTypes$1.string,
    /**
     * 设置 Affix 需要监听滚动事件的容器元素
     * @return {ReactElement} 目标容器元素的实例
     */
    container: PropTypes$1.func,
    /**
     * 距离窗口顶部达到指定偏移量后触发
     */
    offsetTop: PropTypes$1.number,
    /**
     * 距离窗口底部达到制定偏移量后触发
     */
    offsetBottom: PropTypes$1.number,
    /**
     * 当元素的样式发生固钉样式变化时触发的回调函数
     * @param {Boolean} affixed 元素是否被固钉
     */
    onAffix: PropTypes$1.func,
    /**
     * 是否启用绝对布局实现 affix
     * @param {Boolean} 是否启用绝对布局
     */
    useAbsolute: PropTypes$1.bool,
    className: PropTypes$1.string,
    style: PropTypes$1.object,
    children: PropTypes$1.any
  }, _class$1d.defaultProps = {
    prefix: "next-",
    container: function container() {
      return window;
    },
    onAffix: func.noop
  }, _temp$X);
  Affix.displayName = "Affix";
  const Affix$1 = ConfigProvider$1.config(polyfill(Affix));
  var CSSTransition = { exports: {} };
  var addClass$1 = { exports: {} };
  var interopRequireDefault = { exports: {} };
  (function(module) {
    function _interopRequireDefault2(obj2) {
      return obj2 && obj2.__esModule ? obj2 : {
        "default": obj2
      };
    }
    module.exports = _interopRequireDefault2, module.exports.__esModule = true, module.exports["default"] = module.exports;
  })(interopRequireDefault);
  var interopRequireDefaultExports = interopRequireDefault.exports;
  var hasClass = { exports: {} };
  var hasRequiredHasClass;
  function requireHasClass() {
    if (hasRequiredHasClass)
      return hasClass.exports;
    hasRequiredHasClass = 1;
    (function(module, exports) {
      exports.__esModule = true;
      exports.default = hasClass2;
      function hasClass2(element, className) {
        if (element.classList)
          return !!className && element.classList.contains(className);
        else
          return (" " + (element.className.baseVal || element.className) + " ").indexOf(" " + className + " ") !== -1;
      }
      module.exports = exports["default"];
    })(hasClass, hasClass.exports);
    return hasClass.exports;
  }
  (function(module, exports) {
    var _interopRequireDefault2 = interopRequireDefaultExports;
    exports.__esModule = true;
    exports.default = addClass2;
    var _hasClass = _interopRequireDefault2(requireHasClass());
    function addClass2(element, className) {
      if (element.classList)
        element.classList.add(className);
      else if (!(0, _hasClass.default)(element, className))
        if (typeof element.className === "string")
          element.className = element.className + " " + className;
        else
          element.setAttribute("class", (element.className && element.className.baseVal || "") + " " + className);
    }
    module.exports = exports["default"];
  })(addClass$1, addClass$1.exports);
  var addClassExports = addClass$1.exports;
  function replaceClassName(origClass, classToRemove) {
    return origClass.replace(new RegExp("(^|\\s)" + classToRemove + "(?:\\s|$)", "g"), "$1").replace(/\s+/g, " ").replace(/^\s*|\s*$/g, "");
  }
  var removeClass$1 = function removeClass(element, className) {
    if (element.classList)
      element.classList.remove(className);
    else if (typeof element.className === "string")
      element.className = replaceClassName(element.className, className);
    else
      element.setAttribute("class", replaceClassName(element.className && element.className.baseVal || "", className));
  };
  var Transition$1 = {};
  const require$$2 = /* @__PURE__ */ getAugmentedNamespace(reactLifecyclesCompat_es);
  Transition$1.__esModule = true;
  Transition$1.default = Transition$1.EXITING = Transition$1.ENTERED = Transition$1.ENTERING = Transition$1.EXITED = Transition$1.UNMOUNTED = void 0;
  var PropTypes = _interopRequireWildcard(propTypesExports);
  var _react$1 = _interopRequireDefault$3(React);
  var _reactDom = _interopRequireDefault$3(ReactDOM);
  var _reactLifecyclesCompat = require$$2;
  function _interopRequireDefault$3(obj2) {
    return obj2 && obj2.__esModule ? obj2 : { default: obj2 };
  }
  function _interopRequireWildcard(obj2) {
    if (obj2 && obj2.__esModule) {
      return obj2;
    } else {
      var newObj = {};
      if (obj2 != null) {
        for (var key in obj2) {
          if (Object.prototype.hasOwnProperty.call(obj2, key)) {
            var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj2, key) : {};
            if (desc.get || desc.set) {
              Object.defineProperty(newObj, key, desc);
            } else {
              newObj[key] = obj2[key];
            }
          }
        }
      }
      newObj.default = obj2;
      return newObj;
    }
  }
  function _objectWithoutPropertiesLoose$1(source, excluded) {
    if (source == null)
      return {};
    var target = {};
    var sourceKeys = Object.keys(source);
    var key, i;
    for (i = 0; i < sourceKeys.length; i++) {
      key = sourceKeys[i];
      if (excluded.indexOf(key) >= 0)
        continue;
      target[key] = source[key];
    }
    return target;
  }
  function _inheritsLoose$1(subClass, superClass) {
    subClass.prototype = Object.create(superClass.prototype);
    subClass.prototype.constructor = subClass;
    subClass.__proto__ = superClass;
  }
  var UNMOUNTED = "unmounted";
  Transition$1.UNMOUNTED = UNMOUNTED;
  var EXITED = "exited";
  Transition$1.EXITED = EXITED;
  var ENTERING = "entering";
  Transition$1.ENTERING = ENTERING;
  var ENTERED = "entered";
  Transition$1.ENTERED = ENTERED;
  var EXITING = "exiting";
  Transition$1.EXITING = EXITING;
  var Transition = /* @__PURE__ */ function(_React$Component) {
    _inheritsLoose$1(Transition2, _React$Component);
    function Transition2(props, context) {
      var _this2;
      _this2 = _React$Component.call(this, props, context) || this;
      var parentGroup = context.transitionGroup;
      var appear = parentGroup && !parentGroup.isMounting ? props.enter : props.appear;
      var initialStatus;
      _this2.appearStatus = null;
      if (props.in) {
        if (appear) {
          initialStatus = EXITED;
          _this2.appearStatus = ENTERING;
        } else {
          initialStatus = ENTERED;
        }
      } else {
        if (props.unmountOnExit || props.mountOnEnter) {
          initialStatus = UNMOUNTED;
        } else {
          initialStatus = EXITED;
        }
      }
      _this2.state = {
        status: initialStatus
      };
      _this2.nextCallback = null;
      return _this2;
    }
    var _proto = Transition2.prototype;
    _proto.getChildContext = function getChildContext() {
      return {
        transitionGroup: null
        // allows for nested Transitions
      };
    };
    Transition2.getDerivedStateFromProps = function getDerivedStateFromProps(_ref, prevState) {
      var nextIn = _ref.in;
      if (nextIn && prevState.status === UNMOUNTED) {
        return {
          status: EXITED
        };
      }
      return null;
    };
    _proto.componentDidMount = function componentDidMount() {
      this.updateStatus(true, this.appearStatus);
    };
    _proto.componentDidUpdate = function componentDidUpdate(prevProps) {
      var nextStatus = null;
      if (prevProps !== this.props) {
        var status = this.state.status;
        if (this.props.in) {
          if (status !== ENTERING && status !== ENTERED) {
            nextStatus = ENTERING;
          }
        } else {
          if (status === ENTERING || status === ENTERED) {
            nextStatus = EXITING;
          }
        }
      }
      this.updateStatus(false, nextStatus);
    };
    _proto.componentWillUnmount = function componentWillUnmount() {
      this.cancelNextCallback();
    };
    _proto.getTimeouts = function getTimeouts() {
      var timeout = this.props.timeout;
      var exit, enter, appear;
      exit = enter = appear = timeout;
      if (timeout != null && typeof timeout !== "number") {
        exit = timeout.exit;
        enter = timeout.enter;
        appear = timeout.appear !== void 0 ? timeout.appear : enter;
      }
      return {
        exit,
        enter,
        appear
      };
    };
    _proto.updateStatus = function updateStatus(mounting, nextStatus) {
      if (mounting === void 0) {
        mounting = false;
      }
      if (nextStatus !== null) {
        this.cancelNextCallback();
        var node = _reactDom.default.findDOMNode(this);
        if (nextStatus === ENTERING) {
          this.performEnter(node, mounting);
        } else {
          this.performExit(node);
        }
      } else if (this.props.unmountOnExit && this.state.status === EXITED) {
        this.setState({
          status: UNMOUNTED
        });
      }
    };
    _proto.performEnter = function performEnter(node, mounting) {
      var _this2 = this;
      var enter = this.props.enter;
      var appearing = this.context.transitionGroup ? this.context.transitionGroup.isMounting : mounting;
      var timeouts2 = this.getTimeouts();
      var enterTimeout = appearing ? timeouts2.appear : timeouts2.enter;
      if (!mounting && !enter) {
        this.safeSetState({
          status: ENTERED
        }, function() {
          _this2.props.onEntered(node);
        });
        return;
      }
      this.props.onEnter(node, appearing);
      this.safeSetState({
        status: ENTERING
      }, function() {
        _this2.props.onEntering(node, appearing);
        _this2.onTransitionEnd(node, enterTimeout, function() {
          _this2.safeSetState({
            status: ENTERED
          }, function() {
            _this2.props.onEntered(node, appearing);
          });
        });
      });
    };
    _proto.performExit = function performExit(node) {
      var _this3 = this;
      var exit = this.props.exit;
      var timeouts2 = this.getTimeouts();
      if (!exit) {
        this.safeSetState({
          status: EXITED
        }, function() {
          _this3.props.onExited(node);
        });
        return;
      }
      this.props.onExit(node);
      this.safeSetState({
        status: EXITING
      }, function() {
        _this3.props.onExiting(node);
        _this3.onTransitionEnd(node, timeouts2.exit, function() {
          _this3.safeSetState({
            status: EXITED
          }, function() {
            _this3.props.onExited(node);
          });
        });
      });
    };
    _proto.cancelNextCallback = function cancelNextCallback() {
      if (this.nextCallback !== null) {
        this.nextCallback.cancel();
        this.nextCallback = null;
      }
    };
    _proto.safeSetState = function safeSetState(nextState, callback) {
      callback = this.setNextCallback(callback);
      this.setState(nextState, callback);
    };
    _proto.setNextCallback = function setNextCallback(callback) {
      var _this4 = this;
      var active = true;
      this.nextCallback = function(event) {
        if (active) {
          active = false;
          _this4.nextCallback = null;
          callback(event);
        }
      };
      this.nextCallback.cancel = function() {
        active = false;
      };
      return this.nextCallback;
    };
    _proto.onTransitionEnd = function onTransitionEnd(node, timeout, handler) {
      this.setNextCallback(handler);
      var doesNotHaveTimeoutOrListener = timeout == null && !this.props.addEndListener;
      if (!node || doesNotHaveTimeoutOrListener) {
        setTimeout(this.nextCallback, 0);
        return;
      }
      if (this.props.addEndListener) {
        this.props.addEndListener(node, this.nextCallback);
      }
      if (timeout != null) {
        setTimeout(this.nextCallback, timeout);
      }
    };
    _proto.render = function render2() {
      var status = this.state.status;
      if (status === UNMOUNTED) {
        return null;
      }
      var _this$props = this.props, children = _this$props.children, childProps = _objectWithoutPropertiesLoose$1(_this$props, ["children"]);
      delete childProps.in;
      delete childProps.mountOnEnter;
      delete childProps.unmountOnExit;
      delete childProps.appear;
      delete childProps.enter;
      delete childProps.exit;
      delete childProps.timeout;
      delete childProps.addEndListener;
      delete childProps.onEnter;
      delete childProps.onEntering;
      delete childProps.onEntered;
      delete childProps.onExit;
      delete childProps.onExiting;
      delete childProps.onExited;
      if (typeof children === "function") {
        return children(status, childProps);
      }
      var child = _react$1.default.Children.only(children);
      return _react$1.default.cloneElement(child, childProps);
    };
    return Transition2;
  }(_react$1.default.Component);
  Transition.contextTypes = {
    transitionGroup: PropTypes.object
  };
  Transition.childContextTypes = {
    transitionGroup: function transitionGroup() {
    }
  };
  Transition.propTypes = {};
  function noop$l() {
  }
  Transition.defaultProps = {
    in: false,
    mountOnEnter: false,
    unmountOnExit: false,
    appear: false,
    enter: true,
    exit: true,
    onEnter: noop$l,
    onEntering: noop$l,
    onEntered: noop$l,
    onExit: noop$l,
    onExiting: noop$l,
    onExited: noop$l
  };
  Transition.UNMOUNTED = 0;
  Transition.EXITED = 1;
  Transition.ENTERING = 2;
  Transition.ENTERED = 3;
  Transition.EXITING = 4;
  var _default$2 = (0, _reactLifecyclesCompat.polyfill)(Transition);
  Transition$1.default = _default$2;
  (function(module, exports) {
    exports.__esModule = true;
    exports.default = void 0;
    _interopRequireWildcard2(propTypesExports);
    var _addClass = _interopRequireDefault2(addClassExports);
    var _removeClass = _interopRequireDefault2(removeClass$1);
    var _react2 = _interopRequireDefault2(React);
    var _Transition2 = _interopRequireDefault2(Transition$1);
    function _interopRequireDefault2(obj2) {
      return obj2 && obj2.__esModule ? obj2 : { default: obj2 };
    }
    function _interopRequireWildcard2(obj2) {
      if (obj2 && obj2.__esModule) {
        return obj2;
      } else {
        var newObj = {};
        if (obj2 != null) {
          for (var key in obj2) {
            if (Object.prototype.hasOwnProperty.call(obj2, key)) {
              var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj2, key) : {};
              if (desc.get || desc.set) {
                Object.defineProperty(newObj, key, desc);
              } else {
                newObj[key] = obj2[key];
              }
            }
          }
        }
        newObj.default = obj2;
        return newObj;
      }
    }
    function _extends2() {
      _extends2 = Object.assign || function(target) {
        for (var i = 1; i < arguments.length; i++) {
          var source = arguments[i];
          for (var key in source) {
            if (Object.prototype.hasOwnProperty.call(source, key)) {
              target[key] = source[key];
            }
          }
        }
        return target;
      };
      return _extends2.apply(this, arguments);
    }
    function _inheritsLoose2(subClass, superClass) {
      subClass.prototype = Object.create(superClass.prototype);
      subClass.prototype.constructor = subClass;
      subClass.__proto__ = superClass;
    }
    var addClass2 = function addClass3(node, classes) {
      return node && classes && classes.split(" ").forEach(function(c2) {
        return (0, _addClass.default)(node, c2);
      });
    };
    var removeClass3 = function removeClass4(node, classes) {
      return node && classes && classes.split(" ").forEach(function(c2) {
        return (0, _removeClass.default)(node, c2);
      });
    };
    var CSSTransition2 = /* @__PURE__ */ function(_React$Component) {
      _inheritsLoose2(CSSTransition3, _React$Component);
      function CSSTransition3() {
        var _this2;
        for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
          args[_key] = arguments[_key];
        }
        _this2 = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;
        _this2.onEnter = function(node, appearing) {
          var _this$getClassNames = _this2.getClassNames(appearing ? "appear" : "enter"), className = _this$getClassNames.className;
          _this2.removeClasses(node, "exit");
          addClass2(node, className);
          if (_this2.props.onEnter) {
            _this2.props.onEnter(node, appearing);
          }
        };
        _this2.onEntering = function(node, appearing) {
          var _this$getClassNames2 = _this2.getClassNames(appearing ? "appear" : "enter"), activeClassName = _this$getClassNames2.activeClassName;
          _this2.reflowAndAddClass(node, activeClassName);
          if (_this2.props.onEntering) {
            _this2.props.onEntering(node, appearing);
          }
        };
        _this2.onEntered = function(node, appearing) {
          var appearClassName = _this2.getClassNames("appear").doneClassName;
          var enterClassName = _this2.getClassNames("enter").doneClassName;
          var doneClassName = appearing ? appearClassName + " " + enterClassName : enterClassName;
          _this2.removeClasses(node, appearing ? "appear" : "enter");
          addClass2(node, doneClassName);
          if (_this2.props.onEntered) {
            _this2.props.onEntered(node, appearing);
          }
        };
        _this2.onExit = function(node) {
          var _this$getClassNames3 = _this2.getClassNames("exit"), className = _this$getClassNames3.className;
          _this2.removeClasses(node, "appear");
          _this2.removeClasses(node, "enter");
          addClass2(node, className);
          if (_this2.props.onExit) {
            _this2.props.onExit(node);
          }
        };
        _this2.onExiting = function(node) {
          var _this$getClassNames4 = _this2.getClassNames("exit"), activeClassName = _this$getClassNames4.activeClassName;
          _this2.reflowAndAddClass(node, activeClassName);
          if (_this2.props.onExiting) {
            _this2.props.onExiting(node);
          }
        };
        _this2.onExited = function(node) {
          var _this$getClassNames5 = _this2.getClassNames("exit"), doneClassName = _this$getClassNames5.doneClassName;
          _this2.removeClasses(node, "exit");
          addClass2(node, doneClassName);
          if (_this2.props.onExited) {
            _this2.props.onExited(node);
          }
        };
        _this2.getClassNames = function(type2) {
          var classNames = _this2.props.classNames;
          var isStringClassNames = typeof classNames === "string";
          var prefix = isStringClassNames && classNames ? classNames + "-" : "";
          var className = isStringClassNames ? prefix + type2 : classNames[type2];
          var activeClassName = isStringClassNames ? className + "-active" : classNames[type2 + "Active"];
          var doneClassName = isStringClassNames ? className + "-done" : classNames[type2 + "Done"];
          return {
            className,
            activeClassName,
            doneClassName
          };
        };
        return _this2;
      }
      var _proto = CSSTransition3.prototype;
      _proto.removeClasses = function removeClasses(node, type2) {
        var _this$getClassNames6 = this.getClassNames(type2), className = _this$getClassNames6.className, activeClassName = _this$getClassNames6.activeClassName, doneClassName = _this$getClassNames6.doneClassName;
        className && removeClass3(node, className);
        activeClassName && removeClass3(node, activeClassName);
        doneClassName && removeClass3(node, doneClassName);
      };
      _proto.reflowAndAddClass = function reflowAndAddClass(node, className) {
        if (className) {
          node && node.scrollTop;
          addClass2(node, className);
        }
      };
      _proto.render = function render2() {
        var props = _extends2({}, this.props);
        delete props.classNames;
        return _react2.default.createElement(_Transition2.default, _extends2({}, props, {
          onEnter: this.onEnter,
          onEntered: this.onEntered,
          onEntering: this.onEntering,
          onExit: this.onExit,
          onExiting: this.onExiting,
          onExited: this.onExited
        }));
      };
      return CSSTransition3;
    }(_react2.default.Component);
    CSSTransition2.defaultProps = {
      classNames: ""
    };
    CSSTransition2.propTypes = {};
    var _default2 = CSSTransition2;
    exports.default = _default2;
    module.exports = exports["default"];
  })(CSSTransition, CSSTransition.exports);
  var CSSTransitionExports = CSSTransition.exports;
  var ReplaceTransition = { exports: {} };
  var TransitionGroup = { exports: {} };
  var ChildMapping = {};
  ChildMapping.__esModule = true;
  ChildMapping.getChildMapping = getChildMapping;
  ChildMapping.mergeChildMappings = mergeChildMappings;
  ChildMapping.getInitialChildMapping = getInitialChildMapping;
  ChildMapping.getNextChildMapping = getNextChildMapping;
  var _react = React;
  function getChildMapping(children, mapFn) {
    var mapper = function mapper2(child) {
      return mapFn && (0, _react.isValidElement)(child) ? mapFn(child) : child;
    };
    var result = /* @__PURE__ */ Object.create(null);
    if (children)
      _react.Children.map(children, function(c2) {
        return c2;
      }).forEach(function(child) {
        result[child.key] = mapper(child);
      });
    return result;
  }
  function mergeChildMappings(prev, next) {
    prev = prev || {};
    next = next || {};
    function getValueForKey(key) {
      return key in next ? next[key] : prev[key];
    }
    var nextKeysPending = /* @__PURE__ */ Object.create(null);
    var pendingKeys = [];
    for (var prevKey in prev) {
      if (prevKey in next) {
        if (pendingKeys.length) {
          nextKeysPending[prevKey] = pendingKeys;
          pendingKeys = [];
        }
      } else {
        pendingKeys.push(prevKey);
      }
    }
    var i;
    var childMapping = {};
    for (var nextKey in next) {
      if (nextKeysPending[nextKey]) {
        for (i = 0; i < nextKeysPending[nextKey].length; i++) {
          var pendingNextKey = nextKeysPending[nextKey][i];
          childMapping[nextKeysPending[nextKey][i]] = getValueForKey(pendingNextKey);
        }
      }
      childMapping[nextKey] = getValueForKey(nextKey);
    }
    for (i = 0; i < pendingKeys.length; i++) {
      childMapping[pendingKeys[i]] = getValueForKey(pendingKeys[i]);
    }
    return childMapping;
  }
  function getProp(child, prop, props) {
    return props[prop] != null ? props[prop] : child.props[prop];
  }
  function getInitialChildMapping(props, onExited) {
    return getChildMapping(props.children, function(child) {
      return (0, _react.cloneElement)(child, {
        onExited: onExited.bind(null, child),
        in: true,
        appear: getProp(child, "appear", props),
        enter: getProp(child, "enter", props),
        exit: getProp(child, "exit", props)
      });
    });
  }
  function getNextChildMapping(nextProps, prevChildMapping, onExited) {
    var nextChildMapping = getChildMapping(nextProps.children);
    var children = mergeChildMappings(prevChildMapping, nextChildMapping);
    Object.keys(children).forEach(function(key) {
      var child = children[key];
      if (!(0, _react.isValidElement)(child))
        return;
      var hasPrev = key in prevChildMapping;
      var hasNext = key in nextChildMapping;
      var prevChild = prevChildMapping[key];
      var isLeaving = (0, _react.isValidElement)(prevChild) && !prevChild.props.in;
      if (hasNext && (!hasPrev || isLeaving)) {
        children[key] = (0, _react.cloneElement)(child, {
          onExited: onExited.bind(null, child),
          in: true,
          exit: getProp(child, "exit", nextProps),
          enter: getProp(child, "enter", nextProps)
        });
      } else if (!hasNext && hasPrev && !isLeaving) {
        children[key] = (0, _react.cloneElement)(child, {
          in: false
        });
      } else if (hasNext && hasPrev && (0, _react.isValidElement)(prevChild)) {
        children[key] = (0, _react.cloneElement)(child, {
          onExited: onExited.bind(null, child),
          in: prevChild.props.in,
          exit: getProp(child, "exit", nextProps),
          enter: getProp(child, "enter", nextProps)
        });
      }
    });
    return children;
  }
  (function(module, exports) {
    exports.__esModule = true;
    exports.default = void 0;
    var _propTypes = _interopRequireDefault2(propTypesExports);
    var _react2 = _interopRequireDefault2(React);
    var _reactLifecyclesCompat2 = require$$2;
    var _ChildMapping = ChildMapping;
    function _interopRequireDefault2(obj2) {
      return obj2 && obj2.__esModule ? obj2 : { default: obj2 };
    }
    function _objectWithoutPropertiesLoose2(source, excluded) {
      if (source == null)
        return {};
      var target = {};
      var sourceKeys = Object.keys(source);
      var key, i;
      for (i = 0; i < sourceKeys.length; i++) {
        key = sourceKeys[i];
        if (excluded.indexOf(key) >= 0)
          continue;
        target[key] = source[key];
      }
      return target;
    }
    function _extends2() {
      _extends2 = Object.assign || function(target) {
        for (var i = 1; i < arguments.length; i++) {
          var source = arguments[i];
          for (var key in source) {
            if (Object.prototype.hasOwnProperty.call(source, key)) {
              target[key] = source[key];
            }
          }
        }
        return target;
      };
      return _extends2.apply(this, arguments);
    }
    function _inheritsLoose2(subClass, superClass) {
      subClass.prototype = Object.create(superClass.prototype);
      subClass.prototype.constructor = subClass;
      subClass.__proto__ = superClass;
    }
    function _assertThisInitialized(self2) {
      if (self2 === void 0) {
        throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
      }
      return self2;
    }
    var values2 = Object.values || function(obj2) {
      return Object.keys(obj2).map(function(k2) {
        return obj2[k2];
      });
    };
    var defaultProps = {
      component: "div",
      childFactory: function childFactory(child) {
        return child;
      }
      /**
       * The `<TransitionGroup>` component manages a set of transition components
       * (`<Transition>` and `<CSSTransition>`) in a list. Like with the transition
       * components, `<TransitionGroup>` is a state machine for managing the mounting
       * and unmounting of components over time.
       *
       * Consider the example below. As items are removed or added to the TodoList the
       * `in` prop is toggled automatically by the `<TransitionGroup>`.
       *
       * Note that `<TransitionGroup>`  does not define any animation behavior!
       * Exactly _how_ a list item animates is up to the individual transition
       * component. This means you can mix and match animations across different list
       * items.
       */
    };
    var TransitionGroup2 = /* @__PURE__ */ function(_React$Component) {
      _inheritsLoose2(TransitionGroup3, _React$Component);
      function TransitionGroup3(props, context) {
        var _this2;
        _this2 = _React$Component.call(this, props, context) || this;
        var handleExited = _this2.handleExited.bind(_assertThisInitialized(_assertThisInitialized(_this2)));
        _this2.state = {
          handleExited,
          firstRender: true
        };
        return _this2;
      }
      var _proto = TransitionGroup3.prototype;
      _proto.getChildContext = function getChildContext() {
        return {
          transitionGroup: {
            isMounting: !this.appeared
          }
        };
      };
      _proto.componentDidMount = function componentDidMount() {
        this.appeared = true;
        this.mounted = true;
      };
      _proto.componentWillUnmount = function componentWillUnmount() {
        this.mounted = false;
      };
      TransitionGroup3.getDerivedStateFromProps = function getDerivedStateFromProps(nextProps, _ref) {
        var prevChildMapping = _ref.children, handleExited = _ref.handleExited, firstRender = _ref.firstRender;
        return {
          children: firstRender ? (0, _ChildMapping.getInitialChildMapping)(nextProps, handleExited) : (0, _ChildMapping.getNextChildMapping)(nextProps, prevChildMapping, handleExited),
          firstRender: false
        };
      };
      _proto.handleExited = function handleExited(child, node) {
        var currentChildMapping = (0, _ChildMapping.getChildMapping)(this.props.children);
        if (child.key in currentChildMapping)
          return;
        if (child.props.onExited) {
          child.props.onExited(node);
        }
        if (this.mounted) {
          this.setState(function(state) {
            var children = _extends2({}, state.children);
            delete children[child.key];
            return {
              children
            };
          });
        }
      };
      _proto.render = function render2() {
        var _this$props = this.props, Component2 = _this$props.component, childFactory = _this$props.childFactory, props = _objectWithoutPropertiesLoose2(_this$props, ["component", "childFactory"]);
        var children = values2(this.state.children).map(childFactory);
        delete props.appear;
        delete props.enter;
        delete props.exit;
        if (Component2 === null) {
          return children;
        }
        return _react2.default.createElement(Component2, props, children);
      };
      return TransitionGroup3;
    }(_react2.default.Component);
    TransitionGroup2.childContextTypes = {
      transitionGroup: _propTypes.default.object.isRequired
    };
    TransitionGroup2.propTypes = {};
    TransitionGroup2.defaultProps = defaultProps;
    var _default2 = (0, _reactLifecyclesCompat2.polyfill)(TransitionGroup2);
    exports.default = _default2;
    module.exports = exports["default"];
  })(TransitionGroup, TransitionGroup.exports);
  var TransitionGroupExports = TransitionGroup.exports;
  (function(module, exports) {
    exports.__esModule = true;
    exports.default = void 0;
    _interopRequireDefault2(propTypesExports);
    var _react2 = _interopRequireDefault2(React);
    var _reactDom2 = ReactDOM;
    var _TransitionGroup2 = _interopRequireDefault2(TransitionGroupExports);
    function _interopRequireDefault2(obj2) {
      return obj2 && obj2.__esModule ? obj2 : { default: obj2 };
    }
    function _objectWithoutPropertiesLoose2(source, excluded) {
      if (source == null)
        return {};
      var target = {};
      var sourceKeys = Object.keys(source);
      var key, i;
      for (i = 0; i < sourceKeys.length; i++) {
        key = sourceKeys[i];
        if (excluded.indexOf(key) >= 0)
          continue;
        target[key] = source[key];
      }
      return target;
    }
    function _inheritsLoose2(subClass, superClass) {
      subClass.prototype = Object.create(superClass.prototype);
      subClass.prototype.constructor = subClass;
      subClass.__proto__ = superClass;
    }
    var ReplaceTransition2 = /* @__PURE__ */ function(_React$Component) {
      _inheritsLoose2(ReplaceTransition3, _React$Component);
      function ReplaceTransition3() {
        var _this2;
        for (var _len = arguments.length, _args = new Array(_len), _key = 0; _key < _len; _key++) {
          _args[_key] = arguments[_key];
        }
        _this2 = _React$Component.call.apply(_React$Component, [this].concat(_args)) || this;
        _this2.handleEnter = function() {
          for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
            args[_key2] = arguments[_key2];
          }
          return _this2.handleLifecycle("onEnter", 0, args);
        };
        _this2.handleEntering = function() {
          for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
            args[_key3] = arguments[_key3];
          }
          return _this2.handleLifecycle("onEntering", 0, args);
        };
        _this2.handleEntered = function() {
          for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
            args[_key4] = arguments[_key4];
          }
          return _this2.handleLifecycle("onEntered", 0, args);
        };
        _this2.handleExit = function() {
          for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
            args[_key5] = arguments[_key5];
          }
          return _this2.handleLifecycle("onExit", 1, args);
        };
        _this2.handleExiting = function() {
          for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {
            args[_key6] = arguments[_key6];
          }
          return _this2.handleLifecycle("onExiting", 1, args);
        };
        _this2.handleExited = function() {
          for (var _len7 = arguments.length, args = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {
            args[_key7] = arguments[_key7];
          }
          return _this2.handleLifecycle("onExited", 1, args);
        };
        return _this2;
      }
      var _proto = ReplaceTransition3.prototype;
      _proto.handleLifecycle = function handleLifecycle(handler, idx, originalArgs) {
        var _child$props;
        var children = this.props.children;
        var child = _react2.default.Children.toArray(children)[idx];
        if (child.props[handler])
          (_child$props = child.props)[handler].apply(_child$props, originalArgs);
        if (this.props[handler])
          this.props[handler]((0, _reactDom2.findDOMNode)(this));
      };
      _proto.render = function render2() {
        var _this$props = this.props, children = _this$props.children, inProp = _this$props.in, props = _objectWithoutPropertiesLoose2(_this$props, ["children", "in"]);
        var _React$Children$toArr = _react2.default.Children.toArray(children), first = _React$Children$toArr[0], second = _React$Children$toArr[1];
        delete props.onEnter;
        delete props.onEntering;
        delete props.onEntered;
        delete props.onExit;
        delete props.onExiting;
        delete props.onExited;
        return _react2.default.createElement(_TransitionGroup2.default, props, inProp ? _react2.default.cloneElement(first, {
          key: "first",
          onEnter: this.handleEnter,
          onEntering: this.handleEntering,
          onEntered: this.handleEntered
        }) : _react2.default.cloneElement(second, {
          key: "second",
          onEnter: this.handleExit,
          onEntering: this.handleExiting,
          onEntered: this.handleExited
        }));
      };
      return ReplaceTransition3;
    }(_react2.default.Component);
    ReplaceTransition2.propTypes = {};
    var _default2 = ReplaceTransition2;
    exports.default = _default2;
    module.exports = exports["default"];
  })(ReplaceTransition, ReplaceTransition.exports);
  var ReplaceTransitionExports = ReplaceTransition.exports;
  var _CSSTransition = _interopRequireDefault$2(CSSTransitionExports);
  var _ReplaceTransition = _interopRequireDefault$2(ReplaceTransitionExports);
  var _TransitionGroup = _interopRequireDefault$2(TransitionGroupExports);
  var _Transition = _interopRequireDefault$2(Transition$1);
  function _interopRequireDefault$2(obj2) {
    return obj2 && obj2.__esModule ? obj2 : { default: obj2 };
  }
  var reactTransitionGroup = {
    Transition: _Transition.default,
    TransitionGroup: _TransitionGroup.default,
    ReplaceTransition: _ReplaceTransition.default,
    CSSTransition: _CSSTransition.default
  };
  var _class$1c, _temp$W;
  var noop$k = function noop2() {
  };
  var on = events.on, off = events.off;
  var addClass = dom.addClass, removeClass2 = dom.removeClass;
  var prefixes$1 = ["-webkit-", "-moz-", "-o-", "ms-", ""];
  function getStyleProperty$1(node, name) {
    var style = window.getComputedStyle(node);
    var ret = "";
    for (var i = 0; i < prefixes$1.length; i++) {
      ret = style.getPropertyValue(prefixes$1[i] + name);
      if (ret) {
        break;
      }
    }
    return ret;
  }
  var AnimateChild = (_temp$W = _class$1c = function(_Component) {
    _default$4(AnimateChild2, _Component);
    function AnimateChild2(props) {
      _default$7(this, AnimateChild2);
      var _this2 = _default$5(this, _Component.call(this, props));
      func.bindCtx(_this2, ["handleEnter", "handleEntering", "handleEntered", "handleExit", "handleExiting", "handleExited", "addEndListener"]);
      _this2.endListeners = {
        transitionend: [],
        animationend: []
      };
      _this2.timeoutMap = {};
      return _this2;
    }
    AnimateChild2.prototype.componentWillUnmount = function componentWillUnmount() {
      var _this3 = this;
      Object.keys(this.endListeners).forEach(function(eventName) {
        _this3.endListeners[eventName].forEach(function(listener) {
          off(_this3.node, eventName, listener);
        });
      });
      this.endListeners = {
        transitionend: [],
        animationend: []
      };
    };
    AnimateChild2.prototype.generateEndListener = function generateEndListener(node, done, eventName, id2) {
      var _this2 = this;
      return function endListener(e2) {
        if (e2 && e2.target === node) {
          if (_this2.timeoutMap[id2]) {
            clearTimeout(_this2.timeoutMap[id2]);
            delete _this2.timeoutMap[id2];
          }
          done();
          off(node, eventName, endListener);
          var listeners = _this2.endListeners[eventName];
          var index2 = listeners.indexOf(endListener);
          index2 > -1 && listeners.splice(index2, 1);
        }
      };
    };
    AnimateChild2.prototype.addEndListener = function addEndListener(node, done) {
      var _this4 = this;
      if (support.transition || support.animation) {
        var id2 = guid();
        this.node = node;
        if (support.transition) {
          var transitionEndListener = this.generateEndListener(node, done, "transitionend", id2);
          on(node, "transitionend", transitionEndListener);
          this.endListeners.transitionend.push(transitionEndListener);
        }
        if (support.animation) {
          var animationEndListener = this.generateEndListener(node, done, "animationend", id2);
          on(node, "animationend", animationEndListener);
          this.endListeners.animationend.push(animationEndListener);
        }
        setTimeout(function() {
          var transitionDelay = parseFloat(getStyleProperty$1(node, "transition-delay")) || 0;
          var transitionDuration = parseFloat(getStyleProperty$1(node, "transition-duration")) || 0;
          var animationDelay = parseFloat(getStyleProperty$1(node, "animation-delay")) || 0;
          var animationDuration = parseFloat(getStyleProperty$1(node, "animation-duration")) || 0;
          var time = Math.max(transitionDuration + transitionDelay, animationDuration + animationDelay);
          if (time) {
            _this4.timeoutMap[id2] = setTimeout(function() {
              done();
            }, time * 1e3 + 200);
          }
        }, 15);
      } else {
        done();
      }
    };
    AnimateChild2.prototype.removeEndtListener = function removeEndtListener() {
      this.transitionOff && this.transitionOff();
      this.animationOff && this.animationOff();
    };
    AnimateChild2.prototype.removeClassNames = function removeClassNames(node, names) {
      Object.keys(names).forEach(function(key) {
        removeClass2(node, names[key]);
      });
    };
    AnimateChild2.prototype.handleEnter = function handleEnter(node, isAppearing) {
      var names = this.props.names;
      if (names) {
        this.removeClassNames(node, names);
        var className = isAppearing ? "appear" : "enter";
        addClass(node, names[className]);
      }
      var hook = isAppearing ? this.props.onAppear : this.props.onEnter;
      hook(node);
    };
    AnimateChild2.prototype.handleEntering = function handleEntering(node, isAppearing) {
      var _this5 = this;
      setTimeout(function() {
        var names = _this5.props.names;
        if (names) {
          var className = isAppearing ? "appearActive" : "enterActive";
          addClass(node, names[className]);
        }
        var hook = isAppearing ? _this5.props.onAppearing : _this5.props.onEntering;
        hook(node);
      }, 10);
    };
    AnimateChild2.prototype.handleEntered = function handleEntered(node, isAppearing) {
      var names = this.props.names;
      if (names) {
        var classNames = isAppearing ? [names.appear, names.appearActive] : [names.enter, names.enterActive];
        classNames.forEach(function(className) {
          removeClass2(node, className);
        });
      }
      var hook = isAppearing ? this.props.onAppeared : this.props.onEntered;
      hook(node);
    };
    AnimateChild2.prototype.handleExit = function handleExit(node) {
      var names = this.props.names;
      if (names) {
        this.removeClassNames(node, names);
        addClass(node, names.leave);
      }
      this.props.onExit(node);
    };
    AnimateChild2.prototype.handleExiting = function handleExiting(node) {
      var _this6 = this;
      setTimeout(function() {
        var names = _this6.props.names;
        if (names) {
          addClass(node, names.leaveActive);
        }
        _this6.props.onExiting(node);
      }, 10);
    };
    AnimateChild2.prototype.handleExited = function handleExited(node) {
      var names = this.props.names;
      if (names) {
        [names.leave, names.leaveActive].forEach(function(className) {
          removeClass2(node, className);
        });
      }
      this.props.onExited(node);
    };
    AnimateChild2.prototype.render = function render2() {
      var _props = this.props;
      _props.names;
      _props.onAppear;
      _props.onAppeared;
      _props.onAppearing;
      _props.onEnter;
      _props.onEntering;
      _props.onEntered;
      _props.onExit;
      _props.onExiting;
      _props.onExited;
      var others = _default$3(_props, ["names", "onAppear", "onAppeared", "onAppearing", "onEnter", "onEntering", "onEntered", "onExit", "onExiting", "onExited"]);
      return React.createElement(reactTransitionGroup.Transition, _default$8({}, others, {
        onEnter: this.handleEnter,
        onEntering: this.handleEntering,
        onEntered: this.handleEntered,
        onExit: this.handleExit,
        onExiting: this.handleExiting,
        onExited: this.handleExited,
        addEndListener: this.addEndListener
      }));
    };
    return AnimateChild2;
  }(React.Component), _class$1c.propTypes = {
    names: PropTypes$1.oneOfType([PropTypes$1.string, PropTypes$1.object]),
    onAppear: PropTypes$1.func,
    onAppearing: PropTypes$1.func,
    onAppeared: PropTypes$1.func,
    onEnter: PropTypes$1.func,
    onEntering: PropTypes$1.func,
    onEntered: PropTypes$1.func,
    onExit: PropTypes$1.func,
    onExiting: PropTypes$1.func,
    onExited: PropTypes$1.func
  }, _class$1c.defaultProps = {
    onAppear: noop$k,
    onAppearing: noop$k,
    onAppeared: noop$k,
    onEnter: noop$k,
    onEntering: noop$k,
    onEntered: noop$k,
    onExit: noop$k,
    onExiting: noop$k,
    onExited: noop$k
  }, _temp$W);
  AnimateChild.displayName = "AnimateChild";
  var _class$1b, _temp$V;
  var noop$j = function noop3() {
  };
  var FirstChild = function FirstChild2(props) {
    var childrenArray = React.Children.toArray(props.children);
    return childrenArray[0] || null;
  };
  var Animate = (_temp$V = _class$1b = function(_Component) {
    _default$4(Animate2, _Component);
    function Animate2() {
      _default$7(this, Animate2);
      return _default$5(this, _Component.apply(this, arguments));
    }
    Animate2.prototype.normalizeNames = function normalizeNames(names) {
      if (typeof names === "string") {
        return {
          appear: names + "-appear",
          appearActive: names + "-appear-active",
          enter: names + "-enter",
          enterActive: names + "-enter-active",
          leave: names + "-leave",
          leaveActive: names + "-leave-active"
        };
      }
      if ((typeof names === "undefined" ? "undefined" : _default$6(names)) === "object") {
        return {
          appear: names.appear,
          appearActive: names.appear + "-active",
          enter: "" + names.enter,
          enterActive: names.enter + "-active",
          leave: "" + names.leave,
          leaveActive: names.leave + "-active"
        };
      }
    };
    Animate2.prototype.render = function render2() {
      var _this2 = this;
      var _props = this.props, animation2 = _props.animation, children = _props.children, animationAppear = _props.animationAppear, singleMode = _props.singleMode, component = _props.component, beforeAppear = _props.beforeAppear, onAppear = _props.onAppear, afterAppear = _props.afterAppear, beforeEnter = _props.beforeEnter, onEnter = _props.onEnter, afterEnter = _props.afterEnter, beforeLeave = _props.beforeLeave, onLeave = _props.onLeave, afterLeave = _props.afterLeave, others = _default$3(_props, ["animation", "children", "animationAppear", "singleMode", "component", "beforeAppear", "onAppear", "afterAppear", "beforeEnter", "onEnter", "afterEnter", "beforeLeave", "onLeave", "afterLeave"]);
      var animateChildren = React.Children.map(children, function(child) {
        return React.createElement(
          AnimateChild,
          {
            key: child.key,
            names: _this2.normalizeNames(animation2),
            onAppear: beforeAppear,
            onAppearing: onAppear,
            onAppeared: afterAppear,
            onEnter: beforeEnter,
            onEntering: onEnter,
            onEntered: afterEnter,
            onExit: beforeLeave,
            onExiting: onLeave,
            onExited: afterLeave
          },
          child
        );
      });
      return React.createElement(
        reactTransitionGroup.TransitionGroup,
        _default$8({ appear: animationAppear, component: singleMode ? FirstChild : component }, others),
        animateChildren
      );
    };
    return Animate2;
  }(React.Component), _class$1b.propTypes = {
    /**
     * 动画 className
     */
    animation: PropTypes$1.oneOfType([PropTypes$1.string, PropTypes$1.object]),
    /**
     * 子元素第一次挂载时是否执行动画
     */
    animationAppear: PropTypes$1.bool,
    /**
     * 包裹子元素的标签
     */
    component: PropTypes$1.any,
    /**
     * 是否只有单个子元素,如果有多个子元素,请设置为 false
     */
    singleMode: PropTypes$1.bool,
    /**
     * 子元素
     */
    children: PropTypes$1.oneOfType([PropTypes$1.element, PropTypes$1.arrayOf(PropTypes$1.element)]),
    /**
     * 执行第一次挂载动画前触发的回调函数
     * @param {HTMLElement} node 执行动画的 dom 元素
     */
    beforeAppear: PropTypes$1.func,
    /**
     * 执行第一次挂载动画,添加 xxx-appear-active 类名后触发的回调函数
     *  @param {HTMLElement} node 执行动画的 dom 元素
     */
    onAppear: PropTypes$1.func,
    /**
     * 执行完第一次挂载动画后触发的函数
     * @param {HTMLElement} node 执行动画的 dom 元素
     */
    afterAppear: PropTypes$1.func,
    /**
     * 执行进场动画前触发的回调函数
     * @param {HTMLElement} node 执行动画的 dom 元素
     */
    beforeEnter: PropTypes$1.func,
    /**
     * 执行进场动画,添加 xxx-enter-active 类名后触发的回调函数
     * @param {HTMLElement} node 执行动画的 dom 元素
     */
    onEnter: PropTypes$1.func,
    /**
     * 执行完进场动画后触发的回调函数
     * @param {HTMLElement} node 执行动画的 dom 元素
     */
    afterEnter: PropTypes$1.func,
    /**
     * 执行离场动画前触发的回调函数
     * @param {HTMLElement} node 执行动画的 dom 元素
     */
    beforeLeave: PropTypes$1.func,
    /**
     * 执行离场动画,添加 xxx-leave-active 类名后触发的回调函数
     * @param {HTMLElement} node 执行动画的 dom 元素
     */
    onLeave: PropTypes$1.func,
    /**
     * 执行完离场动画后触发的回调函数
     * @param {HTMLElement} node 执行动画的 dom 元素
     */
    afterLeave: PropTypes$1.func
  }, _class$1b.defaultProps = {
    animationAppear: true,
    component: "div",
    singleMode: true,
    beforeAppear: noop$j,
    onAppear: noop$j,
    afterAppear: noop$j,
    beforeEnter: noop$j,
    onEnter: noop$j,
    afterEnter: noop$j,
    beforeLeave: noop$j,
    onLeave: noop$j,
    afterLeave: noop$j
  }, _temp$V);
  Animate.displayName = "Animate";
  const Animate$1 = Animate;
  var _class$1a, _temp$U;
  var noop$i = function noop4() {
  };
  var getStyle$4 = dom.getStyle;
  var Expand$1 = (_temp$U = _class$1a = function(_Component) {
    _default$4(Expand2, _Component);
    function Expand2(props) {
      _default$7(this, Expand2);
      var _this2 = _default$5(this, _Component.call(this, props));
      func.bindCtx(_this2, ["beforeEnter", "onEnter", "afterEnter", "beforeLeave", "onLeave", "afterLeave"]);
      return _this2;
    }
    Expand2.prototype.beforeEnter = function beforeEnter(node) {
      if (this.leaving) {
        this.afterLeave(node);
      }
      this.cacheCurrentStyle(node);
      this.cacheComputedStyle(node);
      this.setCurrentStyleToZero(node);
      this.props.beforeEnter(node);
    };
    Expand2.prototype.onEnter = function onEnter(node) {
      this.setCurrentStyleToComputedStyle(node);
      this.props.onEnter(node);
    };
    Expand2.prototype.afterEnter = function afterEnter(node) {
      this.restoreCurrentStyle(node);
      this.props.afterEnter(node);
    };
    Expand2.prototype.beforeLeave = function beforeLeave(node) {
      this.leaving = true;
      this.cacheCurrentStyle(node);
      this.cacheComputedStyle(node);
      this.setCurrentStyleToComputedStyle(node);
      this.props.beforeLeave(node);
    };
    Expand2.prototype.onLeave = function onLeave(node) {
      this.setCurrentStyleToZero(node);
      this.props.onLeave(node);
    };
    Expand2.prototype.afterLeave = function afterLeave(node) {
      this.leaving = false;
      this.restoreCurrentStyle(node);
      this.props.afterLeave(node);
    };
    Expand2.prototype.cacheCurrentStyle = function cacheCurrentStyle(node) {
      this.styleBorderTopWidth = node.style.borderTopWidth;
      this.stylePaddingTop = node.style.paddingTop;
      this.styleHeight = node.style.height;
      this.stylePaddingBottom = node.style.paddingBottom;
      this.styleBorderBottomWidth = node.style.borderBottomWidth;
    };
    Expand2.prototype.cacheComputedStyle = function cacheComputedStyle(node) {
      this.borderTopWidth = getStyle$4(node, "borderTopWidth");
      this.paddingTop = getStyle$4(node, "paddingTop");
      this.height = node.offsetHeight;
      this.paddingBottom = getStyle$4(node, "paddingBottom");
      this.borderBottomWidth = getStyle$4(node, "borderBottomWidth");
    };
    Expand2.prototype.setCurrentStyleToZero = function setCurrentStyleToZero(node) {
      node.style.borderTopWidth = "0px";
      node.style.paddingTop = "0px";
      node.style.height = "0px";
      node.style.paddingBottom = "0px";
      node.style.borderBottomWidth = "0px";
    };
    Expand2.prototype.setCurrentStyleToComputedStyle = function setCurrentStyleToComputedStyle(node) {
      node.style.borderTopWidth = this.borderTopWidth + "px";
      node.style.paddingTop = this.paddingTop + "px";
      node.style.height = this.height + "px";
      node.style.paddingBottom = this.paddingBottom + "px";
      node.style.borderBottomWidth = this.borderBottomWidth + "px";
    };
    Expand2.prototype.restoreCurrentStyle = function restoreCurrentStyle(node) {
      node.style.borderTopWidth = this.styleBorderTopWidth;
      node.style.paddingTop = this.stylePaddingTop;
      node.style.height = this.styleHeight;
      node.style.paddingBottom = this.stylePaddingBottom;
      node.style.borderBottomWidth = this.styleBorderBottomWidth;
    };
    Expand2.prototype.render = function render2() {
      var _props = this.props, animation2 = _props.animation, others = _default$3(_props, ["animation"]);
      var newAnimation = animation2 || "expand";
      return React.createElement(Animate$1, _default$8({}, others, {
        animation: newAnimation,
        beforeEnter: this.beforeEnter,
        onEnter: this.onEnter,
        afterEnter: this.afterEnter,
        beforeLeave: this.beforeLeave,
        onLeave: this.onLeave,
        afterLeave: this.afterLeave
      }));
    };
    return Expand2;
  }(React.Component), _class$1a.propTypes = {
    animation: PropTypes$1.oneOfType([PropTypes$1.string, PropTypes$1.object]),
    beforeEnter: PropTypes$1.func,
    onEnter: PropTypes$1.func,
    afterEnter: PropTypes$1.func,
    beforeLeave: PropTypes$1.func,
    onLeave: PropTypes$1.func,
    afterLeave: PropTypes$1.func
  }, _class$1a.defaultProps = {
    beforeEnter: noop$i,
    onEnter: noop$i,
    afterEnter: noop$i,
    beforeLeave: noop$i,
    onLeave: noop$i,
    afterLeave: noop$i
  }, _temp$U);
  Expand$1.displayName = "Expand";
  var OverlayAnimate = function OverlayAnimate2(props) {
    var animation2 = props.animation, visible = props.visible, children = props.children, _props$timeout = props.timeout, timeout = _props$timeout === void 0 ? 300 : _props$timeout, style = props.style, mountOnEnter = props.mountOnEnter, unmountOnExit = props.unmountOnExit, appear = props.appear, enter = props.enter, exit = props.exit, onEnter = props.onEnter, onEntering = props.onEntering, onEntered = props.onEntered, onExit = props.onExit, onExiting = props.onExiting, onExited = props.onExited, others = _default$3(props, ["animation", "visible", "children", "timeout", "style", "mountOnEnter", "unmountOnExit", "appear", "enter", "exit", "onEnter", "onEntering", "onEntered", "onExit", "onExiting", "onExited"]);
    var animateProps = {
      mountOnEnter,
      unmountOnExit,
      appear,
      enter,
      exit,
      onEnter,
      onEntering,
      onEntered,
      onExit,
      onExiting,
      onExited
    };
    Object.keys(animateProps).forEach(function(k2) {
      if (!(k2 in props) || typeof props[k2] === "undefined") {
        delete animateProps[k2];
      }
    });
    var animationMap = typeof animation2 === "string" ? { in: animation2, out: animation2 } : animation2;
    var animateClsMap = animation2 ? {
      entering: animationMap.in,
      exiting: animationMap.out
    } : {};
    if (animation2 === false) {
      animateClsMap.entering = "";
      animateClsMap.exiting = "";
    }
    return React.createElement(
      reactTransitionGroup.Transition,
      _default$8({}, animateProps, { "in": visible, timeout: animation2 ? timeout : 0, appear: true }),
      function(state) {
        var _classNames;
        var cls = classnames((_classNames = {}, _classNames[children.props.className] = !!children.props.className, _classNames[animateClsMap[state]] = state in animateClsMap && animateClsMap[state], _classNames));
        var childProps = _default$8({}, others, {
          className: cls
        });
        if (style && children.props && children.props.style) {
          childProps.style = _default$8({}, children.props.style, style);
        }
        return React.cloneElement(children, childProps);
      }
    );
  };
  const OverlayAnimate$1 = OverlayAnimate;
  Animate$1.Expand = Expand$1;
  Animate$1.OverlayAnimate = OverlayAnimate$1;
  var overlayManager = {
    allOverlays: [],
    addOverlay: function addOverlay(overlay) {
      this.removeOverlay(overlay);
      this.allOverlays.unshift(overlay);
    },
    isCurrentOverlay: function isCurrentOverlay(overlay) {
      return overlay && this.allOverlays[0] === overlay;
    },
    removeOverlay: function removeOverlay(overlay) {
      var i = this.allOverlays.indexOf(overlay);
      if (i > -1) {
        this.allOverlays.splice(i, 1);
      }
    }
  };
  const overlayManager$1 = overlayManager;
  function findNode(target, param) {
    if (!target) {
      return null;
    }
    if (typeof target === "string") {
      return document.getElementById(target);
    }
    if (typeof target === "function") {
      try {
        target = target(param);
      } catch (err) {
        target = null;
      }
    }
    if (!target) {
      return null;
    }
    try {
      return ReactDOM.findDOMNode(target);
    } catch (err) {
      return target;
    }
  }
  var _class$19, _temp$T;
  var makeChain$8 = func.makeChain;
  var getContainerNode$1 = function getContainerNode(props) {
    var targetNode = findNode(props.target);
    return findNode(props.container, targetNode);
  };
  var Gateway = (_temp$T = _class$19 = function(_Component) {
    _default$4(Gateway2, _Component);
    function Gateway2(props) {
      _default$7(this, Gateway2);
      var _this2 = _default$5(this, _Component.call(this, props));
      _this2.updateContainer = function() {
        var containerNode = getContainerNode$1(_this2.props);
        if (containerNode !== _this2.state.containerNode) {
          _this2.setState({
            containerNode
          });
        }
      };
      _this2.saveChildRef = function(ref) {
        _this2.child = ref;
      };
      _this2.state = {
        containerNode: null
      };
      return _this2;
    }
    Gateway2.prototype.componentDidMount = function componentDidMount() {
      this.updateContainer();
    };
    Gateway2.prototype.componentDidUpdate = function componentDidUpdate() {
      this.updateContainer();
    };
    Gateway2.prototype.getChildNode = function getChildNode() {
      try {
        return ReactDOM.findDOMNode(this.child);
      } catch (err) {
        return null;
      }
    };
    Gateway2.prototype.render = function render2() {
      var containerNode = this.state.containerNode;
      if (!containerNode) {
        return null;
      }
      var children = this.props.children;
      var child = children ? React.Children.only(children) : null;
      if (!child) {
        return null;
      }
      if (typeof child.ref === "string") {
        throw new Error("Can not set ref by string in Gateway, use function instead.");
      }
      child = React.cloneElement(child, {
        ref: makeChain$8(this.saveChildRef, child.ref)
      });
      return ReactDOM.createPortal(child, containerNode);
    };
    return Gateway2;
  }(React.Component), _class$19.propTypes = {
    children: PropTypes$1.node,
    container: PropTypes$1.any,
    target: PropTypes$1.any
  }, _class$19.defaultProps = {
    container: function container2() {
      return document.body;
    }
  }, _temp$T);
  Gateway.displayName = "Gateway";
  const Gateway$1 = polyfill(Gateway);
  var _class$18, _temp$S, _initialiseProps$2;
  var VIEWPORT = "viewport";
  var getPageX = function getPageX2() {
    return window.pageXOffset || document.documentElement.scrollLeft;
  };
  var getPageY = function getPageY2() {
    return window.pageYOffset || document.documentElement.scrollTop;
  };
  function _getSize(element) {
    if ("offsetWidth" in element && "offsetHeight" in element) {
      return {
        width: element.offsetWidth,
        height: element.offsetHeight
      };
    } else {
      var _element$getBoundingC = element.getBoundingClientRect(), width = _element$getBoundingC.width, height = _element$getBoundingC.height;
      return {
        width,
        height
      };
    }
  }
  function _getElementRect(elem, container4) {
    var offsetTop = 0, offsetLeft = 0, scrollTop = 0, scrollLeft = 0;
    var _getSize2 = _getSize(elem), width = _getSize2.width, height = _getSize2.height;
    do {
      if (!isNaN(elem.offsetTop)) {
        offsetTop += elem.offsetTop;
      }
      if (!isNaN(elem.offsetLeft)) {
        offsetLeft += elem.offsetLeft;
      }
      if (elem && elem.offsetParent) {
        if (!isNaN(elem.offsetParent.scrollLeft) && elem.offsetParent !== document.body) {
          scrollLeft += elem.offsetParent.scrollLeft;
        }
        if (!isNaN(elem.offsetParent.scrollTop) && elem.offsetParent !== document.body) {
          scrollTop += elem.offsetParent.scrollTop;
        }
      }
      elem = elem.offsetParent;
    } while (elem !== null && elem !== container4);
    var treatAsWindow = !container4 || container4 === document.body;
    return {
      top: offsetTop - scrollTop - (treatAsWindow ? document.documentElement.scrollTop || document.body.scrollTop : 0),
      left: offsetLeft - scrollLeft - (treatAsWindow ? document.documentElement.scrollLeft || document.body.scrollLeft : 0),
      width,
      height
    };
  }
  function _getViewportSize(container4) {
    if (!container4 || container4 === document.body) {
      return {
        width: document.documentElement.clientWidth,
        height: document.documentElement.clientHeight
      };
    }
    var _container$getBoundin = container4.getBoundingClientRect(), width = _container$getBoundin.width, height = _container$getBoundin.height;
    return {
      width,
      height
    };
  }
  var getContainer = function getContainer2(_ref) {
    var container4 = _ref.container, baseElement = _ref.baseElement;
    if (typeof document === "undefined") {
      return container4;
    }
    var calcContainer = findNode(container4, baseElement);
    if (!calcContainer) {
      calcContainer = document.body;
    }
    while (dom.getStyle(calcContainer, "position") === "static") {
      if (!calcContainer || calcContainer === document.body) {
        return document.body;
      }
      calcContainer = calcContainer.parentNode;
    }
    return calcContainer;
  };
  var Position$1 = (_temp$S = _class$18 = function() {
    function Position2(props) {
      _default$7(this, Position2);
      _initialiseProps$2.call(this);
      this.pinElement = props.pinElement;
      this.baseElement = props.baseElement;
      this.pinFollowBaseElementWhenFixed = props.pinFollowBaseElementWhenFixed;
      this.container = getContainer(props);
      this.autoFit = props.autoFit || false;
      this.align = props.align || "tl tl";
      this.offset = props.offset || [0, 0];
      this.needAdjust = props.needAdjust || false;
      this.isRtl = props.isRtl || false;
    }
    Position2.prototype.setPosition = function setPosition() {
      var pinElement = this.pinElement;
      var baseElement = this.baseElement;
      var pinFollowBaseElementWhenFixed = this.pinFollowBaseElementWhenFixed;
      var expectedAlign = this._getExpectedAlign();
      var isPinFixed = void 0, isBaseFixed = void 0, firstPositionResult = void 0;
      if (pinElement === VIEWPORT) {
        return;
      }
      if (dom.getStyle(pinElement, "position") !== "fixed") {
        dom.setStyle(pinElement, "position", "absolute");
        isPinFixed = false;
      } else {
        isPinFixed = true;
      }
      if (baseElement === VIEWPORT || dom.getStyle(baseElement, "position") !== "fixed") {
        isBaseFixed = false;
      } else {
        isBaseFixed = true;
      }
      for (var i = 0; i < expectedAlign.length; i++) {
        var align = expectedAlign[i];
        var pinElementPoints = this._normalizePosition(pinElement, align.split(" ")[0], isPinFixed);
        var baseElementPoints = this._normalizePosition(
          baseElement,
          align.split(" ")[1],
          // 忽略元素位置,发生在类似dialog的场景下
          isPinFixed && !pinFollowBaseElementWhenFixed
        );
        var pinElementParentOffset = this._getParentOffset(pinElement);
        var pinElementParentScrollOffset = this._getParentScrollOffset(pinElement);
        var baseElementOffset = isPinFixed && isBaseFixed ? this._getLeftTop(baseElement) : (
          // 在 pin 是 fixed 布局,并且又需要根据 base 计算位置时,计算 base 的 offset 需要忽略页面滚动
          baseElementPoints.offset(isPinFixed && pinFollowBaseElementWhenFixed)
        );
        var top = baseElementOffset.top + baseElementPoints.y - pinElementParentOffset.top - pinElementPoints.y + pinElementParentScrollOffset.top;
        var left = baseElementOffset.left + baseElementPoints.x - pinElementParentOffset.left - pinElementPoints.x + pinElementParentScrollOffset.left;
        this._setPinElementPostion(pinElement, { left, top }, this.offset);
        if (this._isInViewport(pinElement, align)) {
          return align;
        } else if (!firstPositionResult) {
          if (this.needAdjust && !this.autoFit) {
            var _getViewportOffset2 = this._getViewportOffset(pinElement, align), right = _getViewportOffset2.right;
            firstPositionResult = {
              left: right < 0 ? left + right : left,
              top
            };
          } else {
            firstPositionResult = { left, top };
          }
        }
      }
      var inViewportLeft = this._makeElementInViewport(pinElement, firstPositionResult.left, "Left", isPinFixed);
      var inViewportTop = this._makeElementInViewport(pinElement, firstPositionResult.top, "Top", isPinFixed);
      this._setPinElementPostion(pinElement, { left: inViewportLeft, top: inViewportTop }, this._calPinOffset(expectedAlign[0]));
      return expectedAlign[0];
    };
    Position2.prototype._getParentOffset = function _getParentOffset(element) {
      var parent = element.offsetParent || document.documentElement;
      var offset = void 0;
      if (parent === document.body && dom.getStyle(parent, "position") === "static") {
        offset = {
          top: 0,
          left: 0
        };
      } else {
        offset = this._getElementOffset(parent);
      }
      offset.top += parseFloat(dom.getStyle(parent, "border-top-width"), 10);
      offset.left += parseFloat(dom.getStyle(parent, "border-left-width"), 10);
      offset.offsetParent = parent;
      return offset;
    };
    Position2.prototype._makeElementInViewport = function _makeElementInViewport(pinElement, number, type2, isPinFixed) {
      var result = number;
      var docElement = document.documentElement;
      var offsetParent = pinElement.offsetParent || document.documentElement;
      if (result < 0) {
        if (isPinFixed) {
          result = 0;
        } else if (offsetParent === document.body && dom.getStyle(offsetParent, "position") === "static") {
          result = Math.max(docElement["scroll" + type2], document.body["scroll" + type2]);
        }
      }
      return result;
    };
    Position2.prototype._normalizePosition = function _normalizePosition(element, align, ignoreElementOffset) {
      var points = this._normalizeElement(element, ignoreElementOffset);
      this._normalizeXY(points, align);
      return points;
    };
    Position2.prototype._normalizeXY = function _normalizeXY(points, align) {
      var x2 = align.split("")[1];
      var y2 = align.split("")[0];
      points.x = this._xyConverter(x2, points, "width");
      points.y = this._xyConverter(y2, points, "height");
      return points;
    };
    Position2.prototype._xyConverter = function _xyConverter(align, points, type2) {
      var res = align.replace(/t|l/gi, "0%").replace(/c/gi, "50%").replace(/b|r/gi, "100%").replace(/(\d+)%/gi, function(m2, d2) {
        return points.size()[type2] * (d2 / 100);
      });
      return parseFloat(res, 10) || 0;
    };
    Position2.prototype._getLeftTop = function _getLeftTop(element) {
      return {
        left: parseFloat(dom.getStyle(element, "left")) || 0,
        top: parseFloat(dom.getStyle(element, "top")) || 0
      };
    };
    Position2.prototype._normalizeElement = function _normalizeElement(element, ignoreElementOffset) {
      var _this2 = this;
      var result = {
        element,
        x: 0,
        y: 0
      }, isViewport = element === VIEWPORT, docElement = document.documentElement;
      result.offset = function(ignoreScroll) {
        if (ignoreElementOffset) {
          return {
            left: 0,
            top: 0
          };
        } else if (isViewport) {
          return {
            left: getPageX(),
            top: getPageY()
          };
        } else {
          return _this2._getElementOffset(element, ignoreScroll);
        }
      };
      result.size = function() {
        if (isViewport) {
          return {
            width: docElement.clientWidth,
            height: docElement.clientHeight
          };
        } else {
          return _getSize(element);
        }
      };
      return result;
    };
    Position2.prototype._getElementOffset = function _getElementOffset(element, ignoreScroll) {
      var rect = element.getBoundingClientRect();
      var docElement = document.documentElement;
      var body = document.body;
      var docClientLeft = docElement.clientLeft || body.clientLeft || 0;
      var docClientTop = docElement.clientTop || body.clientTop || 0;
      return {
        left: rect.left + (ignoreScroll ? 0 : getPageX()) - docClientLeft,
        top: rect.top + (ignoreScroll ? 0 : getPageY()) - docClientTop
      };
    };
    Position2.prototype._getExpectedAlign = function _getExpectedAlign() {
      var align = this.isRtl ? this._replaceAlignDir(this.align, /l|r/g, { l: "r", r: "l" }) : this.align;
      var expectedAlign = [align];
      if (this.needAdjust) {
        if (/t|b/g.test(align)) {
          expectedAlign.push(this._replaceAlignDir(align, /t|b/g, { t: "b", b: "t" }));
        }
        if (/l|r/g.test(align)) {
          expectedAlign.push(this._replaceAlignDir(align, /l|r/g, { l: "r", r: "l" }));
        }
        if (/c/g.test(align)) {
          expectedAlign.push(this._replaceAlignDir(align, /c(?= |$)/g, { c: "l" }));
          expectedAlign.push(this._replaceAlignDir(align, /c(?= |$)/g, { c: "r" }));
        }
        expectedAlign.push(this._replaceAlignDir(align, /l|r|t|b/g, {
          l: "r",
          r: "l",
          t: "b",
          b: "t"
        }));
      }
      return expectedAlign;
    };
    Position2.prototype._replaceAlignDir = function _replaceAlignDir(align, regExp, map) {
      return align.replace(regExp, function(res) {
        return map[res];
      });
    };
    Position2.prototype._isRightAligned = function _isRightAligned(align) {
      var _align$split = align.split(" "), pinAlign = _align$split[0], baseAlign = _align$split[1];
      return pinAlign[1] === "r" && pinAlign[1] === baseAlign[1];
    };
    Position2.prototype._isBottomAligned = function _isBottomAligned(align) {
      var _align$split2 = align.split(" "), pinAlign = _align$split2[0], baseAlign = _align$split2[1];
      return pinAlign[0] === "b" && pinAlign[0] === baseAlign[0];
    };
    Position2.prototype._isInViewport = function _isInViewport(element, align) {
      var viewportSize = _getViewportSize(this.container);
      var elementRect = _getElementRect(element, this.container);
      var elementSize = _getSize(element);
      var viewportWidth = this._isRightAligned(align) ? viewportSize.width : viewportSize.width - 1;
      var viewportHeight = this._isBottomAligned(align) ? viewportSize.height : viewportSize.height - 1;
      if (this.autoFit) {
        return elementRect.top >= 0 && elementRect.top + element.offsetHeight <= viewportHeight;
      }
      return elementRect.left >= 0 && elementRect.left + elementSize.width <= viewportWidth && elementRect.top >= 0 && elementRect.top + elementSize.height <= viewportHeight;
    };
    Position2.prototype._getViewportOffset = function _getViewportOffset(element, align) {
      var viewportSize = _getViewportSize(this.container);
      var elementRect = _getElementRect(element, this.container);
      var elementSize = _getSize(element);
      var viewportWidth = this._isRightAligned(align) ? viewportSize.width : viewportSize.width - 1;
      var viewportHeight = this._isBottomAligned(align) ? viewportSize.height : viewportSize.height - 1;
      return {
        top: elementRect.top,
        right: viewportWidth - (elementRect.left + elementSize.width),
        bottom: viewportHeight - (elementRect.top + elementSize.height),
        left: elementRect.left
      };
    };
    Position2.prototype._setPinElementPostion = function _setPinElementPostion(pinElement, postion) {
      var offset = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : [0, 0];
      var top = postion.top, left = postion.left;
      if (!this.isRtl) {
        dom.setStyle(pinElement, {
          left: left + offset[0] + "px",
          top: top + offset[1] + "px"
        });
        return;
      }
      var pinElementParentOffset = this._getParentOffset(pinElement);
      var _getElementRect2 = _getElementRect(pinElementParentOffset.offsetParent), offsetParentWidth = _getElementRect2.width;
      var _getElementRect3 = _getElementRect(pinElement), width = _getElementRect3.width;
      var right = offsetParentWidth - (left + width);
      dom.setStyle(pinElement, {
        left: "auto",
        right: right + offset[0] + "px",
        top: top + offset[1] + "px"
      });
    };
    return Position2;
  }(), _class$18.VIEWPORT = VIEWPORT, _class$18.place = function(props) {
    return new Position$1(props).setPosition();
  }, _initialiseProps$2 = function _initialiseProps() {
    var _this2 = this;
    this._calPinOffset = function(align) {
      var offset = [].concat(_this2.offset);
      if (_this2.autoFit && align && _this2.container && _this2.container !== document.body) {
        var baseElementRect = _getElementRect(_this2.baseElement, _this2.container);
        var pinElementRect = _getElementRect(_this2.pinElement, _this2.container);
        var viewportSize = _getViewportSize(_this2.container);
        var pinAlign = align.split(" ")[0];
        pinAlign.charAt(1);
        var y2 = pinAlign.charAt(0);
        if (pinElementRect.top < 0 || pinElementRect.top + pinElementRect.height > viewportSize.height) {
          offset[1] = -baseElementRect.top - (y2 === "t" ? baseElementRect.height : 0);
        }
      }
      return offset;
    };
    this._getParentScrollOffset = function(elem) {
      var top = 0;
      var left = 0;
      if (elem && elem.offsetParent && elem.offsetParent !== document.body) {
        if (!isNaN(elem.offsetParent.scrollTop)) {
          top += elem.offsetParent.scrollTop;
        }
        if (!isNaN(elem.offsetParent.scrollLeft)) {
          left += elem.offsetParent.scrollLeft;
        }
      }
      return {
        top,
        left
      };
    };
  }, _temp$S);
  var _class$17, _temp$R;
  var noop$h = func.noop, bindCtx$a = func.bindCtx;
  var getStyle$3 = dom.getStyle;
  var place = Position$1.place;
  var Position = (_temp$R = _class$17 = function(_Component) {
    _default$4(Position2, _Component);
    function Position2(props) {
      _default$7(this, Position2);
      var _this2 = _default$5(this, _Component.call(this, props));
      _this2.observe = function() {
        var contentNode = _this2.getContentNode();
        contentNode && _this2.resizeObserver.observe(contentNode);
      };
      _this2.unobserve = function() {
        _this2.resizeObserver.disconnect();
      };
      bindCtx$a(_this2, ["handleResize"]);
      _this2.resizeObserver = new index$2(_this2.handleResize);
      return _this2;
    }
    Position2.prototype.componentDidMount = function componentDidMount() {
      this.setPosition();
      if (this.props.needListenResize) {
        events.on(window, "resize", this.handleResize);
        this.observe();
      }
    };
    Position2.prototype.componentDidUpdate = function componentDidUpdate(prevProps) {
      var props = this.props;
      if ("align" in props && props.align !== prevProps.align || props.shouldUpdatePosition) {
        this.shouldUpdatePosition = true;
      }
      if (this.shouldUpdatePosition) {
        clearTimeout(this.resizeTimeout);
        this.setPosition();
        this.shouldUpdatePosition = false;
      }
    };
    Position2.prototype.componentWillUnmount = function componentWillUnmount() {
      if (this.props.needListenResize) {
        events.off(window, "resize", this.handleResize);
        this.unobserve();
      }
      clearTimeout(this.resizeTimeout);
    };
    Position2.prototype.setPosition = function setPosition() {
      var _props = this.props, align = _props.align, offset = _props.offset, beforePosition = _props.beforePosition, onPosition = _props.onPosition, needAdjust = _props.needAdjust, container4 = _props.container, rtl = _props.rtl, pinFollowBaseElementWhenFixed = _props.pinFollowBaseElementWhenFixed, autoFit = _props.autoFit;
      beforePosition();
      var contentNode = this.getContentNode();
      var targetNode = this.getTargetNode();
      if (contentNode && targetNode) {
        var resultAlign = place({
          pinElement: contentNode,
          baseElement: targetNode,
          pinFollowBaseElementWhenFixed,
          align,
          offset,
          autoFit,
          container: container4,
          needAdjust,
          isRtl: rtl
        });
        var top = getStyle$3(contentNode, "top");
        var left = getStyle$3(contentNode, "left");
        onPosition({
          align: resultAlign.split(" "),
          top,
          left
        }, contentNode);
      }
    };
    Position2.prototype.getContentNode = function getContentNode() {
      try {
        return ReactDOM.findDOMNode(this);
      } catch (err) {
        return null;
      }
    };
    Position2.prototype.getTargetNode = function getTargetNode2() {
      var target = this.props.target;
      return target === Position$1.VIEWPORT ? Position$1.VIEWPORT : findNode(target, this.props);
    };
    Position2.prototype.handleResize = function handleResize() {
      var _this2 = this;
      clearTimeout(this.resizeTimeout);
      this.resizeTimeout = setTimeout(function() {
        _this2.setPosition();
      }, 200);
    };
    Position2.prototype.render = function render2() {
      return React.Children.only(this.props.children);
    };
    return Position2;
  }(React.Component), _class$17.VIEWPORT = Position$1.VIEWPORT, _class$17.propTypes = {
    children: PropTypes$1.node,
    target: PropTypes$1.any,
    container: PropTypes$1.any,
    align: PropTypes$1.oneOfType([PropTypes$1.string, PropTypes$1.bool]),
    offset: PropTypes$1.array,
    beforePosition: PropTypes$1.func,
    onPosition: PropTypes$1.func,
    needAdjust: PropTypes$1.bool,
    autoFit: PropTypes$1.bool,
    needListenResize: PropTypes$1.bool,
    shouldUpdatePosition: PropTypes$1.bool,
    rtl: PropTypes$1.bool,
    pinFollowBaseElementWhenFixed: PropTypes$1.bool
  }, _class$17.defaultProps = {
    align: "tl bl",
    offset: [0, 0],
    beforePosition: noop$h,
    onPosition: noop$h,
    needAdjust: true,
    autoFit: false,
    needListenResize: true,
    shouldUpdatePosition: false,
    rtl: false
  }, _temp$R);
  Position.displayName = "Position";
  var _class$16, _temp$Q;
  var saveLastFocusNode = focus.saveLastFocusNode, getFocusNodeList$1 = focus.getFocusNodeList, backLastFocusNode = focus.backLastFocusNode;
  var makeChain$7 = func.makeChain, noop$g = func.noop, bindCtx$9 = func.bindCtx;
  var getContainerNode2 = function getContainerNode3(props) {
    var targetNode = findNode(props.target);
    return findNode(props.container, targetNode);
  };
  var prefixes = ["-webkit-", "-moz-", "-o-", "ms-", ""];
  var getStyleProperty = function getStyleProperty2(node, name) {
    var style = window.getComputedStyle(node);
    var ret = "";
    for (var i = 0; i < prefixes.length; i++) {
      ret = style.getPropertyValue(prefixes[i] + name);
      if (ret) {
        break;
      }
    }
    return ret;
  };
  var containerNodeList = [];
  var Overlay$4 = (_temp$Q = _class$16 = function(_Component) {
    _default$4(Overlay3, _Component);
    function Overlay3(props) {
      _default$7(this, Overlay3);
      var _this2 = _default$5(this, _Component.call(this, props));
      _this2.saveContentRef = function(ref) {
        _this2.contentRef = ref;
      };
      _this2.saveGatewayRef = function(ref) {
        _this2.gatewayRef = ref;
      };
      _this2.lastAlign = props.align;
      bindCtx$9(_this2, ["handlePosition", "handleAnimateEnd", "handleDocumentKeyDown", "handleDocumentClick", "handleMaskClick", "beforeOpen", "beforeClose"]);
      _this2.state = {
        visible: false,
        status: "none",
        animation: _this2.getAnimation(props),
        willOpen: false,
        willClose: false
      };
      _this2.timeoutMap = {};
      return _this2;
    }
    Overlay3.getDerivedStateFromProps = function getDerivedStateFromProps(nextProps, prevState) {
      var willOpen = !prevState.visible && nextProps.visible;
      var willClose = prevState.visible && !nextProps.visible;
      var nextState = {
        willOpen,
        willClose
      };
      if (willOpen) {
        nextProps.beforeOpen && nextProps.beforeOpen();
      } else if (willClose) {
        nextProps.beforeClose && nextProps.beforeClose();
      }
      if (nextProps.animation || nextProps.animation === false) {
        nextState.animation = nextProps.animation;
      }
      if (nextProps.animation !== false && support.animation) {
        if (willOpen) {
          nextState.visible = true;
          nextState.status = "mounting";
        } else if (willClose) {
          nextState.status = "leaving";
        }
      } else if ("visible" in nextProps && nextProps.visible !== prevState.visible) {
        nextState.visible = nextProps.visible;
      }
      return nextState;
    };
    Overlay3.prototype.componentDidMount = function componentDidMount() {
      if (this.state.willOpen) {
        this.beforeOpen();
      } else if (this.state.willClose) {
        this.beforeClose();
      }
      if (this.state.visible) {
        this.doAnimation(true, false);
        this._isMounted = true;
      }
      this.addDocumentEvents();
      overlayManager$1.addOverlay(this);
    };
    Overlay3.prototype.componentDidUpdate = function componentDidUpdate(prevProps) {
      if (this.state.willOpen) {
        this.beforeOpen();
      } else if (this.state.willClose) {
        this.beforeClose();
      }
      if (!this._isMounted && this.props.visible) {
        this._isMounted = true;
      }
      if (this.props.align !== prevProps.align) {
        this.lastAlign = prevProps.align;
      }
      var willOpen = !prevProps.visible && this.props.visible;
      var willClose = prevProps.visible && !this.props.visible;
      (willOpen || willClose) && this.doAnimation(willOpen, willClose);
    };
    Overlay3.prototype.componentWillUnmount = function componentWillUnmount() {
      this._isDestroyed = true;
      this._isMounted = false;
      overlayManager$1.removeOverlay(this);
      this.removeDocumentEvents();
      if (this.focusTimeout) {
        clearTimeout(this.focusTimeout);
      }
      if (this._animation) {
        this._animation.off();
        this._animation = null;
      }
      this.beforeClose();
    };
    Overlay3.prototype.doAnimation = function doAnimation(open2, close2) {
      var _this2 = this;
      if (this.state.animation && support.animation) {
        if (open2) {
          this.onEntering();
        } else if (close2) {
          this.onLeaving();
        }
        this.addAnimationEvents();
      } else {
        if (open2) {
          setTimeout(function() {
            _this2.props.onOpen();
            dom.addClass(_this2.getWrapperNode(), "opened");
            overlayManager$1.addOverlay(_this2);
            _this2.props.afterOpen();
          });
        } else if (close2) {
          this.props.onClose();
          dom.removeClass(this.getWrapperNode(), "opened");
          overlayManager$1.removeOverlay(this);
          this.props.afterClose();
        }
        this.setFocusNode();
      }
    };
    Overlay3.prototype.getAnimation = function getAnimation(props) {
      if (props.animation === false) {
        return false;
      }
      if (props.animation) {
        return props.animation;
      }
      return this.getAnimationByAlign(props.align);
    };
    Overlay3.prototype.getAnimationByAlign = function getAnimationByAlign(align) {
      switch (align[0]) {
        case "t":
          return {
            // 为了防止有的用户 js升级了而css没升级,所以把两个动画都保留了。
            // 动画不会叠加,会替代,顺序根据 src/animate/main.scss 中的样式先后顺序遵循css覆盖原则
            // fadeInDownSmall fadeOutUpSmall 优先级更高
            in: "expandInDown fadeInDownSmall",
            out: "expandOutUp fadeOutUpSmall"
          };
        case "b":
          return {
            in: "fadeInUp",
            out: "fadeOutDown"
          };
        default:
          return {
            in: "expandInDown fadeInDownSmall",
            out: "expandOutUp fadeOutUpSmall"
          };
      }
    };
    Overlay3.prototype.addAnimationEvents = function addAnimationEvents() {
      var _this3 = this;
      setTimeout(function() {
        var node = _this3.getContentNode();
        if (node) {
          var id2 = guid();
          _this3._animation = events.on(node, support.animation.end, _this3.handleAnimateEnd.bind(_this3, id2));
          var animationDelay = parseFloat(getStyleProperty(node, "animation-delay")) || 0;
          var animationDuration = parseFloat(getStyleProperty(node, "animation-duration")) || 0;
          var time = animationDelay + animationDuration;
          if (time) {
            _this3.timeoutMap[id2] = setTimeout(function() {
              _this3.handleAnimateEnd(id2);
            }, time * 1e3 + 200);
          }
        }
      });
    };
    Overlay3.prototype.handlePosition = function handlePosition(config3) {
      var align = config3.align.join(" ");
      if (!("animation" in this.props) && this.props.needAdjust && this.lastAlign !== align) {
        this.setState({
          animation: this.getAnimationByAlign(align)
        });
      }
      var status = this.state.status;
      if (status === "mounting") {
        this.setState({
          status: "entering"
        });
      }
      this.lastAlign = align;
    };
    Overlay3.prototype.handleAnimateEnd = function handleAnimateEnd(id2) {
      if (this.timeoutMap[id2]) {
        clearTimeout(this.timeoutMap[id2]);
      }
      delete this.timeoutMap[id2];
      if (this._animation) {
        this._animation.off();
        this._animation = null;
      }
      if (!this._isMounted) {
        return;
      }
      if (this.state.status === "leaving") {
        this.setState({
          visible: false,
          status: "none"
        });
        this.onLeaved();
      } else if (this.state.status === "entering" || this.state.status === "mounting") {
        this.setState({
          status: "none"
        });
        this.onEntered();
      }
    };
    Overlay3.prototype.onEntering = function onEntering() {
      var _this4 = this;
      if (this._isDestroyed) {
        return;
      }
      setTimeout(function() {
        var wrapperNode = _this4.getWrapperNode();
        dom.addClass(wrapperNode, "opened");
        _this4.props.onOpen();
      });
    };
    Overlay3.prototype.onLeaving = function onLeaving() {
      var wrapperNode = this.getWrapperNode();
      dom.removeClass(wrapperNode, "opened");
      this.props.onClose();
    };
    Overlay3.prototype.onEntered = function onEntered() {
      overlayManager$1.addOverlay(this);
      this.setFocusNode();
      this.props.afterOpen();
    };
    Overlay3.prototype.onLeaved = function onLeaved() {
      overlayManager$1.removeOverlay(this);
      this.setFocusNode();
      this.props.afterClose();
    };
    Overlay3.prototype.beforeOpen = function beforeOpen() {
      if (this.props.disableScroll) {
        var containerNode = getContainerNode2(this.props) || document.body;
        var _containerNode$style = containerNode.style, overflow = _containerNode$style.overflow, paddingRight = _containerNode$style.paddingRight;
        var cnInfo = containerNodeList.find(function(m2) {
          return m2.containerNode === containerNode;
        }) || {
          containerNode,
          count: 0
        };
        if (cnInfo.count === 0 && overflow !== "hidden") {
          var style = {
            overflow: "hidden"
          };
          cnInfo.overflow = overflow;
          if (dom.hasScroll(containerNode)) {
            cnInfo.paddingRight = paddingRight;
            style.paddingRight = dom.getStyle(containerNode, "paddingRight") + dom.scrollbar().width + "px";
          }
          dom.setStyle(containerNode, style);
          containerNodeList.push(cnInfo);
          cnInfo.count++;
        } else if (cnInfo.count) {
          cnInfo.count++;
        }
        this._containerNode = containerNode;
      }
    };
    Overlay3.prototype.beforeClose = function beforeClose() {
      var _this5 = this;
      if (this.props.disableScroll) {
        var idx = containerNodeList.findIndex(function(cn) {
          return cn.containerNode === _this5._containerNode;
        });
        if (idx !== -1) {
          var cnInfo = containerNodeList[idx];
          var overflow = cnInfo.overflow, paddingRight = cnInfo.paddingRight;
          if (cnInfo.count === 1 && this._containerNode && this._containerNode.style.overflow === "hidden") {
            var style = {
              overflow
            };
            if (paddingRight !== void 0) {
              style.paddingRight = paddingRight;
            }
            dom.setStyle(this._containerNode, style);
          }
          cnInfo.count--;
          if (cnInfo.count === 0) {
            containerNodeList.splice(idx, 1);
          }
        }
        this._containerNode = void 0;
      }
    };
    Overlay3.prototype.setFocusNode = function setFocusNode() {
      var _this6 = this;
      if (!this.props.autoFocus) {
        return;
      }
      if (this.state.visible && !this._hasFocused) {
        saveLastFocusNode();
        this.focusTimeout = setTimeout(function() {
          var node = _this6.getContentNode();
          if (node) {
            var focusNodeList = getFocusNodeList$1(node);
            if (focusNodeList.length) {
              focusNodeList[0].focus();
            }
            _this6._hasFocused = true;
          }
        }, 100);
      } else if (!this.state.visible && this._hasFocused) {
        backLastFocusNode();
        this._hasFocused = false;
      }
    };
    Overlay3.prototype.getContent = function getContent() {
      return this.contentRef;
    };
    Overlay3.prototype.getContentNode = function getContentNode() {
      try {
        return ReactDOM.findDOMNode(this.contentRef);
      } catch (err) {
        return null;
      }
    };
    Overlay3.prototype.getWrapperNode = function getWrapperNode() {
      return this.gatewayRef ? this.gatewayRef.getChildNode() : null;
    };
    Overlay3.prototype.addDocumentEvents = function addDocumentEvents() {
      var useCapture = this.props.useCapture;
      if (this.props.canCloseByEsc) {
        this._keydownEvents = events.on(document, "keydown", this.handleDocumentKeyDown, useCapture);
      }
      if (this.props.canCloseByOutSideClick) {
        this._clickEvents = events.on(document, "click", this.handleDocumentClick, useCapture);
        this._touchEvents = events.on(document, "touchend", this.handleDocumentClick, useCapture);
      }
    };
    Overlay3.prototype.removeDocumentEvents = function removeDocumentEvents() {
      var _this7 = this;
      ["_keydownEvents", "_clickEvents", "_touchEvents"].forEach(function(event) {
        if (_this7[event]) {
          _this7[event].off();
          _this7[event] = null;
        }
      });
    };
    Overlay3.prototype.handleDocumentKeyDown = function handleDocumentKeyDown(e2) {
      if (this.state.visible && e2.keyCode === KEYCODE.ESC && overlayManager$1.isCurrentOverlay(this)) {
        this.props.onRequestClose("keyboard", e2);
      }
    };
    Overlay3.prototype.isInShadowDOM = function isInShadowDOM(node) {
      return node.getRootNode ? node.getRootNode().nodeType === 11 : false;
    };
    Overlay3.prototype.getEventPath = function getEventPath(event) {
      return event.path || event.composedPath && event.composedPath() || this.composedPath(event.target);
    };
    Overlay3.prototype.composedPath = function composedPath(el) {
      var path = [];
      while (el) {
        path.push(el);
        if (el.tagName === "HTML") {
          path.push(document);
          path.push(window);
          return path;
        }
        el = el.parentElement;
      }
    };
    Overlay3.prototype.matchInShadowDOM = function matchInShadowDOM(node, e2) {
      if (this.isInShadowDOM(node)) {
        var eventPath = this.getEventPath(e2);
        return node === eventPath[0] || node.contains(eventPath[0]);
      }
      return false;
    };
    Overlay3.prototype.handleDocumentClick = function handleDocumentClick(e2) {
      var _this8 = this;
      if (this.state.visible) {
        var safeNode = this.props.safeNode;
        var safeNodes = Array.isArray(safeNode) ? [].concat(safeNode) : [safeNode];
        safeNodes.unshift(function() {
          return _this8.getWrapperNode();
        });
        for (var i = 0; i < safeNodes.length; i++) {
          var node = findNode(safeNodes[i], this.props);
          if (node && (node === e2.target || node.contains(e2.target) || this.matchInShadowDOM(node, e2) || e2.target !== document && !document.documentElement.contains(e2.target))) {
            return;
          }
        }
        this.props.onRequestClose("docClick", e2);
      }
    };
    Overlay3.prototype.handleMaskClick = function handleMaskClick(e2) {
      if (e2.currentTarget === e2.target && this.props.canCloseByMask) {
        this.props.onRequestClose("maskClick", e2);
      }
    };
    Overlay3.prototype.getInstance = function getInstance() {
      return this;
    };
    Overlay3.prototype.render = function render2() {
      var _props = this.props, prefix = _props.prefix, className = _props.className, style = _props.style, propChildren = _props.children, target = _props.target, align = _props.align, offset = _props.offset, container4 = _props.container, hasMask = _props.hasMask, needAdjust = _props.needAdjust, autoFit = _props.autoFit, beforePosition = _props.beforePosition, onPosition = _props.onPosition, wrapperStyle = _props.wrapperStyle, rtl = _props.rtl, propShouldUpdatePosition = _props.shouldUpdatePosition, cache = _props.cache, wrapperClassName = _props.wrapperClassName, onMaskMouseEnter = _props.onMaskMouseEnter, onMaskMouseLeave = _props.onMaskMouseLeave, maskClass = _props.maskClass, isChildrenInMask = _props.isChildrenInMask, pinFollowBaseElementWhenFixed = _props.pinFollowBaseElementWhenFixed;
      var _state = this.state, stateVisible = _state.visible, status = _state.status, animation2 = _state.animation;
      var children = stateVisible || cache && this._isMounted ? propChildren : null;
      if (children) {
        var _classnames, _classnames2;
        var child = React.Children.only(children);
        if (typeof child.type === "function" && !(child.type.prototype instanceof React.Component)) {
          child = React.createElement(
            "div",
            { role: "none" },
            child
          );
        }
        var childClazz = classnames((_classnames = {}, _classnames[prefix + "overlay-inner"] = true, _classnames[animation2.in] = status === "entering" || status === "mounting", _classnames[animation2.out] = status === "leaving", _classnames[child.props.className] = !!child.props.className, _classnames[className] = !!className, _classnames));
        if (typeof child.ref === "string") {
          throw new Error("Can not set ref by string in Overlay, use function instead.");
        }
        children = React.cloneElement(child, {
          className: childClazz,
          style: _default$8({}, child.props.style, style),
          ref: makeChain$7(this.saveContentRef, child.ref),
          "aria-hidden": !stateVisible && cache && this._isMounted,
          onClick: makeChain$7(this.props.onClick, child.props.onClick),
          onTouchEnd: makeChain$7(this.props.onTouchEnd, child.props.onTouchEnd)
        });
        if (align) {
          var shouldUpdatePosition = status === "leaving" ? false : propShouldUpdatePosition;
          children = React.createElement(Position, {
            children,
            target,
            align,
            offset,
            autoFit,
            container: container4,
            needAdjust,
            pinFollowBaseElementWhenFixed,
            beforePosition,
            onPosition: makeChain$7(this.handlePosition, onPosition),
            shouldUpdatePosition,
            rtl
          });
        }
        var wrapperClazz = classnames([prefix + "overlay-wrapper", wrapperClassName]);
        var newWrapperStyle = _default$8({}, {
          display: stateVisible ? "" : "none"
        }, wrapperStyle);
        var maskClazz = classnames((_classnames2 = {}, _classnames2[prefix + "overlay-backdrop"] = true, _classnames2[maskClass] = !!maskClass, _classnames2));
        children = React.createElement(
          "div",
          { className: wrapperClazz, style: newWrapperStyle, dir: rtl ? "rtl" : void 0 },
          hasMask ? React.createElement(
            "div",
            {
              className: maskClazz,
              onClick: this.handleMaskClick,
              onMouseEnter: onMaskMouseEnter,
              onMouseLeave: onMaskMouseLeave,
              dir: rtl ? "rtl" : void 0
            },
            isChildrenInMask && children
          ) : null,
          !isChildrenInMask && children
        );
      }
      return React.createElement(Gateway$1, _default$8({ container: container4, target, children }, { ref: this.saveGatewayRef }));
    };
    return Overlay3;
  }(React.Component), _class$16.propTypes = {
    prefix: PropTypes$1.string,
    pure: PropTypes$1.bool,
    rtl: PropTypes$1.bool,
    className: PropTypes$1.string,
    style: PropTypes$1.object,
    /**
     * 弹层内容
     */
    children: PropTypes$1.any,
    /**
     * 是否显示弹层
     */
    visible: PropTypes$1.bool,
    /**
     * 弹层请求关闭时触发事件的回调函数
     * @param {String} type 弹层关闭的来源
     * @param {Object} e DOM 事件
     */
    onRequestClose: PropTypes$1.func,
    /**
     * 弹层定位的参照元素
     */
    target: PropTypes$1.any,
    /**
     * 弹层相对于参照元素的定位, 详见开发指南的[定位部分](#定位)
     */
    align: PropTypes$1.string,
    /**
     * 弹层相对于trigger的定位的微调, 接收数组[hoz, ver], 表示弹层在 left / top 上的增量
     * e.g. [100, 100] 表示往右(RTL 模式下是往左) 、下分布偏移100px
     */
    offset: PropTypes$1.array,
    /**
     * 渲染组件的容器,如果是函数需要返回 ref,如果是字符串则是该 DOM 的 id,也可以直接传入 DOM 节点
     */
    container: PropTypes$1.any,
    /**
     * 是否显示遮罩
     */
    hasMask: PropTypes$1.bool,
    /**
     * 是否支持 esc 按键关闭弹层
     */
    canCloseByEsc: PropTypes$1.bool,
    /**
     * 点击弹层外的区域是否关闭弹层,不显示遮罩时生效
     */
    canCloseByOutSideClick: PropTypes$1.bool,
    /**
     * 点击遮罩区域是否关闭弹层,显示遮罩时生效
     */
    canCloseByMask: PropTypes$1.bool,
    /**
     * 弹层打开前触发事件的回调函数
     */
    beforeOpen: PropTypes$1.func,
    /**
     * 弹层打开时触发事件的回调函数
     */
    onOpen: PropTypes$1.func,
    /**
     * 弹层打开后触发事件的回调函数, 如果有动画,则在动画结束后触发
     */
    afterOpen: PropTypes$1.func,
    /**
     * 弹层关闭前触发事件的回调函数
     */
    beforeClose: PropTypes$1.func,
    /**
     * 弹层关闭时触发事件的回调函数
     */
    onClose: PropTypes$1.func,
    /**
     * 弹层关闭后触发事件的回调函数, 如果有动画,则在动画结束后触发
     */
    afterClose: PropTypes$1.func,
    /**
     * 弹层定位完成前触发的事件
     */
    beforePosition: PropTypes$1.func,
    /**
     * 弹层定位完成时触发的事件
     * @param {Object} config 定位的参数
     * @param {Array} config.align 对齐方式,如 ['cc', 'cc'](如果开启 autoAdjust,可能和预先设置的 align 不同)
     * @param {Number} config.top 距离视口顶部距离
     * @param {Number} config.left 距离视口左侧距离
     * @param {Object} node 定位参照的容器节点
     */
    onPosition: PropTypes$1.func,
    shouldUpdatePosition: PropTypes$1.bool,
    /**
     * 弹层打开时是否让其中的元素自动获取焦点
     */
    autoFocus: PropTypes$1.bool,
    needAdjust: PropTypes$1.bool,
    /**
     * 是否禁用页面滚动
     */
    disableScroll: PropTypes$1.bool,
    /**
     * 是否在捕获阶段监听,适配 react 17 事件模型变更
     * @version 1.25
     */
    useCapture: PropTypes$1.bool,
    /**
     * 隐藏时是否保留子节点
     */
    cache: PropTypes$1.bool,
    /**
     * 安全节点,当点击 document 的时候,如果包含该节点则不会关闭弹层,如果是函数需要返回 ref,如果是字符串则是该 DOM 的 id,也可以直接传入 DOM 节点,或者以上值组成的数组
     */
    safeNode: PropTypes$1.any,
    /**
     * 弹层的根节点的样式类
     */
    wrapperClassName: PropTypes$1.string,
    /**
     * 弹层的根节点的内联样式
     */
    wrapperStyle: PropTypes$1.object,
    /**
     * 配置动画的播放方式,支持 { in: 'enter-class', out: 'leave-class' } 的对象参数,如果设置为 false,则不播放动画。 请参考 Animate 组件的文档获取可用的动画名
     * @default { in: 'expandInDown', out: 'expandOutUp' }
     */
    animation: PropTypes$1.oneOfType([PropTypes$1.object, PropTypes$1.bool]),
    onMaskMouseEnter: PropTypes$1.func,
    onMaskMouseLeave: PropTypes$1.func,
    onClick: PropTypes$1.func,
    maskClass: PropTypes$1.string,
    isChildrenInMask: PropTypes$1.bool,
    // 当 pin 元素(一般是弹层)是 fixed 布局的时候,pin 元素是否要跟随 base 元素(一般是trigger)
    // 举例来说,dialog/drawer 这类组件弹层是不跟随trigger的,而 fixed 布局下的subNav是跟随trigger的
    pinFollowBaseElementWhenFixed: PropTypes$1.bool,
    /**
     * 开启 v2 版本
     * @version 1.25
     */
    v2: PropTypes$1.bool,
    /**
     * [v2] align 的数组形式,不能和 align 同时使用
     * @version 1.25
     */
    points: PropTypes$1.array
  }, _class$16.defaultProps = {
    prefix: "next-",
    pure: false,
    visible: false,
    onRequestClose: noop$g,
    target: Position.VIEWPORT,
    align: "tl bl",
    offset: [0, 0],
    hasMask: false,
    canCloseByEsc: true,
    canCloseByOutSideClick: true,
    canCloseByMask: true,
    beforeOpen: noop$g,
    onOpen: noop$g,
    afterOpen: noop$g,
    beforeClose: noop$g,
    onClose: noop$g,
    afterClose: noop$g,
    beforePosition: noop$g,
    onPosition: noop$g,
    onMaskMouseEnter: noop$g,
    onMaskMouseLeave: noop$g,
    shouldUpdatePosition: false,
    autoFocus: false,
    needAdjust: true,
    disableScroll: false,
    cache: false,
    isChildrenInMask: false,
    onTouchEnd: function onTouchEnd(event) {
      event.stopPropagation();
    },
    onClick: function onClick(event) {
      return event.stopPropagation();
    },
    maskClass: "",
    useCapture: true
  }, _temp$Q);
  Overlay$4.displayName = "Overlay";
  const Overlay1 = polyfill(Overlay$4);
  function _extends() {
    _extends = Object.assign ? Object.assign.bind() : function(target) {
      for (var i = 1; i < arguments.length; i++) {
        var source = arguments[i];
        for (var key in source) {
          if (Object.prototype.hasOwnProperty.call(source, key)) {
            target[key] = source[key];
          }
        }
      }
      return target;
    };
    return _extends.apply(this, arguments);
  }
  function _objectWithoutPropertiesLoose(source, excluded) {
    if (source == null)
      return {};
    var target = {};
    var sourceKeys = Object.keys(source);
    var key, i;
    for (i = 0; i < sourceKeys.length; i++) {
      key = sourceKeys[i];
      if (excluded.indexOf(key) >= 0)
        continue;
      target[key] = source[key];
    }
    return target;
  }
  function _setPrototypeOf(o, p2) {
    _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf3(o2, p3) {
      o2.__proto__ = p3;
      return o2;
    };
    return _setPrototypeOf(o, p2);
  }
  function _inheritsLoose(subClass, superClass) {
    subClass.prototype = Object.create(superClass.prototype);
    subClass.prototype.constructor = subClass;
    _setPrototypeOf(subClass, superClass);
  }
  function useListener(nodeList, eventName, callback, useCapture, condition) {
    React.useEffect(function() {
      if (condition) {
        if (!Array.isArray(nodeList)) {
          nodeList = [nodeList];
        }
        nodeList.forEach(function(n2) {
          n2 && n2.addEventListener && n2.addEventListener(eventName, callback, useCapture || false);
        });
        return function() {
          Array.isArray(nodeList) && nodeList.forEach(function(n2) {
            n2 && n2.removeEventListener && n2.removeEventListener(eventName, callback, useCapture || false);
          });
        };
      }
      return void 0;
    }, [condition]);
  }
  function makeChain$6() {
    var _this2 = this;
    for (var _len = arguments.length, fns = new Array(_len), _key = 0; _key < _len; _key++) {
      fns[_key] = arguments[_key];
    }
    if (fns.length === 1) {
      return fns[0];
    }
    return function() {
      for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
        args[_key2] = arguments[_key2];
      }
      for (var i = 0, j = fns.length; i < j; i++) {
        if (fns[i] && fns[i].apply) {
          fns[i].apply(_this2, args);
        }
      }
    };
  }
  function callRef(ref, element) {
    if (!ref) {
      return;
    }
    if (typeof ref === "string") {
      throw new Error("can not set ref string for " + ref);
    } else if (typeof ref === "function") {
      ref(element);
    } else if (Object.prototype.hasOwnProperty.call(ref, "current")) {
      ref.current = element;
    }
  }
  function saveRef(ref) {
    if (!ref) {
      return null;
    }
    return function(element) {
      if (typeof ref === "string") {
        throw new Error("can not set ref string for " + ref);
      } else if (typeof ref === "function") {
        ref(element);
      } else if (Object.prototype.hasOwnProperty.call(ref, "current")) {
        ref.current = element;
      }
    };
  }
  var getRelativeContainer = function getRelativeContainer2(container4) {
    if (typeof document === void 0) {
      return container4;
    }
    var calcContainer = container4;
    while (getStyle$2(calcContainer, "position") === "static") {
      if (!calcContainer || calcContainer === document.documentElement) {
        return document.documentElement;
      }
      calcContainer = calcContainer.parentNode;
    }
    return calcContainer;
  };
  var getOverflowNodes = function getOverflowNodes2(targetNode, container4) {
    if (typeof document === void 0) {
      return [];
    }
    var overflowNodes = [];
    var calcContainer = targetNode;
    while (true) {
      if (!calcContainer || calcContainer === container4 || calcContainer === document.body || calcContainer === document.documentElement) {
        break;
      }
      var overflow = getStyle$2(calcContainer, "overflow");
      if (overflow && overflow.match(/auto|scroll/)) {
        var _calcContainer = calcContainer, clientWidth = _calcContainer.clientWidth, clientHeight = _calcContainer.clientHeight, scrollWidth = _calcContainer.scrollWidth, scrollHeight = _calcContainer.scrollHeight;
        if (clientHeight !== scrollHeight || clientWidth !== scrollWidth) {
          overflowNodes.push(calcContainer);
        }
      }
      calcContainer = calcContainer.parentNode;
    }
    return overflowNodes;
  };
  function getViewPort(container4) {
    var calcContainer = container4;
    while (calcContainer) {
      var overflow = getStyle$2(calcContainer, "overflow");
      if (overflow !== null && overflow !== void 0 && overflow.match(/auto|scroll|hidden/)) {
        return calcContainer;
      }
      calcContainer = calcContainer.parentNode;
    }
    return document.documentElement;
  }
  function getStyle$2(elt, name) {
    if (!elt || elt.nodeType !== 1) {
      return null;
    }
    var style = window.getComputedStyle(elt, null);
    return style.getPropertyValue(name);
  }
  var PIXEL_PATTERN = /margin|padding|width|height|max|min|offset|size|top|left/i;
  function setStyle$1(node, name, value) {
    if (!node) {
      return;
    }
    if (typeof name === "string") {
      if (typeof value === "number" && PIXEL_PATTERN.test(name)) {
        value = value + "px";
      }
      node.style[name] = value;
    } else if (typeof name === "object" && arguments.length === 2) {
      Object.keys(name).forEach(function(key) {
        return setStyle$1(node, key, name[key]);
      });
    }
  }
  function throttle(func2, wait) {
    var previous = -wait;
    return function() {
      var now = Date.now();
      var args = arguments;
      if (now - previous > wait) {
        func2.apply(this, args);
        previous = now;
      }
    };
  }
  function getViewTopLeft(node) {
    if (node === document.documentElement) {
      return {
        top: 0,
        left: 0
      };
    }
    var _node$getBoundingClie = node.getBoundingClientRect(), left = _node$getBoundingClie.left, top = _node$getBoundingClie.top;
    return {
      top,
      left
    };
  }
  function getWidthHeight(element) {
    if ("offsetWidth" in element && "offsetHeight" in element) {
      return {
        width: element.offsetWidth,
        height: element.offsetHeight
      };
    } else {
      var _element$getBoundingC = element.getBoundingClientRect(), width = _element$getBoundingC.width, height = _element$getBoundingC.height;
      return {
        width,
        height
      };
    }
  }
  function getScrollbarWidth() {
    var scrollDiv = document.createElement("div");
    scrollDiv.className += "just-to-get-scrollbar-size";
    setStyle$1(scrollDiv, {
      position: "absolute",
      width: "100px",
      height: "100px",
      overflow: "scroll",
      top: "-9999px"
    });
    document.body && document.body.appendChild(scrollDiv);
    var scrollbarWidth = scrollDiv.offsetWidth - scrollDiv.clientWidth;
    document.body.removeChild(scrollDiv);
    return scrollbarWidth;
  }
  function _isVisible(node) {
    while (node) {
      if (node === document.body || node === document.documentElement) {
        break;
      }
      if (node.style.display === "none" || node.style.visibility === "hidden") {
        return false;
      }
      node = node.parentNode;
    }
    return true;
  }
  function _isFocusable(node) {
    var nodeName = node.nodeName.toLowerCase();
    var tabIndex = parseInt(node.getAttribute("tabindex"), 10);
    var hasTabIndex = !isNaN(tabIndex) && tabIndex > -1;
    if (_isVisible(node)) {
      if (nodeName === "input") {
        return !node.disabled && node.type !== "hidden";
      } else if (["select", "textarea", "button"].indexOf(nodeName) > -1) {
        return !node.disabled;
      } else if (nodeName === "a") {
        return node.getAttribute("href") || hasTabIndex;
      } else {
        return hasTabIndex;
      }
    }
    return false;
  }
  function getFocusNodeList(node) {
    var res = [];
    var nodeList = node.querySelectorAll("*");
    nodeList.forEach(function(item) {
      if (_isFocusable(item)) {
        var method = item.getAttribute("data-auto-focus") ? "unshift" : "push";
        res[method](item);
      }
    });
    if (_isFocusable(node)) {
      res.unshift(node);
    }
    return res;
  }
  function getHTMLElement(node) {
    if (node) {
      if (node.nodeType) {
        if (node.nodeType === 1) {
          return node;
        } else {
          return document.body;
        }
      } else if (node === window) {
        return document.body;
      } else {
        return ReactDOM.findDOMNode(node);
      }
    }
    return node;
  }
  function getTargetNode(target) {
    if (typeof target === "function") {
      return target();
    } else if (typeof target === "string") {
      return document.getElementById(target);
    }
    return target;
  }
  function isSameObject(object1, object2) {
    if (!object1 || !object2) {
      return false;
    }
    var o1keys = Object.keys(object1);
    var o2keys = Object.keys(object2);
    if (o2keys.length !== o1keys.length)
      return false;
    for (var i = 0; i <= o1keys.length - 1; i++) {
      var _key3 = o1keys[i];
      if (!o2keys.includes(_key3))
        return false;
      if (object2[_key3] !== object1[_key3])
        return false;
    }
    return true;
  }
  var useEvent = function useEvent2(handler) {
    var handleRef = React.useRef(handler);
    React.useLayoutEffect(function() {
      handleRef.current = handler;
    });
    return React.useCallback(function() {
      var fn = handleRef.current;
      return fn.apply(void 0, arguments);
    }, []);
  };
  var placementMap = {
    tl: ["bl", "tl"],
    t: ["bc", "tc"],
    tr: ["br", "tr"],
    lt: ["tr", "tl"],
    l: ["cr", "cl"],
    lb: ["br", "bl"],
    bl: ["tl", "bl"],
    b: ["tc", "bc"],
    br: ["tr", "br"],
    rt: ["tl", "tr"],
    r: ["cl", "cr"],
    rb: ["bl", "br"]
  };
  function getXY(p2, staticInfo) {
    var targetInfo = staticInfo.targetInfo, containerInfo = staticInfo.containerInfo, overlayInfo = staticInfo.overlayInfo, opoints = staticInfo.points, placementOffset = staticInfo.placementOffset, offset = staticInfo.offset, rtl = staticInfo.rtl;
    var basex = targetInfo.left - containerInfo.left + containerInfo.scrollLeft;
    var basey = targetInfo.top - containerInfo.top + containerInfo.scrollTop;
    function setPointX(point, positive, width) {
      if (positive === void 0) {
        positive = true;
      }
      var plus = positive ? 1 : -1;
      switch (point) {
        case "l":
          basex += 0;
          break;
        case "c":
          basex += plus * width / 2;
          break;
        case "r":
          basex += plus * width;
          break;
      }
    }
    function setPointY(point, positive, height) {
      if (positive === void 0) {
        positive = true;
      }
      var plus = positive ? 1 : -1;
      switch (point) {
        case "t":
          basey += 0;
          break;
        case "c":
          basey += plus * height / 2;
          break;
        case "b":
          basey += plus * height;
          break;
      }
    }
    var points = [].concat(opoints);
    if (p2 && p2 in placementMap) {
      points = placementMap[p2];
    }
    if (rtl) {
      if (points[0].match(/l/)) {
        points[0] = points[0].replace("l", "r");
      } else if (points[0].match(/r/)) {
        points[0] = points[0].replace("r", "l");
      }
      if (points[1].match(/l/)) {
        points[1] = points[1].replace("l", "r");
      } else if (points[1].match(/r/)) {
        points[1] = points[1].replace("r", "l");
      }
    }
    setPointY(points[1][0], true, targetInfo.height);
    setPointX(points[1][1], true, targetInfo.width);
    setPointY(points[0][0], false, overlayInfo.height);
    setPointX(points[0][1], false, overlayInfo.width);
    if (placementOffset && p2.length >= 1) {
      switch (p2[0]) {
        case "t":
          basey -= placementOffset;
          break;
        case "b":
          basey += placementOffset;
          break;
        case "l":
          basex -= placementOffset;
          break;
        case "r":
          basex += placementOffset;
          break;
      }
    }
    return {
      points,
      left: basex + offset[0],
      top: basey + offset[1]
    };
  }
  function shouldResizePlacement(l2, t2, viewport, staticInfo) {
    var container4 = staticInfo.container, containerInfo = staticInfo.containerInfo, overlayInfo = staticInfo.overlayInfo;
    if (viewport !== container4) {
      var _getViewTopLeft = getViewTopLeft(viewport), vleft = _getViewTopLeft.left, vtop = _getViewTopLeft.top;
      var vwidth = viewport.scrollWidth, vheight = viewport.scrollHeight, vscrollTop = viewport.scrollTop, vscrollLeft = viewport.scrollLeft;
      var nt = t2 + containerInfo.top - vtop + vscrollTop;
      var nl = l2 + containerInfo.left - vleft + vscrollLeft;
      return nt < 0 || nl < 0 || nt + overlayInfo.height > vheight || nl + overlayInfo.width > vwidth;
    }
    return t2 < 0 || l2 < 0 || t2 + overlayInfo.height > containerInfo.height || l2 + overlayInfo.width > containerInfo.width;
  }
  function getNewPlacement(l2, t2, p2, staticInfo) {
    var overlayInfo = staticInfo.overlayInfo, containerInfo = staticInfo.containerInfo;
    var np = p2.split("");
    if (np.length === 1) {
      np.push("");
    }
    if (t2 < 0) {
      np = [np[0].replace("t", "b"), np[1].replace("b", "t")];
    }
    if (l2 < 0) {
      np = [np[0].replace("l", "r"), np[1].replace("r", "l")];
    }
    if (t2 + overlayInfo.height > containerInfo.height) {
      np = [np[0].replace("b", "t"), np[1].replace("t", "b")];
    }
    if (l2 + overlayInfo.width > containerInfo.width) {
      np = [np[0].replace("r", "l"), np[1].replace("l", "r")];
    }
    return np.join("");
  }
  function ajustLeftAndTop(l2, t2, staticInfo) {
    var overlayInfo = staticInfo.overlayInfo, containerInfo = staticInfo.containerInfo;
    if (t2 < 0) {
      t2 = 0;
    }
    if (l2 < 0) {
      l2 = 0;
    }
    if (t2 + overlayInfo.height > containerInfo.height) {
      t2 = containerInfo.height - overlayInfo.height;
    }
    if (l2 + overlayInfo.width > containerInfo.width) {
      l2 = containerInfo.width - overlayInfo.width;
    }
    return {
      left: l2,
      top: t2
    };
  }
  function getPlacements(config3) {
    var target = config3.target, overlay = config3.overlay, container4 = config3.container, scrollNode = config3.scrollNode, oplacement = config3.placement, _config$placementOffs = config3.placementOffset, placementOffset = _config$placementOffs === void 0 ? 0 : _config$placementOffs, _config$points = config3.points, opoints = _config$points === void 0 ? ["tl", "bl"] : _config$points, _config$offset = config3.offset, offset = _config$offset === void 0 ? [0, 0] : _config$offset, _config$position = config3.position, position = _config$position === void 0 ? "absolute" : _config$position, beforePosition = config3.beforePosition, _config$autoAdjust = config3.autoAdjust, autoAdjust = _config$autoAdjust === void 0 ? true : _config$autoAdjust, _config$autoHideScrol = config3.autoHideScrollOverflow, autoHideScrollOverflow = _config$autoHideScrol === void 0 ? true : _config$autoHideScrol, rtl = config3.rtl;
    var placement = oplacement;
    var _getWidthHeight = getWidthHeight(overlay), owidth = _getWidthHeight.width, oheight = _getWidthHeight.height;
    if (position === "fixed") {
      var _result = {
        config: {
          placement: void 0,
          points: void 0
        },
        style: {
          position,
          left: offset[0],
          top: offset[1]
        }
      };
      if (beforePosition && typeof beforePosition) {
        return beforePosition(_result, {
          overlay: {
            node: overlay,
            width: owidth,
            height: oheight
          }
        });
      }
      return _result;
    }
    var _target$getBoundingCl = target.getBoundingClientRect(), twidth = _target$getBoundingCl.width, theight = _target$getBoundingCl.height, tleft = _target$getBoundingCl.left, ttop = _target$getBoundingCl.top;
    var _getViewTopLeft2 = getViewTopLeft(container4), cleft = _getViewTopLeft2.left, ctop = _getViewTopLeft2.top;
    var cwidth = container4.scrollWidth, cheight = container4.scrollHeight, cscrollTop = container4.scrollTop, cscrollLeft = container4.scrollLeft;
    var staticInfo = {
      targetInfo: {
        width: twidth,
        height: theight,
        left: tleft,
        top: ttop
      },
      containerInfo: {
        left: cleft,
        top: ctop,
        width: cwidth,
        height: cheight,
        scrollTop: cscrollTop,
        scrollLeft: cscrollLeft
      },
      overlayInfo: {
        width: owidth,
        height: oheight
      },
      points: opoints,
      placementOffset,
      offset,
      container: container4,
      rtl
    };
    var _getXY = getXY(placement, staticInfo), left = _getXY.left, top = _getXY.top, points = _getXY.points;
    var viewport = getViewPort(container4);
    if (autoAdjust && placement && shouldResizePlacement(left, top, viewport, staticInfo)) {
      var nplacement = getNewPlacement(left, top, placement, staticInfo);
      if (placement !== nplacement) {
        var _getXY2 = getXY(nplacement, staticInfo), _nleft = _getXY2.left, _ntop = _getXY2.top;
        if (shouldResizePlacement(_nleft, _ntop, viewport, staticInfo)) {
          var nnplacement = getNewPlacement(_nleft, _ntop, nplacement, staticInfo);
          if (nplacement !== nnplacement) {
            var _getXY3 = getXY(nnplacement, staticInfo), nnleft = _getXY3.left, nntop = _getXY3.top;
            var _ajustLeftAndTop = ajustLeftAndTop(nnleft, nntop, staticInfo), nnnleft = _ajustLeftAndTop.left, nnntop = _ajustLeftAndTop.top;
            placement = nnplacement;
            left = nnnleft;
            top = nnntop;
          } else {
            placement = nplacement;
            left = _nleft;
            top = _ntop;
          }
        } else {
          placement = nplacement;
          left = _nleft;
          top = _ntop;
        }
      }
      var _ajustLeftAndTop2 = ajustLeftAndTop(left, top, staticInfo), nleft = _ajustLeftAndTop2.left, ntop = _ajustLeftAndTop2.top;
      left = nleft;
      top = ntop;
    }
    var result = {
      config: {
        placement,
        points
      },
      style: {
        position,
        left: Math.round(left),
        top: Math.round(top)
      }
    };
    if (autoHideScrollOverflow && placement && scrollNode !== null && scrollNode !== void 0 && scrollNode.length) {
      scrollNode.forEach(function(node) {
        var _node$getBoundingClie = node.getBoundingClientRect(), top2 = _node$getBoundingClie.top, left2 = _node$getBoundingClie.left, width = _node$getBoundingClie.width, height = _node$getBoundingClie.height;
        if (ttop + theight < top2 || ttop > top2 + height || tleft + twidth < left2 || tleft > left2 + width) {
          result.style.display = "none";
        } else {
          result.style.display = "";
        }
      });
    }
    if (beforePosition && typeof beforePosition) {
      return beforePosition(result, {
        target: {
          node: target,
          width: twidth,
          height: theight,
          left: tleft,
          top: ttop
        },
        overlay: {
          node: overlay,
          width: owidth,
          height: oheight
        }
      });
    }
    return result;
  }
  var OverlayContext = /* @__PURE__ */ React.createContext({
    setVisibleOverlayToParent: function setVisibleOverlayToParent() {
    }
  });
  var _excluded$1 = ["target", "children", "wrapperClassName", "maskClassName", "maskStyle", "hasMask", "canCloseByMask", "maskRender", "points", "offset", "fixed", "visible", "onRequestClose", "onOpen", "onClose", "container", "placement", "placementOffset", "disableScroll", "canCloseByOutSideClick", "canCloseByEsc", "safeNode", "beforePosition", "onPosition", "cache", "autoAdjust", "autoFocus", "isAnimationEnd", "rtl", "wrapperStyle"], _excluded2 = ["setVisibleOverlayToParent"];
  var _this = globalThis;
  function _createForOfIteratorHelperLoose(o, allowArrayLike) {
    var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
    if (it)
      return (it = it.call(o)).next.bind(it);
    if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
      if (it)
        o = it;
      var i = 0;
      return function() {
        if (i >= o.length)
          return { done: true };
        return { done: false, value: o[i++] };
      };
    }
    throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  }
  function _unsupportedIterableToArray(o, minLen) {
    if (!o)
      return;
    if (typeof o === "string")
      return _arrayLikeToArray(o, minLen);
    var n2 = Object.prototype.toString.call(o).slice(8, -1);
    if (n2 === "Object" && o.constructor)
      n2 = o.constructor.name;
    if (n2 === "Map" || n2 === "Set")
      return Array.from(o);
    if (n2 === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n2))
      return _arrayLikeToArray(o, minLen);
  }
  function _arrayLikeToArray(arr, len) {
    if (len == null || len > arr.length)
      len = arr.length;
    for (var i = 0, arr2 = new Array(len); i < len; i++) {
      arr2[i] = arr[i];
    }
    return arr2;
  }
  var isScrollDisplay2 = function isScrollDisplay3(element) {
    try {
      var scrollbarStyle = window.getComputedStyle(element, "::-webkit-scrollbar");
      return !scrollbarStyle || scrollbarStyle.getPropertyValue("display") !== "none";
    } catch (e2) {
    }
    return true;
  };
  var hasScroll = function hasScroll2(containerNode) {
    var overflow = getStyle$2(containerNode, "overflow");
    if (overflow === "hidden") {
      return false;
    }
    var parentNode = containerNode.parentNode;
    return parentNode && parentNode.scrollHeight > parentNode.clientHeight && getScrollbarWidth() > 0 && isScrollDisplay2(parentNode) && isScrollDisplay2(containerNode);
  };
  var RefWrapper = /* @__PURE__ */ function(_React$Component) {
    _inheritsLoose(RefWrapper2, _React$Component);
    function RefWrapper2() {
      return _React$Component.apply(this, arguments) || this;
    }
    var _proto = RefWrapper2.prototype;
    _proto.render = function render2() {
      return this.props.children;
    };
    return RefWrapper2;
  }(React.Component);
  var Overlay$3 = /* @__PURE__ */ React.forwardRef(function(props, ref) {
    var _overflowRef$current;
    var body = function body2() {
      return document.body;
    };
    var target = props.target, children = props.children, wrapperClassName = props.wrapperClassName, maskClassName = props.maskClassName, maskStyle = props.maskStyle, hasMask = props.hasMask, _props$canCloseByMask = props.canCloseByMask, canCloseByMask = _props$canCloseByMask === void 0 ? true : _props$canCloseByMask, maskRender = props.maskRender, points = props.points, offset = props.offset, fixed2 = props.fixed, visible = props.visible, _props$onRequestClose = props.onRequestClose, onRequestClose = _props$onRequestClose === void 0 ? function() {
    } : _props$onRequestClose, onOpen = props.onOpen, onClose = props.onClose, _props$container = props.container, popupContainer = _props$container === void 0 ? body : _props$container, placement = props.placement, placementOffset = props.placementOffset, _props$disableScroll = props.disableScroll, disableScroll = _props$disableScroll === void 0 ? false : _props$disableScroll, _props$canCloseByOutS = props.canCloseByOutSideClick, canCloseByOutSideClick = _props$canCloseByOutS === void 0 ? true : _props$canCloseByOutS, _props$canCloseByEsc = props.canCloseByEsc, canCloseByEsc = _props$canCloseByEsc === void 0 ? true : _props$canCloseByEsc, safeNode = props.safeNode, beforePosition = props.beforePosition, onPosition = props.onPosition, _props$cache = props.cache, cache = _props$cache === void 0 ? false : _props$cache, autoAdjust = props.autoAdjust, _props$autoFocus = props.autoFocus, autoFocus = _props$autoFocus === void 0 ? false : _props$autoFocus, _props$isAnimationEnd = props.isAnimationEnd, isAnimationEnd = _props$isAnimationEnd === void 0 ? true : _props$isAnimationEnd, rtl = props.rtl, owrapperStyle = props.wrapperStyle, others = _objectWithoutPropertiesLoose(props, _excluded$1);
    var position = fixed2 ? "fixed" : "absolute";
    var _useState = React.useState(visible), firstVisible = _useState[0], setFirst = _useState[1];
    var _useState2 = React.useState(null), forceUpdate = _useState2[1];
    var positionStyleRef = React.useRef({
      position
    });
    var getContainer3 = typeof popupContainer === "string" ? function() {
      return document.getElementById(popupContainer);
    } : typeof popupContainer !== "function" ? function() {
      return popupContainer;
    } : popupContainer;
    var _useState3 = React.useState(null), container4 = _useState3[0], setContainer = _useState3[1];
    var targetRef = React.useRef(null);
    var preTarget = React.useRef(target);
    var overlayRef = React.useRef(null);
    var containerRef = React.useRef(null);
    var maskRef = React.useRef(null);
    var overflowRef = React.useRef([]);
    var lastFocus = React.useRef(null);
    var ro = React.useRef(null);
    var _useState4 = React.useState(Date.now().toString(36)), uuid2 = _useState4[0];
    var _useContext = React.useContext(OverlayContext), setVisibleOverlayToParent2 = _useContext.setVisibleOverlayToParent, otherContext = _objectWithoutPropertiesLoose(_useContext, _excluded2);
    var childIDMap = React.useRef(/* @__PURE__ */ new Map());
    var handleOpen = function handleOpen2(node) {
      setVisibleOverlayToParent2(uuid2, node);
      onOpen === null || onOpen === void 0 ? void 0 : onOpen(node);
    };
    var handleClose = function handleClose2() {
      positionStyleRef.current = null;
      setVisibleOverlayToParent2(uuid2, null);
      onClose === null || onClose === void 0 ? void 0 : onClose();
    };
    var getVisibleOverlayFromChild = function getVisibleOverlayFromChild2(id2, node) {
      if (node) {
        childIDMap.current.set(id2, node);
      } else {
        childIDMap.current["delete"](id2);
      }
      setVisibleOverlayToParent2(id2, node);
    };
    var child = React.Children.only(children);
    if (typeof child.ref === "string") {
      throw new Error("Can not set ref by string in Overlay, use function instead.");
    }
    var updatePosition = useEvent(function() {
      var overlayNode2 = overlayRef.current;
      var containerNode = containerRef.current;
      var targetNode = targetRef.current;
      if (!overlayNode2 || !containerNode || !targetNode) {
        return;
      }
      var placements = getPlacements({
        target: targetNode,
        overlay: overlayNode2,
        container: containerNode,
        scrollNode: overflowRef.current,
        points,
        offset,
        position,
        placement,
        placementOffset,
        beforePosition,
        autoAdjust,
        rtl
      });
      if (!isSameObject(positionStyleRef.current, placements.style)) {
        positionStyleRef.current = placements.style;
        setStyle$1(overlayNode2, placements.style);
        typeof onPosition === "function" && onPosition(placements);
      }
    });
    var overlayRefCallback = React.useCallback(function(nodeRef) {
      var node = ReactDOM.findDOMNode(nodeRef);
      overlayRef.current = node;
      callRef(ref, node);
      if (node !== null && container4) {
        var containerNode = getRelativeContainer(getHTMLElement(container4));
        containerRef.current = containerNode;
        var targetElement = target === "viewport" ? hasMask ? maskRef.current : body() : getTargetNode(target) || body();
        var targetNode = getHTMLElement(targetElement);
        targetRef.current = targetNode;
        overflowRef.current = getOverflowNodes(targetNode, containerNode);
        setStyle$1(node, {
          position: fixed2 ? "fixed" : "absolute",
          top: -1e3,
          left: -1e3
        });
        var waitTime = 100;
        ro.current = new index$2(throttle(updatePosition.bind(_this), waitTime));
        ro.current.observe(containerNode);
        ro.current.observe(node);
        forceUpdate({});
        if (autoFocus) {
          setTimeout(function() {
            var focusableNodes = getFocusNodeList(node);
            if (focusableNodes.length > 0 && focusableNodes[0]) {
              lastFocus.current = document.activeElement;
              focusableNodes[0].focus();
            }
          }, waitTime);
        }
        !cache && handleOpen(node);
      } else {
        !cache && handleClose();
        if (ro.current) {
          ro.current.disconnect();
          ro.current = null;
        }
      }
    }, [container4]);
    var clickEvent = function clickEvent2(e2) {
      for (var _iterator3 = _createForOfIteratorHelperLoose(childIDMap.current.entries()), _step; !(_step = _iterator3()).done; ) {
        var _step$value = _step.value, oNode = _step$value[1];
        var _node2 = getHTMLElement(oNode);
        if (_node2 && (_node2 === e2.target || _node2.contains(e2.target))) {
          return;
        }
      }
      if (!visible) {
        return;
      }
      if (hasMask && maskRef.current === e2.target) {
        if (canCloseByMask) {
          onRequestClose("maskClick", e2);
        }
        return;
      }
      var safeNodeList = Array.isArray(safeNode) ? safeNode : [safeNode];
      if (overlayRef.current) {
        safeNodeList.push(function() {
          return overlayRef.current;
        });
      }
      for (var i = 0; i < safeNodeList.length; i++) {
        var _safeNode = getTargetNode(safeNodeList[i]);
        var _node = getHTMLElement(_safeNode);
        if (_node && (_node === e2.target || _node.contains(e2.target))) {
          return;
        }
      }
      if (canCloseByOutSideClick) {
        onRequestClose("docClick", e2);
      }
    };
    useListener(document, "mousedown", clickEvent, false, !!(visible && overlayRef.current && (canCloseByOutSideClick || hasMask && canCloseByMask)));
    var keydownEvent = function keydownEvent2(e2) {
      if (!visible) {
        return;
      }
      if (e2.keyCode === 27 && canCloseByEsc && !childIDMap.current.size) {
        onRequestClose("esc", e2);
      }
    };
    useListener(document, "keydown", keydownEvent, false, !!(visible && overlayRef.current && canCloseByEsc));
    var scrollEvent = function scrollEvent2(e2) {
      if (!visible) {
        return;
      }
      updatePosition();
    };
    useListener(overflowRef.current, "scroll", scrollEvent, false, !!(visible && overlayRef.current && (_overflowRef$current = overflowRef.current) !== null && _overflowRef$current !== void 0 && _overflowRef$current.length));
    React.useEffect(function() {
      if (visible && disableScroll) {
        var originStyle = document.body.getAttribute("style");
        setStyle$1(document.body, "overflow", "hidden");
        if (hasScroll(document.body)) {
          var scrollWidth = getScrollbarWidth();
          if (scrollWidth) {
            setStyle$1(document.body, "padding-right", "calc(" + getStyle$2(document.body, "padding-right") + " + " + scrollWidth + "px)");
          }
        }
        return function() {
          document.body.setAttribute("style", originStyle || "");
        };
      }
      return void 0;
    }, [visible && disableScroll]);
    React.useEffect(function() {
      if (!firstVisible && visible) {
        setFirst(true);
      }
    }, [visible]);
    var overlayNode = overlayRef.current;
    React.useEffect(function() {
      if (cache && overlayNode) {
        if (visible) {
          updatePosition();
          handleOpen(overlayNode);
        } else {
          handleClose();
        }
      }
    }, [visible, cache && overlayNode]);
    React.useEffect(function() {
      if (visible && overlayNode) {
        if (target && targetRef.current && preTarget.current !== target) {
          var targetElement = target === "viewport" ? hasMask ? maskRef.current : body() : getTargetNode(target) || body();
          var targetNode = getHTMLElement(targetElement);
          if (targetNode && targetRef.current !== targetNode) {
            targetRef.current = targetNode;
            updatePosition();
          }
          preTarget.current = target;
        }
      }
    }, [target]);
    React.useEffect(function() {
      if (visible && overlayNode) {
        updatePosition();
      }
    }, [offset, placement, placementOffset, points, autoAdjust, rtl]);
    React.useEffect(function() {
      if (!visible && autoFocus && lastFocus.current) {
        lastFocus.current.focus();
        lastFocus.current = null;
      }
    }, [!visible && autoFocus && lastFocus.current]);
    React.useEffect(function() {
      if (visible) {
        if (!container4) {
          setContainer(getContainer3());
        } else if (getContainer3() !== container4) {
          setContainer(getContainer3());
        }
      }
    }, [visible, popupContainer]);
    if (firstVisible === false || !container4) {
      return null;
    }
    if (!visible && !cache && isAnimationEnd) {
      return null;
    }
    var newChildren = child ? /* @__PURE__ */ React.createElement(RefWrapper, {
      ref: overlayRefCallback
    }, /* @__PURE__ */ React.cloneElement(child, _extends({}, others, {
      style: _extends({
        top: 0,
        left: 0
      }, child.props.style, positionStyleRef.current)
    }))) : null;
    var wrapperStyle = _extends({}, owrapperStyle);
    if (cache && !visible && isAnimationEnd) {
      wrapperStyle.display = "none";
    }
    var maskNode = /* @__PURE__ */ React.createElement("div", {
      className: maskClassName,
      style: maskStyle,
      ref: maskRef
    });
    var content = /* @__PURE__ */ React.createElement("div", {
      className: wrapperClassName,
      style: wrapperStyle
    }, hasMask ? maskRender ? maskRender(maskNode) : maskNode : null, newChildren);
    return /* @__PURE__ */ React.createElement(OverlayContext.Provider, {
      value: _extends({}, otherContext, {
        setVisibleOverlayToParent: getVisibleOverlayFromChild
      })
    }, /* @__PURE__ */ ReactDOM.createPortal(content, container4));
  });
  var _excluded = ["overlay", "triggerType", "triggerClickKeyCode", "children", "defaultVisible", "className", "onVisibleChange", "container", "style", "placement", "canCloseByTrigger", "delay", "overlayProps", "safeNode", "followTrigger", "target", "disabled"];
  var Popup$7 = /* @__PURE__ */ React.forwardRef(function(props, ref) {
    var body = function body2() {
      return document.body;
    };
    var overlay = props.overlay, _props$triggerType = props.triggerType, triggerType = _props$triggerType === void 0 ? "click" : _props$triggerType, triggerClickKeyCode = props.triggerClickKeyCode, children = props.children, defaultVisible = props.defaultVisible;
    props.className;
    var _props$onVisibleChang = props.onVisibleChange, onVisibleChange = _props$onVisibleChang === void 0 ? function() {
    } : _props$onVisibleChang, _props$container = props.container, container4 = _props$container === void 0 ? body : _props$container;
    props.style;
    var _props$placement = props.placement, placement = _props$placement === void 0 ? "bl" : _props$placement, _props$canCloseByTrig = props.canCloseByTrigger, canCloseByTrigger = _props$canCloseByTrig === void 0 ? true : _props$canCloseByTrig, _props$delay = props.delay, delay = _props$delay === void 0 ? 200 : _props$delay, _props$overlayProps = props.overlayProps, overlayProps = _props$overlayProps === void 0 ? {} : _props$overlayProps, safeNode = props.safeNode, _props$followTrigger = props.followTrigger, followTrigger = _props$followTrigger === void 0 ? false : _props$followTrigger, otarget = props.target, _props$disabled = props.disabled, disabled = _props$disabled === void 0 ? false : _props$disabled, others = _objectWithoutPropertiesLoose(props, _excluded);
    var _useState = React.useState(defaultVisible || props.visible), visible = _useState[0], setVisible = _useState[1];
    var triggerRef = React.useRef(null);
    var overlayRef = React.useRef(null);
    var mouseLeaveTimer = React.useRef(null);
    var mouseEnterTimer = React.useRef(null);
    var overlayClick = React.useRef(false);
    var child = children && React.Children.only(children);
    var overlayChild = React.Children.only(overlay);
    React.useEffect(function() {
      if ("visible" in props) {
        setVisible(props.visible);
      }
    }, [props.visible]);
    var handleVisibleChange = function handleVisibleChange2(visible2, e2, triggerType2) {
      if (triggerType2 === void 0) {
        triggerType2 = "fromTrigger";
      }
      if (disabled) {
        return;
      }
      if (!("visible" in props)) {
        if (visible2 || overlayRef.current) {
          setVisible(visible2);
        }
      }
      onVisibleChange(visible2, triggerType2, e2);
    };
    var handleClick = function handleClick2(e2) {
      if (visible && !canCloseByTrigger) {
        return;
      }
      handleVisibleChange(!visible, e2);
    };
    var handleKeyDown = function handleKeyDown2(e2) {
      var keycodes = Array.isArray(triggerClickKeyCode) ? triggerClickKeyCode : [triggerClickKeyCode];
      if (keycodes.includes(e2.keyCode)) {
        handleVisibleChange(!visible, e2);
      }
    };
    var handleMouseEnter = function handleMouseEnter2(targetType) {
      return function(e2) {
        if (mouseLeaveTimer.current && visible) {
          clearTimeout(mouseLeaveTimer.current);
          mouseLeaveTimer.current = null;
          return;
        }
        if (!mouseEnterTimer.current && !visible) {
          mouseEnterTimer.current = setTimeout(function() {
            handleVisibleChange(true, e2, targetType);
            mouseEnterTimer.current = null;
          }, delay);
        }
      };
    };
    var handleMouseLeave = function handleMouseLeave2(targetType) {
      return function(e2) {
        if (!mouseLeaveTimer.current && visible) {
          mouseLeaveTimer.current = setTimeout(function() {
            handleVisibleChange(false, e2, targetType);
            mouseLeaveTimer.current = null;
          }, delay);
        }
        if (mouseEnterTimer.current && !visible) {
          clearTimeout(mouseEnterTimer.current);
          mouseEnterTimer.current = null;
        }
      };
    };
    var handleFocus = function handleFocus2(e2) {
      handleVisibleChange(true, e2);
    };
    var handleBlur = function handleBlur2(e2) {
      if (overlayClick.current) {
        overlayClick.current = false;
        return;
      }
      handleVisibleChange(false, e2);
    };
    var handleOverlayClick = function handleOverlayClick2(e2) {
      overlayClick.current = true;
    };
    var handleRequestClose = function handleRequestClose2(targetType, e2) {
      handleVisibleChange(false, e2, targetType);
    };
    var triggerProps = {};
    var overlayOtherProps = {};
    var safeNodes = Array.isArray(safeNode) ? safeNode : [safeNode];
    if (child && !disabled) {
      var triggerTypeList = typeof triggerType === "string" ? [triggerType] : triggerType;
      triggerTypeList.forEach(function(t2) {
        var _child$props, _child$props2, _child$props3, _child$props4, _child$props5, _child$props6;
        switch (t2) {
          case "click":
            triggerProps.onClick = makeChain$6(handleClick, (_child$props = child.props) === null || _child$props === void 0 ? void 0 : _child$props.onClick);
            triggerProps.onKeyDown = makeChain$6(handleKeyDown, (_child$props2 = child.props) === null || _child$props2 === void 0 ? void 0 : _child$props2.onKeyDown);
            break;
          case "hover":
            triggerProps.onMouseEnter = makeChain$6(handleMouseEnter("fromTrigger"), (_child$props3 = child.props) === null || _child$props3 === void 0 ? void 0 : _child$props3.onMouseEnter);
            triggerProps.onMouseLeave = makeChain$6(handleMouseLeave("fromTrigger"), (_child$props4 = child.props) === null || _child$props4 === void 0 ? void 0 : _child$props4.onMouseLeave);
            overlayOtherProps.onMouseEnter = makeChain$6(handleMouseEnter("overlay"), overlayProps.onMouseEnter);
            overlayOtherProps.onMouseLeave = makeChain$6(handleMouseLeave("overlay"), overlayProps.onMouseLeave);
            break;
          case "focus":
            triggerProps.onFocus = makeChain$6(handleFocus, (_child$props5 = child.props) === null || _child$props5 === void 0 ? void 0 : _child$props5.onFocus);
            triggerProps.onBlur = makeChain$6(handleBlur, (_child$props6 = child.props) === null || _child$props6 === void 0 ? void 0 : _child$props6.onBlur);
            overlayOtherProps.onMouseDown = makeChain$6(handleOverlayClick, overlayProps.onMouseDown);
            break;
        }
      });
      safeNodes.push(function() {
        return ReactDOM.findDOMNode(triggerRef.current);
      });
    }
    var target = otarget ? otarget : child ? function() {
      return ReactDOM.findDOMNode(triggerRef.current);
    } : body;
    var getContainer3 = typeof container4 === "string" ? function() {
      return document.getElementById(container4);
    } : typeof container4 !== "function" ? function() {
      return container4;
    } : function() {
      return container4(ReactDOM.findDOMNode(triggerRef.current));
    };
    var overlayContainer = followTrigger ? function() {
      var _findDOMNode;
      return (_findDOMNode = ReactDOM.findDOMNode(triggerRef.current)) === null || _findDOMNode === void 0 ? void 0 : _findDOMNode.parentNode;
    } : getContainer3;
    return /* @__PURE__ */ React.createElement(React.Fragment, null, child && /* @__PURE__ */ React.createElement(RefWrapper, {
      ref: React.useCallback(function(ref2) {
        return triggerRef.current = ref2;
      }, [])
    }, /* @__PURE__ */ React.cloneElement(child, triggerProps)), /* @__PURE__ */ React.createElement(Overlay$3, _extends({}, others, overlayOtherProps, {
      placement,
      container: overlayContainer,
      safeNode: safeNodes,
      visible,
      target,
      onRequestClose: handleRequestClose,
      ref: React.useCallback(makeChain$6(saveRef(overlayRef), saveRef(ref)), [])
    }), overlayChild));
  });
  var Overlay$2 = Overlay$3;
  Overlay$2.Popup = Popup$7;
  Overlay$2.OverlayContext = OverlayContext;
  var Overlay2 = function Overlay22(props) {
    var _classNames;
    if (!React.useState || !React.useRef || !React.useEffect) {
      log.warning("need react version > 16.8.0");
      return null;
    }
    var _props$prefix = props.prefix, prefix = _props$prefix === void 0 ? "next-" : _props$prefix, _props$animation = props.animation, animation2 = _props$animation === void 0 ? { in: "expandInDown", out: "expandOutUp" } : _props$animation, visible = props.visible, hasMask = props.hasMask, align = props.align, _props$points = props.points, points = _props$points === void 0 ? align ? align.split(" ") : void 0 : _props$points, onPosition = props.onPosition, children = props.children, className = props.className, style = props.style, wrapperClassName = props.wrapperClassName, beforeOpen = props.beforeOpen, onOpen = props.onOpen, afterOpen = props.afterOpen, beforeClose = props.beforeClose, onClose = props.onClose, afterClose = props.afterClose, others = _default$3(props, ["prefix", "animation", "visible", "hasMask", "align", "points", "onPosition", "children", "className", "style", "wrapperClassName", "beforeOpen", "onOpen", "afterOpen", "beforeClose", "onClose", "afterClose"]);
    var _useState = React.useState(true), isAnimationEnd = _useState[0], markAnimationEnd = _useState[1];
    var overlayRef = React.useRef(null);
    var handleEnter = function handleEnter2() {
      markAnimationEnd(false);
      typeof beforeOpen === "function" && beforeOpen(overlayRef.current);
    };
    var handleEntering = function handleEntering2() {
      typeof onOpen === "function" && onOpen(overlayRef.current);
    };
    var handleEntered = function handleEntered2() {
      typeof afterOpen === "function" && afterOpen(overlayRef.current);
    };
    var handleExit = function handleExit2() {
      typeof beforeClose === "function" && beforeClose(overlayRef.current);
    };
    var handleExiting = function handleExiting2() {
      typeof onClose === "function" && onClose(overlayRef.current);
    };
    var handleExited = function handleExited2() {
      markAnimationEnd(true);
      typeof afterClose === "function" && afterClose(overlayRef.current);
    };
    var childrenNode = React.createElement(
      Animate$1.OverlayAnimate,
      {
        visible,
        animation: animation2,
        onEnter: handleEnter,
        onEntering: handleEntering,
        onEntered: handleEntered,
        onExit: handleExit,
        onExiting: handleExiting,
        onExited: handleExited,
        timeout: 300,
        style
      },
      children ? React.cloneElement(children, {
        className: classnames([prefix + "overlay-inner", className, children && children.props && children.props.className])
      }) : React.createElement("span", null)
    );
    var wraperCls = classnames((_classNames = {}, _classNames[prefix + "overlay-wrapper v2"] = true, _classNames[wrapperClassName] = wrapperClassName, _classNames.opened = visible, _classNames));
    var handlePosition = function handlePosition2(result) {
      _default$8(result, { align: result.config.points });
      typeof onPosition === "function" && onPosition(result);
    };
    var maskRender = function maskRender2(node) {
      return React.createElement(
        Animate$1.OverlayAnimate,
        {
          visible,
          animation: animation2 ? { in: "fadeIn", out: "fadeOut" } : false,
          timeout: 300,
          unmountOnExit: true
        },
        node
      );
    };
    return React.createElement(
      Overlay$2,
      _default$8({}, others, {
        visible,
        isAnimationEnd,
        hasMask,
        wrapperClassName: wraperCls,
        maskClassName: prefix + "overlay-backdrop",
        maskRender,
        points,
        onPosition: handlePosition,
        ref: overlayRef
      }),
      childrenNode
    );
  };
  const Overlay2$1 = Overlay2;
  var _class$15, _temp$P;
  var noop$f = func.noop, makeChain$5 = func.makeChain, bindCtx$8 = func.bindCtx;
  var Popup$6 = (_temp$P = _class$15 = function(_Component) {
    _default$4(Popup4, _Component);
    function Popup4(props) {
      _default$7(this, Popup4);
      var _this2 = _default$5(this, _Component.call(this, props));
      _this2.state = {
        visible: typeof props.visible === "undefined" ? props.defaultVisible : props.visible
      };
      bindCtx$8(_this2, ["handleTriggerClick", "handleTriggerKeyDown", "handleTriggerMouseEnter", "handleTriggerMouseLeave", "handleTriggerFocus", "handleTriggerBlur", "handleContentMouseEnter", "handleContentMouseLeave", "handleContentMouseDown", "handleRequestClose", "handleMaskMouseEnter", "handleMaskMouseLeave"]);
      return _this2;
    }
    Popup4.getDerivedStateFromProps = function getDerivedStateFromProps(nextProps, prevState) {
      if ("visible" in nextProps) {
        return _default$8({}, prevState, {
          visible: nextProps.visible
        });
      }
      return null;
    };
    Popup4.prototype.componentWillUnmount = function componentWillUnmount() {
      var _this2 = this;
      ["_timer", "_hideTimer", "_showTimer"].forEach(function(time) {
        _this2[time] && clearTimeout(_this2[time]);
      });
    };
    Popup4.prototype.handleVisibleChange = function handleVisibleChange(visible, type2, e2) {
      if (!("visible" in this.props)) {
        this.setState({
          visible
        });
      }
      this.props.onVisibleChange(visible, type2, e2);
    };
    Popup4.prototype.handleTriggerClick = function handleTriggerClick(e2) {
      if (this.state.visible && !this.props.canCloseByTrigger) {
        return;
      }
      this.handleVisibleChange(!this.state.visible, "fromTrigger", e2);
    };
    Popup4.prototype.handleTriggerKeyDown = function handleTriggerKeyDown(e2) {
      var triggerClickKeycode = this.props.triggerClickKeycode;
      var keycodes = Array.isArray(triggerClickKeycode) ? triggerClickKeycode : [triggerClickKeycode];
      if (keycodes.includes(e2.keyCode)) {
        e2.preventDefault();
        this.handleTriggerClick(e2);
      }
    };
    Popup4.prototype.handleTriggerMouseEnter = function handleTriggerMouseEnter(e2) {
      var _this3 = this;
      this._mouseNotFirstOnMask = false;
      if (this._hideTimer) {
        clearTimeout(this._hideTimer);
        this._hideTimer = null;
      }
      if (this._showTimer) {
        clearTimeout(this._showTimer);
        this._showTimer = null;
      }
      if (!this.state.visible) {
        this._showTimer = setTimeout(function() {
          _this3.handleVisibleChange(true, "fromTrigger", e2);
        }, this.props.delay);
      }
    };
    Popup4.prototype.handleTriggerMouseLeave = function handleTriggerMouseLeave(e2, type2) {
      var _this4 = this;
      if (this._showTimer) {
        clearTimeout(this._showTimer);
        this._showTimer = null;
      }
      if (this.state.visible) {
        this._hideTimer = setTimeout(function() {
          _this4.handleVisibleChange(false, type2 || "fromTrigger", e2);
        }, this.props.delay);
      }
    };
    Popup4.prototype.handleTriggerFocus = function handleTriggerFocus(e2) {
      this.handleVisibleChange(true, "fromTrigger", e2);
    };
    Popup4.prototype.handleTriggerBlur = function handleTriggerBlur(e2) {
      if (!this._isForwardContent) {
        this.handleVisibleChange(false, "fromTrigger", e2);
      }
      this._isForwardContent = false;
    };
    Popup4.prototype.handleContentMouseDown = function handleContentMouseDown() {
      this._isForwardContent = true;
    };
    Popup4.prototype.handleContentMouseEnter = function handleContentMouseEnter() {
      clearTimeout(this._hideTimer);
    };
    Popup4.prototype.handleContentMouseLeave = function handleContentMouseLeave(e2) {
      this.handleTriggerMouseLeave(e2, "fromContent");
    };
    Popup4.prototype.handleMaskMouseEnter = function handleMaskMouseEnter() {
      if (!this._mouseNotFirstOnMask) {
        clearTimeout(this._hideTimer);
        this._hideTimer = null;
        this._mouseNotFirstOnMask = false;
      }
    };
    Popup4.prototype.handleMaskMouseLeave = function handleMaskMouseLeave() {
      this._mouseNotFirstOnMask = true;
    };
    Popup4.prototype.handleRequestClose = function handleRequestClose(type2, e2) {
      this.handleVisibleChange(false, type2, e2);
    };
    Popup4.prototype.renderTrigger = function renderTrigger() {
      var _this5 = this;
      var _props = this.props, trigger = _props.trigger, disabled = _props.disabled;
      var props = {
        key: "trigger",
        "aria-haspopup": true,
        "aria-expanded": this.state.visible
      };
      if (!this.state.visible) {
        props["aria-describedby"] = void 0;
      }
      if (!disabled) {
        var triggerType = this.props.triggerType;
        var triggerTypes = Array.isArray(triggerType) ? triggerType : [triggerType];
        var _ref = trigger && trigger.props || {}, onClick3 = _ref.onClick, onKeyDown = _ref.onKeyDown, onMouseEnter = _ref.onMouseEnter, onMouseLeave = _ref.onMouseLeave, onFocus = _ref.onFocus, onBlur = _ref.onBlur;
        triggerTypes.forEach(function(triggerType2) {
          switch (triggerType2) {
            case "click":
              props.onClick = makeChain$5(_this5.handleTriggerClick, onClick3);
              props.onKeyDown = makeChain$5(_this5.handleTriggerKeyDown, onKeyDown);
              break;
            case "hover":
              props.onMouseEnter = makeChain$5(_this5.handleTriggerMouseEnter, onMouseEnter);
              props.onMouseLeave = makeChain$5(_this5.handleTriggerMouseLeave, onMouseLeave);
              break;
            case "focus":
              props.onFocus = makeChain$5(_this5.handleTriggerFocus, onFocus);
              props.onBlur = makeChain$5(_this5.handleTriggerBlur, onBlur);
              break;
          }
        });
      }
      return trigger && React.cloneElement(trigger, props);
    };
    Popup4.prototype.renderContent = function renderContent() {
      var _this6 = this;
      var _props2 = this.props, children = _props2.children, triggerType = _props2.triggerType;
      var triggerTypes = Array.isArray(triggerType) ? triggerType : [triggerType];
      var content = React.Children.only(children);
      var _content$props = content.props, onMouseDown = _content$props.onMouseDown, onMouseEnter = _content$props.onMouseEnter, onMouseLeave = _content$props.onMouseLeave;
      var props = {
        key: "portal"
      };
      triggerTypes.forEach(function(triggerType2) {
        switch (triggerType2) {
          case "focus":
            props.onMouseDown = makeChain$5(_this6.handleContentMouseDown, onMouseDown);
            break;
          case "hover":
            props.onMouseEnter = makeChain$5(_this6.handleContentMouseEnter, onMouseEnter);
            props.onMouseLeave = makeChain$5(_this6.handleContentMouseLeave, onMouseLeave);
            break;
        }
      });
      return React.cloneElement(content, props);
    };
    Popup4.prototype.renderPortal = function renderPortal() {
      var _this7 = this;
      var _props3 = this.props, target = _props3.target, safeNode = _props3.safeNode, followTrigger = _props3.followTrigger, triggerType = _props3.triggerType, hasMask = _props3.hasMask, wrapperStyle = _props3.wrapperStyle, others = _default$3(_props3, ["target", "safeNode", "followTrigger", "triggerType", "hasMask", "wrapperStyle"]);
      var container4 = this.props.container;
      var findTriggerNode = function findTriggerNode2() {
        return ReactDOM.findDOMNode(_this7);
      };
      var safeNodes = Array.isArray(safeNode) ? [].concat(safeNode) : [safeNode];
      safeNodes.unshift(findTriggerNode);
      var newWrapperStyle = wrapperStyle || {};
      if (followTrigger) {
        container4 = function container5(trigger) {
          return trigger && trigger.parentNode || trigger;
        };
        newWrapperStyle.position = "relative";
      }
      if (triggerType === "hover" && hasMask) {
        others.onMaskMouseEnter = this.handleMaskMouseEnter;
        others.onMaskMouseLeave = this.handleMaskMouseLeave;
      }
      return React.createElement(
        Overlay1,
        _default$8({}, others, {
          key: "overlay",
          ref: function ref(overlay) {
            return _this7.overlay = overlay;
          },
          visible: this.state.visible,
          target: target || findTriggerNode,
          container: container4,
          safeNode: safeNodes,
          wrapperStyle: newWrapperStyle,
          triggerType,
          hasMask,
          onRequestClose: this.handleRequestClose
        }),
        this.props.children && this.renderContent()
      );
    };
    Popup4.prototype.render = function render2() {
      return [this.renderTrigger(), this.renderPortal()];
    };
    return Popup4;
  }(React.Component), _class$15.propTypes = {
    /**
     * 弹层内容
     */
    children: PropTypes$1.node,
    /**
     * 触发弹层显示或隐藏的元素
     */
    trigger: PropTypes$1.element,
    /**
     * 触发弹层显示或隐藏的操作类型,可以是 'click','hover','focus',或者它们组成的数组,如 ['hover', 'focus']
     */
    triggerType: PropTypes$1.oneOfType([PropTypes$1.string, PropTypes$1.array]),
    /**
     * 当 triggerType 为 click 时才生效,可自定义触发弹层显示的键盘码
     */
    triggerClickKeycode: PropTypes$1.oneOfType([PropTypes$1.number, PropTypes$1.array]),
    /**
     * 弹层当前是否显示
     */
    visible: PropTypes$1.bool,
    /**
     * 弹层默认是否显示
     */
    defaultVisible: PropTypes$1.bool,
    /**
     * 弹层显示或隐藏时触发的回调函数
     * @param {Boolean} visible 弹层是否显示
     * @param {String} type 触发弹层显示或隐藏的来源 fromTrigger 表示由trigger的点击触发; docClick 表示由document的点击触发
     * @param {Object} e DOM事件
     */
    onVisibleChange: PropTypes$1.func,
    /**
     * 设置此属性,弹层无法显示或隐藏
     */
    disabled: PropTypes$1.bool,
    autoFit: PropTypes$1.bool,
    /**
     * 弹层显示或隐藏的延时时间(以毫秒为单位),在 triggerType 被设置为 hover 时生效
     */
    delay: PropTypes$1.number,
    /**
     * trigger 是否可以关闭弹层
     */
    canCloseByTrigger: PropTypes$1.bool,
    /**
     * 弹层定位的参照元素
     * @default target 属性,即触发元素
     */
    target: PropTypes$1.any,
    safeNode: PropTypes$1.any,
    /**
     * 是否跟随trigger滚动
     */
    followTrigger: PropTypes$1.bool,
    container: PropTypes$1.any,
    hasMask: PropTypes$1.bool,
    wrapperStyle: PropTypes$1.object,
    rtl: PropTypes$1.bool,
    /**
     * 开启 v2 版本
     */
    v2: PropTypes$1.bool,
    /**
     * [v2] 快捷位置,包含 'tl' | 't' | 'tr' | 'rt' | 'r' | 'rb' | 'bl' | 'b' | 'br' | 'lt' | 'l' | 'lb'
     */
    placement: PropTypes$1.string,
    /**
     * [v2] 弹层偏离触发元素的像素值
     */
    placementOffset: PropTypes$1.number,
    /**
     * [v2] 浮窗被遮挡时是否自动调整位置
     */
    autoAdjust: PropTypes$1.bool
  }, _class$15.defaultProps = {
    triggerType: "hover",
    triggerClickKeycode: [KEYCODE.SPACE, KEYCODE.ENTER],
    defaultVisible: false,
    onVisibleChange: noop$f,
    disabled: false,
    autoFit: false,
    delay: 200,
    canCloseByTrigger: true,
    followTrigger: false,
    container: function container3() {
      return document.body;
    },
    rtl: false
  }, _temp$P);
  Popup$6.displayName = "Popup";
  const Popup1 = polyfill(Popup$6);
  var Popup$5 = function Popup(props) {
    var _classNames;
    if (!React.useState || !React.useRef || !React.useEffect) {
      log.warning("need react version > 16.8.0");
      return null;
    }
    var _props$prefix = props.prefix, prefix = _props$prefix === void 0 ? "next-" : _props$prefix, _props$animation = props.animation, panimation = _props$animation === void 0 ? { in: "expandInDown", out: "expandOutUp" } : _props$animation, defaultVisible = props.defaultVisible, _props$onVisibleChang = props.onVisibleChange, onVisibleChange = _props$onVisibleChang === void 0 ? function() {
    } : _props$onVisibleChang, trigger = props.trigger, _props$triggerType = props.triggerType, triggerType = _props$triggerType === void 0 ? "hover" : _props$triggerType, overlay = props.overlay, onPosition = props.onPosition, children = props.children, className = props.className, style = props.style, wrapperClassName = props.wrapperClassName, triggerClickKeycode = props.triggerClickKeycode, align = props.align, beforeOpen = props.beforeOpen, onOpen = props.onOpen, afterOpen = props.afterOpen, beforeClose = props.beforeClose, onClose = props.onClose, afterClose = props.afterClose, others = _default$3(props, ["prefix", "animation", "defaultVisible", "onVisibleChange", "trigger", "triggerType", "overlay", "onPosition", "children", "className", "style", "wrapperClassName", "triggerClickKeycode", "align", "beforeOpen", "onOpen", "afterOpen", "beforeClose", "onClose", "afterClose"]);
    var _useState = React.useState(defaultVisible), visible = _useState[0], setVisible = _useState[1];
    var _useState2 = React.useState(panimation), animation2 = _useState2[0], setAnimation = _useState2[1];
    var _useState3 = React.useState(true), isAnimationEnd = _useState3[0], markAnimationEnd = _useState3[1];
    var overlayRef = React.useRef(null);
    React.useEffect(function() {
      if ("visible" in props) {
        setVisible(props.visible);
      }
    }, [props.visible]);
    React.useEffect(function() {
      if ("animation" in props && animation2 !== panimation) {
        setAnimation(panimation);
      }
    }, [panimation]);
    var handleVisibleChange = function handleVisibleChange2(visible2) {
      for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
        args[_key - 1] = arguments[_key];
      }
      if (!("visible" in props)) {
        setVisible(visible2);
      }
      onVisibleChange.apply(void 0, [visible2].concat(args));
    };
    var triggerNode = overlay ? children : trigger;
    var overlayNode = overlay ? overlay : children;
    var handleEnter = function handleEnter2() {
      markAnimationEnd(false);
      typeof beforeOpen === "function" && beforeOpen(overlayRef.current);
    };
    var handleEntering = function handleEntering2() {
      typeof onOpen === "function" && onOpen(overlayRef.current);
    };
    var handleEntered = function handleEntered2() {
      typeof afterOpen === "function" && afterOpen(overlayRef.current);
    };
    var handleExit = function handleExit2() {
      typeof beforeClose === "function" && beforeClose(overlayRef.current);
    };
    var handleExiting = function handleExiting2() {
      typeof onClose === "function" && onClose(overlayRef.current);
    };
    var handleExited = function handleExited2() {
      markAnimationEnd(true);
      typeof afterClose === "function" && afterClose(overlayRef.current);
    };
    overlayNode = React.createElement(
      Animate$1.OverlayAnimate,
      {
        visible,
        animation: animation2,
        timeout: 200,
        onEnter: handleEnter,
        onEntering: handleEntering,
        onEntered: handleEntered,
        onExit: handleExit,
        onExiting: handleExiting,
        onExited: handleExited,
        style
      },
      overlayNode ? React.cloneElement(overlayNode, {
        className: classnames([prefix + "overlay-inner", className, overlayNode && overlayNode.props && overlayNode.props.className])
      }) : React.createElement("span", null)
    );
    var handlePosition = function handlePosition2(result) {
      _default$8(result, { align: result.config.points });
      var placement = result.config.placement;
      if (placement && typeof placement === "string") {
        if (animation2.in === "expandInDown" && animation2.out === "expandOutUp" && placement.match(/t/)) {
          setAnimation({
            in: "expandInUp",
            out: "expandOutDown"
          });
        } else if (animation2.in === "expandInUp" && animation2.out === "expandOutDown" && placement.match(/b/)) {
          setAnimation({
            in: "expandInDown",
            out: "expandOutUp"
          });
        }
      }
      typeof onPosition === "function" && onPosition(result);
    };
    var wraperCls = classnames((_classNames = {}, _classNames[prefix + "overlay-wrapper v2"] = true, _classNames[wrapperClassName] = wrapperClassName, _classNames.opened = visible, _classNames));
    var v1Props = {};
    if (align) {
      v1Props.points = align.split(" ");
    }
    var maskRender = function maskRender2(node) {
      return React.createElement(
        Animate$1.OverlayAnimate,
        {
          visible,
          animation: animation2 ? { in: "fadeIn", out: "fadeOut" } : false,
          timeout: 200,
          unmountOnExit: true
        },
        node
      );
    };
    return React.createElement(
      Overlay$2.Popup,
      _default$8({}, others, v1Props, {
        wrapperClassName: wraperCls,
        overlay: overlayNode,
        visible,
        isAnimationEnd,
        triggerType,
        onVisibleChange: handleVisibleChange,
        onPosition: handlePosition,
        triggerClickKeyCode: triggerClickKeycode,
        maskRender,
        ref: overlayRef
      }),
      triggerNode
    );
  };
  const Popup2 = Popup$5;
  var Overlay = function(_React$Component) {
    _default$4(Overlay3, _React$Component);
    function Overlay3(props) {
      _default$7(this, Overlay3);
      var _this2 = _default$5(this, _React$Component.call(this, props));
      _this2.overlayRef = null;
      _this2.saveRef = _this2.saveRef.bind(_this2);
      return _this2;
    }
    Overlay3.prototype.saveRef = function saveRef2(ref) {
      this.overlayRef = ref;
    };
    Overlay3.prototype.getContent = function getContent() {
      if (this.overlayRef) {
        return this.overlayRef.getContent();
      }
      return null;
    };
    Overlay3.prototype.getContentNode = function getContentNode() {
      if (this.overlayRef) {
        return this.overlayRef.getContentNode();
      }
      return null;
    };
    Overlay3.prototype.render = function render2() {
      var _props = this.props, v2 = _props.v2, others = _default$3(_props, ["v2"]);
      if (v2) {
        if ("needAdjust" in others) {
          log.deprecated("needAdjust", "autoAdjust", "Overlay v2");
          others.autoAdjust = others.needAdjust;
          delete others.needAdjust;
        }
        return React.createElement(Overlay2$1, others);
      } else {
        return React.createElement(Overlay1, _default$8({}, others, { ref: this.saveRef }));
      }
    };
    return Overlay3;
  }(React.Component);
  Overlay.displayName = "Overlay";
  var Popup$4 = function(_React$Component2) {
    _default$4(Popup4, _React$Component2);
    function Popup4(props) {
      _default$7(this, Popup4);
      var _this2 = _default$5(this, _React$Component2.call(this, props));
      _this2.overlay = null;
      _this2.saveRef = _this2.saveRef.bind(_this2);
      return _this2;
    }
    Popup4.prototype.saveRef = function saveRef2(ref) {
      if (ref) {
        this.overlay = ref.overlay;
      }
    };
    Popup4.prototype.render = function render2() {
      var _props2 = this.props, v2 = _props2.v2, others = _default$3(_props2, ["v2"]);
      if (v2) {
        if ("needAdjust" in others) {
          log.deprecated("needAdjust", "needAdjust", "Popup v2");
          others.autoAdjust = others.needAdjust;
          delete others.needAdjust;
        }
        if ("shouldUpdatePosition" in others) {
          delete others.shouldUpdatePosition;
        }
        return React.createElement(Popup2, others);
      } else {
        return React.createElement(Popup1, _default$8({}, others, { ref: this.saveRef }));
      }
    };
    return Popup4;
  }(React.Component);
  Popup$4.displayName = "Popup";
  Overlay.Gateway = Gateway$1;
  Overlay.Position = Position;
  Overlay.Popup = ConfigProvider$1.config(Popup$4, {
    exportNames: ["overlay"]
  });
  const Overlay$1 = ConfigProvider$1.config(Overlay, {
    exportNames: ["getContent", "getContentNode"]
  });
  var _class$14, _temp$O;
  var Icon$1 = (_temp$O = _class$14 = function(_Component) {
    _default$4(Icon2, _Component);
    function Icon2() {
      _default$7(this, Icon2);
      return _default$5(this, _Component.apply(this, arguments));
    }
    Icon2.prototype.render = function render2() {
      var _cx;
      var _props = this.props, prefix = _props.prefix, type2 = _props.type, size2 = _props.size, className = _props.className, rtl = _props.rtl, style = _props.style, children = _props.children;
      var others = obj.pickOthers(_default$8({}, Icon2.propTypes), this.props);
      var classes = classnames((_cx = {}, _cx[prefix + "icon"] = true, _cx[prefix + "icon-" + type2] = !!type2, _cx["" + prefix + size2] = !!size2 && typeof size2 === "string", _cx[className] = !!className, _cx));
      if (rtl && ["arrow-left", "arrow-right", "arrow-double-left", "arrow-double-right", "switch", "sorting", "descending", "ascending"].indexOf(type2) !== -1) {
        others.dir = "rtl";
      }
      var sizeStyle = typeof size2 === "number" ? {
        width: size2,
        height: size2,
        lineHeight: size2 + "px",
        fontSize: size2
      } : {};
      return React.createElement(
        "i",
        _default$8({}, others, { style: _default$8({}, sizeStyle, style), className: classes }),
        children
      );
    };
    return Icon2;
  }(React.Component), _class$14.propTypes = _default$8({}, ConfigProvider$1.propTypes, {
    /**
     * 指定显示哪种图标
     */
    type: PropTypes$1.string,
    children: PropTypes$1.node,
    /**
     * 指定图标大小
     * <br/>**可选值**<br/> xxs, xs, small, medium, large, xl, xxl, xxxl, inherit
     */
    size: PropTypes$1.oneOfType([PropTypes$1.oneOf(["xxs", "xs", "small", "medium", "large", "xl", "xxl", "xxxl", "inherit"]), PropTypes$1.number]),
    className: PropTypes$1.string,
    style: PropTypes$1.object
  }), _class$14.defaultProps = {
    prefix: "next-",
    size: "medium"
  }, _class$14._typeMark = "icon", _temp$O);
  Icon$1.displayName = "Icon";
  const Icon$2 = Icon$1;
  var customCache = /* @__PURE__ */ new Set();
  var ConfigIcon = ConfigProvider$1.config(Icon$2);
  function createFromIconfontCN() {
    var options = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
    var scriptUrl = options.scriptUrl, _options$extraCommonP = options.extraCommonProps, extraCommonProps = _options$extraCommonP === void 0 ? {} : _options$extraCommonP;
    var hasExist = customCache.has(scriptUrl);
    if (document.querySelector('script[data-namespace="' + scriptUrl + '"]')) {
      hasExist = true;
    }
    if (typeof document !== "undefined" && typeof window !== "undefined" && typeof document.createElement === "function" && typeof scriptUrl === "string" && scriptUrl.length && !hasExist) {
      var script = document.createElement("script");
      script.setAttribute("src", scriptUrl);
      script.setAttribute("data-namespace", scriptUrl);
      customCache.add(scriptUrl);
      document.body.appendChild(script);
    }
    var Iconfont = function Iconfont2(props) {
      var _cx;
      var type2 = props.type, size2 = props.size, children = props.children, className = props.className, _props$prefix = props.prefix, prefix = _props$prefix === void 0 ? "next-" : _props$prefix, others = _default$3(props, ["type", "size", "children", "className", "prefix"]);
      var content = null;
      if (props.type) {
        content = React.createElement("use", { xlinkHref: "#" + type2 });
      }
      if (children) {
        content = children;
      }
      var classes = classnames((_cx = {}, _cx[prefix + "icon-remote"] = true, _cx), className);
      return (
        // FIXME: 这里理论上优先级是 props 中的 prefix 优先级更高,不过之前的行为一直是取上层 ConfigProvider 中的 prefix,
        // 先兼容之前的表现,will be fixed in 2.x
        // https://github.com/alibaba-fusion/next/issues/3906
        React.createElement(
          ConfigIcon,
          { size: size2 },
          React.createElement(
            "svg",
            _default$8({ className: classes, focusable: false }, others, extraCommonProps),
            content
          )
        )
      );
    };
    Iconfont.displayName = "Iconfont";
    return ConfigProvider$1.config(Iconfont);
  }
  Icon$2.createFromIconfontCN = createFromIconfontCN;
  const Icon = ConfigProvider$1.config(Icon$2);
  var normalMap = {
    t: {
      align: "bc tc",
      rtlAlign: "bc tc",
      arrow: "bottom",
      trOrigin: "bottom",
      rtlTrOrigin: "bottom",
      offset: [0, -12]
    },
    r: {
      align: "cl cr",
      rtlAlign: "cr cl",
      arrow: "left",
      trOrigin: "left",
      rtlTrOrigin: "right",
      offset: [12, 0]
    },
    b: {
      align: "tc bc",
      rtlAlign: "tc bc",
      arrow: "top",
      trOrigin: "top",
      rtlTrOrigin: "top",
      offset: [0, 12]
    },
    l: {
      align: "cr cl",
      rtlAlign: "cl cr",
      arrow: "right",
      trOrigin: "right",
      rtlTrOrigin: "left",
      offset: [-12, 0]
    },
    tl: {
      align: "br tc",
      rtlAlign: "bl tc",
      arrow: "bottom-right",
      trOrigin: "bottom right",
      rtlTrOrigin: "bottom left",
      offset: [20, -12]
    },
    tr: {
      align: "bl tc",
      rtlAlign: "br tc",
      arrow: "bottom-left",
      trOrigin: "bottom left",
      rtlTrOrigin: "bottom right",
      offset: [-20, -12]
    },
    rt: {
      align: "bl cr",
      rtlAlign: "br cl",
      arrow: "left-bottom",
      trOrigin: "bottom left",
      rtlTrOrigin: "bottom right",
      offset: [12, 20]
    },
    rb: {
      align: "tl cr",
      rtlAlign: "tr cl",
      arrow: "left-top",
      trOrigin: "top left",
      rtlTrOrigin: "top right",
      offset: [12, -20]
    },
    bl: {
      align: "tr bc",
      rtlAlign: "tl bc",
      arrow: "top-right",
      trOrigin: "top right",
      rtlTrOrigin: "top left",
      offset: [20, 12]
    },
    br: {
      align: "tl bc",
      rtlAlign: "tr bc",
      arrow: "top-left",
      trOrigin: "top left",
      rtlTrOrigin: "top right",
      offset: [-20, 12]
    },
    lt: {
      align: "br cl",
      rtlAlign: "bl cr",
      arrow: "right-bottom",
      trOrigin: "bottom right",
      rtlTrOrigin: "bottom left",
      offset: [-12, 20]
    },
    lb: {
      align: "tr cl",
      rtlAlign: "tl cr",
      arrow: "right-top",
      trOrigin: "top right",
      rtlTrOrigin: "top left",
      offset: [-12, -20]
    }
  };
  var edgeMap = {
    t: {
      align: "bc tc",
      rtlAlign: "bc tc",
      arrow: "bottom",
      trOrigin: "bottom",
      rtlTrOrigin: "bottom",
      offset: [0, -12]
    },
    r: {
      align: "cl cr",
      rtlAlign: "cr cl",
      arrow: "left",
      trOrigin: "left",
      rtlTrOrigin: "right",
      offset: [12, 0]
    },
    b: {
      align: "tc bc",
      rtlAlign: "tc bc",
      arrow: "top",
      trOrigin: "top",
      rtlTrOrigin: "top",
      offset: [0, 12]
    },
    l: {
      align: "cr cl",
      rtlAlign: "cl cr",
      arrow: "right",
      trOrigin: "right",
      rtlTrOrigin: "left",
      offset: [-12, 0]
    },
    tl: {
      align: "bl tl",
      rtlAlign: "br tr",
      arrow: "bottom-left",
      trOrigin: "bottom left",
      rtlTrOrigin: "bottom right",
      offset: [0, -12]
    },
    tr: {
      align: "br tr",
      rtlAlign: "bl tl",
      arrow: "bottom-right",
      trOrigin: "bottom right",
      rtlTrOrigin: "bottom left",
      offset: [0, -12]
    },
    rt: {
      align: "tl tr",
      rtlAlign: "tr tl",
      arrow: "left-top",
      trOrigin: "top left",
      rtlTrOrigin: "top right",
      offset: [12, 0]
    },
    rb: {
      align: "bl br",
      rtlAlign: "br bl",
      arrow: "left-bottom",
      trOrigin: "bottom left",
      rtlTrOrigin: "bottom right",
      offset: [12, 0]
    },
    bl: {
      align: "tl bl",
      rtlAlign: "tr br",
      arrow: "top-left",
      trOrigin: "top left",
      rtlTrOrigin: "top right",
      offset: [0, 12]
    },
    br: {
      align: "tr br",
      rtlAlign: "tl bl",
      arrow: "top-right",
      trOrigin: "top right",
      rtlTrOrigin: "top left",
      offset: [0, 12]
    },
    lt: {
      align: "tr tl",
      rtlAlign: "tl tr",
      arrow: "right-top",
      trOrigin: "top right",
      rtlTrOrigin: "top left",
      offset: [-12, 0]
    },
    lb: {
      align: "br bl",
      rtlAlign: "bl br",
      arrow: "right-bottom",
      trOrigin: "bottom right",
      rtlTrOrigin: "bottom left",
      offset: [-12, 0]
    }
  };
  var _class$13, _temp$N;
  var noop$e = func.noop;
  var BalloonInner = (_temp$N = _class$13 = function(_React$Component) {
    _default$4(BalloonInner2, _React$Component);
    function BalloonInner2() {
      _default$7(this, BalloonInner2);
      return _default$5(this, _React$Component.apply(this, arguments));
    }
    BalloonInner2.prototype.render = function render2() {
      var _classNames, _classNames2;
      var _props = this.props, prefix = _props.prefix, closable = _props.closable, className = _props.className, style = _props.style, isTooltip = _props.isTooltip, align = _props.align, title = _props.title, type2 = _props.type, onClose = _props.onClose, alignEdge = _props.alignEdge, v2 = _props.v2, children = _props.children, rtl = _props.rtl, locale = _props.locale, others = _default$3(_props, ["prefix", "closable", "className", "style", "isTooltip", "align", "title", "type", "onClose", "alignEdge", "v2", "children", "rtl", "locale"]);
      var alignMap2 = alignEdge || v2 ? edgeMap : normalMap;
      var _prefix = prefix;
      if (isTooltip) {
        _prefix = _prefix + "balloon-tooltip";
      } else {
        _prefix = _prefix + "balloon";
      }
      var closableInTitle = closable && title !== void 0;
      var closableInContent = closable && title === void 0;
      var classes = classnames((_classNames = {}, _classNames["" + _prefix] = true, _classNames[_prefix + "-" + type2] = type2, _classNames[_prefix + "-medium"] = true, _classNames[_prefix + "-" + alignMap2[align].arrow] = alignMap2[align], _classNames[_prefix + "-closable"] = closableInContent, _classNames[className] = className, _classNames));
      var titleCls = classnames((_classNames2 = {}, _classNames2[prefix + "balloon-title"] = true, _classNames2[_prefix + "-closable"] = closableInTitle, _classNames2));
      var closeIcon = React.createElement(
        "a",
        { role: "button", "aria-label": locale.close, tabIndex: "0", className: _prefix + "-close", onClick: onClose },
        React.createElement(Icon, { type: "close", size: "small" })
      );
      return React.createElement(
        "div",
        _default$8({
          role: "tooltip",
          "aria-live": "polite",
          dir: rtl ? "rtl" : void 0,
          className: classes,
          style
        }, obj.pickOthers(Object.keys(BalloonInner2.propTypes), others)),
        React.createElement(
          "div",
          { className: prefix + "balloon-arrow" },
          React.createElement("div", { className: prefix + "balloon-arrow-content" })
        ),
        title && React.createElement(
          "div",
          { className: titleCls },
          title,
          closableInTitle && closeIcon
        ),
        React.createElement(
          "div",
          { className: prefix + "balloon-content" },
          children
        ),
        closableInContent && closeIcon
      );
    };
    return BalloonInner2;
  }(React.Component), _class$13.contextTypes = {
    prefix: PropTypes$1.string
  }, _class$13.propTypes = {
    prefix: PropTypes$1.string,
    rtl: PropTypes$1.bool,
    closable: PropTypes$1.bool,
    children: PropTypes$1.any,
    title: PropTypes$1.node,
    className: PropTypes$1.string,
    alignEdge: PropTypes$1.bool,
    onClose: PropTypes$1.func,
    style: PropTypes$1.any,
    align: PropTypes$1.string,
    type: PropTypes$1.string,
    isTooltip: PropTypes$1.bool,
    locale: PropTypes$1.object,
    pure: PropTypes$1.bool,
    v2: PropTypes$1.bool
  }, _class$13.defaultProps = {
    prefix: "next-",
    closable: true,
    onClose: noop$e,
    locale: defaultLocale.Balloon,
    align: "b",
    type: "normal",
    alignEdge: false,
    pure: false
  }, _temp$N);
  BalloonInner.displayName = "BalloonInner";
  const Inner = BalloonInner;
  function getDisabledCompatibleTrigger(element) {
    if (element.type.displayName === "Config(Button)" && element.props.disabled) {
      var displayStyle = element.props.style && element.props.style.display ? element.props.style.display : "inline-block";
      var child = React.cloneElement(element, {
        style: _default$8({}, element.props.style, {
          pointerEvents: "none"
        })
      });
      return (
        // eslint-disable-next-line
        React.createElement(
          "span",
          { style: { display: displayStyle, cursor: "not-allowed" } },
          child
        )
      );
    }
    return element;
  }
  var _class$12, _temp$M;
  var noop$d = func.noop;
  var Popup$3 = Overlay$1.Popup;
  var alignList = ["t", "r", "b", "l", "tl", "tr", "bl", "br", "lt", "lb", "rt", "rb"];
  var alignMap$1 = normalMap;
  var Balloon$1 = (_temp$M = _class$12 = function(_React$Component) {
    _default$4(Balloon2, _React$Component);
    function Balloon2(props, context) {
      _default$7(this, Balloon2);
      var _this2 = _default$5(this, _React$Component.call(this, props, context));
      _this2.beforePosition = function(result, obj2) {
        var placement = result.config.placement;
        if (placement !== _this2.state.align) {
          _this2.setState({
            align: placement,
            innerAlign: true
          });
        }
        if (_this2.props.arrowPointToCenter) {
          var _obj$target = obj2.target, width = _obj$target.width, height = _obj$target.height;
          if (placement.length === 2) {
            var offset = normalMap[placement].offset;
            switch (placement[0]) {
              case "b":
              case "t":
                {
                  var plus = offset[0] > 0 ? 1 : -1;
                  result.style.left = result.style.left + plus * width / 2 - offset[0];
                }
                break;
              case "l":
              case "r":
                {
                  var _plus = offset[0] > 0 ? 1 : -1;
                  result.style.top = result.style.top + _plus * height / 2 - offset[1];
                }
                break;
            }
          }
        }
        return result;
      };
      _this2.state = {
        align: alignList.includes(props.align) ? props.align : "b",
        visible: "visible" in props ? props.visible : props.defaultVisible
      };
      _this2._onClose = _this2._onClose.bind(_this2);
      _this2._onPosition = _this2._onPosition.bind(_this2);
      _this2._onVisibleChange = _this2._onVisibleChange.bind(_this2);
      return _this2;
    }
    Balloon2.getDerivedStateFromProps = function getDerivedStateFromProps(nextProps, prevState) {
      var nextState = {};
      if ("visible" in nextProps) {
        nextState.visible = nextProps.visible;
      }
      if (!prevState.innerAlign && "align" in nextProps && alignList.includes(nextProps.align) && nextProps.align !== prevState.align) {
        nextState.align = nextProps.align;
        nextState.innerAlign = false;
      }
      return nextState;
    };
    Balloon2.prototype._onVisibleChange = function _onVisibleChange(visible, trigger) {
      if (!("visible" in this.props)) {
        this.setState({
          visible
        });
      }
      this.props.onVisibleChange(visible, trigger);
      if (!visible) {
        this.props.onClose();
      }
    };
    Balloon2.prototype._onClose = function _onClose(e2) {
      this._onVisibleChange(false, "closeClick");
      e2.preventDefault();
    };
    Balloon2.prototype._onPosition = function _onPosition(res) {
      var rtl = this.props.rtl;
      alignMap$1 = this.props.alignEdge ? edgeMap : normalMap;
      var newAlign = res.align.join(" ");
      var resAlign = void 0;
      var alignKey = "align";
      if (rtl) {
        alignKey = "rtlAlign";
      }
      for (var key in alignMap$1) {
        if (alignMap$1[key][alignKey] === newAlign) {
          resAlign = key;
          break;
        }
      }
      resAlign = resAlign || this.state.align;
      if (resAlign !== this.state.align) {
        this.setState({
          align: resAlign,
          innerAlign: true
        });
      }
    };
    Balloon2.prototype.render = function render2() {
      var _props = this.props, id2 = _props.id, type2 = _props.type, prefix = _props.prefix, className = _props.className, title = _props.title, alignEdge = _props.alignEdge, trigger = _props.trigger, triggerType = _props.triggerType, children = _props.children, closable = _props.closable, shouldUpdatePosition = _props.shouldUpdatePosition, delay = _props.delay, needAdjust = _props.needAdjust, autoAdjust = _props.autoAdjust, safeId = _props.safeId, autoFocus = _props.autoFocus, safeNode = _props.safeNode, onClick3 = _props.onClick, onHover = _props.onHover, animation2 = _props.animation, offset = _props.offset, style = _props.style, container4 = _props.container, popupContainer = _props.popupContainer, cache = _props.cache, popupStyle = _props.popupStyle, popupClassName = _props.popupClassName, popupProps = _props.popupProps, followTrigger = _props.followTrigger, rtl = _props.rtl, v2 = _props.v2;
      _props.arrowPointToCenter;
      var _props$placementOffse = _props.placementOffset, placementOffset = _props$placementOffse === void 0 ? 0 : _props$placementOffse, others = _default$3(_props, ["id", "type", "prefix", "className", "title", "alignEdge", "trigger", "triggerType", "children", "closable", "shouldUpdatePosition", "delay", "needAdjust", "autoAdjust", "safeId", "autoFocus", "safeNode", "onClick", "onHover", "animation", "offset", "style", "container", "popupContainer", "cache", "popupStyle", "popupClassName", "popupProps", "followTrigger", "rtl", "v2", "arrowPointToCenter", "placementOffset"]);
      if (container4) {
        log.deprecated("container", "popupContainer", "Balloon");
      }
      var align = this.state.align;
      alignMap$1 = alignEdge || v2 ? edgeMap : normalMap;
      var _prefix = this.context.prefix || prefix;
      var trOrigin = "trOrigin";
      if (rtl) {
        trOrigin = "rtlTrOrigin";
      }
      var _offset = [alignMap$1[align].offset[0] + offset[0], alignMap$1[align].offset[1] + offset[1]];
      var transformOrigin = alignMap$1[align][trOrigin];
      var _style = _default$8({ transformOrigin }, style);
      var content = React.createElement(
        Inner,
        _default$8({}, obj.pickOthers(Object.keys(Balloon2.propTypes), others), {
          id: id2,
          title,
          prefix: _prefix,
          closable,
          onClose: this._onClose,
          className,
          style: _style,
          align,
          type: type2,
          rtl,
          alignEdge,
          v2
        }),
        children
      );
      var triggerProps = {};
      triggerProps["aria-describedby"] = id2;
      triggerProps.tabIndex = "0";
      var ariaTrigger = id2 ? React.cloneElement(trigger, triggerProps) : trigger;
      var newTrigger = getDisabledCompatibleTrigger(React.isValidElement(ariaTrigger) ? ariaTrigger : React.createElement(
        "span",
        null,
        ariaTrigger
      ));
      var otherProps = {
        delay,
        shouldUpdatePosition,
        needAdjust,
        align: alignMap$1[align].align,
        offset: _offset,
        safeId,
        onHover,
        onPosition: this._onPosition
      };
      if (v2) {
        delete otherProps.align;
        delete otherProps.shouldUpdatePosition;
        delete otherProps.needAdjust;
        delete otherProps.safeId;
        delete otherProps.onHover;
        delete otherProps.onPosition;
        _default$8(otherProps, {
          placement: align,
          placementOffset: placementOffset + 12,
          v2: true,
          beforePosition: this.beforePosition,
          autoAdjust
        });
      }
      return React.createElement(
        Popup$3,
        _default$8({}, popupProps, {
          followTrigger,
          trigger: newTrigger,
          cache,
          triggerType,
          visible: this.state.visible,
          onClick: onClick3,
          afterClose: this.props.afterClose,
          onVisibleChange: this._onVisibleChange,
          animation: animation2,
          autoFocus: triggerType === "focus" ? false : autoFocus,
          safeNode,
          container: popupContainer || container4,
          className: popupClassName,
          style: popupStyle,
          rtl
        }, otherProps),
        content
      );
    };
    return Balloon2;
  }(React.Component), _class$12.contextTypes = {
    prefix: PropTypes$1.string
  }, _class$12.propTypes = {
    prefix: PropTypes$1.string,
    pure: PropTypes$1.bool,
    rtl: PropTypes$1.bool,
    /**
     * 自定义类名
     */
    className: PropTypes$1.string,
    /**
     * 自定义内敛样式
     */
    style: PropTypes$1.object,
    /**
     * 浮层的内容
     */
    children: PropTypes$1.any,
    size: PropTypes$1.string,
    /**
     * 样式类型
     */
    type: PropTypes$1.oneOf(["normal", "primary"]),
    /**
     * 标题
     * @version 1.23
     */
    title: PropTypes$1.node,
    /**
     * 弹层当前显示的状态
     */
    visible: PropTypes$1.bool,
    /**
     * 弹层默认显示的状态
     */
    defaultVisible: PropTypes$1.bool,
    /**
     * 弹层在显示和隐藏触发的事件
     * @param {Boolean} visible 弹层是否隐藏和显示
     * @param {String} type 触发弹层显示或隐藏的来源, closeClick 表示由自带的关闭按钮触发; fromTrigger 表示由trigger的点击触发; docClick 表示由document的点击触发
     */
    onVisibleChange: PropTypes$1.func,
    alignEdge: PropTypes$1.bool,
    /**
     * 开启 v2 版本
     * @version 1.25
     */
    v2: PropTypes$1.bool,
    /**
     * [v2] 箭头是否指向目标元素的中心
     * @version 1.25
     */
    arrowPointToCenter: PropTypes$1.bool,
    /**
     * [v2] 弹层偏离触发元素的像素值
     */
    placementOffset: PropTypes$1.number,
    /**
     * 是否显示关闭按钮
     */
    closable: PropTypes$1.bool,
    /**
     * 弹出层位置
     * @enumdesc 上, 右, 下, 左, 上左, 上右, 下左, 下右, 左上, 左下, 右上, 右下
     */
    align: PropTypes$1.oneOf(alignList),
    /**
     * 弹层相对于trigger的定位的微调, 接收数组[hoz, ver], 表示弹层在 left / top 上的增量
     * e.g. [100, 100] 表示往右(RTL 模式下是往左) 、下分布偏移100px
     */
    offset: PropTypes$1.array,
    /**
     * 触发元素
     */
    trigger: PropTypes$1.any,
    /**
     * 触发行为
     * 鼠标悬浮, 鼠标点击('hover','click')或者它们组成的数组,如 ['hover', 'click'], 强烈不建议使用'focus',若弹窗内容有复杂交互请使用click
     */
    triggerType: PropTypes$1.oneOfType([PropTypes$1.string, PropTypes$1.array]),
    onClick: PropTypes$1.func,
    /**
     * 任何visible为false时会触发的事件
     */
    onClose: PropTypes$1.func,
    onHover: PropTypes$1.func,
    /**
     * [v2] 是否进行自动位置调整,默认自动开启。
     * @version 1.25
     */
    autoAdjust: PropTypes$1.bool,
    needAdjust: PropTypes$1.bool,
    /**
     * 弹层在触发以后的延时显示, 单位毫秒 ms
     */
    delay: PropTypes$1.number,
    /**
     * 浮层关闭后触发的事件, 如果有动画,则在动画结束后触发
     */
    afterClose: PropTypes$1.func,
    shouldUpdatePosition: PropTypes$1.bool,
    /**
     * 弹层出现后是否自动focus到内部第一个元素
     */
    autoFocus: PropTypes$1.bool,
    /**
     * 安全节点:对于triggetType为click的浮层,会在点击除了浮层外的其它区域时关闭浮层.safeNode用于添加不触发关闭的节点, 值可以是dom节点的id或者是节点的dom对象
     */
    safeNode: PropTypes$1.string,
    /**
     * 用来指定safeNode节点的id,和safeNode配合使用
     */
    safeId: PropTypes$1.string,
    /**
     * 配置动画的播放方式,格式是{in: '', out: ''}, 常用的动画class请查看Animate组件文档
     * @param {String} in 进场动画
     * @param {String} out 出场动画
     */
    animation: PropTypes$1.oneOfType([PropTypes$1.object, PropTypes$1.bool]),
    /**
     * 弹层的dom节点关闭时是否删除
     */
    cache: PropTypes$1.bool,
    /**
     * 指定浮层渲染的父节点, 可以为节点id的字符串,也可以返回节点的函数。
     */
    popupContainer: PropTypes$1.any,
    container: PropTypes$1.any,
    /**
     * 弹层组件style,透传给Popup
     */
    popupStyle: PropTypes$1.object,
    /**
     * 弹层组件className,透传给Popup
     */
    popupClassName: PropTypes$1.string,
    /**
     * 弹层组件属性,透传给Popup
     */
    popupProps: PropTypes$1.object,
    /**
     * 是否跟随滚动
     */
    followTrigger: PropTypes$1.bool,
    /**
     * 弹层id, 传入值才会支持无障碍
     */
    id: PropTypes$1.string
  }, _class$12.defaultProps = {
    prefix: "next-",
    pure: false,
    type: "normal",
    closable: true,
    defaultVisible: false,
    size: "medium",
    alignEdge: false,
    arrowPointToCenter: false,
    align: "b",
    offset: [0, 0],
    trigger: React.createElement("span", null),
    onClose: noop$d,
    afterClose: noop$d,
    onVisibleChange: noop$d,
    needAdjust: false,
    triggerType: "hover",
    safeNode: void 0,
    safeId: null,
    autoFocus: true,
    animation: {
      in: "zoomIn zoomInBig",
      out: "zoomOut zoomOutBig"
    },
    cache: false,
    popupStyle: {},
    popupClassName: "",
    popupProps: {}
  }, _temp$M);
  Balloon$1.displayName = "Balloon";
  const Balloon$2 = polyfill(Balloon$1);
  var _class$11, _temp$L;
  var Popup$2 = Overlay$1.Popup;
  var alignMap = normalMap;
  var Tooltip = (_temp$L = _class$11 = function(_React$Component) {
    _default$4(Tooltip2, _React$Component);
    function Tooltip2(props) {
      _default$7(this, Tooltip2);
      var _this2 = _default$5(this, _React$Component.call(this, props));
      _this2.beforePosition = function(result, obj2) {
        var placement = result.config.placement;
        if (placement !== _this2.state.align) {
          _this2.setState({
            align: placement,
            innerAlign: true
          });
        }
        if (_this2.props.arrowPointToCenter) {
          var _obj$target = obj2.target, width = _obj$target.width, height = _obj$target.height;
          if (placement.length === 2) {
            var offset = normalMap[placement].offset;
            switch (placement[0]) {
              case "b":
              case "t":
                {
                  var plus = offset[0] > 0 ? 1 : -1;
                  result.style.left = result.style.left + plus * width / 2 - offset[0];
                }
                break;
              case "l":
              case "r":
                {
                  var _plus = offset[0] > 0 ? 1 : -1;
                  result.style.top = result.style.top + _plus * height / 2 - offset[1];
                }
                break;
            }
          }
        }
        return result;
      };
      _this2.state = {
        align: props.placement || props.align,
        innerAlign: false
      };
      return _this2;
    }
    Tooltip2.getDerivedStateFromProps = function getDerivedStateFromProps(nextProps, prevState) {
      if (nextProps.v2 && !prevState.innerAlign && "align" in nextProps && nextProps.align !== prevState.align) {
        return {
          align: nextProps.align,
          innerAlign: false
        };
      }
      return null;
    };
    Tooltip2.prototype.render = function render2() {
      var _props = this.props, id2 = _props.id, className = _props.className, palign = _props.align, style = _props.style, prefix = _props.prefix, trigger = _props.trigger, children = _props.children, popupContainer = _props.popupContainer, popupProps = _props.popupProps, popupClassName = _props.popupClassName, popupStyle = _props.popupStyle, followTrigger = _props.followTrigger, triggerType = _props.triggerType, autoFocus = _props.autoFocus, alignEdge = _props.alignEdge, autoAdjust = _props.autoAdjust, rtl = _props.rtl, delay = _props.delay, v2 = _props.v2;
      _props.arrowPointToCenter;
      var others = _default$3(_props, ["id", "className", "align", "style", "prefix", "trigger", "children", "popupContainer", "popupProps", "popupClassName", "popupStyle", "followTrigger", "triggerType", "autoFocus", "alignEdge", "autoAdjust", "rtl", "delay", "v2", "arrowPointToCenter"]);
      var trOrigin = "trOrigin";
      if (rtl) {
        others.rtl = true;
        trOrigin = "rtlTrOrigin";
      }
      alignMap = alignEdge || v2 ? edgeMap : normalMap;
      var align = v2 ? this.state.align : palign;
      var transformOrigin = alignMap[align][trOrigin];
      var _offset = alignMap[align].offset;
      var _style = _default$8({ transformOrigin }, style);
      var content = React.createElement(
        Inner,
        _default$8({}, others, {
          id: id2,
          prefix,
          closable: false,
          isTooltip: true,
          className,
          style: _style,
          align,
          rtl,
          alignEdge,
          v2
        }),
        children
      );
      var triggerProps = {};
      triggerProps["aria-describedby"] = id2;
      triggerProps.tabIndex = "0";
      var newTriggerType = triggerType;
      if (triggerType === "hover" && id2) {
        newTriggerType = ["focus", "hover"];
      }
      var ariaTrigger = id2 ? React.cloneElement(trigger, triggerProps) : trigger;
      var newTrigger = getDisabledCompatibleTrigger(React.isValidElement(ariaTrigger) ? ariaTrigger : React.createElement(
        "span",
        null,
        ariaTrigger
      ));
      var otherProps = {
        delay,
        shouldUpdatePosition: true,
        needAdjust: false,
        align: alignMap[align].align,
        offset: _offset
      };
      if (v2) {
        delete otherProps.align;
        delete otherProps.shouldUpdatePosition;
        delete otherProps.needAdjust;
        delete otherProps.offset;
        _default$8(otherProps, {
          placement: align,
          placementOffset: 12,
          v2: true,
          beforePosition: this.beforePosition,
          autoAdjust
        });
      }
      return React.createElement(
        Popup$2,
        _default$8({
          role: "tooltip",
          animation: {
            in: "zoomIn",
            out: "zoomOut"
          },
          className: popupClassName,
          container: popupContainer,
          followTrigger,
          trigger: newTrigger,
          triggerType: newTriggerType,
          style: popupStyle,
          rtl,
          autoFocus: triggerType === "focus" ? false : autoFocus
        }, otherProps, popupProps),
        content
      );
    };
    return Tooltip2;
  }(React.Component), _class$11.propTypes = {
    /**
     * 样式类名的品牌前缀
     */
    prefix: PropTypes$1.string,
    /**
     * 自定义类名
     */
    className: PropTypes$1.string,
    /**
     * 自定义内联样式
     */
    style: PropTypes$1.object,
    /**
     * tooltip的内容
     */
    children: PropTypes$1.any,
    /**
     * 弹出层位置
     * @enumdesc 上, 右, 下, 左, 上左, 上右, 下左, 下右, 左上, 左下, 右上, 右下
     */
    align: PropTypes$1.oneOf(["t", "r", "b", "l", "tl", "tr", "bl", "br", "lt", "lb", "rt", "rb"]),
    /**
     * 触发元素
     */
    trigger: PropTypes$1.any,
    /**
     * 触发行为
     * 鼠标悬浮,  鼠标点击('hover', 'click')或者它们组成的数组,如 ['hover', 'click'], 强烈不建议使用'focus',若有复杂交互,推荐使用triggerType为click的Balloon组件
     */
    triggerType: PropTypes$1.oneOfType([PropTypes$1.string, PropTypes$1.array]),
    /**
     * 弹层组件style,透传给Popup
     */
    popupStyle: PropTypes$1.object,
    /**
     * 弹层组件className,透传给Popup
     */
    popupClassName: PropTypes$1.string,
    /**
     * 弹层组件属性,透传给Popup
     */
    popupProps: PropTypes$1.object,
    /**
     * 是否pure render
     */
    pure: PropTypes$1.bool,
    /**
     * 指定浮层渲染的父节点, 可以为节点id的字符串,也可以返回节点的函数。
     */
    popupContainer: PropTypes$1.any,
    /**
     * 是否跟随滚动
     */
    followTrigger: PropTypes$1.bool,
    /**
     * 弹层id, 传入值才会支持无障碍
     */
    id: PropTypes$1.string,
    /**
     * 如果需要让 Tooltip 内容可被点击,可以设置这个参数,例如 100
     */
    delay: PropTypes$1.number,
    /**
     * 开启 v2 版本
     */
    v2: PropTypes$1.bool,
    /**
     * [v2] 箭头是否指向目标元素的中心
     */
    arrowPointToCenter: PropTypes$1.bool
  }, _class$11.defaultProps = {
    triggerType: "hover",
    prefix: "next-",
    align: "b",
    delay: 50,
    trigger: React.createElement("span", null),
    arrowPointToCenter: false
  }, _temp$L);
  Tooltip.displayName = "Tooltip";
  Balloon$2.Tooltip = ConfigProvider$1.config(Tooltip, {
    transform: (
      /* istanbul ignore next */
      function transform(props, deprecated2) {
        if ("text" in props) {
          deprecated2("text", "children", "Tooltip");
          var _props = props, text = _props.text, others = _default$3(_props, ["text"]);
          props = _default$8({ children: text }, others);
        }
        return props;
      }
    )
  });
  Balloon$2.Inner = Inner;
  const Balloon = ConfigProvider$1.config(Balloon$2, {
    transform: (
      /* istanbul ignore next */
      function transform2(props, deprecated2) {
        if (props.alignment) {
          deprecated2("alignment", "alignEdge", "Balloon");
          var _props2 = props, alignment = _props2.alignment, others = _default$3(_props2, ["alignment"]);
          props = _default$8({ alignEdge: alignment === "edge" }, others);
        }
        if (props.onCloseClick) {
          deprecated2("onCloseClick", 'onVisibleChange(visible, [type = "closeClick"])', "Balloon");
          var _props3 = props, onCloseClick = _props3.onCloseClick, onVisibleChange = _props3.onVisibleChange, _others = _default$3(_props3, ["onCloseClick", "onVisibleChange"]);
          var newOnVisibleChange = function newOnVisibleChange2(visible, type2) {
            if (type2 === "closeClick") {
              onCloseClick();
            }
            if (onVisibleChange) {
              onVisibleChange(visible, type2);
            }
          };
          props = _default$8({ onVisibleChange: newOnVisibleChange }, _others);
        }
        return props;
      }
    )
  });
  var _class$10, _temp$K;
  var noop$c = func.noop, makeChain$4 = func.makeChain, bindCtx$7 = func.bindCtx;
  var Popup$1 = Overlay$1.Popup;
  var Dropdown$1 = (_temp$K = _class$10 = function(_Component) {
    _default$4(Dropdown2, _Component);
    function Dropdown2(props) {
      _default$7(this, Dropdown2);
      var _this2 = _default$5(this, _Component.call(this, props));
      _this2.state = {
        visible: "visible" in props ? props.visible : props.defaultVisible || false,
        autoFocus: "autoFocus" in props ? props.autoFocus : false
      };
      bindCtx$7(_this2, ["onTriggerKeyDown", "onMenuClick", "onVisibleChange"]);
      return _this2;
    }
    Dropdown2.getDerivedStateFromProps = function getDerivedStateFromProps(nextProps) {
      var state = {};
      if ("visible" in nextProps) {
        state.visible = nextProps.visible;
      }
      return state;
    };
    Dropdown2.prototype.getVisible = function getVisible() {
      var props = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : this.props;
      return "visible" in props ? props.visible : this.state.visible;
    };
    Dropdown2.prototype.onMenuClick = function onMenuClick() {
      var autoClose = this.props.autoClose;
      if (!("visible" in this.props) && autoClose) {
        this.setState({
          visible: false
        });
      }
      this.onVisibleChange(false, "fromContent");
    };
    Dropdown2.prototype.onVisibleChange = function onVisibleChange(visible, from) {
      this.setState({ visible });
      this.props.onVisibleChange(visible, from);
    };
    Dropdown2.prototype.onTriggerKeyDown = function onTriggerKeyDown() {
      var autoFocus = true;
      if ("autoFocus" in this.props) {
        autoFocus = this.props.autoFocus;
      }
      this.setState({
        autoFocus
      });
    };
    Dropdown2.prototype.render = function render2() {
      var _props = this.props, trigger = _props.trigger, rtl = _props.rtl, autoClose = _props.autoClose;
      var child = React.Children.only(this.props.children);
      var content = child;
      if (typeof child.type === "function" && child.type.isNextMenu) {
        content = React.cloneElement(child, {
          onItemClick: makeChain$4(this.onMenuClick, child.props.onItemClick)
        });
      } else if (autoClose) {
        content = React.cloneElement(child, {
          onClick: makeChain$4(this.onMenuClick, child.props.onClick)
        });
      }
      var newTrigger = React.cloneElement(trigger, {
        onKeyDown: makeChain$4(this.onTriggerKeyDown, trigger.props.onKeyDown)
      });
      return React.createElement(
        Popup$1,
        _default$8({}, this.props, {
          rtl,
          autoFocus: this.state.autoFocus,
          trigger: newTrigger,
          visible: this.getVisible(),
          onVisibleChange: this.onVisibleChange,
          canCloseByOutSideClick: true
        }),
        content
      );
    };
    return Dropdown2;
  }(React.Component), _class$10.propTypes = {
    prefix: PropTypes$1.string,
    pure: PropTypes$1.bool,
    rtl: PropTypes$1.bool,
    className: PropTypes$1.string,
    /**
     * 弹层内容
     */
    children: PropTypes$1.node,
    /**
     * 弹层当前是否显示
     */
    visible: PropTypes$1.bool,
    /**
     * 弹层默认是否显示
     */
    defaultVisible: PropTypes$1.bool,
    /**
     * 弹层显示或隐藏时触发的回调函数
     * @param {Boolean} visible 弹层是否显示
     * @param {String} type 触发弹层显示或隐藏的来源 fromContent 表示由Dropdown内容触发; fromTrigger 表示由trigger的点击触发; docClick 表示由document的点击触发
     */
    onVisibleChange: PropTypes$1.func,
    /**
     * 触发弹层显示或者隐藏的元素
     */
    trigger: PropTypes$1.node,
    /**
     * 触发弹层显示或隐藏的操作类型,可以是 'click','hover',或者它们组成的数组,如 ['hover', 'click']
     */
    triggerType: PropTypes$1.oneOfType([PropTypes$1.string, PropTypes$1.array]),
    /**
     * 设置此属性,弹层无法显示或隐藏
     */
    disabled: PropTypes$1.bool,
    /**
     * 弹层相对于触发元素的定位, 详见 Overlay 的定位部分
     */
    align: PropTypes$1.string,
    /**
     * 弹层相对于trigger的定位的微调, 接收数组[hoz, ver], 表示弹层在 left / top 上的增量
     * e.g. [100, 100] 表示往右(RTL 模式下是往左) 、下分布偏移100px
     */
    offset: PropTypes$1.array,
    /**
     * 弹层显示或隐藏的延时时间(以毫秒为单位),在 triggerType 被设置为 hover 时生效
     */
    delay: PropTypes$1.number,
    /**
     * 弹层打开时是否让其中的元素自动获取焦点
     */
    autoFocus: PropTypes$1.bool,
    /**
     * 是否显示遮罩
     */
    hasMask: PropTypes$1.bool,
    /**
     * 开启后,children 不管是不是Menu,点击后都默认关掉弹层(2.x默认设置为true)
     * @version 1.23
     */
    autoClose: PropTypes$1.bool,
    /**
     * 隐藏时是否保留子节点
     */
    cache: PropTypes$1.bool,
    /**
     * 配置动画的播放方式,支持 { in: 'enter-class', out: 'leave-class' } 的对象参数,如果设置为 false,则不播放动画
     * @default { in: 'expandInDown', out: 'expandOutUp' }
     */
    animation: PropTypes$1.oneOfType([PropTypes$1.object, PropTypes$1.bool])
  }, _class$10.defaultProps = {
    prefix: "next-",
    pure: false,
    defaultVisible: false,
    autoClose: false,
    onVisibleChange: noop$c,
    triggerType: "hover",
    disabled: false,
    align: "tl bl",
    offset: [0, 0],
    delay: 200,
    hasMask: false,
    cache: false,
    onPosition: noop$c
  }, _temp$K);
  Dropdown$1.displayName = "Dropdown";
  const Dropdown = ConfigProvider$1.config(Dropdown$1, {
    transform: (
      /* istanbul ignore next */
      function transform3(props, deprecated2) {
        if ("triggerType" in props) {
          var triggerType = Array.isArray(props.triggerType) ? [].concat(props.triggerType) : [props.triggerType];
          if (triggerType.indexOf("focus") > -1) {
            deprecated2("triggerType[focus]", "triggerType[hover, click]", "Balloon");
          }
        }
        return props;
      }
    )
  });
  var _class$$, _temp$J;
  var bindCtx$6 = func.bindCtx;
  var pickOthers$8 = obj.pickOthers;
  var Item$1 = (_temp$J = _class$$ = function(_Component) {
    _default$4(Item2, _Component);
    function Item2(props) {
      _default$7(this, Item2);
      var _this2 = _default$5(this, _Component.call(this, props));
      bindCtx$6(_this2, ["handleClick", "handleKeyDown"]);
      return _this2;
    }
    Item2.prototype.componentDidMount = function componentDidMount() {
      this.itemNode = ReactDOM.findDOMNode(this);
      var _props = this.props, parentMode = _props.parentMode, root = _props.root, menu = _props.menu;
      if (menu) {
        this.menuNode = ReactDOM.findDOMNode(menu);
      } else if (parentMode === "popup") {
        this.menuNode = this.itemNode.parentNode;
      } else {
        this.menuNode = ReactDOM.findDOMNode(root);
        var _root$props = root.props, prefix = _root$props.prefix, header = _root$props.header, footer = _root$props.footer;
        if (header || footer) {
          this.menuNode = this.menuNode.querySelector("." + prefix + "menu-content");
        }
      }
      this.setFocus();
    };
    Item2.prototype.componentDidUpdate = function componentDidUpdate() {
      var root = this.props.root;
      if (root.props.focusable && root.state.focusedKey !== this.lastFocusedKey) {
        this.setFocus();
      }
    };
    Item2.prototype.focusable = function focusable() {
      var _props2 = this.props, root = _props2.root, type2 = _props2.type, disabled = _props2.disabled;
      var focusable2 = root.props.focusable;
      return focusable2 && (type2 === "submenu" || !disabled);
    };
    Item2.prototype.getFocused = function getFocused() {
      var _props3 = this.props, _key = _props3._key, root = _props3.root;
      var focusedKey = root.state.focusedKey;
      return focusedKey === _key;
    };
    Item2.prototype.setFocus = function setFocus() {
      var focused = this.getFocused();
      this.lastFocusedKey = this.props.root.state.focusedKey;
      if (focused) {
        if (this.focusable()) {
          this.itemNode.focus({ preventScroll: true });
        }
        if (this.menuNode && this.menuNode.scrollHeight > this.menuNode.clientHeight) {
          var scrollBottom = this.menuNode.clientHeight + this.menuNode.scrollTop;
          var itemBottom = this.itemNode.offsetTop + this.itemNode.offsetHeight;
          if (itemBottom > scrollBottom) {
            this.menuNode.scrollTop = itemBottom - this.menuNode.clientHeight;
          } else if (this.itemNode.offsetTop < this.menuNode.scrollTop) {
            this.menuNode.scrollTop = this.itemNode.offsetTop;
          }
        }
      }
    };
    Item2.prototype.handleClick = function handleClick(e2) {
      e2.stopPropagation();
      var _props4 = this.props, _key = _props4._key, root = _props4.root, disabled = _props4.disabled;
      if (!disabled) {
        root.handleItemClick(_key, this, e2);
        this.props.onClick && this.props.onClick(e2);
      } else {
        e2.preventDefault();
      }
    };
    Item2.prototype.handleKeyDown = function handleKeyDown(e2) {
      var _props5 = this.props, _key = _props5._key, root = _props5.root, type2 = _props5.type;
      if (this.focusable()) {
        root.handleItemKeyDown(_key, type2, this, e2);
        switch (e2.keyCode) {
          case KEYCODE.ENTER: {
            if (!(type2 === "submenu")) {
              this.handleClick(e2);
            }
            break;
          }
        }
      }
      this.props.onKeyDown && this.props.onKeyDown(e2);
    };
    Item2.prototype.getTitle = function getTitle(children) {
      if (typeof children === "string") {
        return children;
      }
      return;
    };
    Item2.prototype.render = function render2() {
      var _cx;
      var _props6 = this.props, inlineLevel = _props6.inlineLevel, root = _props6.root, replaceClassName2 = _props6.replaceClassName, groupIndent = _props6.groupIndent, component = _props6.component, disabled = _props6.disabled, className = _props6.className, children = _props6.children, needIndent = _props6.needIndent, parentMode = _props6.parentMode, _key = _props6._key;
      var others = pickOthers$8(Object.keys(Item2.propTypes), this.props);
      var _root$props2 = root.props, prefix = _root$props2.prefix, focusable = _root$props2.focusable, inlineIndent = _root$props2.inlineIndent, itemClassName = _root$props2.itemClassName, rtl = _root$props2.rtl;
      var focused = this.getFocused();
      var newClassName = replaceClassName2 ? className : classnames((_cx = {}, _cx[prefix + "menu-item"] = true, _cx[prefix + "disabled"] = disabled, _cx[prefix + "focused"] = !focusable && focused, _cx[itemClassName] = !!itemClassName, _cx[className] = !!className, _cx));
      if (disabled) {
        others["aria-disabled"] = true;
        others["aria-hidden"] = true;
      }
      others.tabIndex = root.state.tabbableKey === _key ? "0" : "-1";
      if (parentMode === "inline" && inlineLevel > 1 && inlineIndent > 0 && needIndent) {
        var _extends2;
        var paddingProp = rtl ? "paddingRight" : "paddingLeft";
        others.style = _default$8({}, others.style || {}, (_extends2 = {}, _extends2[paddingProp] = inlineLevel * inlineIndent - (groupIndent || 0) * 0.4 * inlineIndent + "px", _extends2));
      }
      var TagName = component;
      var role = "menuitem";
      if ("selectMode" in root.props) {
        role = "option";
      }
      return React.createElement(
        TagName,
        _default$8({
          role,
          title: this.getTitle(children)
        }, others, {
          className: newClassName,
          onClick: this.handleClick,
          onKeyDown: this.handleKeyDown
        }),
        React.createElement(
          "div",
          { className: prefix + "menu-item-inner" },
          children
        )
      );
    };
    return Item2;
  }(React.Component), _class$$.propTypes = {
    _key: PropTypes$1.string,
    level: PropTypes$1.number,
    inlineLevel: PropTypes$1.number,
    groupIndent: PropTypes$1.number,
    root: PropTypes$1.object,
    menu: PropTypes$1.any,
    parent: PropTypes$1.object,
    parentMode: PropTypes$1.oneOf(["inline", "popup"]),
    type: PropTypes$1.oneOf(["submenu", "item"]),
    component: PropTypes$1.string,
    disabled: PropTypes$1.bool,
    className: PropTypes$1.string,
    onClick: PropTypes$1.func,
    onKeyDown: PropTypes$1.func,
    needIndent: PropTypes$1.bool,
    replaceClassName: PropTypes$1.bool
  }, _class$$.defaultProps = {
    component: "li",
    groupIndent: 0,
    replaceClassName: false,
    needIndent: true
  }, _temp$J);
  Item$1.displayName = "Item";
  var _class$_, _temp$I;
  var bindCtx$5 = func.bindCtx;
  var pickOthers$7 = obj.pickOthers;
  var SelectableItem = (_temp$I = _class$_ = function(_Component) {
    _default$4(SelectableItem2, _Component);
    function SelectableItem2(props) {
      _default$7(this, SelectableItem2);
      var _this2 = _default$5(this, _Component.call(this, props));
      bindCtx$5(_this2, ["handleKeyDown", "handleClick"]);
      return _this2;
    }
    SelectableItem2.prototype.getSelected = function getSelected() {
      var _props = this.props, _key = _props._key, root = _props.root, selected = _props.selected;
      var selectMode = root.props.selectMode;
      var selectedKeys = root.state.selectedKeys;
      return selected || !!selectMode && selectedKeys.indexOf(_key) > -1;
    };
    SelectableItem2.prototype.handleSelect = function handleSelect(e2) {
      var _props2 = this.props, _key = _props2._key, root = _props2.root, onSelect = _props2.onSelect;
      if (onSelect) {
        onSelect(!this.getSelected(), this, e2);
      } else {
        root.handleSelect(_key, !this.getSelected(), this);
      }
    };
    SelectableItem2.prototype.handleKeyDown = function handleKeyDown(e2) {
      if (e2.keyCode === KEYCODE.SPACE && !this.props.disabled) {
        this.handleSelect(e2);
      }
      this.props.onKeyDown && this.props.onKeyDown(e2);
    };
    SelectableItem2.prototype.handleClick = function handleClick(e2) {
      this.handleSelect(e2);
      this.props.onClick && this.props.onClick(e2);
    };
    SelectableItem2.prototype.renderSelectedIcon = function renderSelectedIcon(selected) {
      var _cx;
      var _props3 = this.props, root = _props3.root, inlineIndent = _props3.inlineIndent, needIndent = _props3.needIndent, hasSelectedIcon = _props3.hasSelectedIcon, isSelectIconRight = _props3.isSelectIconRight, type2 = _props3.type;
      var _root$props = root.props, prefix = _root$props.prefix, rootSelectedIcon = _root$props.hasSelectedIcon, rootSelectIconRight = _root$props.isSelectIconRight, icons = _root$props.icons;
      var iconsSelect = icons.select;
      if (!React.isValidElement(icons.select) && icons.select) {
        iconsSelect = React.createElement(
          "span",
          null,
          icons.select
        );
      }
      var cls = classnames((_cx = {}, _cx[prefix + "menu-icon-selected"] = true, _cx[prefix + "menu-symbol-icon-selected"] = !iconsSelect, _cx[prefix + "menu-icon-right"] = ("isSelectIconRight" in this.props ? isSelectIconRight : rootSelectIconRight) && type2 !== "submenu", _cx));
      return ("hasSelectedIcon" in this.props ? hasSelectedIcon : rootSelectedIcon) && selected ? React.cloneElement(iconsSelect || React.createElement(Icon, { type: "select" }), {
        style: needIndent && inlineIndent > 0 ? { left: inlineIndent + "px" } : null,
        className: cls
      }) : null;
    };
    SelectableItem2.prototype.render = function render2() {
      var _cx2;
      var _props4 = this.props, _key = _props4._key, root = _props4.root, className = _props4.className, disabled = _props4.disabled, helper = _props4.helper, children = _props4.children, needIndent = _props4.needIndent;
      var prefix = root.props.prefix;
      var others = pickOthers$7(Object.keys(SelectableItem2.propTypes), this.props);
      var selected = this.getSelected();
      var newProps = _default$8({
        _key,
        root,
        disabled,
        type: "item",
        className: classnames((_cx2 = {}, _cx2[prefix + "selected"] = selected, _cx2[className] = !!className, _cx2)),
        onKeyDown: this.handleKeyDown,
        onClick: !disabled ? this.handleClick : this.props.onClick,
        needIndent
      }, others);
      if (!("title" in newProps) && typeof children === "string") {
        newProps.title = children;
      }
      var textProps = {};
      if ("selectMode" in root.props) {
        textProps["aria-selected"] = selected;
      }
      return React.createElement(
        Item$1,
        newProps,
        this.renderSelectedIcon(selected),
        React.createElement(
          "span",
          _default$8({ className: prefix + "menu-item-text" }, textProps),
          children
        ),
        helper ? React.createElement(
          "div",
          { className: prefix + "menu-item-helper" },
          helper
        ) : null
      );
    };
    return SelectableItem2;
  }(React.Component), _class$_.menuChildType = "item", _class$_.propTypes = {
    _key: PropTypes$1.string,
    root: PropTypes$1.object,
    selected: PropTypes$1.bool,
    onSelect: PropTypes$1.func,
    inlineIndent: PropTypes$1.number,
    /**
     * 是否禁用
     */
    disabled: PropTypes$1.bool,
    /**
     * 帮助文本
     */
    helper: PropTypes$1.node,
    /**
     * 菜单项标签内容
     */
    children: PropTypes$1.node,
    className: PropTypes$1.string,
    onKeyDown: PropTypes$1.func,
    onClick: PropTypes$1.func,
    needIndent: PropTypes$1.bool,
    hasSelectedIcon: PropTypes$1.bool,
    isSelectIconRight: PropTypes$1.bool,
    icons: PropTypes$1.object
  }, _class$_.defaultProps = {
    disabled: false,
    needIndent: true,
    icons: {}
  }, _temp$I);
  SelectableItem.displayName = "SelectableItem";
  var getWidth = function getWidth2(elem) {
    var width = elem && typeof elem.getBoundingClientRect === "function" && elem.getBoundingClientRect().width;
    if (width) {
      width = +width.toFixed(6);
    }
    return width || 0;
  };
  var normalizeToArray = function normalizeToArray2(items) {
    if (items) {
      if (Array.isArray(items)) {
        return items;
      }
      return [items];
    }
    return [];
  };
  var isSibling = function isSibling2(currentPos, targetPos) {
    var currentNums = currentPos.split("-").slice(0, -1);
    var targetNums = targetPos.split("-").slice(0, -1);
    return currentNums.length === targetNums.length && currentNums.every(function(num, index2) {
      return num === targetNums[index2];
    });
  };
  var isAncestor = function isAncestor2(currentPos, targetPos) {
    var currentNums = currentPos.split("-");
    var targetNums = targetPos.split("-");
    return currentNums.length > targetNums.length && targetNums.every(function(num, index2) {
      return num === currentNums[index2];
    });
  };
  var isAvailablePos = function isAvailablePos2(refPos, targetPos, _p2n) {
    var _p2n$targetPos = _p2n[targetPos], type2 = _p2n$targetPos.type, disabled = _p2n$targetPos.disabled;
    return isSibling(refPos, targetPos) && (type2 === "item" && !disabled || type2 === "submenu");
  };
  var getFirstAvaliablelChildKey = function getFirstAvaliablelChildKey2(parentPos, _p2n) {
    var pos = Object.keys(_p2n).find(function(p2) {
      return isAvailablePos(parentPos + "-0", p2, _p2n);
    });
    return pos ? _p2n[pos].key : null;
  };
  var getChildSelected = function getChildSelected2(_ref) {
    var selectMode = _ref.selectMode, selectedKeys = _ref.selectedKeys, _k2n = _ref._k2n, _key = _ref._key;
    if (!_k2n) {
      return false;
    }
    var _keyPos = (_k2n[_key] && _k2n[_key].pos) + "-";
    return !!selectMode && selectedKeys.some(function(key) {
      return _k2n[key] && _k2n[key].pos.indexOf(_keyPos) === 0;
    });
  };
  var _class$Z, _temp$H;
  var bindCtx$4 = func.bindCtx;
  var setStyle = dom.setStyle;
  var Popup3 = Overlay$1.Popup;
  var PopupItem = (_temp$H = _class$Z = function(_Component) {
    _default$4(PopupItem2, _Component);
    function PopupItem2(props) {
      _default$7(this, PopupItem2);
      var _this2 = _default$5(this, _Component.call(this, props));
      bindCtx$4(_this2, ["handleOpen", "handlePopupOpen", "handlePopupClose", "getPopup"]);
      return _this2;
    }
    PopupItem2.prototype.getPopup = function getPopup(ref) {
      this.popup = ref;
    };
    PopupItem2.prototype.getOpen = function getOpen() {
      var _props = this.props, _key = _props._key, root = _props.root;
      var openKeys = root.state.openKeys;
      return openKeys.indexOf(_key) > -1;
    };
    PopupItem2.prototype.getPopupProps = function getPopupProps() {
      var popupProps = this.props.root.props.popupProps;
      if (typeof popupProps === "function") {
        popupProps = popupProps(this.props);
      }
      return popupProps;
    };
    PopupItem2.prototype.handleOpen = function handleOpen(open2, triggerType, e2) {
      var _props2 = this.props, _key = _props2._key, root = _props2.root;
      root.handleOpen(_key, open2, triggerType, e2);
      var popupProps = this.popupProps;
      popupProps.onVisibleChange && popupProps.onVisibleChange(open2, triggerType, e2);
    };
    PopupItem2.prototype.handlePopupOpen = function handlePopupOpen() {
      var _props3 = this.props, root = _props3.root, level = _props3.level, align = _props3.align, autoWidth = _props3.autoWidth;
      var _root$props = root.props, rootPopupAutoWidth = _root$props.popupAutoWidth, rootPopupAlign = _root$props.popupAlign, direction = _root$props.direction;
      var popupAlign = align || rootPopupAlign;
      var popupAutoWidth = "autoWidth" in this.props ? autoWidth : rootPopupAutoWidth;
      try {
        var itemNode = ReactDOM.findDOMNode(this);
        var menuNode = itemNode.parentNode;
        this.popupNode = this.popup.getInstance().overlay.getInstance().getContentNode();
        root.popupNodes.push(this.popupNode);
        if (popupAutoWidth) {
          var targetNode = direction === "hoz" && level === 1 ? itemNode : menuNode;
          if (targetNode.offsetWidth > this.popupNode.offsetWidth) {
            setStyle(this.popupNode, "width", targetNode.offsetWidth + "px");
          }
        }
        if (popupAlign === "outside" && !(direction === "hoz" && level === 1)) {
          setStyle(this.popupNode, "height", menuNode.offsetHeight + "px");
          this.popupNode.firstElementChild && setStyle(this.popupNode.firstElementChild, "overflow-y", "auto");
        }
        var popupProps = this.popupProps;
        popupProps.onOpen && popupProps.onOpen();
      } catch (error) {
        return null;
      }
    };
    PopupItem2.prototype.handlePopupClose = function handlePopupClose() {
      var root = this.props.root;
      var popupNodes = root.popupNodes;
      var index2 = popupNodes.indexOf(this.popupNode);
      index2 > -1 && popupNodes.splice(index2, 1);
      var popupProps = this.popupProps;
      popupProps.onClose && popupProps.onClose();
    };
    PopupItem2.prototype.renderItem = function renderItem(selectable, children, others) {
      var _cx;
      var _props4 = this.props, _key = _props4._key, root = _props4.root, level = _props4.level, inlineLevel = _props4.inlineLevel, label = _props4.label, className = _props4.className;
      var _root$props2 = root.props, prefix = _root$props2.prefix, selectMode = _root$props2.selectMode;
      var NewItem = selectable ? SelectableItem : Item$1;
      var open2 = this.getOpen();
      var _root$state = root.state, selectedKeys = _root$state.selectedKeys, _k2n = _root$state._k2n;
      var isChildSelected = getChildSelected({
        _key,
        _k2n,
        selectMode,
        selectedKeys
      });
      var itemProps = {
        "aria-haspopup": true,
        "aria-expanded": open2,
        _key,
        root,
        level,
        inlineLevel,
        type: "submenu"
      };
      itemProps.className = classnames((_cx = {}, _cx[prefix + "opened"] = open2, _cx[prefix + "child-selected"] = isChildSelected, _cx[className] = !!className, _cx));
      return React.createElement(
        NewItem,
        _default$8({}, itemProps, others),
        React.createElement(
          "span",
          { className: prefix + "menu-item-text" },
          label
        ),
        children
      );
    };
    PopupItem2.prototype.renderPopup = function renderPopup(trigger, triggerType, positionProps, children) {
      var _this2 = this;
      var _props5 = this.props, root = _props5.root, level = _props5.level, selectable = _props5.selectable, propCls = _props5.className;
      var direction = root.props.direction;
      this.popupProps = this.getPopupProps();
      var open2 = this.getOpen();
      if (direction === "hoz" && level === 1 && selectable) {
        positionProps.target = function() {
          return ReactDOM.findDOMNode(_this2);
        };
      }
      var posCls = positionProps.className, otherPostion = _default$3(positionProps, ["className"]);
      var className = classnames(propCls, posCls);
      return React.createElement(
        Popup3,
        _default$8({
          ref: this.getPopup
        }, otherPostion, this.popupProps, {
          canCloseByEsc: false,
          trigger,
          triggerType,
          visible: open2,
          pinFollowBaseElementWhenFixed: true,
          onVisibleChange: this.handleOpen,
          onOpen: this.handlePopupOpen,
          onClose: this.handlePopupClose
        }),
        React.createElement(
          "div",
          { className },
          children
        )
      );
    };
    PopupItem2.prototype.render = function render2() {
      var _this3 = this;
      var _props6 = this.props, root = _props6.root, level = _props6.level, hasSubMenu = _props6.hasSubMenu, selectableFromProps = _props6.selectable, children = _props6.children, triggerType = _props6.triggerType, align = _props6.align, noIcon = _props6.noIcon;
      _props6.rtl;
      var others = obj.pickOthers(Object.keys(PopupItem2.propTypes), this.props);
      var _root$props3 = root.props, prefix = _root$props3.prefix, selectMode = _root$props3.selectMode, direction = _root$props3.direction, rootPopupAlign = _root$props3.popupAlign, rootTriggerType = _root$props3.triggerType;
      var popupAlign = align || rootPopupAlign;
      var newTriggerType = triggerType || (hasSubMenu ? rootTriggerType : "hover");
      var newChildren = Array.isArray(children) ? children[0] : children;
      var selectable = selectMode && selectableFromProps;
      var triggerIsIcon = selectable && newTriggerType === "click";
      var open2 = this.getOpen();
      var positionProps = {};
      var arrowProps = void 0;
      if (direction === "hoz" && level === 1) {
        var _cx2;
        positionProps.align = "tl bl";
        positionProps.className = prefix + "menu-spacing-tb";
        arrowProps = {
          type: "arrow-down",
          className: classnames((_cx2 = {}, _cx2[prefix + "menu-hoz-icon-arrow"] = true, _cx2[prefix + "open"] = open2, _cx2))
        };
      } else {
        if (popupAlign === "outside") {
          positionProps.target = function() {
            return ReactDOM.findDOMNode(root);
          };
          positionProps.align = "tl tr";
          positionProps.className = prefix + "menu-spacing-lr " + prefix + "menu-outside";
        } else {
          if (triggerIsIcon) {
            positionProps.target = function() {
              return ReactDOM.findDOMNode(_this3);
            };
          }
          positionProps.align = "tl tr";
          positionProps.className = prefix + "menu-spacing-lr";
        }
        arrowProps = {
          type: "arrow-right",
          className: prefix + "menu-icon-arrow " + prefix + "menu-symbol-popupfold"
        };
      }
      var arrow = React.createElement(Icon, arrowProps);
      var trigger = triggerIsIcon ? arrow : this.renderItem(selectable, noIcon ? null : arrow, others);
      var popup = this.renderPopup(trigger, newTriggerType, positionProps, newChildren);
      return triggerIsIcon ? this.renderItem(selectable, popup, others) : popup;
    };
    return PopupItem2;
  }(React.Component), _class$Z.menuChildType = "submenu", _class$Z.propTypes = {
    _key: PropTypes$1.string,
    root: PropTypes$1.object,
    level: PropTypes$1.number,
    hasSubMenu: PropTypes$1.bool,
    noIcon: PropTypes$1.bool,
    rtl: PropTypes$1.bool,
    selectable: PropTypes$1.bool,
    /**
     * 标签内容
     */
    label: PropTypes$1.node,
    /**
     * 自定义弹层内容
     */
    children: PropTypes$1.node,
    className: PropTypes$1.string,
    /**
     * 子菜单打开的触发行为
     */
    triggerType: PropTypes$1.oneOf(["click", "hover"]),
    align: PropTypes$1.oneOf(["outside", "follow"]),
    autoWidth: PropTypes$1.bool
  }, _class$Z.defaultProps = {
    selectable: false,
    noIcon: false
  }, _temp$H);
  PopupItem.displayName = "PopupItem";
  var _class$Y, _temp$G;
  var Expand = Animate$1.Expand;
  var bindCtx$3 = func.bindCtx;
  var SubMenu = (_temp$G = _class$Y = function(_Component) {
    _default$4(SubMenu2, _Component);
    function SubMenu2(props) {
      _default$7(this, SubMenu2);
      var _this2 = _default$5(this, _Component.call(this, props));
      bindCtx$3(_this2, ["handleMouseEnter", "handleMouseLeave", "handleClick", "handleOpen", "afterLeave"]);
      return _this2;
    }
    SubMenu2.prototype.componentDidMount = function componentDidMount() {
      this.itemNode = ReactDOM.findDOMNode(this);
    };
    SubMenu2.prototype.afterLeave = function afterLeave() {
      var _props = this.props, focused = _props.focused, root = _props.root;
      var focusable = root.props.focusable;
      if (focusable && focused) {
        this.itemNode.focus();
      }
    };
    SubMenu2.prototype.getOpen = function getOpen() {
      var _props2 = this.props, _key = _props2._key, root = _props2.root;
      var openKeys = root.state.openKeys;
      return openKeys.indexOf(_key) > -1;
    };
    SubMenu2.prototype.handleMouseEnter = function handleMouseEnter(e2) {
      this.handleOpen(true);
      this.props.onMouseEnter && this.props.onMouseEnter(e2);
    };
    SubMenu2.prototype.handleMouseLeave = function handleMouseLeave(e2) {
      this.handleOpen(false);
      this.props.onMouseLeave && this.props.onMouseLeave(e2);
    };
    SubMenu2.prototype.handleClick = function handleClick(e2) {
      var _props3 = this.props, root = _props3.root, selectable = _props3.selectable;
      var selectMode = root.props.selectMode;
      if (selectMode && selectable) {
        e2.stopPropagation();
      }
      var open2 = this.getOpen();
      this.handleOpen(!open2);
    };
    SubMenu2.prototype.handleOpen = function handleOpen(open2, triggerType, e2) {
      var _props4 = this.props, _key = _props4._key, root = _props4.root;
      root.handleOpen(_key, open2, triggerType, e2);
    };
    SubMenu2.prototype.passParentToChildren = function passParentToChildren(children) {
      var _this2 = this;
      var _props5 = this.props, mode = _props5.mode, root = _props5.root;
      return React.Children.map(children, function(child) {
        if (typeof child !== "function" && (typeof child === "undefined" ? "undefined" : _default$6(child)) !== "object") {
          return child;
        }
        return React.cloneElement(child, {
          parent: _this2,
          parentMode: mode || root.props.mode
        });
      });
    };
    SubMenu2.prototype.renderInline = function renderInline() {
      var _cx, _cx2, _cx3, _cx4;
      var _props6 = this.props, _key = _props6._key, level = _props6.level, inlineLevel = _props6.inlineLevel, root = _props6.root, className = _props6.className, selectableFromProps = _props6.selectable, label = _props6.label, children = _props6.children, noIcon = _props6.noIcon, subMenuContentClassName = _props6.subMenuContentClassName, propsTriggerType = _props6.triggerType, parentMode = _props6.parentMode;
      var _root$props = root.props, prefix = _root$props.prefix, selectMode = _root$props.selectMode, rootTriggerType = _root$props.triggerType, inlineArrowDirection = _root$props.inlineArrowDirection, expandAnimation = _root$props.expandAnimation, rtl = _root$props.rtl;
      var triggerType = propsTriggerType || rootTriggerType;
      var open2 = this.getOpen();
      var _root$state = root.state, selectedKeys = _root$state.selectedKeys, _k2n = _root$state._k2n;
      var isChildSelected = getChildSelected({
        _key,
        _k2n,
        selectMode,
        selectedKeys
      });
      var others = obj.pickOthers(Object.keys(SubMenu2.propTypes), this.props);
      var liProps = {
        className: classnames((_cx = {}, _cx[prefix + "menu-sub-menu-wrapper"] = true, _cx[className] = !!className, _cx))
      };
      var itemProps = {
        "aria-expanded": open2,
        _key,
        level,
        role: "listitem",
        inlineLevel,
        root,
        type: "submenu",
        component: "div",
        parentMode,
        className: classnames((_cx2 = {}, _cx2[prefix + "opened"] = open2, _cx2[prefix + "child-selected"] = isChildSelected, _cx2))
      };
      if (typeof label === "string") {
        itemProps.title = label;
      }
      var arrorProps = {
        type: inlineArrowDirection === "right" ? "arrow-right" : "arrow-down",
        className: classnames((_cx3 = {}, _cx3[prefix + "menu-icon-arrow"] = true, _cx3[prefix + "menu-icon-arrow-down"] = inlineArrowDirection === "down", _cx3[prefix + "menu-icon-arrow-right"] = inlineArrowDirection === "right", _cx3[prefix + "open"] = open2, _cx3))
      };
      var selectable = !!selectMode && selectableFromProps;
      var NewItem = selectable ? SelectableItem : Item$1;
      if (triggerType === "hover") {
        liProps.onMouseEnter = this.handleMouseEnter;
        liProps.onMouseLeave = this.handleMouseLeave;
      } else if (selectable) {
        arrorProps.onClick = this.handleClick;
      } else {
        itemProps.onClick = this.handleClick;
      }
      var newSubMenuContentClassName = classnames((_cx4 = {}, _cx4[prefix + "menu-sub-menu"] = true, _cx4[subMenuContentClassName] = !!subMenuContentClassName, _cx4));
      var roleMenu = "menu", roleItem = "menuitem";
      if ("selectMode" in root.props) {
        roleMenu = "listbox";
        roleItem = "option";
      }
      var subMenu = open2 ? React.createElement(
        "ul",
        { role: roleMenu, dir: rtl ? "rtl" : void 0, className: newSubMenuContentClassName },
        this.passParentToChildren(children)
      ) : null;
      return React.createElement(
        "li",
        _default$8({ role: roleItem }, others, liProps),
        React.createElement(
          NewItem,
          itemProps,
          React.createElement(
            "span",
            { className: prefix + "menu-item-text" },
            label
          ),
          noIcon ? null : React.createElement(Icon, arrorProps)
        ),
        expandAnimation ? React.createElement(
          Expand,
          { animationAppear: false, afterLeave: this.afterLeave },
          subMenu
        ) : subMenu
      );
    };
    SubMenu2.prototype.renderPopup = function renderPopup() {
      var _cx5;
      var _props7 = this.props, children = _props7.children, subMenuContentClassName = _props7.subMenuContentClassName, noIcon = _props7.noIcon, others = _default$3(_props7, ["children", "subMenuContentClassName", "noIcon"]);
      var root = this.props.root;
      var _root$props2 = root.props, prefix = _root$props2.prefix, popupClassName = _root$props2.popupClassName, popupStyle = _root$props2.popupStyle, rtl = _root$props2.rtl;
      var newClassName = classnames((_cx5 = {}, _cx5[prefix + "menu"] = true, _cx5[prefix + "ver"] = true, _cx5[popupClassName] = !!popupClassName, _cx5[subMenuContentClassName] = !!subMenuContentClassName, _cx5));
      others.rtl = rtl;
      return React.createElement(
        PopupItem,
        _default$8({}, others, { noIcon, hasSubMenu: true }),
        React.createElement(
          "ul",
          { role: "menu", dir: rtl ? "rtl" : void 0, className: newClassName, style: popupStyle },
          this.passParentToChildren(children)
        )
      );
    };
    SubMenu2.prototype.render = function render2() {
      var _props8 = this.props, mode = _props8.mode, root = _props8.root;
      var newMode = mode || root.props.mode;
      return newMode === "popup" ? this.renderPopup() : this.renderInline();
    };
    return SubMenu2;
  }(React.Component), _class$Y.menuChildType = "submenu", _class$Y.propTypes = {
    _key: PropTypes$1.string,
    root: PropTypes$1.object,
    level: PropTypes$1.number,
    inlineLevel: PropTypes$1.number,
    groupIndent: PropTypes$1.number,
    /**
     * 标签内容
     */
    label: PropTypes$1.node,
    /**
     * 是否可选,该属性仅在设置 Menu 组件 selectMode 属性后生效
     */
    selectable: PropTypes$1.bool,
    /**
     * 子菜单打开方式,如果设置会覆盖 Menu 上的同名属性
     * @default Menu 的 mode 属性值
     */
    mode: PropTypes$1.oneOf(["inline", "popup"]),
    /**
     * 是否需要提示当前项可展开的 icon,默认是有的
     */
    noIcon: PropTypes$1.bool,
    /**
     * 菜单项或下一级子菜单
     */
    children: PropTypes$1.node,
    onMouseEnter: PropTypes$1.func,
    onMouseLeave: PropTypes$1.func,
    subMenuContentClassName: PropTypes$1.string,
    triggerType: PropTypes$1.oneOf(["click", "hover"]),
    align: PropTypes$1.oneOf(["outside", "follow"]),
    parentMode: PropTypes$1.oneOf(["inline", "popup"]),
    parent: PropTypes$1.any
  }, _class$Y.defaultProps = {
    groupIndent: 0,
    noIcon: false,
    selectable: false
  }, _temp$G);
  SubMenu.displayName = "SubMenu";
  var _class$X, _temp$F;
  var bindCtx$2 = func.bindCtx;
  var pickOthers$6 = obj.pickOthers, isNil$1 = obj.isNil;
  var noop$b = function noop5() {
  };
  var MENUITEM_OVERFLOWED_CLASSNAME = "menuitem-overflowed";
  var getIndicatorsItem = function getIndicatorsItem2(items, isPlaceholder) {
    var _cx;
    var prefix = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : "";
    var renderMore = arguments[3];
    var moreCls = classnames((_cx = {}, _cx[prefix + "menu-more"] = true, _cx));
    var style = {};
    if (isPlaceholder) {
      style.visibility = "hidden";
      style.display = "inline-block";
    } else if (items && items.length === 0) {
      style.display = "none";
      style.visibility = "unset";
    }
    if (renderMore && typeof renderMore === "function") {
      var moreNode = renderMore(items);
      var renderMoreCls = classnames(moreCls, moreNode.props && moreNode.props.className);
      return React.isValidElement(moreNode) ? React.cloneElement(moreNode, {
        style,
        className: renderMoreCls
      }) : moreNode;
    }
    return React.createElement(
      SubMenu,
      { label: "···", noIcon: true, className: moreCls, style },
      items
    );
  };
  var addIndicators = function addIndicators2(_ref) {
    var children = _ref.children, lastVisibleIndex = _ref.lastVisibleIndex, prefix = _ref.prefix, renderMore = _ref.renderMore;
    var arr = [];
    React.Children.forEach(children, function(child, index2) {
      if (!child) {
        return;
      }
      var overflowedItems = [];
      if (index2 > lastVisibleIndex) {
        child = React.cloneElement(child, {
          // 别折叠不显示的 item,不占用真实的用户传入的 key
          key: "more-" + index2,
          style: { display: "none" },
          className: (child && child.className || "") + " " + MENUITEM_OVERFLOWED_CLASSNAME
        });
      }
      if (index2 === lastVisibleIndex + 1) {
        overflowedItems = children.slice(lastVisibleIndex + 1).map(function(c2, i) {
          return React.cloneElement(c2, {
            key: c2.key || "more-" + index2 + "-" + i
          });
        });
        arr.push(getIndicatorsItem(overflowedItems, false, prefix, renderMore));
      }
      arr.push(child);
    });
    arr.push(getIndicatorsItem([], true, prefix, renderMore));
    return arr;
  };
  var getNewChildren$1 = function getNewChildren(_ref2) {
    var children = _ref2.children, root = _ref2.root, mode = _ref2.mode, lastVisibleIndex = _ref2.lastVisibleIndex, hozInLine = _ref2.hozInLine, prefix = _ref2.prefix, renderMore = _ref2.renderMore;
    var k2n = {};
    var p2n = {};
    var arr = hozInLine ? addIndicators({
      children,
      lastVisibleIndex,
      prefix,
      renderMore
    }) : children;
    var loop = function loop2(children2, posPrefix) {
      var indexWrapper = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : { index: 0 };
      var inlineLevel = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : 1;
      var keyArray = [];
      return React.Children.map(children2, function(child) {
        if (child && (typeof child.type === "function" || // `React.forwardRef(render)` returns a forwarding
        // object that includes `render` method, and the specific
        // `child.type` will be an object instead of a class or
        // function.
        _default$6(child.type) === "object") && "menuChildType" in child.type) {
          var newChild = void 0;
          var pos = void 0;
          var props = { root };
          if (["item", "submenu", "group"].indexOf(child.type.menuChildType) > -1) {
            pos = posPrefix + "-" + indexWrapper.index++;
            var key = typeof child.key === "string" ? child.key : pos;
            if (keyArray.indexOf(key) > -1) {
              return;
            }
            keyArray.push(key);
            var level = pos.split("-").length - 1;
            k2n[key] = p2n[pos] = {
              key,
              pos,
              mode: child.props.mode,
              type: child.type.menuChildType,
              disabled: child.props.disabled,
              label: child.props.label || child.props.children
            };
            props.level = level;
            props.inlineLevel = inlineLevel;
            props._key = key;
            props.groupIndent = child.type.menuChildType === "group" ? 1 : 0;
          }
          var childLevel = (child.props.mode || mode) === "popup" ? 1 : inlineLevel + 1;
          switch (child.type.menuChildType) {
            case "submenu":
              newChild = React.cloneElement(child, props, loop2(child.props.children, pos, void 0, childLevel));
              break;
            case "group":
              newChild = React.cloneElement(child, props, loop2(child.props.children, posPrefix, indexWrapper, props.level));
              break;
            case "item":
            case "divider":
              newChild = React.cloneElement(child, props);
              break;
            default:
              newChild = child;
              break;
          }
          return newChild;
        }
        return child;
      });
    };
    var newChildren = loop(arr, "0");
    return {
      newChildren,
      _k2n: k2n,
      _p2n: p2n
    };
  };
  var Menu$2 = (_temp$F = _class$X = function(_Component) {
    _default$4(Menu2, _Component);
    function Menu2(props) {
      _default$7(this, Menu2);
      var _this2 = _default$5(this, _Component.call(this, props));
      _this2.getUpdateChildren = function() {
        var _this$state = _this2.state, root = _this$state.root, lastVisibleIndex = _this$state.lastVisibleIndex;
        return getNewChildren$1(_default$8({
          root,
          lastVisibleIndex
        }, _this2.props));
      };
      _this2.menuContentRef = function(ref) {
        _this2.menuContent = ref;
      };
      _this2.menuHeaderRef = function(ref) {
        _this2.menuHeader = ref;
      };
      _this2.menuFooterRef = function(ref) {
        _this2.menuFooter = ref;
      };
      var _this$props = _this2.props;
      _this$props.prefix;
      _this$props.children;
      var selectedKeys = _this$props.selectedKeys, defaultSelectedKeys = _this$props.defaultSelectedKeys, focusedKey = _this$props.focusedKey, focusable = _this$props.focusable, autoFocus = _this$props.autoFocus;
      _this$props.hozInLine;
      _this$props.renderMore;
      _this2.state = {
        lastVisibleIndex: void 0
      };
      var _getNewChildren = getNewChildren$1(_default$8({
        root: _this2
      }, _this2.props)), newChildren = _getNewChildren.newChildren, _k2n = _getNewChildren._k2n, _p2n = _getNewChildren._p2n;
      var tabbableKey = focusable ? getFirstAvaliablelChildKey("0", _p2n) : void 0;
      _this2.state = {
        root: _this2,
        lastVisibleIndex: void 0,
        newChildren,
        _k2n,
        _p2n,
        tabbableKey,
        openKeys: _this2.getInitOpenKeys(props, _k2n, _p2n),
        selectedKeys: normalizeToArray(selectedKeys || defaultSelectedKeys),
        focusedKey: !isNil$1(_this2.props.focusedKey) ? focusedKey : focusable && autoFocus ? tabbableKey : null
      };
      bindCtx$2(_this2, ["handleOpen", "handleSelect", "handleItemClick", "handleItemKeyDown", "onBlur", "adjustChildrenWidth"]);
      _this2.popupNodes = [];
      return _this2;
    }
    Menu2.getDerivedStateFromProps = function getDerivedStateFromProps(nextProps, prevState) {
      var state = {};
      if ("openKeys" in nextProps) {
        state.openKeys = normalizeToArray(nextProps.openKeys);
      } else if ("mode" in nextProps && nextProps.mode === "popup" && prevState.lastMode === "inline") {
        state.openKeys = [];
      }
      if ("selectedKeys" in nextProps) {
        state.selectedKeys = normalizeToArray(nextProps.selectedKeys);
      }
      if ("focusedKey" in nextProps) {
        state.focusedKey = nextProps.focusedKey;
      }
      state.lastMode = nextProps.mode;
      var _getNewChildren2 = getNewChildren$1(_default$8({
        root: prevState.root,
        lastVisibleIndex: prevState.lastVisibleIndex
      }, nextProps)), newChildren = _getNewChildren2.newChildren, _k2n = _getNewChildren2._k2n, _p2n = _getNewChildren2._p2n;
      state.newChildren = newChildren;
      state._k2n = _k2n;
      state._p2n = _p2n;
      if (nextProps.focusable) {
        if (prevState.tabbableKey in _k2n) {
          if (prevState.focusedKey) {
            state.tabbableKey = prevState.focusedKey;
          }
        } else {
          state.tabbableKey = getFirstAvaliablelChildKey("0", _p2n);
        }
      }
      return state;
    };
    Menu2.prototype.componentDidMount = function componentDidMount() {
      this.menuNode = ReactDOM.findDOMNode(this);
      this.adjustChildrenWidth();
      if (this.props.hozInLine) {
        events.on(window, "resize", this.adjustChildrenWidth);
      }
    };
    Menu2.prototype.componentDidUpdate = function componentDidUpdate(prevProps, prevState) {
      if (prevState.lastVisibleIndex !== this.state.lastVisibleIndex) {
        this.adjustChildrenWidth();
      }
    };
    Menu2.prototype.componentWillUnmount = function componentWillUnmount() {
      events.off(window, "resize", this.adjustChildrenWidth);
    };
    Menu2.prototype.adjustChildrenWidth = function adjustChildrenWidth() {
      var _props = this.props, direction = _props.direction, prefix = _props.prefix, header = _props.header, footer = _props.footer, hozInLine = _props.hozInLine;
      if (direction !== "hoz" || !hozInLine) {
        return;
      }
      if (!this.menuNode && !this.menuContent) {
        return;
      }
      var children = [], spaceWidth = void 0;
      if (header || footer) {
        children = this.menuContent.children;
        spaceWidth = getWidth(this.menuNode) - getWidth(this.menuHeader) - getWidth(this.menuFooter);
      } else {
        children = this.menuNode.children;
        spaceWidth = getWidth(this.menuNode);
      }
      if (children.length < 2) {
        return;
      }
      var currentSumWidth = 0, lastVisibleIndex = -1;
      var moreNode = "";
      var menuItemNodes = [].slice.call(children).filter(function(node) {
        if (node.className.split(" ").indexOf(prefix + "menu-more") < 0) {
          return true;
        } else {
          moreNode = node;
        }
        return false;
      });
      var overflowedItems = menuItemNodes.filter(function(c2) {
        return c2.className.split(" ").indexOf(MENUITEM_OVERFLOWED_CLASSNAME) >= 0;
      });
      overflowedItems.forEach(function(c2) {
        dom.setStyle(c2, "display", "inline-block");
      });
      dom.setStyle(moreNode, "display", "inline-block");
      var moreWidth = getWidth(moreNode);
      this.menuItemSizes = menuItemNodes.map(function(c2) {
        return getWidth(c2);
      });
      var totalLen = this.menuItemSizes.length;
      overflowedItems.forEach(function(c2) {
        dom.setStyle(c2, "display", "none");
      });
      this.menuItemSizes.forEach(function(liWidth, i) {
        currentSumWidth += liWidth;
        if (i >= totalLen - 1 && currentSumWidth <= spaceWidth || currentSumWidth + moreWidth <= spaceWidth) {
          lastVisibleIndex++;
        }
      });
      if (lastVisibleIndex >= totalLen - 1) {
        dom.setStyle(moreNode, "display", "none");
      }
      this.setState(_default$8({
        lastVisibleIndex
      }, this.getUpdateChildren()));
    };
    Menu2.prototype.onBlur = function onBlur(e2) {
      this.setState({
        focusedKey: void 0
      });
      this.props.onBlur && this.props.onBlur(e2);
    };
    Menu2.prototype.getInitOpenKeys = function getInitOpenKeys(props, _k2n, _p2n) {
      var initOpenKeys = void 0;
      var openKeys = props.openKeys, defaultOpenKeys = props.defaultOpenKeys, defaultOpenAll = props.defaultOpenAll, mode = props.mode, openMode = props.openMode;
      if (openKeys) {
        initOpenKeys = openKeys;
      } else if (defaultOpenAll && mode === "inline" && openMode === "multiple") {
        initOpenKeys = Object.keys(_k2n).filter(function(key) {
          return _k2n[key].type === "submenu";
        });
      } else {
        initOpenKeys = defaultOpenKeys;
      }
      return normalizeToArray(initOpenKeys);
    };
    Menu2.prototype.handleOpen = function handleOpen(key, open2, triggerType, e2) {
      var newOpenKeys = void 0;
      var _props2 = this.props, mode = _props2.mode, openMode = _props2.openMode;
      var _state = this.state, openKeys = _state.openKeys, _k2n = _state._k2n;
      var index2 = openKeys.indexOf(key);
      if (open2 && index2 === -1) {
        if (mode === "inline") {
          if (openMode === "single") {
            newOpenKeys = openKeys.filter(function(k2) {
              return _k2n[k2] && !isSibling(_k2n[key].pos, _k2n[k2].pos);
            });
            newOpenKeys.push(key);
          } else {
            newOpenKeys = openKeys.concat(key);
          }
        } else {
          newOpenKeys = openKeys.filter(function(k2) {
            return _k2n[k2] && isAncestor(_k2n[key].pos, _k2n[k2].pos);
          });
          newOpenKeys.push(key);
        }
      } else if (!open2 && index2 > -1) {
        if (mode === "inline") {
          newOpenKeys = [].concat(openKeys.slice(0, index2), openKeys.slice(index2 + 1));
        } else if (triggerType === "docClick") {
          if (!this.popupNodes.concat(this.menuNode).some(function(node) {
            return node.contains(e2.target);
          })) {
            newOpenKeys = [];
          }
        } else {
          newOpenKeys = openKeys.filter(function(k2) {
            return k2 !== key && _k2n[k2] && !isAncestor(_k2n[k2].pos, _k2n[key].pos);
          });
        }
      }
      if (newOpenKeys) {
        if (isNil$1(this.props.openKeys)) {
          this.setState(_default$8({
            openKeys: newOpenKeys
          }, this.getUpdateChildren()));
        }
        this.props.onOpen(newOpenKeys, {
          key,
          open: open2
        });
      }
    };
    Menu2.prototype.getPath = function getPath(key, _k2n, _p2n) {
      var keyPath = [];
      var labelPath = [];
      var pos = _k2n[key].pos;
      var nums = pos.split("-");
      for (var i = 1; i < nums.length - 1; i++) {
        var parentNums = nums.slice(0, i + 1);
        var parentPos = parentNums.join("-");
        var parent = _p2n[parentPos];
        keyPath.push(parent.key);
        labelPath.push(parent.label);
      }
      return {
        keyPath,
        labelPath
      };
    };
    Menu2.prototype.handleSelect = function handleSelect(key, select, menuItem) {
      var _state2 = this.state, _k2n = _state2._k2n, _p2n = _state2._p2n;
      var pos = _k2n[key].pos;
      var level = pos.split("-").length - 1;
      if (this.props.shallowSelect && level > 1) {
        return;
      }
      var newSelectedKeys = void 0;
      var selectMode = this.props.selectMode;
      var selectedKeys = this.state.selectedKeys;
      var index2 = selectedKeys.indexOf(key);
      if (select && index2 === -1) {
        if (selectMode === "single") {
          newSelectedKeys = [key];
        } else if (selectMode === "multiple") {
          newSelectedKeys = selectedKeys.concat(key);
        }
      } else if (!select && index2 > -1 && selectMode === "multiple") {
        newSelectedKeys = [].concat(selectedKeys.slice(0, index2), selectedKeys.slice(index2 + 1));
      }
      if (newSelectedKeys) {
        if (isNil$1(this.props.selectedKeys)) {
          this.setState({
            selectedKeys: newSelectedKeys
          });
        }
        this.props.onSelect(newSelectedKeys, menuItem, _default$8({
          key,
          select,
          label: _k2n[key].label
        }, this.getPath(key, _k2n, _p2n)));
      }
    };
    Menu2.prototype.handleItemClick = function handleItemClick(key, item, e2) {
      var _k2n = this.state._k2n;
      if (this.props.focusable) {
        if (isNil$1(this.props.focusedKey)) {
          this.setState({
            focusedKey: key
          });
        }
        this.props.onItemFocus(key, item, e2);
      }
      if (item.props.type === "item") {
        if (item.props.parentMode === "popup" && this.state.openKeys.length) {
          if (isNil$1(this.props.openKeys)) {
            this.setState({
              openKeys: []
            });
          }
          this.props.onOpen([], {
            key: this.state.openKeys.sort(function(prevKey, nextKey) {
              return _k2n[nextKey].pos.split("-").length - _k2n[prevKey].pos.split("-").length;
            })[0],
            open: false
          });
        }
        this.props.onItemClick(key, item, e2);
      }
    };
    Menu2.prototype.getAvailableKey = function getAvailableKey(pos, prev) {
      var _p2n = this.state._p2n;
      var ps = Object.keys(_p2n).filter(function(p2) {
        return isAvailablePos(pos, p2, _p2n);
      });
      if (ps.length > 1) {
        var index2 = ps.indexOf(pos);
        var targetIndex = void 0;
        if (prev) {
          targetIndex = index2 === 0 ? ps.length - 1 : index2 - 1;
        } else {
          targetIndex = index2 === ps.length - 1 ? 0 : index2 + 1;
        }
        return _p2n[ps[targetIndex]].key;
      }
      return null;
    };
    Menu2.prototype.getParentKey = function getParentKey(pos) {
      return this.state._p2n[pos.slice(0, pos.length - 2)].key;
    };
    Menu2.prototype.handleItemKeyDown = function handleItemKeyDown(key, type2, item, e2) {
      if ([KEYCODE.UP, KEYCODE.DOWN, KEYCODE.RIGHT, KEYCODE.LEFT, KEYCODE.ENTER, KEYCODE.ESC, KEYCODE.SPACE].indexOf(e2.keyCode) > -1) {
        e2.preventDefault();
        e2.stopPropagation();
      }
      var focusedKey = this.state.focusedKey;
      var _state3 = this.state, _p2n = _state3._p2n, _k2n = _state3._k2n;
      var direction = this.props.direction;
      var pos = _k2n[key].pos;
      var level = pos.split("-").length - 1;
      switch (e2.keyCode) {
        case KEYCODE.UP: {
          var avaliableKey = this.getAvailableKey(pos, true);
          if (avaliableKey) {
            focusedKey = avaliableKey;
          }
          break;
        }
        case KEYCODE.DOWN: {
          var _avaliableKey = void 0;
          if (direction === "hoz" && level === 1 && type2 === "submenu") {
            this.handleOpen(key, true);
            _avaliableKey = getFirstAvaliablelChildKey(pos, _p2n);
          } else {
            _avaliableKey = this.getAvailableKey(pos, false);
          }
          if (_avaliableKey) {
            focusedKey = _avaliableKey;
          }
          break;
        }
        case KEYCODE.RIGHT: {
          var _avaliableKey2 = void 0;
          if (direction === "hoz" && level === 1) {
            _avaliableKey2 = this.getAvailableKey(pos, false);
          } else if (type2 === "submenu") {
            this.handleOpen(key, true);
            _avaliableKey2 = getFirstAvaliablelChildKey(pos, _p2n);
          }
          if (_avaliableKey2) {
            focusedKey = _avaliableKey2;
          }
          break;
        }
        case KEYCODE.ENTER: {
          if (type2 === "submenu") {
            this.handleOpen(key, true);
            var _avaliableKey3 = getFirstAvaliablelChildKey(pos, _p2n);
            if (_avaliableKey3) {
              focusedKey = _avaliableKey3;
            }
          }
          break;
        }
        case KEYCODE.LEFT: {
          if (direction === "hoz" && level === 1) {
            var _avaliableKey4 = this.getAvailableKey(pos, true);
            if (_avaliableKey4) {
              focusedKey = _avaliableKey4;
            }
          } else if (level > 1) {
            var parentKey = this.getParentKey(pos);
            this.handleOpen(parentKey, false);
            focusedKey = parentKey;
          }
          break;
        }
        case KEYCODE.ESC:
          if (level > 1) {
            var _parentKey = this.getParentKey(pos);
            this.handleOpen(_parentKey, false);
            focusedKey = _parentKey;
          }
          break;
        case KEYCODE.TAB:
          focusedKey = null;
          break;
      }
      if (focusedKey !== this.state.focusedKey) {
        if (isNil$1(this.props.focusedKey)) {
          this.setState({
            focusedKey
          });
        }
        this.props.onItemKeyDown(focusedKey, item, e2);
        this.props.onItemFocus(focusedKey, e2);
      }
    };
    Menu2.prototype.render = function render2() {
      var _cx2, _cx3;
      var _props3 = this.props, prefix = _props3.prefix, className = _props3.className, direction = _props3.direction, hozAlign = _props3.hozAlign, header = _props3.header, footer = _props3.footer, footerWrapperClassName = _props3.footerWrapperClassName, embeddable = _props3.embeddable, selectMode = _props3.selectMode, hozInLine = _props3.hozInLine, rtl = _props3.rtl, flatenContent = _props3.flatenContent;
      var newChildren = this.state.newChildren;
      var others = pickOthers$6(Object.keys(Menu2.propTypes), this.props);
      var newClassName = classnames((_cx2 = {}, _cx2[prefix + "menu"] = true, _cx2[prefix + "ver"] = direction === "ver", _cx2[prefix + "hoz"] = direction === "hoz", _cx2[prefix + "menu-embeddable"] = embeddable, _cx2[prefix + "menu-nowrap"] = hozInLine, _cx2[prefix + "menu-selectable-" + selectMode] = selectMode, _cx2[className] = !!className, _cx2));
      var role = direction === "hoz" ? "menubar" : "menu";
      var ariaMultiselectable = void 0;
      if ("selectMode" in this.props) {
        role = "listbox";
        ariaMultiselectable = !!(selectMode === "multiple");
      }
      var headerElement = header ? React.createElement(
        "li",
        { className: prefix + "menu-header", ref: this.menuHeaderRef },
        header
      ) : null;
      var itemsElement = !flatenContent && (header || footer) ? React.createElement(
        "ul",
        { className: prefix + "menu-content", ref: this.menuContentRef },
        newChildren
      ) : newChildren;
      var footerElement = footer ? React.createElement(
        "li",
        {
          className: classnames((_cx3 = {}, _cx3[prefix + "menu-footer"] = true, _cx3[footerWrapperClassName] = !!footerWrapperClassName, _cx3)),
          ref: this.menuFooterRef
        },
        footer
      ) : null;
      var shouldWrapItemsAndFooter = hozAlign === "right" && !!header;
      if (rtl) {
        others.dir = "rtl";
      }
      return React.createElement(
        "ul",
        _default$8({
          role,
          onBlur: this.onBlur,
          className: newClassName,
          onKeyDown: this.handleEnter,
          "aria-multiselectable": ariaMultiselectable
        }, others),
        headerElement,
        shouldWrapItemsAndFooter ? React.createElement(
          "div",
          { className: prefix + "menu-hoz-right" },
          itemsElement,
          footerElement
        ) : null,
        !shouldWrapItemsAndFooter ? itemsElement : null,
        !shouldWrapItemsAndFooter ? footerElement : null
      );
    };
    return Menu2;
  }(React.Component), _class$X.isNextMenu = true, _class$X.propTypes = _default$8({}, ConfigProvider$1.propTypes, {
    prefix: PropTypes$1.string,
    pure: PropTypes$1.bool,
    rtl: PropTypes$1.bool,
    className: PropTypes$1.string,
    /**
     * 菜单项和子菜单
     */
    children: PropTypes$1.node,
    /**
     * 点击菜单项触发的回调函数
     * @param {String} key 点击的菜单项的 key 值
     * @param {Object} item 点击的菜单项对象
     * @param {Object} event 点击的事件对象
     */
    onItemClick: PropTypes$1.func,
    /**
     * 当前打开的子菜单的 key 值
     */
    openKeys: PropTypes$1.oneOfType([PropTypes$1.string, PropTypes$1.array]),
    /**
     * 初始打开的子菜单的 key 值
     */
    defaultOpenKeys: PropTypes$1.oneOfType([PropTypes$1.string, PropTypes$1.array]),
    /**
     * 初始展开所有的子菜单,只在 mode 设置为 'inline' 以及 openMode 设置为 'multiple' 下生效,优先级高于 defaultOpenKeys
     */
    defaultOpenAll: PropTypes$1.bool,
    /**
     * 打开或关闭子菜单触发的回调函数
     * @param {Array} key 打开的所有子菜单的 key 值
     * @param {Object} extra 额外参数
     * @param {String} extra.key 当前操作子菜单的 key 值
     * @param {Boolean} extra.open 是否是打开
     */
    onOpen: PropTypes$1.func,
    /**
     * 子菜单打开的模式
     */
    mode: PropTypes$1.oneOf(["inline", "popup"]),
    /**
     * 子菜单打开的触发行为
     */
    triggerType: PropTypes$1.oneOf(["click", "hover"]),
    /**
     * 展开内连子菜单的模式,同时可以展开一个子菜单还是多个子菜单,该属性仅在 mode 为 inline 时生效
     */
    openMode: PropTypes$1.oneOf(["single", "multiple"]),
    /**
     * 内连子菜单缩进距离
     */
    inlineIndent: PropTypes$1.number,
    inlineArrowDirection: PropTypes$1.oneOf(["down", "right"]),
    /**
     * 是否自动让弹层的宽度和菜单项保持一致,如果弹层的宽度比菜单项小则和菜单项保持一致,如果宽度大于菜单项则不做处理
     */
    popupAutoWidth: PropTypes$1.bool,
    /**
     * 弹层的对齐方式
     */
    popupAlign: PropTypes$1.oneOf(["follow", "outside"]),
    /**
     * 弹层自定义 props
     */
    popupProps: PropTypes$1.oneOfType([PropTypes$1.object, PropTypes$1.func]),
    /**
     * 弹出子菜单自定义 className
     */
    popupClassName: PropTypes$1.string,
    /**
     * 弹出子菜单自定义 style
     */
    popupStyle: PropTypes$1.object,
    /**
     * 当前选中菜单项的 key 值
     */
    selectedKeys: PropTypes$1.oneOfType([PropTypes$1.string, PropTypes$1.array]),
    /**
     * 初始选中菜单项的 key 值
     */
    defaultSelectedKeys: PropTypes$1.oneOfType([PropTypes$1.string, PropTypes$1.array]),
    /**
     * 选中或取消选中菜单项触发的回调函数
     * @param {Array} selectedKeys 选中的所有菜单项的值
     * @param {Object} item 选中或取消选中的菜单项
     * @param {Object} extra 额外参数
     * @param {Boolean} extra.select 是否是选中
     * @param {Array} extra.key 菜单项的 key
     * @param {Object} extra.label 菜单项的文本
     * @param {Array} extra.keyPath 菜单项 key 的路径
     */
    onSelect: PropTypes$1.func,
    /**
     * 选中模式,单选还是多选,默认无值,不可选
     */
    selectMode: PropTypes$1.oneOf(["single", "multiple"]),
    /**
     * 是否只能选择第一层菜单项(不能选择子菜单中的菜单项)
     */
    shallowSelect: PropTypes$1.bool,
    /**
     * 是否显示选中图标,如果设置为 false 需配合配置平台设置选中时的背景色以示区分
     */
    hasSelectedIcon: PropTypes$1.bool,
    labelToggleChecked: PropTypes$1.bool,
    /**
     * 是否将选中图标居右,仅当 hasSelectedIcon 为true 时生效。
     * 注意:SubMenu 上的选中图标一直居左,不受此API控制
     */
    isSelectIconRight: PropTypes$1.bool,
    /**
     * 菜单第一层展示方向
     */
    direction: PropTypes$1.oneOf(["ver", "hoz"]),
    /**
     * 横向菜单条 item 和 footer 的对齐方向,在 direction 设置为 'hoz' 并且 header 存在时生效
     */
    hozAlign: PropTypes$1.oneOf(["left", "right"]),
    /**
     * 横向菜单模式下,是否维持在一行,即超出一行折叠成 SubMenu 显示, 仅在 direction='hoz' mode='popup' 时生效
     */
    hozInLine: PropTypes$1.bool,
    renderMore: PropTypes$1.func,
    /**
     * 自定义菜单头部
     */
    header: PropTypes$1.node,
    /**
     * 自定义菜单尾部
     */
    footer: PropTypes$1.node,
    /**
     * 自定义菜单尾部容器的 className
     */
    footerWrapperClassName: PropTypes$1.string,
    /**
     * 是否自动获得焦点
     */
    autoFocus: PropTypes$1.bool,
    /**
     * 当前获得焦点的子菜单或菜单项 key 值
     */
    focusedKey: PropTypes$1.oneOfType([PropTypes$1.string, PropTypes$1.number, PropTypes$1.object]),
    focusable: PropTypes$1.bool,
    onItemFocus: PropTypes$1.func,
    onBlur: PropTypes$1.func,
    /**
     * 是否开启嵌入式模式,一般用于Layout的布局中,开启后没有默认背景、外层border、box-shadow,可以配合`<Menu style={{lineHeight: '100px'}}>` 自定义高度
     * @version 1.18
     */
    embeddable: PropTypes$1.bool,
    onItemKeyDown: PropTypes$1.func,
    expandAnimation: PropTypes$1.bool,
    itemClassName: PropTypes$1.string,
    /**
     * 可配置的icons,包括 select 等
     */
    icons: PropTypes$1.object,
    // content 是否为单层模式,目前主要在有 header 或 footer 的时候有意义
    flatenContent: PropTypes$1.bool
  }), _class$X.defaultProps = {
    prefix: "next-",
    pure: false,
    defaultOpenKeys: [],
    defaultOpenAll: false,
    onOpen: noop$b,
    mode: "inline",
    triggerType: "click",
    openMode: "multiple",
    inlineIndent: 20,
    inlineArrowDirection: "down",
    popupAutoWidth: false,
    popupAlign: "follow",
    popupProps: {},
    defaultSelectedKeys: [],
    onSelect: noop$b,
    shallowSelect: false,
    hasSelectedIcon: true,
    isSelectIconRight: false,
    labelToggleChecked: true,
    direction: "ver",
    hozAlign: "left",
    hozInLine: false,
    autoFocus: false,
    focusable: true,
    embeddable: false,
    onItemFocus: noop$b,
    onItemKeyDown: noop$b,
    onItemClick: noop$b,
    expandAnimation: true,
    icons: {}
  }, _temp$F);
  Menu$2.displayName = "Menu";
  const Menu$3 = polyfill(Menu$2);
  var $export = _export;
  $export($export.S + $export.F * !_descriptors, "Object", { defineProperty: _objectDp.f });
  var $Object = _coreExports.Object;
  var defineProperty$2 = function defineProperty3(it, key, desc) {
    return $Object.defineProperty(it, key, desc);
  };
  var defineProperty$1 = { "default": defineProperty$2, __esModule: true };
  var _defineProperty = defineProperty$1;
  var _defineProperty2$1 = _interopRequireDefault$1(_defineProperty);
  function _interopRequireDefault$1(obj2) {
    return obj2 && obj2.__esModule ? obj2 : { default: obj2 };
  }
  var _default$1 = function() {
    function defineProperties3(target, props) {
      for (var i = 0; i < props.length; i++) {
        var descriptor2 = props[i];
        descriptor2.enumerable = descriptor2.enumerable || false;
        descriptor2.configurable = true;
        if ("value" in descriptor2)
          descriptor2.writable = true;
        (0, _defineProperty2$1.default)(target, descriptor2.key, descriptor2);
      }
    }
    return function(Constructor, protoProps, staticProps) {
      if (protoProps)
        defineProperties3(Constructor.prototype, protoProps);
      if (staticProps)
        defineProperties3(Constructor, staticProps);
      return Constructor;
    };
  }();
  var makeChain$3 = func.makeChain;
  var UIState = function(_Component) {
    _default$4(UIState2, _Component);
    function UIState2(props) {
      _default$7(this, UIState2);
      var _this2 = _default$5(this, _Component.call(this, props));
      _this2.state = {};
      ["_onUIFocus", "_onUIBlur"].forEach(function(item) {
        _this2[item] = _this2[item].bind(_this2);
      });
      return _this2;
    }
    UIState2.prototype.getStateElement = function getStateElement(base) {
      var _props = this.props, onFocus = _props.onFocus, onBlur = _props.onBlur;
      return React.cloneElement(base, {
        onFocus: makeChain$3(this._onUIFocus, onFocus),
        onBlur: makeChain$3(this._onUIBlur, onBlur)
      });
    };
    UIState2.prototype.getStateClassName = function getStateClassName() {
      var focused = this.state.focused;
      return classnames({
        focused
      });
    };
    UIState2.prototype.resetUIState = function resetUIState() {
      this.setState({
        focused: false
      });
    };
    UIState2.prototype._onUIFocus = function _onUIFocus() {
      this.setState({
        focused: true
      });
    };
    UIState2.prototype._onUIBlur = function _onUIBlur() {
      this.setState({
        focused: false
      });
    };
    return UIState2;
  }(React.Component);
  UIState.displayName = "UIState";
  const UIState$1 = UIState;
  function withContext$2(Checkbox2) {
    var _class2, _temp3;
    return _temp3 = _class2 = function(_React$Component) {
      _default$4(WrappedComp, _React$Component);
      function WrappedComp() {
        _default$7(this, WrappedComp);
        return _default$5(this, _React$Component.apply(this, arguments));
      }
      WrappedComp.prototype.render = function render2() {
        return React.createElement(Checkbox2, _default$8({}, this.props, { context: this.context }));
      };
      return WrappedComp;
    }(React.Component), _class2.displayName = "Checkbox", _class2.contextTypes = {
      onChange: PropTypes$1.func,
      __group__: PropTypes$1.bool,
      selectedValue: PropTypes$1.array,
      disabled: PropTypes$1.bool,
      prefix: PropTypes$1.string
    }, _temp3;
  }
  var _class$W, _temp$E;
  var noop$a = func.noop;
  function isChecked(selectedValue, value) {
    return selectedValue.indexOf(value) > -1;
  }
  var Checkbox = (_temp$E = _class$W = function(_UIState) {
    _default$4(Checkbox2, _UIState);
    function Checkbox2(props) {
      _default$7(this, Checkbox2);
      var _this2 = _default$5(this, _UIState.call(this, props));
      var context = props.context;
      var checked = void 0, indeterminate = void 0;
      if ("checked" in props) {
        checked = props.checked;
      } else {
        checked = props.defaultChecked;
      }
      if ("indeterminate" in props) {
        indeterminate = props.indeterminate;
      } else {
        indeterminate = props.defaultIndeterminate;
      }
      if (context.__group__) {
        checked = isChecked(context.selectedValue, props.value);
      }
      _this2.state = {
        checked,
        indeterminate
      };
      _this2.onChange = _this2.onChange.bind(_this2);
      return _this2;
    }
    Checkbox2.getDerivedStateFromProps = function getDerivedStateFromProps(nextProps) {
      var nextContext = nextProps.context;
      var state = {};
      if (nextContext.__group__) {
        if ("selectedValue" in nextContext) {
          state.checked = isChecked(nextContext.selectedValue, nextProps.value);
        }
      } else if ("checked" in nextProps) {
        state.checked = nextProps.checked;
      }
      if ("indeterminate" in nextProps) {
        state.indeterminate = nextProps.indeterminate;
      }
      return state;
    };
    Checkbox2.prototype.shouldComponentUpdate = function shouldComponentUpdate(nextProps, nextState, nextContext) {
      var shallowEqual2 = obj.shallowEqual;
      return !shallowEqual2(this.props, nextProps) || !shallowEqual2(this.state, nextState) || !shallowEqual2(this.context, nextContext);
    };
    Checkbox2.prototype.onChange = function onChange6(e2) {
      var _props = this.props, context = _props.context, value = _props.value;
      var checked = e2.target.checked;
      if (this.disabled) {
        return;
      }
      if (context.__group__) {
        context.onChange(value, e2);
      } else {
        if (!("checked" in this.props)) {
          this.setState({
            checked
          });
        }
        if (!("indeterminate" in this.props)) {
          this.setState({
            indeterminate: false
          });
        }
        this.props.onChange(checked, e2);
      }
    };
    Checkbox2.prototype.render = function render2() {
      var _classnames, _classnames2;
      var _props2 = this.props, id2 = _props2.id, className = _props2.className, children = _props2.children, style = _props2.style, label = _props2.label, onMouseEnter = _props2.onMouseEnter, onMouseLeave = _props2.onMouseLeave, rtl = _props2.rtl, isPreview = _props2.isPreview, renderPreview = _props2.renderPreview, context = _props2.context, value = _props2.value, name = _props2.name, otherProps = _default$3(_props2, ["id", "className", "children", "style", "label", "onMouseEnter", "onMouseLeave", "rtl", "isPreview", "renderPreview", "context", "value", "name"]);
      var checked = !!this.state.checked;
      var disabled = this.disabled;
      var indeterminate = !!this.state.indeterminate;
      var prefix = context.prefix || this.props.prefix;
      var others = obj.pickOthers(Checkbox2.propTypes, otherProps);
      var othersData = obj.pickAttrsWith(others, "data-");
      if (otherProps.title) {
        othersData.title = otherProps.title;
      }
      var childInput = React.createElement("input", _default$8({}, obj.pickOthers(Checkbox2.propTypes, otherProps), {
        id: id2,
        value,
        name,
        disabled,
        checked,
        type: "checkbox",
        onChange: this.onChange,
        "aria-checked": indeterminate ? "mixed" : checked,
        className: prefix + "checkbox-input"
      }));
      if (!disabled) {
        childInput = this.getStateElement(childInput);
      }
      var cls = classnames((_classnames = {}, _classnames[prefix + "checkbox-wrapper"] = true, _classnames[className] = !!className, _classnames.checked = checked, _classnames.disabled = disabled, _classnames.indeterminate = indeterminate, _classnames[this.getStateClassName()] = true, _classnames));
      var labelCls = prefix + "checkbox-label";
      var type2 = indeterminate ? "semi-select" : "select";
      if (isPreview) {
        var previewCls = classnames(className, prefix + "form-preview");
        if ("renderPreview" in this.props) {
          return React.createElement(
            "div",
            _default$8({ id: id2, dir: rtl ? "rtl" : void 0 }, othersData, { className: previewCls }),
            renderPreview(checked, this.props)
          );
        }
        return React.createElement(
          "p",
          _default$8({ id: id2, dir: rtl ? "rtl" : void 0 }, othersData, { className: previewCls }),
          checked && (children || label || this.state.value)
        );
      }
      var iconCls = classnames((_classnames2 = {
        zoomIn: indeterminate
      }, _classnames2[prefix + "checkbox-semi-select-icon"] = indeterminate, _classnames2[prefix + "checkbox-select-icon"] = !indeterminate, _classnames2));
      return React.createElement(
        "label",
        _default$8({}, othersData, {
          className: cls,
          style,
          dir: rtl ? "rtl" : void 0,
          onMouseEnter,
          onMouseLeave
        }),
        React.createElement(
          "span",
          { className: prefix + "checkbox" },
          React.createElement(
            "span",
            { className: prefix + "checkbox-inner" },
            React.createElement(Icon, { type: type2, size: "xs", className: iconCls })
          ),
          childInput
        ),
        [label, children].map(function(item, i) {
          return [void 0, null].indexOf(item) === -1 ? React.createElement(
            "span",
            { key: i, className: labelCls },
            item
          ) : null;
        })
      );
    };
    _default$1(Checkbox2, [{
      key: "disabled",
      get: function get() {
        var props = this.props;
        var context = props.context;
        return props.disabled || "disabled" in context && context.disabled;
      }
    }]);
    return Checkbox2;
  }(UIState$1), _class$W.displayName = "Checkbox", _class$W.propTypes = _default$8({}, ConfigProvider$1.propTypes, {
    prefix: PropTypes$1.string,
    rtl: PropTypes$1.bool,
    /**
     * 自定义类名
     */
    className: PropTypes$1.string,
    /**
     * checkbox id, 挂载在input上
     */
    id: PropTypes$1.string,
    /**
     * 自定义内敛样式
     */
    style: PropTypes$1.object,
    /**
     * 选中状态
     */
    checked: PropTypes$1.bool,
    /**
     * 默认选中状态
     */
    defaultChecked: PropTypes$1.bool,
    /**
     * 禁用
     */
    disabled: PropTypes$1.bool,
    /**
     * 通过属性配置label,
     */
    label: PropTypes$1.node,
    /**
     * Checkbox 的中间状态,只会影响到 Checkbox 的样式,并不影响其 checked 属性
     */
    indeterminate: PropTypes$1.bool,
    /**
     *  Checkbox 的默认中间态,只会影响到 Checkbox 的样式,并不影响其 checked 属性
     */
    defaultIndeterminate: PropTypes$1.bool,
    /**
     * 状态变化时触发的事件
     * @param {Boolean} checked 是否选中
     * @param {Event} e Dom 事件对象
     */
    onChange: PropTypes$1.func,
    /**
     * 鼠标进入enter事件
     * @param {Event} e Dom 事件对象
     */
    onMouseEnter: PropTypes$1.func,
    /**
     * 鼠标离开Leave事件
     * @param {Event} e Dom 事件对象
     */
    onMouseLeave: PropTypes$1.func,
    /**
     * checkbox 的value
     */
    value: PropTypes$1.oneOfType([PropTypes$1.string, PropTypes$1.number]),
    /**
     * name
     */
    name: PropTypes$1.string,
    /**
     * 是否为预览态
     * @version 1.19
     */
    isPreview: PropTypes$1.bool,
    /**
     * 预览态模式下渲染的内容
     * @param {Boolean} checked 是否选中
     * @param {Object} props 所有传入的参数
     * @returns {reactNode} Element 渲染内容
     * @version 1.19
     */
    renderPreview: PropTypes$1.func
  }), _class$W.defaultProps = {
    defaultChecked: false,
    defaultIndeterminate: false,
    onChange: noop$a,
    onMouseEnter: noop$a,
    onMouseLeave: noop$a,
    prefix: "next-",
    isPreview: false
  }, _temp$E);
  const Checkbox$1 = ConfigProvider$1.config(withContext$2(polyfill(Checkbox)));
  var _class$V, _temp$D;
  var pickOthers$5 = obj.pickOthers;
  var CheckboxGroup = (_temp$D = _class$V = function(_Component) {
    _default$4(CheckboxGroup2, _Component);
    function CheckboxGroup2(props) {
      _default$7(this, CheckboxGroup2);
      var _this2 = _default$5(this, _Component.call(this, props));
      var value = [];
      if ("value" in props) {
        value = props.value;
      } else if ("defaultValue" in props) {
        value = props.defaultValue;
      }
      if (!Array.isArray(value)) {
        if (value === null || value === void 0) {
          value = [];
        } else {
          value = [value];
        }
      }
      _this2.state = {
        value: [].concat(value)
      };
      _this2.onChange = _this2.onChange.bind(_this2);
      return _this2;
    }
    CheckboxGroup2.prototype.getChildContext = function getChildContext() {
      return {
        __group__: true,
        onChange: this.onChange,
        selectedValue: this.state.value,
        disabled: this.props.disabled
      };
    };
    CheckboxGroup2.getDerivedStateFromProps = function getDerivedStateFromProps(nextProps) {
      if ("value" in nextProps) {
        var value = nextProps.value;
        if (!Array.isArray(value)) {
          if (value === null || value === void 0) {
            value = [];
          } else {
            value = [value];
          }
        }
        return { value };
      }
      return null;
    };
    CheckboxGroup2.prototype.onChange = function onChange6(currentValue, e2) {
      var value = this.state.value;
      var index2 = value.indexOf(currentValue);
      var valTemp = [].concat(value);
      if (index2 === -1) {
        valTemp.push(currentValue);
      } else {
        valTemp.splice(index2, 1);
      }
      if (!("value" in this.props)) {
        this.setState({ value: valTemp });
      }
      this.props.onChange(valTemp, e2);
    };
    CheckboxGroup2.prototype.render = function render2() {
      var _this2 = this, _classnames;
      var _props = this.props, className = _props.className, style = _props.style, prefix = _props.prefix, disabled = _props.disabled, direction = _props.direction, rtl = _props.rtl, isPreview = _props.isPreview, renderPreview = _props.renderPreview;
      var others = pickOthers$5(CheckboxGroup2.propTypes, this.props);
      var children = void 0;
      var previewed = [];
      if (this.props.children) {
        children = React.Children.map(this.props.children, function(child) {
          if (!React.isValidElement(child)) {
            return child;
          }
          var checked = _this2.state.value && _this2.state.value.indexOf(child.props.value) > -1;
          if (checked) {
            previewed.push({
              label: child.props.children,
              value: child.props.value
            });
          }
          return React.cloneElement(child, child.props.rtl === void 0 ? { rtl } : null);
        });
      } else {
        children = this.props.dataSource.map(function(item, index2) {
          var option = item;
          if ((typeof item === "undefined" ? "undefined" : _default$6(item)) !== "object") {
            option = {
              label: item,
              value: item,
              disabled
            };
          }
          var checked = _this2.state.value && _this2.state.value.indexOf(option.value) > -1;
          if (checked) {
            previewed.push({
              label: option.label,
              value: option.value
            });
          }
          return React.createElement(Checkbox$1, {
            key: index2,
            value: option.value,
            checked,
            rtl,
            disabled: disabled || option.disabled,
            label: option.label
          });
        });
      }
      if (isPreview) {
        var previewCls = classnames(className, prefix + "form-preview");
        if ("renderPreview" in this.props) {
          return React.createElement(
            "div",
            _default$8({}, others, { dir: rtl ? "rtl" : void 0, className: previewCls }),
            renderPreview(previewed, this.props)
          );
        }
        return React.createElement(
          "p",
          _default$8({}, others, { dir: rtl ? "rtl" : void 0, className: previewCls }),
          previewed.map(function(item) {
            return item.label;
          }).join(", ")
        );
      }
      var cls = classnames((_classnames = {}, _classnames[prefix + "checkbox-group"] = true, _classnames[prefix + "checkbox-group-" + direction] = true, _classnames[className] = !!className, _classnames.disabled = disabled, _classnames));
      return React.createElement(
        "span",
        _default$8({ dir: rtl ? "rtl" : void 0 }, others, { className: cls, style }),
        children
      );
    };
    return CheckboxGroup2;
  }(React.Component), _class$V.propTypes = {
    prefix: PropTypes$1.string,
    rtl: PropTypes$1.bool,
    /**
     * 自定义类名
     */
    className: PropTypes$1.string,
    /**
     * 自定义内敛样式
     */
    style: PropTypes$1.object,
    /**
     * 整体禁用
     */
    disabled: PropTypes$1.bool,
    /**
     * 可选项列表, 数据项可为 String 或者 Object, 如 `['apple', 'pear', 'orange']` 或者 `[{value: 'apple', label: '苹果',}, {value: 'pear', label: '梨'}, {value: 'orange', label: '橙子'}]`
     */
    dataSource: PropTypes$1.oneOfType([PropTypes$1.arrayOf(PropTypes$1.string), PropTypes$1.arrayOf(PropTypes$1.object)]),
    /**
     * 被选中的值列表
     */
    value: PropTypes$1.oneOfType([PropTypes$1.array, PropTypes$1.string, PropTypes$1.number]),
    /**
     * 默认被选中的值列表
     */
    defaultValue: PropTypes$1.oneOfType([PropTypes$1.array, PropTypes$1.string, PropTypes$1.number]),
    /**
     * 通过子元素方式设置内部 checkbox
     */
    children: PropTypes$1.arrayOf(PropTypes$1.element),
    /**
     * 选中值改变时的事件
     * @param {Array} value 选中项列表
     * @param {Event} e Dom 事件对象
     */
    onChange: PropTypes$1.func,
    /**
     * 子项目的排列方式
     * - hoz: 水平排列 (default)
     * - ver: 垂直排列
     */
    direction: PropTypes$1.oneOf(["hoz", "ver"]),
    /**
     * 是否为预览态
     * @version 1.19
     */
    isPreview: PropTypes$1.bool,
    /**
     * 预览态模式下渲染的内容
     * @param {Array} previewed 预览值 [{label: '', value:''},...]
     * @param {Object} props 所有传入的参数
     * @returns {reactNode} Element 渲染内容
     * @version 1.19
     */
    renderPreview: PropTypes$1.func
  }, _class$V.defaultProps = {
    dataSource: [],
    onChange: function onChange() {
    },
    prefix: "next-",
    direction: "hoz",
    isPreview: false
  }, _class$V.childContextTypes = {
    onChange: PropTypes$1.func,
    __group__: PropTypes$1.bool,
    selectedValue: PropTypes$1.array,
    disabled: PropTypes$1.bool
  }, _temp$D);
  CheckboxGroup.displayName = "CheckboxGroup";
  const Group$3 = polyfill(CheckboxGroup);
  Checkbox$1.Group = ConfigProvider$1.config(Group$3, {
    transform: (
      /* istanbul ignore next */
      function transform4(props, deprecated2) {
        if ("itemDirection" in props) {
          deprecated2("itemDirection", "direction", "Checkbox");
          var _props = props, itemDirection = _props.itemDirection, others = _default$3(_props, ["itemDirection"]);
          props = _default$8({ direction: itemDirection }, others);
        }
        return props;
      }
    )
  });
  function withContext$1(Radio2) {
    var _class2, _temp3;
    return _temp3 = _class2 = function(_React$Component) {
      _default$4(WrappedComp, _React$Component);
      function WrappedComp(props) {
        _default$7(this, WrappedComp);
        var _this2 = _default$5(this, _React$Component.call(this, props));
        _this2.radioRef = null;
        return _this2;
      }
      WrappedComp.prototype.focus = function focus2() {
        if (this.radioRef) {
          this.radioRef.focus();
        }
      };
      WrappedComp.prototype.render = function render2() {
        var _this2 = this;
        return React.createElement(Radio2, _default$8({
          ref: function ref(el) {
            _this2.radioRef = el;
          }
        }, this.props, {
          context: this.context
        }));
      };
      return WrappedComp;
    }(React.Component), _class2.displayName = "Radio", _class2.contextTypes = {
      onChange: PropTypes$1.func,
      __group__: PropTypes$1.bool,
      isButton: PropTypes$1.bool,
      selectedValue: PropTypes$1.oneOfType([PropTypes$1.string, PropTypes$1.number, PropTypes$1.bool]),
      disabled: PropTypes$1.bool
    }, _temp3;
  }
  var _class$U, _temp$C;
  var makeChain$2 = func.makeChain, noop$9 = func.noop;
  var Radio = (_temp$C = _class$U = function(_UIState) {
    _default$4(Radio2, _UIState);
    function Radio2(props) {
      _default$7(this, Radio2);
      var _this2 = _default$5(this, _UIState.call(this, props));
      var context = props.context;
      var checked = void 0;
      if (context.__group__) {
        checked = context.selectedValue === props.value;
      } else if ("checked" in props) {
        checked = props.checked;
      } else {
        checked = props.defaultChecked;
      }
      _this2.state = { checked };
      _this2.radioRef = null;
      _this2.onChange = _this2.onChange.bind(_this2);
      return _this2;
    }
    Radio2.getDerivedStateFromProps = function getDerivedStateFromProps(nextProps) {
      var nextContext = nextProps.context;
      if (nextContext.__group__ && "selectedValue" in nextContext) {
        return {
          checked: nextContext.selectedValue === nextProps.value
        };
      } else if ("checked" in nextProps) {
        return {
          checked: nextProps.checked
        };
      }
      return null;
    };
    Radio2.prototype.shouldComponentUpdate = function shouldComponentUpdate(nextProps, nextState, nextContext) {
      var shallowEqual2 = obj.shallowEqual;
      return !shallowEqual2(this.props, nextProps) || !shallowEqual2(this.state, nextState) || !shallowEqual2(this.context, nextContext);
    };
    Radio2.prototype.componentDidUpdate = function componentDidUpdate() {
      if (this.disabled) {
        this.resetUIState();
      }
    };
    Radio2.prototype.onChange = function onChange6(e2) {
      var checked = e2.target.checked;
      var _props = this.props, context = _props.context, value = _props.value;
      if (context.__group__) {
        context.onChange(value, e2);
      } else if (this.state.checked !== checked) {
        if (!("checked" in this.props)) {
          this.setState({
            checked
          });
        }
        this.props.onChange(checked, e2);
      }
    };
    Radio2.prototype.focus = function focus2() {
      if (this.radioRef) {
        this.radioRef.focus();
        this._onUIFocus();
      }
    };
    Radio2.prototype.render = function render2() {
      var _this2 = this, _classnames, _classnames2, _classnames3;
      var _props2 = this.props, id2 = _props2.id, className = _props2.className, children = _props2.children, style = _props2.style, label = _props2.label, onMouseEnter = _props2.onMouseEnter, onMouseLeave = _props2.onMouseLeave, tabIndex = _props2.tabIndex, rtl = _props2.rtl, name = _props2.name, isPreview = _props2.isPreview, renderPreview = _props2.renderPreview, value = _props2.value, context = _props2.context, otherProps = _default$3(_props2, ["id", "className", "children", "style", "label", "onMouseEnter", "onMouseLeave", "tabIndex", "rtl", "name", "isPreview", "renderPreview", "value", "context"]);
      var checked = !!this.state.checked;
      var disabled = this.disabled;
      var isButton = context.isButton;
      var prefix = context.prefix || this.props.prefix;
      var others = obj.pickOthers(Radio2.propTypes, otherProps);
      var othersData = obj.pickAttrsWith(others, "data-");
      if (isPreview) {
        var previewCls = classnames(className, prefix + "form-preview");
        if ("renderPreview" in this.props) {
          return React.createElement(
            "div",
            _default$8({ id: id2, dir: rtl ? "rtl" : "ltr" }, others, { className: previewCls }),
            renderPreview(checked, this.props)
          );
        }
        return React.createElement(
          "p",
          _default$8({ id: id2, dir: rtl ? "rtl" : "ltr" }, others, { className: previewCls }),
          checked && (children || label || value)
        );
      }
      var input = React.createElement("input", _default$8({}, obj.pickOthers(othersData, others), {
        name,
        id: id2,
        tabIndex,
        disabled,
        checked,
        type: "radio",
        onChange: this.onChange,
        "aria-checked": checked,
        className: prefix + "radio-input",
        ref: function ref(e2) {
          _this2.radioRef = e2;
        }
      }));
      if (!disabled) {
        input = this.getStateElement(input);
      }
      var cls = classnames((_classnames = {}, _classnames[prefix + "radio"] = true, _classnames.checked = checked, _classnames.disabled = disabled, _classnames[this.getStateClassName()] = true, _classnames));
      var clsInner = classnames((_classnames2 = {}, _classnames2[prefix + "radio-inner"] = true, _classnames2.press = checked, _classnames2.unpress = !checked, _classnames2));
      var clsWrapper = classnames((_classnames3 = {}, _classnames3[prefix + "radio-wrapper"] = true, _classnames3[className] = !!className, _classnames3.checked = checked, _classnames3.disabled = disabled, _classnames3[this.getStateClassName()] = true, _classnames3));
      var childrenCls = prefix + "radio-label";
      var radioComp = !isButton ? React.createElement(
        "span",
        { className: cls },
        React.createElement("span", { className: clsInner }),
        input
      ) : React.createElement(
        "span",
        { className: prefix + "radio-single-input" },
        input
      );
      return React.createElement(
        "label",
        _default$8({}, othersData, {
          dir: rtl ? "rtl" : "ltr",
          style,
          "aria-checked": checked,
          "aria-disabled": disabled,
          className: clsWrapper,
          onMouseEnter: disabled ? onMouseEnter : makeChain$2(this._onUIMouseEnter, onMouseEnter),
          onMouseLeave: disabled ? onMouseLeave : makeChain$2(this._onUIMouseLeave, onMouseLeave)
        }),
        radioComp,
        [children, label].map(function(d2, i) {
          return d2 !== void 0 ? React.createElement(
            "span",
            { key: i, className: childrenCls },
            d2
          ) : null;
        })
      );
    };
    _default$1(Radio2, [{
      key: "disabled",
      get: function get() {
        var props = this.props;
        var context = props.context;
        var disabled = props.disabled || context.__group__ && "disabled" in context && context.disabled;
        return disabled;
      }
    }]);
    return Radio2;
  }(UIState$1), _class$U.displayName = "Radio", _class$U.propTypes = _default$8({}, ConfigProvider$1.propTypes, {
    /**
     * 自定义类名
     */
    className: PropTypes$1.string,
    /**
     * 组件input的id
     */
    id: PropTypes$1.string,
    /**
     * 自定义内敛样式
     */
    style: PropTypes$1.object,
    /**
     * 设置radio是否选中
     */
    checked: PropTypes$1.bool,
    /**
     * 设置radio是否默认选中
     */
    defaultChecked: PropTypes$1.bool,
    /**
     * 通过属性配置label
     */
    label: PropTypes$1.node,
    /**
     * 状态变化时触发的事件
     * @param {Boolean} checked 是否选中
     * @param {Event} e Dom 事件对象
     */
    onChange: PropTypes$1.func,
    /**
     * 鼠标进入enter事件
     * @param {Event} e Dom 事件对象
     */
    onMouseEnter: PropTypes$1.func,
    /**
     * 鼠标离开事件
     * @param {Event} e Dom 事件对象
     */
    onMouseLeave: PropTypes$1.func,
    /**
     * radio是否被禁用
     */
    disabled: PropTypes$1.bool,
    /**
     * radio 的value
     */
    value: PropTypes$1.oneOfType([PropTypes$1.string, PropTypes$1.number, PropTypes$1.bool]),
    /**
     * name
     */
    name: PropTypes$1.string,
    /**
     * 是否为预览态
     */
    isPreview: PropTypes$1.bool,
    /**
     * 预览态模式下渲染的内容
     * @param {Boolean} checked 是否选中
     * @param {Object} props 所有传入的参数
     * @returns {reactNode} Element 渲染内容
     */
    renderPreview: PropTypes$1.func
  }), _class$U.defaultProps = {
    onChange: noop$9,
    onMouseLeave: noop$9,
    onMouseEnter: noop$9,
    tabIndex: 0,
    prefix: "next-",
    isPreview: false
  }, _class$U.contextTypes = {
    onChange: PropTypes$1.func,
    __group__: PropTypes$1.bool,
    isButton: PropTypes$1.bool,
    selectedValue: PropTypes$1.oneOfType([PropTypes$1.string, PropTypes$1.number, PropTypes$1.bool]),
    disabled: PropTypes$1.bool
  }, _temp$C);
  const Radio$1 = ConfigProvider$1.config(withContext$1(polyfill(Radio)));
  var _class$T, _temp$B;
  var makeChain$1 = func.makeChain;
  var focusRef = focus.focusRef;
  var pickOthers$4 = obj.pickOthers;
  var RadioGroup = (_temp$B = _class$T = function(_Component) {
    _default$4(RadioGroup2, _Component);
    function RadioGroup2(props) {
      _default$7(this, RadioGroup2);
      var _this2 = _default$5(this, _Component.call(this, props));
      _this2.saveRadioRef = function(el, index2) {
        if (el && typeof el.getInstance === "function") {
          var radio = el.getInstance();
          _this2.radioRefs[index2] = radio;
        }
      };
      var value = "";
      if ("value" in props) {
        value = props.value;
      } else if ("defaultValue" in props) {
        value = props.defaultValue;
      }
      _this2.radioRefs = [];
      _this2.hasFocus = false;
      _this2.state = { value };
      _this2.onChange = _this2.onChange.bind(_this2);
      return _this2;
    }
    RadioGroup2.getDerivedStateFromProps = function getDerivedStateFromProps(props, state) {
      if ("value" in props && props.value !== state.value) {
        return {
          value: props.value
        };
      }
      return null;
    };
    RadioGroup2.prototype.getChildContext = function getChildContext() {
      var disabled = this.props.disabled;
      return {
        __group__: true,
        isButton: this.props.shape === "button",
        onChange: this.onChange,
        selectedValue: this.state.value,
        disabled
      };
    };
    RadioGroup2.prototype.onChange = function onChange6(currentValue, e2) {
      if (!("value" in this.props)) {
        this.setState({ value: currentValue });
      }
      if (currentValue !== this.state.value) {
        this.props.onChange(currentValue, e2);
      }
    };
    RadioGroup2.prototype.focus = function focus2() {
      if (!this.hasFocus) {
        var availableRef = this.radioRefs.filter(function(ref) {
          if (ref) {
            return !ref.props.disabled;
          }
          return false;
        });
        var radioRef = availableRef.find(function(ref) {
          if (ref) {
            return ref.props.checked;
          }
          return false;
        });
        if (radioRef) {
          focusRef(radioRef);
        } else if (availableRef.length > 0) {
          focusRef(availableRef[0]);
        }
      }
    };
    RadioGroup2.prototype.render = function render2() {
      var _this2 = this, _classnames;
      var _props = this.props, rtl = _props.rtl, className = _props.className, disabled = _props.disabled, shape = _props.shape, size2 = _props.size, style = _props.style, prefix = _props.prefix, direction = _props.direction, component = _props.component, isPreview = _props.isPreview, renderPreview = _props.renderPreview;
      var others = pickOthers$4(Object.keys(RadioGroup2.propTypes), this.props);
      if (rtl) {
        others.dir = "rtl";
      }
      var children = void 0;
      var previewed = {};
      this.radioRefs = [];
      if (this.props.children) {
        children = React.Children.map(this.props.children, function(child, index2) {
          if (!React.isValidElement(child)) {
            return child;
          }
          var checked = _this2.state.value === child.props.value;
          if (checked) {
            previewed.label = child.props.children;
            previewed.value = child.props.value;
          }
          var tabIndex = index2 === 0 && !_this2.state.value || checked ? 0 : -1;
          var childrtl = child.props.rtl === void 0 ? rtl : child.props.rtl;
          if (child.type && child.type.displayName === "Config(Radio)") {
            return React.cloneElement(child, {
              checked,
              tabIndex,
              rtl: childrtl,
              ref: function ref(e2) {
                _this2.saveRadioRef(e2, index2);
              }
            });
          }
          return React.cloneElement(child, {
            checked,
            rtl: childrtl,
            ref: function ref(e2) {
              _this2.saveRadioRef(e2, index2);
            }
          });
        });
      } else {
        children = this.props.dataSource.map(function(item, index2) {
          var option = item;
          if ((typeof item === "undefined" ? "undefined" : _default$6(item)) !== "object") {
            option = {
              label: item,
              value: item,
              disabled
            };
          }
          var checked = _this2.state.value === option.value;
          if (checked) {
            previewed.label = option.label;
            previewed.value = option.value;
          }
          return React.createElement(Radio$1, {
            key: index2,
            tabIndex: index2 === 0 && !_this2.state.value || checked ? 0 : -1,
            value: option.value,
            checked,
            label: option.label,
            disabled: disabled || option.disabled,
            ref: function ref(e2) {
              _this2.saveRadioRef(e2, index2);
            }
          });
        });
      }
      if (children.length === 0) {
        this.firstRef = null;
      }
      if (!previewed.value) {
        this.selectedRef = null;
      }
      if (isPreview) {
        var previewCls = classnames(className, prefix + "form-preview");
        if ("renderPreview" in this.props) {
          return React.createElement(
            "div",
            _default$8({}, others, { className: previewCls }),
            renderPreview(previewed, this.props)
          );
        }
        return React.createElement(
          "p",
          _default$8({}, others, { className: previewCls }),
          previewed.label
        );
      }
      var isButtonShape = shape === "button";
      var cls = classnames((_classnames = {}, _classnames[prefix + "radio-group"] = true, _classnames[prefix + "radio-group-" + direction] = !isButtonShape, _classnames[prefix + "radio-button"] = isButtonShape, _classnames[prefix + "radio-button-" + size2] = isButtonShape, _classnames[className] = !!className, _classnames.disabled = disabled, _classnames));
      var TagName = component;
      return React.createElement(
        TagName,
        _default$8({}, others, {
          "aria-disabled": disabled,
          role: "radiogroup",
          className: cls,
          style,
          onFocus: makeChain$1((function() {
            this.hasFocus = true;
          }).bind(this), this.props.onFocus),
          onBlur: makeChain$1((function() {
            this.hasFocus = false;
          }).bind(this), this.props.onBlur)
        }),
        children
      );
    };
    return RadioGroup2;
  }(React.Component), _class$T.propTypes = _default$8({}, ConfigProvider$1.propTypes, {
    /**
     * 样式类名的品牌前缀
     */
    prefix: PropTypes$1.string,
    /**
     * 自定义类名
     */
    className: PropTypes$1.string,
    /**
     * 自定义内敛样式
     */
    style: PropTypes$1.object,
    /**
     * name
     */
    name: PropTypes$1.string,
    /**
     * radio group的选中项的值
     */
    value: PropTypes$1.oneOfType([PropTypes$1.string, PropTypes$1.number, PropTypes$1.bool]),
    /**
     * radio group的默认值
     */
    defaultValue: PropTypes$1.oneOfType([PropTypes$1.string, PropTypes$1.number, PropTypes$1.bool]),
    /**
     * 设置标签类型
     */
    component: PropTypes$1.oneOfType([PropTypes$1.string, PropTypes$1.func]),
    /**
     * 选中值改变时的事件
     * @param {String/Number} value 选中项的值
     * @param {Event} e Dom 事件对象
     */
    onChange: PropTypes$1.func,
    /**
     * 表示radio被禁用
     */
    disabled: PropTypes$1.bool,
    /**
     * 可以设置成 button 展示形状
     * @enumdesc 按钮状
     */
    shape: PropTypes$1.oneOf(["normal", "button"]),
    /**
     * 与 `shape` 属性配套使用,shape设为button时有效
     * @enumdesc 大, 中, 小
     */
    size: PropTypes$1.oneOf(["large", "medium", "small"]),
    /**
     * 可选项列表, 数据项可为 String 或者 Object, 如 `['apple', 'pear', 'orange']` `[{label: 'apply', value: 'apple'}]`
     */
    dataSource: PropTypes$1.oneOfType([PropTypes$1.arrayOf(PropTypes$1.string), PropTypes$1.arrayOf(PropTypes$1.object)]),
    /**
     * 通过子元素方式设置内部radio
     */
    children: PropTypes$1.oneOfType([PropTypes$1.arrayOf(PropTypes$1.element), PropTypes$1.element]),
    /**
     * 子项目的排列方式
     * - hoz: 水平排列 (default)
     * - ver: 垂直排列
     */
    direction: PropTypes$1.oneOf(["hoz", "ver"]),
    /**
     * 是否为预览态
     */
    isPreview: PropTypes$1.bool,
    /**
     * 预览态模式下渲染的内容
     * @param {Object} previewed 预览值:{label: "", value: ""}
     * @param {Object} props 所有传入的参数
     * @returns {reactNode} Element 渲染内容
     */
    renderPreview: PropTypes$1.func
  }), _class$T.defaultProps = {
    dataSource: [],
    size: "medium",
    onChange: function onChange2() {
    },
    prefix: "next-",
    component: "div",
    direction: "hoz",
    isPreview: false
  }, _class$T.childContextTypes = {
    onChange: PropTypes$1.func,
    __group__: PropTypes$1.bool,
    isButton: PropTypes$1.bool,
    selectedValue: PropTypes$1.oneOfType([PropTypes$1.string, PropTypes$1.number, PropTypes$1.bool]),
    disabled: PropTypes$1.bool
  }, _temp$B);
  RadioGroup.displayName = "RadioGroup";
  const RadioGroup$1 = polyfill(RadioGroup);
  Radio$1.Group = ConfigProvider$1.config(RadioGroup$1, {
    transform: (
      /* istanbul ignore next */
      function transform5(props, deprecated2) {
        if ("itemDirection" in props) {
          deprecated2("itemDirection", "direction", "Radio");
          var _props = props, itemDirection = _props.itemDirection, others = _default$3(_props, ["itemDirection"]);
          props = _default$8({ direction: itemDirection }, others);
        }
        return props;
      }
    )
  });
  var _class$S, _temp$A;
  var noop$8 = {};
  var bindCtx$1 = func.bindCtx;
  var pickOthers$3 = obj.pickOthers;
  var CheckableItem = (_temp$A = _class$S = function(_Component) {
    _default$4(CheckableItem2, _Component);
    function CheckableItem2(props) {
      _default$7(this, CheckableItem2);
      var _this2 = _default$5(this, _Component.call(this, props));
      bindCtx$1(_this2, ["stopPropagation", "handleKeyDown", "handleClick"]);
      _this2.id = htmlId.escapeForId("checkable-item-" + (props.id || props._key));
      return _this2;
    }
    CheckableItem2.prototype.stopPropagation = function stopPropagation(e2) {
      e2.stopPropagation();
    };
    CheckableItem2.prototype.handleCheck = function handleCheck(e2) {
      var _props = this.props, checkType = _props.checkType, checked = _props.checked, onChange6 = _props.onChange;
      if (!(checkType === "radio" && checked)) {
        onChange6(!checked, e2);
      }
    };
    CheckableItem2.prototype.handleKeyDown = function handleKeyDown(e2) {
      if (e2.keyCode === KEYCODE.SPACE && !this.props.checkDisabled) {
        this.handleCheck(e2);
      }
      this.props.onKeyDown && this.props.onKeyDown(e2);
    };
    CheckableItem2.prototype.handleClick = function handleClick(e2) {
      this.handleCheck(e2);
      this.props.onClick && this.props.onClick(e2);
    };
    CheckableItem2.prototype.renderCheck = function renderCheck() {
      var _props2 = this.props, root = _props2.root, checked = _props2.checked, indeterminate = _props2.indeterminate, disabled = _props2.disabled, checkType = _props2.checkType, checkDisabled = _props2.checkDisabled, onChange6 = _props2.onChange;
      var labelToggleChecked = root.props.labelToggleChecked;
      var Check = checkType === "radio" ? Radio$1 : Checkbox$1;
      var checkProps = {
        tabIndex: "-1",
        checked,
        disabled: disabled || checkDisabled
      };
      if (checkType === "checkbox") {
        checkProps.indeterminate = indeterminate;
      }
      if (!labelToggleChecked) {
        checkProps.onChange = onChange6;
        checkProps.onClick = this.stopPropagation;
      }
      return React.createElement(Check, _default$8({ "aria-labelledby": this.id }, checkProps));
    };
    CheckableItem2.prototype.render = function render2() {
      var _props3 = this.props, _key = _props3._key, root = _props3.root, checked = _props3.checked, disabled = _props3.disabled, onClick3 = _props3.onClick, helper = _props3.helper, children = _props3.children;
      var _root$props = root.props, prefix = _root$props.prefix, labelToggleChecked = _root$props.labelToggleChecked;
      var others = pickOthers$3(Object.keys(CheckableItem2.propTypes), this.props);
      var newProps = _default$8({
        _key,
        root,
        disabled,
        type: "item",
        onClick: onClick3,
        onKeyDown: this.handleKeyDown
      }, others);
      if (labelToggleChecked && !disabled) {
        newProps.onClick = this.handleClick;
      }
      var title = void 0;
      if (typeof children === "string") {
        title = children;
      }
      return React.createElement(
        Item$1,
        _default$8({ "aria-checked": checked, title }, newProps),
        this.renderCheck(),
        React.createElement(
          "span",
          { className: prefix + "menu-item-text", id: this.id },
          children
        ),
        helper ? React.createElement(
          "div",
          { className: prefix + "menu-item-helper" },
          helper
        ) : null
      );
    };
    return CheckableItem2;
  }(React.Component), _class$S.propTypes = {
    _key: PropTypes$1.string,
    root: PropTypes$1.object,
    disabled: PropTypes$1.bool,
    inlineIndent: PropTypes$1.number,
    checked: PropTypes$1.bool,
    indeterminate: PropTypes$1.bool,
    onChange: PropTypes$1.func,
    checkType: PropTypes$1.oneOf(["checkbox", "radio"]),
    checkDisabled: PropTypes$1.bool,
    helper: PropTypes$1.node,
    children: PropTypes$1.node,
    onKeyDown: PropTypes$1.func,
    onClick: PropTypes$1.func,
    id: PropTypes$1.string
  }, _class$S.defaultProps = {
    disabled: false,
    checked: false,
    indeterminate: false,
    checkType: "checkbox",
    checkDisabled: false,
    onChange: noop$8
  }, _temp$A);
  CheckableItem.displayName = "CheckableItem";
  var _class$R, _temp$z;
  var CheckboxItem = (_temp$z = _class$R = function(_Component) {
    _default$4(CheckboxItem2, _Component);
    function CheckboxItem2() {
      _default$7(this, CheckboxItem2);
      return _default$5(this, _Component.apply(this, arguments));
    }
    CheckboxItem2.prototype.render = function render2() {
      var _props = this.props, checkboxDisabled = _props.checkboxDisabled, others = _default$3(_props, ["checkboxDisabled"]);
      return React.createElement(CheckableItem, _default$8({ role: "menuitemcheckbox", checkType: "checkbox", checkDisabled: checkboxDisabled }, others));
    };
    return CheckboxItem2;
  }(React.Component), _class$R.menuChildType = "item", _class$R.propTypes = {
    /**
     * 是否选中
     */
    checked: PropTypes$1.bool,
    /**
     * 是否半选中
     */
    indeterminate: PropTypes$1.bool,
    /**
     * 是否禁用
     */
    disabled: PropTypes$1.bool,
    /**
     * 选中或取消选中触发的回调函数
     * @param {Boolean} checked 是否选中
     * @param {Object} event 选中事件对象
     */
    onChange: PropTypes$1.func,
    /**
     * 帮助文本
     */
    helper: PropTypes$1.node,
    /**
     * 标签内容
     */
    children: PropTypes$1.node,
    checkboxDisabled: PropTypes$1.bool
  }, _class$R.defaultProps = {
    checked: false,
    indeterminate: false,
    disabled: false,
    onChange: function onChange3() {
    },
    checkboxDisabled: false
  }, _temp$z);
  CheckboxItem.displayName = "CheckboxItem";
  var _class$Q, _temp$y;
  var RadioItem = (_temp$y = _class$Q = function(_Component) {
    _default$4(RadioItem2, _Component);
    function RadioItem2() {
      _default$7(this, RadioItem2);
      return _default$5(this, _Component.apply(this, arguments));
    }
    RadioItem2.prototype.render = function render2() {
      return React.createElement(CheckableItem, _default$8({ role: "menuitemradio", checkType: "radio" }, this.props));
    };
    return RadioItem2;
  }(React.Component), _class$Q.menuChildType = "item", _class$Q.propTypes = {
    /**
     * 是否选中
     */
    checked: PropTypes$1.bool,
    /**
     * 是否禁用
     */
    disabled: PropTypes$1.bool,
    /**
     * 选中或取消选中触发的回调函数
     * @param {Boolean} checked 是否选中
     * @param {Object} event 选中事件对象
     */
    onChange: PropTypes$1.func,
    /**
     * 帮助文本
     */
    helper: PropTypes$1.node,
    /**
     * 标签内容
     */
    children: PropTypes$1.node
  }, _class$Q.defaultProps = {
    checked: false,
    disabled: false,
    onChange: function onChange4() {
    }
  }, _temp$y);
  RadioItem.displayName = "RadioItem";
  var _class$P, _temp$x;
  var Group$2 = (_temp$x = _class$P = function(_Component) {
    _default$4(Group2, _Component);
    function Group2() {
      _default$7(this, Group2);
      return _default$5(this, _Component.apply(this, arguments));
    }
    Group2.prototype.render = function render2() {
      var _cx;
      var _props = this.props, root = _props.root, className = _props.className, label = _props.label, children = _props.children, parentMode = _props.parentMode, others = _default$3(_props, ["root", "className", "label", "children", "parentMode"]);
      var prefix = root.props.prefix;
      var newClassName = classnames((_cx = {}, _cx[prefix + "menu-group-label"] = true, _cx[className] = !!className, _cx));
      var newChildren = children.map(function(child) {
        var _cx2;
        if (typeof child !== "function" && (typeof child === "undefined" ? "undefined" : _default$6(child)) !== "object") {
          return child;
        }
        var className2 = child.props.className;
        var newChildClassName = classnames((_cx2 = {}, _cx2[prefix + "menu-group-item"] = true, _cx2[className2] = !!className2, _cx2));
        return React.cloneElement(child, {
          parentMode,
          className: newChildClassName
        });
      });
      return [React.createElement(
        Item$1,
        _default$8({
          key: "menu-group-label",
          className: newClassName,
          replaceClassName: true,
          root,
          parentMode
        }, others),
        label
      )].concat(newChildren);
    };
    return Group2;
  }(React.Component), _class$P.menuChildType = "group", _class$P.propTypes = {
    root: PropTypes$1.object,
    className: PropTypes$1.string,
    /**
     * 标签内容
     */
    label: PropTypes$1.node,
    /**
     * 菜单项
     */
    children: PropTypes$1.node,
    parentMode: PropTypes$1.oneOf(["inline", "popup"])
  }, _temp$x);
  Group$2.displayName = "Group";
  var _class$O, _temp$w;
  var Divider = (_temp$w = _class$O = function(_Component) {
    _default$4(Divider2, _Component);
    function Divider2() {
      _default$7(this, Divider2);
      return _default$5(this, _Component.apply(this, arguments));
    }
    Divider2.prototype.render = function render2() {
      var _cx;
      var _props = this.props, root = _props.root, className = _props.className;
      _props.parentMode;
      _props.parent;
      var others = _default$3(_props, ["root", "className", "parentMode", "parent"]);
      var prefix = root.props.prefix;
      var newClassName = classnames((_cx = {}, _cx[prefix + "menu-divider"] = true, _cx[className] = !!className, _cx));
      return React.createElement("li", _default$8({ role: "separator", className: newClassName }, others));
    };
    return Divider2;
  }(React.Component), _class$O.menuChildType = "divider", _class$O.propTypes = {
    root: PropTypes$1.object,
    className: PropTypes$1.string
  }, _temp$w);
  Divider.displayName = "Divider";
  var _class$N, _temp$v;
  var bindCtx = func.bindCtx;
  var getContextProps = ConfigProvider$1.getContextProps;
  var Menu$1 = ConfigProvider$1.config(Menu$3);
  var menuInstance = void 0;
  var ContextMenu = (_temp$v = _class$N = function(_Component) {
    _default$4(ContextMenu2, _Component);
    function ContextMenu2(props) {
      _default$7(this, ContextMenu2);
      var _this2 = _default$5(this, _Component.call(this, props));
      _this2.state = {
        visible: true
      };
      bindCtx(_this2, ["handleOverlayClose", "handleOverlayOpen", "handleItemClick", "getOverlay"]);
      return _this2;
    }
    ContextMenu2.prototype.getOverlay = function getOverlay(ref) {
      this.overlay = ref;
    };
    ContextMenu2.prototype.close = function close2() {
      this.setState({
        visible: false
      });
      menuInstance = null;
    };
    ContextMenu2.prototype.handleOverlayClose = function handleOverlayClose(triggerType, e2) {
      var clickedPopupMenu = triggerType === "docClick" && this.popupNodes.some(function(node) {
        return node.contains(e2.target);
      });
      if (!clickedPopupMenu) {
        this.close();
        var overlayProps = this.props.overlayProps;
        if (overlayProps && overlayProps.onRequestClose) {
          for (var _len = arguments.length, others = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
            others[_key - 2] = arguments[_key];
          }
          overlayProps.onRequestClose.apply(overlayProps, [triggerType, e2].concat(others));
        }
      }
    };
    ContextMenu2.prototype.handleOverlayOpen = function handleOverlayOpen() {
      this.popupNodes = this.overlay.getInstance().getContent().getInstance().popupNodes;
      var overlayProps = this.props.overlayProps;
      if (overlayProps && overlayProps.onOpen) {
        overlayProps.onOpen();
      }
    };
    ContextMenu2.prototype.handleItemClick = function handleItemClick() {
      var _props;
      this.close();
      this.props.onItemClick && (_props = this.props).onItemClick.apply(_props, arguments);
    };
    ContextMenu2.prototype.render = function render2() {
      var _cx, _cx2;
      var _props2 = this.props, className = _props2.className, popupClassName = _props2.popupClassName, target = _props2.target, align = _props2.align, offset = _props2.offset, afterClose = _props2.afterClose, _props2$overlayProps = _props2.overlayProps, overlayProps = _props2$overlayProps === void 0 ? {} : _props2$overlayProps, others = _default$3(_props2, ["className", "popupClassName", "target", "align", "offset", "afterClose", "overlayProps"]);
      var contextProps = getContextProps(this.props);
      var prefix = contextProps.prefix;
      var visible = this.state.visible;
      var newOverlayProps = _default$8({}, contextProps, overlayProps, {
        target,
        align,
        offset,
        afterClose,
        visible,
        onRequestClose: this.handleOverlayClose,
        onOpen: this.handleOverlayOpen,
        ref: this.getOverlay
      });
      var menuProps = _default$8({}, contextProps, {
        triggerType: "hover"
      }, others, {
        className: classnames((_cx = {}, _cx[prefix + "context"] = true, _cx[className] = !!className, _cx)),
        popupClassName: classnames((_cx2 = {}, _cx2[prefix + "context"] = true, _cx2[popupClassName] = !!popupClassName, _cx2)),
        onItemClick: this.handleItemClick
      });
      newOverlayProps.rtl = false;
      return React.createElement(
        Overlay$1,
        newOverlayProps,
        React.createElement(Menu$1, menuProps)
      );
    };
    return ContextMenu2;
  }(React.Component), _class$N.propTypes = {
    className: PropTypes$1.string,
    popupClassName: PropTypes$1.string,
    target: PropTypes$1.any,
    align: PropTypes$1.string,
    offset: PropTypes$1.array,
    overlayProps: PropTypes$1.object,
    afterClose: PropTypes$1.func,
    mode: PropTypes$1.oneOf(["inline", "popup"]),
    onOpen: PropTypes$1.func,
    onItemClick: PropTypes$1.func
  }, _class$N.defaultProps = {
    prefix: "next-",
    align: "tl tl",
    mode: "popup"
  }, _temp$v);
  ContextMenu.displayName = "ContextMenu";
  function create$1(props) {
    if (menuInstance) {
      menuInstance.destroy();
    }
    var afterClose = props.afterClose, others = _default$3(props, ["afterClose"]);
    var div = document.createElement("div");
    document.body.appendChild(div);
    var closeChain = function closeChain2() {
      ReactDOM.unmountComponentAtNode(div);
      document.body.removeChild(div);
      afterClose && afterClose();
    };
    var newContext = ConfigProvider$1.getContext();
    var menu = void 0;
    ReactDOM.render(React.createElement(
      ConfigProvider$1,
      newContext,
      React.createElement(ContextMenu, _default$8({
        ref: function ref(_ref) {
          menu = _ref;
        },
        afterClose: closeChain
      }, others))
    ), div);
    menuInstance = {
      destroy: function destroy() {
        if (menu) {
          menu.close();
        }
      }
    };
    return menuInstance;
  }
  Menu$3.SubMenu = SubMenu;
  Menu$3.Item = SelectableItem;
  Menu$3.CheckboxItem = CheckboxItem;
  Menu$3.RadioItem = RadioItem;
  Menu$3.PopupItem = PopupItem;
  Menu$3.Group = Group$2;
  Menu$3.Divider = Divider;
  Menu$3.create = create$1;
  var transform6 = function transform7(props, deprecated2) {
    if ("indentSize" in props) {
      deprecated2("indentSize", "inlineIndent", "Menu");
      var _props = props, indentSize = _props.indentSize, others = _default$3(_props, ["indentSize"]);
      props = _default$8({ inlineIndent: indentSize }, others);
    }
    if ("onDeselect" in props) {
      deprecated2("onDeselect", "onSelect", "Menu");
      if (props.onDeselect) {
        var _props2 = props, onDeselect = _props2.onDeselect, onSelect = _props2.onSelect, _others = _default$3(_props2, ["onDeselect", "onSelect"]);
        var newOnSelect = function newOnSelect2(selectedKeys, item, extra) {
          if (!extra.select) {
            onDeselect(extra.key);
          }
          if (onSelect) {
            onSelect(selectedKeys, item, extra);
          }
        };
        props = _default$8({ onSelect: newOnSelect }, _others);
      }
    }
    return props;
  };
  const Menu = ConfigProvider$1.config(Menu$3, {
    transform: transform6
  });
  var _class$M, _temp2$h;
  function mapIconSize(size2) {
    return {
      large: "small",
      medium: "xs",
      small: "xs"
    }[size2];
  }
  var Button$1 = (_temp2$h = _class$M = function(_Component) {
    _default$4(Button2, _Component);
    function Button2() {
      var _temp3, _this2, _ret;
      _default$7(this, Button2);
      for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
        args[_key] = arguments[_key];
      }
      return _ret = (_temp3 = (_this2 = _default$5(this, _Component.call.apply(_Component, [this].concat(args))), _this2), _this2.onMouseUp = function(e2) {
        _this2.button.blur();
        if (_this2.props.onMouseUp) {
          _this2.props.onMouseUp(e2);
        }
      }, _this2.buttonRefHandler = function(button) {
        _this2.button = button;
      }, _temp3), _default$5(_this2, _ret);
    }
    Button2.prototype.render = function render2() {
      var _btnClsObj;
      var _props = this.props, prefix = _props.prefix, className = _props.className, type2 = _props.type, size2 = _props.size, htmlType = _props.htmlType, loading = _props.loading, text = _props.text, warning2 = _props.warning, ghost = _props.ghost, component = _props.component, iconSize = _props.iconSize, icons = _props.icons, disabled = _props.disabled, onClick3 = _props.onClick, children = _props.children, rtl = _props.rtl, others = _default$3(_props, ["prefix", "className", "type", "size", "htmlType", "loading", "text", "warning", "ghost", "component", "iconSize", "icons", "disabled", "onClick", "children", "rtl"]);
      var ghostType = ["light", "dark"].indexOf(ghost) >= 0 ? ghost : "dark";
      var btnClsObj = (_btnClsObj = {}, _btnClsObj[prefix + "btn"] = true, _btnClsObj["" + prefix + size2] = size2, _btnClsObj[prefix + "btn-" + type2] = type2 && !ghost, _btnClsObj[prefix + "btn-text"] = text, _btnClsObj[prefix + "btn-warning"] = warning2, _btnClsObj[prefix + "btn-loading"] = loading, _btnClsObj[prefix + "btn-ghost"] = ghost, _btnClsObj[prefix + "btn-" + ghostType] = ghost, _btnClsObj[className] = className, _btnClsObj);
      var loadingIcon = null;
      if (icons && icons.loading && React.isValidElement(icons.loading)) {
        var _classNames;
        if (loading) {
          delete btnClsObj[prefix + "btn-loading"];
          btnClsObj[prefix + "btn-custom-loading"] = true;
        }
        var loadingSize = iconSize || mapIconSize(size2);
        loadingIcon = React.cloneElement(icons.loading, {
          className: classnames((_classNames = {}, _classNames[prefix + "btn-custom-loading-icon"] = true, _classNames.show = loading, _classNames)),
          size: loadingSize
        });
      }
      var count = React.Children.count(children);
      var clonedChildren = React.Children.map(children, function(child, index2) {
        if (child && ["function", "object"].indexOf(_default$6(child.type)) > -1 && child.type._typeMark === "icon") {
          var _classNames2;
          var iconCls = classnames((_classNames2 = {}, _classNames2[prefix + "btn-icon"] = !iconSize, _classNames2[prefix + "btn-icon-size"] = iconSize, _classNames2[prefix + "icon-first"] = count > 1 && index2 === 0, _classNames2[prefix + "icon-last"] = count > 1 && index2 === count - 1, _classNames2[prefix + "icon-alone"] = count === 1, _classNames2[child.props.className] = !!child.props.className, _classNames2));
          if ("size" in child.props) {
            log.warning('The size of Icon will not take effect, when Icon is the [direct child element] of Button(<Button><Icon size="' + child.props.size + '" /></Button>), use <Button iconSize="' + child.props.size + '"> or <Button><div><Icon size="' + child.props.size + '" /></div></Button> instead of.');
          }
          return React.cloneElement(child, {
            className: iconCls,
            size: iconSize || mapIconSize(size2)
          });
        }
        if (!React.isValidElement(child)) {
          return React.createElement(
            "span",
            { className: prefix + "btn-helper" },
            child
          );
        }
        return child;
      });
      var TagName = component;
      var tagAttrs = _default$8({}, obj.pickOthers(Object.keys(Button2.propTypes), others), {
        type: htmlType,
        disabled,
        onClick: onClick3,
        className: classnames(btnClsObj)
      });
      if (TagName !== "button") {
        delete tagAttrs.type;
        if (tagAttrs.disabled) {
          delete tagAttrs.onClick;
          tagAttrs.href && delete tagAttrs.href;
        }
      }
      return React.createElement(
        TagName,
        _default$8({}, tagAttrs, { dir: rtl ? "rtl" : void 0, onMouseUp: this.onMouseUp, ref: this.buttonRefHandler }),
        loadingIcon,
        clonedChildren
      );
    };
    return Button2;
  }(React.Component), _class$M.propTypes = _default$8({}, ConfigProvider$1.propTypes, {
    prefix: PropTypes$1.string,
    rtl: PropTypes$1.bool,
    /**
     * 按钮的类型
     */
    type: PropTypes$1.oneOf(["primary", "secondary", "normal"]),
    /**
     * 按钮的尺寸
     */
    size: PropTypes$1.oneOf(["small", "medium", "large"]),
    /**
     * 按钮中可配置的 Icon,格式为 { loading: <Icon type="loading" /> }
     */
    icons: PropTypes$1.shape({
      loading: PropTypes$1.node
    }),
    /**
     * 按钮中 Icon 的尺寸,用于替代 Icon 的默认大小
     */
    iconSize: PropTypes$1.oneOfType([PropTypes$1.oneOf(["xxs", "xs", "small", "medium", "large", "xl", "xxl", "xxxl", "inherit"]), PropTypes$1.number]),
    /**
     * 当 component = 'button' 时,设置 button 标签的 type 值
     */
    htmlType: PropTypes$1.oneOf(["submit", "reset", "button"]),
    /**
     * 设置标签类型
     */
    component: PropTypes$1.oneOf(["button", "a", "div", "span"]),
    /**
     * 设置按钮的载入状态
     */
    loading: PropTypes$1.bool,
    /**
     * 是否为幽灵按钮
     */
    ghost: PropTypes$1.oneOf([true, false, "light", "dark"]),
    /**
     * 是否为文本按钮
     */
    text: PropTypes$1.bool,
    /**
     * 是否为警告按钮
     */
    warning: PropTypes$1.bool,
    /**
     * 是否禁用
     */
    disabled: PropTypes$1.bool,
    /**
     * 点击按钮的回调
     * @param {Object} e Event Object
     */
    onClick: PropTypes$1.func,
    className: PropTypes$1.string,
    onMouseUp: PropTypes$1.func,
    children: PropTypes$1.node
  }), _class$M.defaultProps = {
    prefix: "next-",
    type: "normal",
    size: "medium",
    icons: {},
    htmlType: "button",
    component: "button",
    loading: false,
    ghost: false,
    text: false,
    warning: false,
    disabled: false,
    onClick: function onClick2() {
    }
  }, _temp2$h);
  Button$1.displayName = "Button";
  var _class$L, _temp$u;
  var ButtonGroup = (_temp$u = _class$L = function(_Component) {
    _default$4(ButtonGroup2, _Component);
    function ButtonGroup2() {
      _default$7(this, ButtonGroup2);
      return _default$5(this, _Component.apply(this, arguments));
    }
    ButtonGroup2.prototype.render = function render2() {
      var _classNames;
      var _props = this.props, prefix = _props.prefix, className = _props.className, size2 = _props.size, children = _props.children, rtl = _props.rtl, others = _default$3(_props, ["prefix", "className", "size", "children", "rtl"]);
      var groupCls = classnames((_classNames = {}, _classNames[prefix + "btn-group"] = true, _classNames[className] = className, _classNames));
      var cloneChildren = React.Children.map(children, function(child) {
        if (child) {
          return React.cloneElement(child, {
            size: size2
          });
        }
      });
      if (rtl) {
        others.dir = "rtl";
      }
      return React.createElement(
        "div",
        _default$8({}, others, { className: groupCls }),
        cloneChildren
      );
    };
    return ButtonGroup2;
  }(React.Component), _class$L.propTypes = _default$8({}, ConfigProvider$1.propTypes, {
    rtl: PropTypes$1.bool,
    prefix: PropTypes$1.string,
    /**
     * 统一设置 Button 组件的按钮大小
     */
    size: PropTypes$1.string,
    className: PropTypes$1.string,
    children: PropTypes$1.node
  }), _class$L.defaultProps = {
    prefix: "next-",
    size: "medium"
  }, _temp$u);
  ButtonGroup.displayName = "ButtonGroup";
  const ButtonGroup$1 = ConfigProvider$1.config(ButtonGroup);
  Button$1.Group = ButtonGroup$1;
  const Button = ConfigProvider$1.config(Button$1, {
    transform: (
      /* istanbul ignore next */
      function transform8(props, deprecated2) {
        if ("shape" in props) {
          deprecated2("shape", "text | warning | ghost", "Button");
          var _props = props, shape = _props.shape, type2 = _props.type, others = _default$3(_props, ["shape", "type"]);
          var newType = type2;
          if (type2 === "light" || type2 === "dark" || type2 === "secondary" && shape === "warning") {
            newType = "normal";
          }
          var ghost = void 0;
          if (shape === "ghost") {
            ghost = {
              primary: "dark",
              secondary: "dark",
              normal: "light",
              dark: "dark",
              light: "light"
            }[type2 || Button$1.defaultProps.type];
          }
          var text = shape === "text";
          var warning2 = shape === "warning";
          props = _default$8({ type: newType, ghost, text, warning: warning2 }, others);
        }
        return props;
      }
    )
  });
  var _class$K, _temp2$g;
  var Base$1 = (_temp2$g = _class$K = function(_React$Component) {
    _default$4(Base2, _React$Component);
    function Base2() {
      var _temp3, _this2, _ret;
      _default$7(this, Base2);
      for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
        args[_key] = arguments[_key];
      }
      return _ret = (_temp3 = (_this2 = _default$5(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this2), _this2.handleCompositionStart = function(e2) {
        _this2.setState({
          composition: true
        });
        _this2.props.onCompositionStart(e2);
      }, _this2.handleCompositionEnd = function(e2) {
        _this2.setState({
          composition: false
        });
        _this2.props.onCompositionEnd(e2);
        var value = e2.target.value;
        _this2.props.onChange(value, e2);
      }, _this2.saveRef = function(input) {
        _this2.inputRef = input;
      }, _temp3), _default$5(_this2, _ret);
    }
    Base2.getDerivedStateFromProps = function getDerivedStateFromProps(nextProps, prevState) {
      if ("value" in nextProps && nextProps.value !== prevState.value && !prevState.composition) {
        var value = nextProps.value;
        return {
          value: value === void 0 || value === null ? "" : value
        };
      }
      return null;
    };
    Base2.prototype.ieHack = function ieHack(value) {
      return value;
    };
    Base2.prototype.onChange = function onChange6(e2) {
      if ("stopPropagation" in e2) {
        e2.stopPropagation();
      } else if ("cancelBubble" in e2) {
        e2.cancelBubble();
      }
      var value = e2.target.value;
      if (this.props.trim) {
        value = value.trim();
      }
      value = this.ieHack(value);
      if (!("value" in this.props) || this.state.composition) {
        this.setState({
          value
        });
      }
      if (this.state.composition) {
        return;
      }
      if (value && this.props.htmlType === "number") {
        value = Number(value);
      }
      this.props.onChange(value, e2);
    };
    Base2.prototype.onKeyDown = function onKeyDown(e2) {
      var value = e2.target.value;
      var maxLength = this.props.maxLength;
      var len = maxLength > 0 && value ? this.getValueLength(value) : 0;
      var opts = {};
      if (this.props.trim && e2.keyCode === 32) {
        opts.beTrimed = true;
      }
      if (maxLength > 0 && (len > maxLength + 1 || (len === maxLength || len === maxLength + 1) && e2.keyCode !== 8 && e2.keyCode !== 46)) {
        opts.overMaxLength = true;
      }
      this.props.onKeyDown(e2, opts);
    };
    Base2.prototype.onFocus = function onFocus(e2) {
      this.setState({
        focus: true
      });
      this.props.onFocus(e2);
    };
    Base2.prototype.onBlur = function onBlur(e2) {
      this.setState({
        focus: false
      });
      this.props.onBlur(e2);
    };
    Base2.prototype.renderLength = function renderLength() {
      var _classNames;
      var _props = this.props, maxLength = _props.maxLength, showLimitHint = _props.showLimitHint, prefix = _props.prefix, rtl = _props.rtl;
      var len = maxLength > 0 && this.state.value ? this.getValueLength(this.state.value) : 0;
      var classesLenWrap = classnames((_classNames = {}, _classNames[prefix + "input-len"] = true, _classNames[prefix + "error"] = len > maxLength, _classNames));
      var content = rtl ? maxLength + "/" + len : len + "/" + maxLength;
      return maxLength && showLimitHint ? React.createElement(
        "span",
        { className: classesLenWrap },
        content
      ) : null;
    };
    Base2.prototype.renderControl = function renderControl() {
      var _this2 = this;
      var lenWrap = this.renderLength();
      return lenWrap ? React.createElement(
        "span",
        { onClick: function onClick3() {
          return _this2.focus();
        }, className: this.props.prefix + "input-control" },
        lenWrap
      ) : null;
    };
    Base2.prototype.getClass = function getClass() {
      var _classNames2;
      var _props2 = this.props, disabled = _props2.disabled, state = _props2.state, prefix = _props2.prefix;
      return classnames((_classNames2 = {}, _classNames2[prefix + "input"] = true, _classNames2[prefix + "disabled"] = !!disabled, _classNames2[prefix + "error"] = state === "error", _classNames2[prefix + "warning"] = state === "warning", _classNames2[prefix + "focus"] = this.state.focus, _classNames2));
    };
    Base2.prototype.getProps = function getProps() {
      var _props3 = this.props, placeholder = _props3.placeholder, inputStyle = _props3.inputStyle, disabled = _props3.disabled, readOnly = _props3.readOnly, cutString = _props3.cutString, maxLength = _props3.maxLength, name = _props3.name, onCompositionStart = _props3.onCompositionStart, onCompositionEnd = _props3.onCompositionEnd;
      var props = {
        style: inputStyle,
        placeholder,
        disabled,
        readOnly,
        name,
        maxLength: cutString ? maxLength : void 0,
        value: this.state.value,
        onChange: this.onChange.bind(this),
        onBlur: this.onBlur.bind(this),
        onFocus: this.onFocus.bind(this),
        onCompositionStart,
        onCompositionEnd
      };
      if (disabled) {
        props["aria-disabled"] = disabled;
      }
      return props;
    };
    Base2.prototype.getInputNode = function getInputNode() {
      return this.inputRef;
    };
    Base2.prototype.focus = function focus2(start, end) {
      var preventScroll = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : false;
      this.inputRef.focus({ preventScroll });
      if (typeof start === "number") {
        this.inputRef.selectionStart = start;
      }
      if (typeof end === "number") {
        this.inputRef.selectionEnd = end;
      }
    };
    return Base2;
  }(React.Component), _class$K.propTypes = _default$8({}, ConfigProvider$1.propTypes, {
    /**
     * 当前值
     */
    value: PropTypes$1.oneOfType([PropTypes$1.string, PropTypes$1.number]),
    /**
     * 初始化值
     */
    defaultValue: PropTypes$1.oneOfType([PropTypes$1.string, PropTypes$1.number]),
    /**
     * 发生改变的时候触发的回调
     * @param {String} value 数据
     * @param {Event} e DOM事件对象
     */
    onChange: PropTypes$1.func,
    /**
     * 键盘按下的时候触发的回调
     * @param {Event} e DOM事件对象
     * @param {Object} opts 可扩展的附加信息:<br> - opts.overMaxLength: {Boolean} 已超出最大长度<br> - opts.beTrimed: {Boolean} 输入的空格被清理
     */
    onKeyDown: PropTypes$1.func,
    /**
     * 禁用状态
     */
    disabled: PropTypes$1.bool,
    /**
     * 最大长度
     */
    maxLength: PropTypes$1.number,
    /**
     * 是否展现最大长度样式(旧版本为 hasLimitHint,目前仍兼容旧用法,将在2.x直接废弃)
     */
    showLimitHint: PropTypes$1.bool,
    /**
     * 当设置了maxLength时,是否截断超出字符串
     */
    cutString: PropTypes$1.bool,
    /**
     * 只读
     */
    readOnly: PropTypes$1.bool,
    /**
     * onChange返回会自动去除头尾空字符
     */
    trim: PropTypes$1.bool,
    /**
     * 输入提示
     */
    placeholder: PropTypes$1.string,
    /**
     * 获取焦点时候触发的回调
     * @param {Event} e DOM事件对象
     */
    onFocus: PropTypes$1.func,
    /**
     * 失去焦点时候触发的回调
     * @param {Event} e DOM事件对象
     */
    onBlur: PropTypes$1.func,
    /**
     * 自定义字符串计算长度方式
     * @param {String} value 数据
     * @returns {Number} 自定义长度
     */
    getValueLength: PropTypes$1.func,
    inputStyle: PropTypes$1.object,
    /**
     * 自定义class
     */
    className: PropTypes$1.string,
    /**
     * 自定义内联样式
     */
    style: PropTypes$1.object,
    /**
     * 原生type
     */
    htmlType: PropTypes$1.string,
    /**
     * name
     */
    name: PropTypes$1.string,
    rtl: PropTypes$1.bool,
    state: PropTypes$1.oneOf(["error", "loading", "success", "warning"]),
    locale: PropTypes$1.object,
    /**
     * 是否为预览态
     */
    isPreview: PropTypes$1.bool,
    /**
     * 预览态模式下渲染的内容
     * @param {number} value 评分值
     */
    renderPreview: PropTypes$1.func,
    /**
     * 尺寸
     * @enumdesc 小, 中, 大
     */
    size: PropTypes$1.oneOf(["small", "medium", "large"]),
    /**
     * 开启后会过滤输入法中间字母状态,文字输入完成后才会触发 onChange
     * @version 1.23
     */
    composition: PropTypes$1.bool,
    onCompositionStart: PropTypes$1.func,
    onCompositionEnd: PropTypes$1.func
  }), _class$K.defaultProps = {
    disabled: false,
    prefix: "next-",
    size: "medium",
    maxLength: null,
    showLimitHint: false,
    cutString: true,
    readOnly: false,
    isPreview: false,
    trim: false,
    composition: false,
    onFocus: func.noop,
    onBlur: func.noop,
    onChange: func.noop,
    onKeyDown: func.noop,
    getValueLength: func.noop,
    onCompositionStart: func.noop,
    onCompositionEnd: func.noop,
    locale: defaultLocale.Input
  }, _temp2$g);
  Base$1.displayName = "Base";
  const Base$2 = polyfill(Base$1);
  var _class$J, _temp$t;
  var Group = (_temp$t = _class$J = function(_React$Component) {
    _default$4(Group2, _React$Component);
    function Group2() {
      _default$7(this, Group2);
      return _default$5(this, _React$Component.apply(this, arguments));
    }
    Group2.prototype.render = function render2() {
      var _classNames, _classNames2, _classNames3;
      var _props = this.props, className = _props.className, style = _props.style, children = _props.children, prefix = _props.prefix, addonBefore = _props.addonBefore, addonAfter = _props.addonAfter, addonBeforeClassName = _props.addonBeforeClassName, addonAfterClassName = _props.addonAfterClassName, rtl = _props.rtl, disabled = _props.disabled, others = _default$3(_props, ["className", "style", "children", "prefix", "addonBefore", "addonAfter", "addonBeforeClassName", "addonAfterClassName", "rtl", "disabled"]);
      var cls = classnames((_classNames = {}, _classNames[prefix + "input-group"] = true, _classNames[prefix + "disabled"] = disabled, _classNames[className] = !!className, _classNames));
      var addonCls = prefix + "input-group-addon";
      var beforeCls = classnames(addonCls, (_classNames2 = {}, _classNames2[prefix + "before"] = true, _classNames2[addonBeforeClassName] = addonBeforeClassName, _classNames2));
      var afterCls = classnames(addonCls, (_classNames3 = {}, _classNames3[prefix + "after"] = true, _classNames3[addonAfterClassName] = addonAfterClassName, _classNames3));
      var before = addonBefore ? React.createElement(
        "span",
        { className: beforeCls },
        addonBefore
      ) : null;
      var after = addonAfter ? React.createElement(
        "span",
        { className: afterCls },
        addonAfter
      ) : null;
      return React.createElement(
        "span",
        _default$8({}, others, { disabled, dir: rtl ? "rtl" : void 0, className: cls, style }),
        before,
        children,
        after
      );
    };
    return Group2;
  }(React.Component), _class$J.displayName = "Group", _class$J.propTypes = {
    /**
     * 样式前缀
     */
    prefix: PropTypes$1.string,
    className: PropTypes$1.string,
    style: PropTypes$1.object,
    children: PropTypes$1.node,
    /**
     * 输入框前附加内容
     */
    addonBefore: PropTypes$1.node,
    /**
     * 输入框前附加内容css
     */
    addonBeforeClassName: PropTypes$1.string,
    /**
     * 输入框后附加内容
     */
    addonAfter: PropTypes$1.node,
    /**
     * 输入框后额外css
     */
    addonAfterClassName: PropTypes$1.string,
    /**
     * rtl
     */
    rtl: PropTypes$1.bool
  }, _class$J.defaultProps = {
    prefix: "next-"
  }, _temp$t);
  Group.displayName = "Group";
  const Group$1 = ConfigProvider$1.config(Group);
  var _class$I, _temp$s;
  function preventDefault$2(e2) {
    e2.preventDefault();
  }
  var Input$1 = (_temp$s = _class$I = function(_Base) {
    _default$4(Input2, _Base);
    function Input2(props) {
      _default$7(this, Input2);
      var _this2 = _default$5(this, _Base.call(this, props));
      _this2.handleKeyDown = function(e2) {
        if (e2.keyCode === 13) {
          _this2.props.onPressEnter(e2);
        }
        _this2.onKeyDown(e2);
      };
      _this2.handleKeyDownFromClear = function(e2) {
        if (e2.keyCode === 13) {
          _this2.onClear(e2);
        }
      };
      var value = void 0;
      if ("value" in props) {
        value = props.value;
      } else {
        value = props.defaultValue;
      }
      _this2.state = {
        value: typeof value === "undefined" ? "" : value
      };
      return _this2;
    }
    Input2.prototype.getValueLength = function getValueLength(value) {
      var nv = "" + value;
      var strLen = this.props.getValueLength(nv);
      if (typeof strLen !== "number") {
        strLen = nv.length;
      }
      return strLen;
    };
    Input2.prototype.renderControl = function renderControl() {
      var _this2 = this;
      var _props = this.props, hasClear = _props.hasClear, readOnly = _props.readOnly, state = _props.state, prefix = _props.prefix, hint = _props.hint, extra = _props.extra, locale = _props.locale, disabled = _props.disabled, hoverShowClear = _props.hoverShowClear;
      var lenWrap = this.renderLength();
      var stateWrap = null;
      if (state === "success") {
        stateWrap = React.createElement(Icon, { type: "success-filling", className: prefix + "input-success-icon" });
      } else if (state === "loading") {
        stateWrap = React.createElement(Icon, { type: "loading", className: prefix + "input-loading-icon" });
      } else if (state === "warning") {
        stateWrap = React.createElement(Icon, { type: "warning", className: prefix + "input-warning-icon" });
      }
      var clearWrap = null;
      var showClear = hasClear && !readOnly && !!("" + this.state.value) && !disabled;
      if (hint || showClear) {
        var hintIcon = null;
        if (hint) {
          if (typeof hint === "string") {
            hintIcon = React.createElement(Icon, { type: hint, className: prefix + "input-hint" });
          } else if (React.isValidElement(hint)) {
            hintIcon = React.cloneElement(hint, {
              className: classnames(hint.props.className, prefix + "input-hint")
            });
          } else {
            hintIcon = hint;
          }
        } else {
          var _classNames;
          var cls = classnames((_classNames = {}, _classNames[prefix + "input-hint"] = true, _classNames[prefix + "input-clear-icon"] = true, _classNames[prefix + "input-hover-show"] = hoverShowClear, _classNames));
          hintIcon = React.createElement(Icon, {
            type: "delete-filling",
            role: "button",
            tabIndex: "0",
            className: cls,
            "aria-label": locale.clear,
            onClick: this.onClear.bind(this),
            onMouseDown: preventDefault$2,
            onKeyDown: this.handleKeyDownFromClear
          });
        }
        clearWrap = React.createElement(
          "span",
          { className: prefix + "input-hint-wrap" },
          hasClear && hint ? React.createElement(Icon, {
            type: "delete-filling",
            role: "button",
            tabIndex: "0",
            className: prefix + "input-clear " + prefix + "input-clear-icon",
            "aria-label": locale.clear,
            onClick: this.onClear.bind(this),
            onMouseDown: preventDefault$2,
            onKeyDown: this.handleKeyDownFromClear
          }) : null,
          hintIcon
        );
      }
      if (state === "loading") {
        clearWrap = null;
      }
      return clearWrap || lenWrap || stateWrap || extra ? React.createElement(
        "span",
        { onClick: function onClick3() {
          return _this2.focus();
        }, className: prefix + "input-control" },
        clearWrap,
        lenWrap,
        stateWrap,
        extra
      ) : null;
    };
    Input2.prototype.renderLabel = function renderLabel() {
      var _props2 = this.props, label = _props2.label, prefix = _props2.prefix, id2 = _props2.id;
      return label ? React.createElement(
        "label",
        { className: prefix + "input-label", htmlFor: id2 },
        label
      ) : null;
    };
    Input2.prototype.renderInner = function renderInner(inner, cls) {
      return inner ? React.createElement(
        "span",
        { className: cls },
        inner
      ) : null;
    };
    Input2.prototype.onClear = function onClear(e2) {
      if (this.props.disabled) {
        return;
      }
      if (!("value" in this.props)) {
        this.setState({
          value: ""
        });
      }
      this.props.onChange("", e2, "clear");
      this.focus();
    };
    Input2.prototype.render = function render2() {
      var _classNames2, _classNames3, _classNames4, _classNames5, _classNames6, _classNames7, _classNames8;
      var _props3 = this.props, size2 = _props3.size, htmlType = _props3.htmlType, htmlSize = _props3.htmlSize, autoComplete = _props3.autoComplete, autoFocus = _props3.autoFocus, disabled = _props3.disabled, style = _props3.style, innerBefore = _props3.innerBefore, innerAfter = _props3.innerAfter, innerBeforeClassName = _props3.innerBeforeClassName, innerAfterClassName = _props3.innerAfterClassName, className = _props3.className, hasBorder = _props3.hasBorder, prefix = _props3.prefix, isPreview = _props3.isPreview, renderPreview = _props3.renderPreview, addonBefore = _props3.addonBefore, addonAfter = _props3.addonAfter, addonTextBefore = _props3.addonTextBefore, addonTextAfter = _props3.addonTextAfter, inputRender2 = _props3.inputRender, rtl = _props3.rtl, composition = _props3.composition;
      var hasAddon = addonBefore || addonAfter || addonTextBefore || addonTextAfter;
      var cls = classnames(this.getClass(), (_classNames2 = {}, _classNames2["" + prefix + size2] = true, _classNames2[prefix + "hidden"] = this.props.htmlType === "hidden", _classNames2[prefix + "noborder"] = !hasBorder || this.props.htmlType === "file", _classNames2[prefix + "input-group-auto-width"] = hasAddon, _classNames2[prefix + "disabled"] = disabled, _classNames2[className] = !!className && !hasAddon, _classNames2));
      var innerCls = prefix + "input-inner";
      var innerBeforeCls = classnames((_classNames3 = {}, _classNames3[innerCls] = true, _classNames3[prefix + "before"] = true, _classNames3[innerBeforeClassName] = innerBeforeClassName, _classNames3));
      var innerAfterCls = classnames((_classNames4 = {}, _classNames4[innerCls] = true, _classNames4[prefix + "after"] = true, _classNames4[prefix + "input-inner-text"] = typeof innerAfter === "string", _classNames4[innerAfterClassName] = innerAfterClassName, _classNames4));
      var previewCls = classnames((_classNames5 = {}, _classNames5[prefix + "form-preview"] = true, _classNames5[className] = !!className, _classNames5));
      var props = this.getProps();
      var dataProps = obj.pickAttrsWith(this.props, "data-");
      var others = obj.pickOthers(_default$8({}, dataProps, Input2.propTypes), this.props);
      if (isPreview) {
        var value = props.value;
        var label = this.props.label;
        if (typeof renderPreview === "function") {
          return React.createElement(
            "div",
            _default$8({}, others, { className: previewCls }),
            renderPreview(value, this.props)
          );
        }
        return React.createElement(
          "div",
          _default$8({}, others, { className: previewCls }),
          addonBefore || addonTextBefore,
          label,
          innerBefore,
          value,
          innerAfter,
          addonAfter || addonTextAfter
        );
      }
      var compositionProps = {};
      if (composition) {
        compositionProps.onCompositionStart = this.handleCompositionStart;
        compositionProps.onCompositionEnd = this.handleCompositionEnd;
      }
      var inputEl = React.createElement("input", _default$8({}, others, props, compositionProps, {
        height: "100%",
        type: htmlType,
        size: htmlSize,
        autoFocus,
        autoComplete,
        onKeyDown: this.handleKeyDown,
        ref: this.saveRef
      }));
      var inputWrap = React.createElement(
        "span",
        _default$8({}, dataProps, { dir: rtl ? "rtl" : void 0, className: cls, style: hasAddon ? void 0 : style }),
        this.renderLabel(),
        this.renderInner(innerBefore, innerBeforeCls),
        inputRender2(inputEl),
        this.renderInner(innerAfter, innerAfterCls),
        this.renderControl()
      );
      var groupCls = classnames((_classNames6 = {}, _classNames6[prefix + "input-group-text"] = true, _classNames6["" + prefix + size2] = !!size2, _classNames6[prefix + "disabled"] = disabled, _classNames6));
      var addonBeforeCls = classnames((_classNames7 = {}, _classNames7[groupCls] = addonTextBefore, _classNames7));
      var addonAfterCls = classnames((_classNames8 = {}, _classNames8[groupCls] = addonTextAfter, _classNames8));
      if (hasAddon) {
        return React.createElement(
          Group$1,
          _default$8({}, dataProps, {
            prefix,
            className,
            style,
            disabled,
            addonBefore: addonBefore || addonTextBefore,
            addonBeforeClassName: addonBeforeCls,
            addonAfter: addonAfter || addonTextAfter,
            addonAfterClassName: addonAfterCls
          }),
          inputWrap
        );
      }
      return inputWrap;
    };
    return Input2;
  }(Base$2), _class$I.displayName = "Input", _class$I.getDerivedStateFromProps = Base$2.getDerivedStateFromProps, _class$I.propTypes = _default$8({}, Base$2.propTypes, {
    /**
     * label
     */
    label: PropTypes$1.node,
    /**
     * 是否出现clear按钮
     */
    hasClear: PropTypes$1.bool,
    /**
     * 是否有边框
     */
    hasBorder: PropTypes$1.bool,
    /**
     * 状态
     * @enumdesc 错误, 校验中, 成功, 警告
     */
    state: PropTypes$1.oneOf(["error", "loading", "success", "warning"]),
    /**
     * 按下回车的回调
     */
    onPressEnter: PropTypes$1.func,
    /**
     * 原生type
     */
    htmlType: PropTypes$1.string,
    htmlSize: PropTypes$1.string,
    /**
     * 水印 (Icon的type类型,和hasClear占用一个地方)
     */
    hint: PropTypes$1.oneOfType([PropTypes$1.string, PropTypes$1.node]),
    /**
     * 文字前附加内容
     */
    innerBefore: PropTypes$1.node,
    /**
     * 文字后附加内容
     */
    innerAfter: PropTypes$1.node,
    /**
     * 输入框前附加内容
     */
    addonBefore: PropTypes$1.node,
    /**
     * 输入框后附加内容
     */
    addonAfter: PropTypes$1.node,
    /**
     * 输入框前附加文字
     */
    addonTextBefore: PropTypes$1.node,
    /**
     * 输入框后附加文字
     */
    addonTextAfter: PropTypes$1.node,
    /**
     * (原生input支持)
     */
    autoComplete: PropTypes$1.string,
    /**
     * 自动聚焦(原生input支持)
     */
    autoFocus: PropTypes$1.bool,
    inputRender: PropTypes$1.func,
    extra: PropTypes$1.node,
    innerBeforeClassName: PropTypes$1.string,
    innerAfterClassName: PropTypes$1.string,
    /**
     * 是否为预览态
     */
    isPreview: PropTypes$1.bool,
    /**
     * 预览态模式下渲染的内容
     * @param {number} value 评分值
     */
    renderPreview: PropTypes$1.func,
    /**
     * hover展示clear (配合 hasClear=true使用)
     * @version 1.24
     */
    hoverShowClear: PropTypes$1.bool
  }), _class$I.defaultProps = _default$8({}, Base$2.defaultProps, {
    autoComplete: "off",
    hasBorder: true,
    isPreview: false,
    hoverShowClear: false,
    onPressEnter: func.noop,
    inputRender: function inputRender(el) {
      return el;
    }
  }), _temp$s);
  const Input$2 = Input$1;
  var _class$H, _temp2$f;
  function preventDefault$1(e2) {
    e2.preventDefault();
  }
  var Password = (_temp2$f = _class$H = function(_Input) {
    _default$4(Password2, _Input);
    function Password2() {
      var _temp3, _this2, _ret;
      _default$7(this, Password2);
      for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
        args[_key] = arguments[_key];
      }
      return _ret = (_temp3 = (_this2 = _default$5(this, _Input.call.apply(_Input, [this].concat(args))), _this2), _this2.state = {
        hint: "eye-close",
        htmlType: "password"
      }, _this2.toggleEye = function(e2) {
        e2.preventDefault();
        if (_this2.props.disabled)
          return;
        var eyeClose = _this2.state.hint === "eye";
        _this2.setState({
          hint: eyeClose ? "eye-close" : "eye",
          htmlType: eyeClose || !_this2.props.showToggle ? "password" : "text"
        });
      }, _temp3), _default$5(_this2, _ret);
    }
    Password2.prototype.render = function render2() {
      var _props = this.props, showToggle = _props.showToggle, others = _default$3(_props, ["showToggle"]);
      var _state = this.state, hint = _state.hint, htmlType = _state.htmlType;
      var extra = showToggle ? React.createElement(Icon, { type: hint, onClick: this.toggleEye, onMouseDown: preventDefault$1 }) : null;
      return React.createElement(Input$2, _default$8({}, others, { extra, htmlType }));
    };
    return Password2;
  }(Input$2), _class$H.displayName = "Password", _class$H.getDerivedStateFromProps = Input$2.getDerivedStateFromProps, _class$H.propTypes = _default$8({}, Input$2.propTypes, {
    /**
     * 是否展示切换按钮
     */
    showToggle: PropTypes$1.bool
  }), _class$H.defaultProps = _default$8({}, Input$2.defaultProps, {
    showToggle: true
  }), _temp2$f);
  var _class$G, _temp$r, _initialiseProps$1;
  function onNextFrame(cb) {
    if (window.requestAnimationFrame) {
      return window.requestAnimationFrame(cb);
    }
    return window.setTimeout(cb, 1);
  }
  function clearNextFrameAction(nextFrameId) {
    if (window.cancelAnimationFrame) {
      window.cancelAnimationFrame(nextFrameId);
    } else {
      window.clearTimeout(nextFrameId);
    }
  }
  var isMacSafari = typeof navigator !== "undefined" && navigator && navigator.userAgent ? navigator.userAgent.match(/^((?!chrome|android|windows).)*safari/i) : false;
  var hiddenStyle = {
    visibility: "hidden",
    position: "absolute",
    zIndex: "-1000",
    top: "-1000px",
    overflowY: "hidden",
    left: 0,
    right: 0
  };
  var TextArea = (_temp$r = _class$G = function(_Base) {
    _default$4(TextArea2, _Base);
    function TextArea2(props) {
      _default$7(this, TextArea2);
      var _this2 = _default$5(this, _Base.call(this, props));
      _initialiseProps$1.call(_this2);
      var value = void 0;
      if ("value" in props) {
        value = props.value;
      } else {
        value = props.defaultValue;
      }
      _this2.state = {
        value: typeof value === "undefined" || value === null ? "" : value
      };
      return _this2;
    }
    TextArea2.prototype.componentDidMount = function componentDidMount() {
      var autoHeight = this.props.autoHeight;
      if (autoHeight) {
        if ((typeof autoHeight === "undefined" ? "undefined" : _default$6(autoHeight)) === "object") {
          this.setState(this._getMinMaxHeight(autoHeight, this.state.value));
        } else {
          this.setState({
            height: this._getHeight(this.state.value),
            overflowY: "hidden"
          });
        }
      }
    };
    TextArea2.prototype.componentDidUpdate = function componentDidUpdate(prevProps) {
      if (this.props.autoHeight && (this.props.value !== prevProps.value || this.props.isPreview !== prevProps.isPreview)) {
        this._resizeTextArea(this.props.value);
      }
    };
    TextArea2.prototype._getMinMaxHeight = function _getMinMaxHeight(_ref, value) {
      var minRows = _ref.minRows, maxRows = _ref.maxRows;
      var node = ReactDOM.findDOMNode(this.helpRef);
      if (!node) {
        return {};
      }
      node.setAttribute("rows", minRows);
      var minHeight = node.clientHeight;
      node.setAttribute("rows", maxRows);
      var maxHeight = node.clientHeight;
      node.setAttribute("rows", "1");
      var height = this._getHeight(value);
      return {
        minHeight,
        maxHeight,
        height,
        overflowY: height <= maxHeight ? "hidden" : void 0
      };
    };
    TextArea2.prototype._getHeight = function _getHeight(value) {
      var node = ReactDOM.findDOMNode(this.helpRef);
      if (!node) {
        return 0;
      }
      node.value = value;
      return node.scrollHeight;
    };
    TextArea2.prototype.ieHack = function ieHack(value) {
      if (env.ieVersion === 9 && this.props.maxLength) {
        var maxLength = parseInt(this.props.maxLength);
        var len = this.getValueLength(value, true);
        if (len > maxLength && this.props.cutString) {
          value = value.replace(/\n/g, "\n\n");
          value = value.substr(0, maxLength);
          value = value.replace(/\n\n/g, "\n");
        }
      }
      this.props.autoHeight && this._resizeTextArea(value);
      return value;
    };
    TextArea2.prototype.getValueLength = function getValueLength(value) {
      var _props = this.props, maxLength = _props.maxLength, cutString = _props.cutString;
      var nv = "" + value;
      var strLen = this.props.getValueLength(nv);
      if (typeof strLen !== "number") {
        strLen = nv.length;
      }
      if (env.ieVersion || isMacSafari) {
        strLen = strLen + nv.split("\n").length - 1;
        if (strLen > maxLength && cutString) {
          strLen = maxLength;
        }
      }
      return strLen;
    };
    TextArea2.prototype.saveTextAreaRef = function saveTextAreaRef(textArea) {
      this.inputRef = textArea;
    };
    TextArea2.prototype.saveHelpRef = function saveHelpRef(ref) {
      this.helpRef = ref;
    };
    TextArea2.prototype.render = function render2() {
      var _classNames, _classNames2;
      var _props2 = this.props, rows = _props2.rows, style = _props2.style, className = _props2.className, autoHeight = _props2.autoHeight, isPreview = _props2.isPreview, renderPreview = _props2.renderPreview, prefix = _props2.prefix, rtl = _props2.rtl, hasBorder = _props2.hasBorder, size2 = _props2.size, composition = _props2.composition;
      var cls = classnames(this.getClass(), (_classNames = {}, _classNames["" + prefix + size2] = size2 === "large" || false, _classNames[prefix + "input-textarea"] = true, _classNames[prefix + "noborder"] = !hasBorder, _classNames[className] = !!className, _classNames));
      var props = this.getProps();
      var dataProps = obj.pickAttrsWith(this.props, "data-");
      var others = obj.pickOthers(_default$8({}, dataProps, TextArea2.propTypes), this.props);
      var textareStyle = _default$8({}, props.style, {
        height: this.state.height,
        minHeight: this.state.minHeight,
        maxHeight: this.state.maxHeight,
        overflowY: this.state.overflowY
      });
      var previewCls = classnames((_classNames2 = {}, _classNames2[prefix + "input-textarea"] = true, _classNames2[prefix + "form-preview"] = true, _classNames2[className] = !!className, _classNames2));
      var wrapStyle = autoHeight ? _default$8({}, style, { position: "relative" }) : style;
      if (isPreview) {
        var value = props.value;
        if ("renderPreview" in this.props) {
          return React.createElement(
            "div",
            _default$8({}, others, { className: previewCls }),
            renderPreview(value, this.props)
          );
        }
        return React.createElement(
          "div",
          _default$8({}, others, { className: previewCls }),
          value.split("\n").map(function(data, i) {
            return React.createElement(
              "p",
              { key: "p-" + i },
              data
            );
          })
        );
      }
      var compositionProps = {};
      if (composition) {
        compositionProps.onCompositionStart = this.handleCompositionStart;
        compositionProps.onCompositionEnd = this.handleCompositionEnd;
      }
      return React.createElement(
        "span",
        _default$8({ className: cls, style: wrapStyle, dir: rtl ? "rtl" : void 0 }, dataProps),
        React.createElement("textarea", _default$8({}, others, props, compositionProps, {
          "data-real": true,
          rows,
          style: textareStyle,
          ref: this.saveRef.bind(this),
          onKeyDown: this.onKeyDown.bind(this)
        })),
        autoHeight ? React.createElement("textarea", {
          "data-fake": true,
          ref: this.saveHelpRef.bind(this),
          style: _default$8({}, props.style, hiddenStyle),
          rows: "1"
        }) : null,
        this.renderControl()
      );
    };
    return TextArea2;
  }(Base$2), _class$G.displayName = "TextArea", _class$G.getDerivedStateFromProps = Base$2.getDerivedStateFromProps, _class$G.propTypes = _default$8({}, Base$2.propTypes, {
    /**
     * 是否有边框
     */
    hasBorder: PropTypes$1.bool,
    /**
     * 状态
     * @enumdesc 错误
     */
    state: PropTypes$1.oneOf(["error", "warning"]),
    /**
     * 自动高度 true / {minRows: 2, maxRows: 4}
     */
    autoHeight: PropTypes$1.oneOfType([PropTypes$1.bool, PropTypes$1.object]),
    /**
     * 多行文本框高度 <br />(不要直接用height设置多行文本框的高度, ie9 10会有兼容性问题)
     */
    rows: PropTypes$1.number,
    /**
     * 是否为预览态
     */
    isPreview: PropTypes$1.bool,
    /**
     * 预览态模式下渲染的内容
     * @param {number} value 评分值
     */
    renderPreview: PropTypes$1.func
  }), _class$G.defaultProps = _default$8({}, Base$2.defaultProps, {
    hasBorder: true,
    isPreview: false,
    rows: 4,
    autoHeight: false
  }), _initialiseProps$1 = function _initialiseProps2() {
    var _this2 = this;
    this._resizeTextArea = function(value) {
      if (_this2.nextFrameActionId) {
        clearNextFrameAction(_this2.nextFrameActionId);
      }
      _this2.nextFrameActionId = onNextFrame(function() {
        var height = _this2._getHeight(value);
        var maxHeight = _this2.state.maxHeight ? _this2.state.maxHeight : Infinity;
        _this2.setState({
          height: _this2._getHeight(value),
          overflowY: height <= maxHeight ? "hidden" : void 0
        });
      });
    };
  }, _temp$r);
  Input$2.Password = ConfigProvider$1.config(Password, {
    exportNames: ["getInputNode", "focus"],
    transform: (
      /* istanbul ignore next */
      function transform9(props, deprecated2) {
        if ("hasLimitHint" in props) {
          deprecated2("hasLimitHint", "showLimitHint", "Input");
          var _props = props, hasLimitHint = _props.hasLimitHint, others = _default$3(_props, ["hasLimitHint"]);
          props = _default$8({ showLimitHint: hasLimitHint }, others);
        }
        return props;
      }
    )
  });
  Input$2.TextArea = ConfigProvider$1.config(TextArea, {
    exportNames: ["getInputNode", "focus"],
    transform: (
      /* istanbul ignore next */
      function transform10(props, deprecated2) {
        if ("hasLimitHint" in props) {
          deprecated2("hasLimitHint", "showLimitHint", "Input");
          var _props2 = props, hasLimitHint = _props2.hasLimitHint, others = _default$3(_props2, ["hasLimitHint"]);
          props = _default$8({ showLimitHint: hasLimitHint }, others);
        }
        return props;
      }
    )
  });
  Input$2.Group = Group$1;
  const Input = ConfigProvider$1.config(Input$2, {
    exportNames: ["getInputNode", "focus"],
    transform: (
      /* istanbul ignore next */
      function transform11(props, deprecated2) {
        if ("hasLimitHint" in props) {
          deprecated2("hasLimitHint", "showLimitHint", "Input");
          var _props3 = props, hasLimitHint = _props3.hasLimitHint, others = _default$3(_props3, ["hasLimitHint"]);
          props = _default$8({ showLimitHint: hasLimitHint }, others);
        }
        return props;
      }
    )
  });
  var _class$F, _temp2$e;
  var noop$7 = function noop6() {
  };
  var Message$1 = (_temp2$e = _class$F = function(_Component) {
    _default$4(Message2, _Component);
    function Message2() {
      var _temp3, _this2, _ret;
      _default$7(this, Message2);
      for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
        args[_key] = arguments[_key];
      }
      return _ret = (_temp3 = (_this2 = _default$5(this, _Component.call.apply(_Component, [this].concat(args))), _this2), _this2.state = {
        visible: typeof _this2.props.visible === "undefined" ? _this2.props.defaultVisible : _this2.props.visible
      }, _this2.onClose = function() {
        if (!("visible" in _this2.props)) {
          _this2.setState({
            visible: false
          });
        }
        _this2.props.onClose(false);
      }, _temp3), _default$5(_this2, _ret);
    }
    Message2.getDerivedStateFromProps = function getDerivedStateFromProps(props) {
      if ("visible" in props) {
        return {
          visible: props.visible
        };
      }
      return {};
    };
    Message2.prototype.render = function render2() {
      var _classNames;
      var _props = this.props, prefix = _props.prefix;
      _props.pure;
      var className = _props.className, style = _props.style, type2 = _props.type, shape = _props.shape, size2 = _props.size, title = _props.title, children = _props.children;
      _props.defaultVisible;
      _props.visible;
      var icon = _props.iconType, closeable = _props.closeable;
      _props.onClose;
      var afterClose = _props.afterClose, animation2 = _props.animation, rtl = _props.rtl, locale = _props.locale;
      var others = _default$8({}, obj.pickOthers(Object.keys(Message2.propTypes), this.props));
      var visible = this.state.visible;
      var messagePrefix = prefix + "message";
      var classes = classnames((_classNames = {}, _classNames[messagePrefix] = true, _classNames[prefix + "message-" + type2] = type2, _classNames["" + prefix + shape] = shape, _classNames["" + prefix + size2] = size2, _classNames[prefix + "title-content"] = !!title, _classNames[prefix + "only-content"] = !title && !!children, _classNames[className] = className, _classNames));
      var newChildren = visible ? React.createElement(
        "div",
        _default$8({ role: "alert", style }, others, { className: classes, dir: rtl ? "rtl" : void 0 }),
        closeable ? React.createElement(
          "a",
          {
            role: "button",
            "aria-label": locale.closeAriaLabel,
            className: messagePrefix + "-close",
            onClick: this.onClose
          },
          React.createElement(Icon, { type: "close" })
        ) : null,
        icon !== false ? React.createElement(Icon, {
          className: messagePrefix + "-symbol " + (!icon && messagePrefix + "-symbol-icon"),
          type: icon
        }) : null,
        title ? React.createElement(
          "div",
          { className: messagePrefix + "-title" },
          title
        ) : null,
        children ? React.createElement(
          "div",
          { className: messagePrefix + "-content" },
          children
        ) : null
      ) : null;
      if (animation2) {
        return React.createElement(
          Animate$1.Expand,
          { animationAppear: false, afterLeave: afterClose },
          newChildren
        );
      }
      return newChildren;
    };
    return Message2;
  }(React.Component), _class$F.propTypes = {
    prefix: PropTypes$1.string,
    pure: PropTypes$1.bool,
    className: PropTypes$1.string,
    style: PropTypes$1.object,
    /**
     * 反馈类型
     */
    type: PropTypes$1.oneOf(["success", "warning", "error", "notice", "help", "loading"]),
    /**
     * 反馈外观
     */
    shape: PropTypes$1.oneOf(["inline", "addon", "toast"]),
    /**
     * 反馈大小
     */
    size: PropTypes$1.oneOf(["medium", "large"]),
    /**
     * 标题
     */
    title: PropTypes$1.node,
    /**
     * 内容
     */
    children: PropTypes$1.node,
    /**
     * 默认是否显示
     */
    defaultVisible: PropTypes$1.bool,
    /**
     * 当前是否显示
     */
    visible: PropTypes$1.bool,
    /**
     * 显示的图标类型,会覆盖内部设置的IconType,传false不显示图标
     */
    iconType: PropTypes$1.oneOfType([PropTypes$1.string, PropTypes$1.bool]),
    /**
     * 显示关闭按钮
     */
    closeable: PropTypes$1.bool,
    /**
     * 关闭按钮的回调
     */
    onClose: PropTypes$1.func,
    /**
     * 关闭之后调用的函数
     */
    afterClose: PropTypes$1.func,
    /**
     * 是否开启展开收起动画
     */
    animation: PropTypes$1.bool,
    locale: PropTypes$1.object,
    rtl: PropTypes$1.bool
  }, _class$F.defaultProps = {
    prefix: "next-",
    pure: false,
    type: "success",
    shape: "inline",
    size: "medium",
    defaultVisible: true,
    closeable: false,
    onClose: noop$7,
    afterClose: noop$7,
    animation: true,
    locale: defaultLocale.Message
  }, _temp2$e);
  Message$1.displayName = "Message";
  const Message$2 = ConfigProvider$1.config(polyfill(Message$1));
  var _class$E, _temp2$d;
  var config = ConfigProvider$1.config;
  var instance = void 0;
  var timeouts = {};
  var Mask = (_temp2$d = _class$E = function(_React$Component) {
    _default$4(Mask2, _React$Component);
    function Mask2() {
      var _temp3, _this2, _ret;
      _default$7(this, Mask2);
      for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
        args[_key] = arguments[_key];
      }
      return _ret = (_temp3 = (_this2 = _default$5(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this2), _this2.state = {
        visible: true
      }, _this2.handleClose = function() {
        var silent = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : false;
        _this2.setState({
          visible: false
        });
        if (!silent) {
          _this2.props.onClose && _this2.props.onClose();
        }
      }, _temp3), _default$5(_this2, _ret);
    }
    Mask2.prototype.componentWillUnmount = function componentWillUnmount() {
      var timeoutId = this.props.timeoutId;
      if (timeoutId in timeouts) {
        var timeout = timeouts[timeoutId];
        clearTimeout(timeout);
        delete timeouts[timeoutId];
      }
    };
    Mask2.prototype.render = function render2() {
      var _props = this.props, prefix = _props.prefix, type2 = _props.type, title = _props.title, content = _props.content, align = _props.align, offset = _props.offset, hasMask = _props.hasMask, afterClose = _props.afterClose, animation2 = _props.animation, overlayProps = _props.overlayProps;
      _props.timeoutId;
      var className = _props.className, style = _props.style, others = _default$3(_props, ["prefix", "type", "title", "content", "align", "offset", "hasMask", "afterClose", "animation", "overlayProps", "timeoutId", "className", "style"]);
      var visible = this.state.visible;
      return React.createElement(
        Overlay$1,
        _default$8({}, overlayProps, {
          prefix,
          animation: animation2,
          visible,
          align,
          offset,
          hasMask,
          afterClose
        }),
        React.createElement(
          Message$2,
          _default$8({}, others, {
            prefix,
            visible: true,
            type: type2,
            shape: "toast",
            title,
            style,
            className: prefix + "message-wrapper " + className,
            onClose: this.handleClose
          }),
          content
        )
      );
    };
    return Mask2;
  }(React.Component), _class$E.contextTypes = {
    prefix: PropTypes$1.string
  }, _class$E.propTypes = {
    prefix: PropTypes$1.string,
    type: PropTypes$1.string,
    title: PropTypes$1.node,
    content: PropTypes$1.node,
    align: PropTypes$1.string,
    offset: PropTypes$1.array,
    hasMask: PropTypes$1.bool,
    afterClose: PropTypes$1.func,
    animation: PropTypes$1.oneOfType([PropTypes$1.object, PropTypes$1.bool]),
    overlayProps: PropTypes$1.object,
    onClose: PropTypes$1.func,
    timeoutId: PropTypes$1.string,
    style: PropTypes$1.object,
    className: PropTypes$1.string
  }, _class$E.defaultProps = {
    prefix: "next-",
    align: "tc tc",
    offset: [0, 30],
    hasMask: false,
    animation: {
      in: "pulse",
      out: "zoomOut"
    },
    style: {},
    className: ""
  }, _temp2$d);
  Mask.displayName = "Mask";
  var NewMask = config(Mask);
  var create4 = function create5(props) {
    props.duration;
    var afterClose = props.afterClose, contextConfig = props.contextConfig, others = _default$3(props, ["duration", "afterClose", "contextConfig"]);
    var div = document.createElement("div");
    document.body.appendChild(div);
    var closeChain = function closeChain2() {
      ReactDOM.unmountComponentAtNode(div);
      document.body.removeChild(div);
      afterClose && afterClose();
    };
    var newContext = contextConfig;
    if (!newContext)
      newContext = ConfigProvider$1.getContext();
    var mask = void 0, myRef = void 0, destroyed = false;
    var destroy = function destroy2() {
      var inc = mask && mask.getInstance();
      inc && inc.handleClose(true);
      destroyed = true;
    };
    ReactDOM.render(React.createElement(
      ConfigProvider$1,
      newContext,
      React.createElement(NewMask, _default$8({
        afterClose: closeChain
      }, others, {
        ref: function ref(_ref) {
          myRef = _ref;
        }
      }))
    ), div, function() {
      mask = myRef;
      if (mask && destroyed) {
        destroy();
      }
    });
    return {
      component: mask,
      destroy
    };
  };
  function handleConfig$1(config3, type2) {
    var newConfig = {};
    if (typeof config3 === "string" || React.isValidElement(config3)) {
      newConfig.title = config3;
    } else if (isObject(config3)) {
      newConfig = _default$8({}, config3);
    }
    if (typeof newConfig.duration !== "number") {
      newConfig.duration = 3e3;
    }
    if (type2) {
      newConfig.type = type2;
    }
    return newConfig;
  }
  function isObject(obj2) {
    return {}.toString.call(obj2) === "[object Object]";
  }
  function open$1(config3, type2) {
    close$1();
    config3 = handleConfig$1(config3, type2);
    var timeoutId = guid();
    instance = create4(_default$8({}, config3, { timeoutId }));
    if (config3.duration > 0) {
      var timeout = setTimeout(close$1, config3.duration);
      timeouts[timeoutId] = timeout;
    }
  }
  function close$1() {
    if (instance) {
      instance.destroy();
      instance = null;
    }
  }
  function _show(config3) {
    open$1(config3);
  }
  function hide() {
    close$1();
  }
  function _success(config3) {
    open$1(config3, "success");
  }
  function _warning(config3) {
    open$1(config3, "warning");
  }
  function _error(config3) {
    open$1(config3, "error");
  }
  function _help(config3) {
    open$1(config3, "help");
  }
  function _loading(config3) {
    open$1(config3, "loading");
  }
  function _notice(config3) {
    open$1(config3, "notice");
  }
  const toast = {
    show: _show,
    hide,
    success: _success,
    warning: _warning,
    error: _error,
    help: _help,
    loading: _loading,
    notice: _notice
  };
  var withContext = function withContext2(WrappedComponent) {
    var HOC = function HOC2(props) {
      return React.createElement(
        ConfigProvider$1.Consumer,
        null,
        function(contextConfig) {
          return React.createElement(WrappedComponent, _default$8({}, props, {
            contextMessage: {
              show: function show() {
                var config3 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
                return _show(_default$8({}, config3, { contextConfig }));
              },
              hide,
              success: function success() {
                var config3 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
                return _success(_default$8({}, config3, { contextConfig }));
              },
              warning: function warning2() {
                var config3 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
                return _warning(_default$8({}, config3, { contextConfig }));
              },
              error: function error() {
                var config3 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
                return _error(_default$8({}, config3, { contextConfig }));
              },
              help: function help() {
                var config3 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
                return _help(_default$8({}, config3, { contextConfig }));
              },
              loading: function loading() {
                var config3 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
                return _loading(_default$8({}, config3, { contextConfig }));
              },
              notice: function notice() {
                var config3 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
                return _notice(_default$8({}, config3, { contextConfig }));
              }
            }
          }));
        }
      );
    };
    return HOC;
  };
  var _config = {
    top: 8,
    maxCount: 0,
    duration: 3e3
  };
  var MessageWrapper = function MessageWrapper2(props) {
    var _props$prefix = props.prefix, prefix = _props$prefix === void 0 ? "next-" : _props$prefix, _props$dataSource = props.dataSource, dataSource = _props$dataSource === void 0 ? [] : _props$dataSource;
    var _useState = React.useState(), forceUpdate = _useState[1];
    dataSource.forEach(function(i) {
      if (!i.timer) {
        i.timer = setTimeout(function() {
          var idx = dataSource.indexOf(i);
          if (idx > -1) {
            var item = dataSource[idx];
            typeof item.onClose === "function" && item.onClose();
            dataSource.splice(idx, 1);
            forceUpdate({});
          }
        }, i.duration);
      }
    });
    return React.createElement(
      "div",
      { className: prefix + "message-wrapper-v2", style: { top: _config.top } },
      React.createElement(
        Animate$1,
        {
          animationAppear: true,
          animation: {
            appear: "pulse",
            enter: "pulse",
            leave: prefix + "message-fade-leave"
          },
          singleMode: false
        },
        dataSource.map(function(i) {
          var key = i.key, className = i.className, type2 = i.type, title = i.title, content = i.content, style = i.style, others = _default$3(i, ["key", "className", "type", "title", "content", "style"]);
          return React.createElement(
            "div",
            { className: prefix + "message-list", key },
            React.createElement(
              Message$2,
              _default$8({}, others, {
                className,
                prefix,
                visible: true,
                type: type2,
                shape: "toast",
                title,
                style
              }),
              content
            )
          );
        })
      )
    );
  };
  var ConfigedMessages = ConfigProvider$1.config(MessageWrapper);
  var messageRootNode = void 0;
  var messageList = [];
  var createMessage = function createMessage2(props) {
    var _props$key = props.key, key = _props$key === void 0 ? guid("message-") : _props$key, others = _default$3(props, ["key"]);
    if (!messageRootNode) {
      messageRootNode = document.createElement("div");
      document.body.appendChild(messageRootNode);
    }
    var maxCount = _config.maxCount, duration = _config.duration;
    var item = _default$8({
      key,
      duration
    }, others);
    messageList.push(item);
    if (maxCount && messageList.length > maxCount) {
      messageList.shift();
    }
    ReactDOM.render(React.createElement(
      ConfigProvider$1,
      ConfigProvider$1.getContext(),
      React.createElement(ConfigedMessages, { dataSource: messageList })
    ), messageRootNode);
    return {
      key,
      close: function close2() {
        if (item.timer) {
          clearTimeout(item.timer);
        }
        var idx = messageList.indexOf(item);
        if (idx > -1) {
          typeof item.onClose === "function" && item.onClose();
          messageList.splice(idx, 1);
          ReactDOM.render(React.createElement(
            ConfigProvider$1,
            ConfigProvider$1.getContext(),
            React.createElement(ConfigedMessages, { dataSource: messageList })
          ), messageRootNode);
        }
      }
    };
  };
  function close(key) {
    if (key) {
      var index2 = messageList.findIndex(function(item) {
        return item.key === key;
      });
      messageList.splice(index2, 1);
    } else {
      messageList = [];
    }
    if (messageRootNode) {
      ReactDOM.render(React.createElement(
        ConfigProvider$1,
        ConfigProvider$1.getContext(),
        React.createElement(ConfigedMessages, { dataSource: messageList })
      ), messageRootNode);
    }
  }
  function handleConfig(config3, type2) {
    var newConfig = {};
    if (typeof config3 === "string" || React.isValidElement(config3)) {
      newConfig.title = config3;
    } else if (obj.typeOf(config3) === "Object") {
      newConfig = _default$8({}, config3);
    }
    if (type2) {
      newConfig.type = type2;
    }
    return newConfig;
  }
  function open(type2) {
    return function(config3) {
      config3 = handleConfig(config3, type2);
      return createMessage(config3);
    };
  }
  function destory() {
    if (!messageRootNode)
      return;
    if (messageRootNode) {
      ReactDOM.unmountComponentAtNode(messageRootNode);
      messageRootNode.parentNode.removeChild(messageRootNode);
      messageRootNode = null;
    }
  }
  const message = {
    open: open(),
    success: open("success"),
    warning: open("warning"),
    error: open("error"),
    help: open("help"),
    loading: open("loading"),
    notice: open("notice"),
    close,
    destory,
    config: function config2() {
      if (!React.useState) {
        log.warning("need react version > 16.8.0");
        return;
      }
      for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
        args[_key] = arguments[_key];
      }
      return _default$8.apply(void 0, [_config].concat(args));
    }
  };
  Message$2.show = toast.show;
  Message$2.success = toast.success;
  Message$2.warning = toast.warning;
  Message$2.error = toast.error;
  Message$2.notice = toast.notice;
  Message$2.help = toast.help;
  Message$2.loading = toast.loading;
  Message$2.hide = toast.hide;
  Message$2.withContext = withContext;
  var MessageProvider = ConfigProvider$1.config(Message$2, {
    componentName: "Message"
  });
  const Message = MessageProvider;
  var openV2 = false;
  MessageProvider.config = function(config3) {
    message.config(config3);
    if (!openV2) {
      MessageProvider.show = message.open;
      MessageProvider.open = message.open;
      MessageProvider.hide = message.close;
      MessageProvider.close = message.close;
      MessageProvider.destory = message.destory;
      MessageProvider.success = message.success;
      MessageProvider.warning = message.warning;
      MessageProvider.error = message.error;
      MessageProvider.notice = message.notice;
      MessageProvider.help = message.help;
      MessageProvider.loading = message.loading;
      openV2 = true;
    }
  };
  var lib$1 = {};
  var regeneratorRuntime$1 = { exports: {} };
  var _typeof = { exports: {} };
  var hasRequired_typeof;
  function require_typeof() {
    if (hasRequired_typeof)
      return _typeof.exports;
    hasRequired_typeof = 1;
    (function(module) {
      function _typeof4(o) {
        "@babel/helpers - typeof";
        return module.exports = _typeof4 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
          return typeof o2;
        } : function(o2) {
          return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
        }, module.exports.__esModule = true, module.exports["default"] = module.exports, _typeof4(o);
      }
      module.exports = _typeof4, module.exports.__esModule = true, module.exports["default"] = module.exports;
    })(_typeof);
    return _typeof.exports;
  }
  var hasRequiredRegeneratorRuntime;
  function requireRegeneratorRuntime() {
    if (hasRequiredRegeneratorRuntime)
      return regeneratorRuntime$1.exports;
    hasRequiredRegeneratorRuntime = 1;
    (function(module) {
      var _typeof4 = require_typeof()["default"];
      function _regeneratorRuntime() {
        module.exports = _regeneratorRuntime = function _regeneratorRuntime2() {
          return e2;
        }, module.exports.__esModule = true, module.exports["default"] = module.exports;
        var t2, e2 = {}, r2 = Object.prototype, n2 = r2.hasOwnProperty, o = Object.defineProperty || function(t3, e3, r3) {
          t3[e3] = r3.value;
        }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c2 = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag";
        function define(t3, e3, r3) {
          return Object.defineProperty(t3, e3, {
            value: r3,
            enumerable: true,
            configurable: true,
            writable: true
          }), t3[e3];
        }
        try {
          define({}, "");
        } catch (t3) {
          define = function define2(t4, e3, r3) {
            return t4[e3] = r3;
          };
        }
        function wrap2(t3, e3, r3, n3) {
          var i2 = e3 && e3.prototype instanceof Generator ? e3 : Generator, a2 = Object.create(i2.prototype), c3 = new Context(n3 || []);
          return o(a2, "_invoke", {
            value: makeInvokeMethod(t3, r3, c3)
          }), a2;
        }
        function tryCatch(t3, e3, r3) {
          try {
            return {
              type: "normal",
              arg: t3.call(e3, r3)
            };
          } catch (t4) {
            return {
              type: "throw",
              arg: t4
            };
          }
        }
        e2.wrap = wrap2;
        var h2 = "suspendedStart", l2 = "suspendedYield", f2 = "executing", s = "completed", y2 = {};
        function Generator() {
        }
        function GeneratorFunction() {
        }
        function GeneratorFunctionPrototype() {
        }
        var p2 = {};
        define(p2, a, function() {
          return this;
        });
        var d2 = Object.getPrototypeOf, v2 = d2 && d2(d2(values2([])));
        v2 && v2 !== r2 && n2.call(v2, a) && (p2 = v2);
        var g2 = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p2);
        function defineIteratorMethods(t3) {
          ["next", "throw", "return"].forEach(function(e3) {
            define(t3, e3, function(t4) {
              return this._invoke(e3, t4);
            });
          });
        }
        function AsyncIterator(t3, e3) {
          function invoke2(r4, o2, i2, a2) {
            var c3 = tryCatch(t3[r4], t3, o2);
            if ("throw" !== c3.type) {
              var u2 = c3.arg, h3 = u2.value;
              return h3 && "object" == _typeof4(h3) && n2.call(h3, "__await") ? e3.resolve(h3.__await).then(function(t4) {
                invoke2("next", t4, i2, a2);
              }, function(t4) {
                invoke2("throw", t4, i2, a2);
              }) : e3.resolve(h3).then(function(t4) {
                u2.value = t4, i2(u2);
              }, function(t4) {
                return invoke2("throw", t4, i2, a2);
              });
            }
            a2(c3.arg);
          }
          var r3;
          o(this, "_invoke", {
            value: function value(t4, n3) {
              function callInvokeWithMethodAndArg() {
                return new e3(function(e4, r4) {
                  invoke2(t4, n3, e4, r4);
                });
              }
              return r3 = r3 ? r3.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
            }
          });
        }
        function makeInvokeMethod(e3, r3, n3) {
          var o2 = h2;
          return function(i2, a2) {
            if (o2 === f2)
              throw new Error("Generator is already running");
            if (o2 === s) {
              if ("throw" === i2)
                throw a2;
              return {
                value: t2,
                done: true
              };
            }
            for (n3.method = i2, n3.arg = a2; ; ) {
              var c3 = n3.delegate;
              if (c3) {
                var u2 = maybeInvokeDelegate(c3, n3);
                if (u2) {
                  if (u2 === y2)
                    continue;
                  return u2;
                }
              }
              if ("next" === n3.method)
                n3.sent = n3._sent = n3.arg;
              else if ("throw" === n3.method) {
                if (o2 === h2)
                  throw o2 = s, n3.arg;
                n3.dispatchException(n3.arg);
              } else
                "return" === n3.method && n3.abrupt("return", n3.arg);
              o2 = f2;
              var p3 = tryCatch(e3, r3, n3);
              if ("normal" === p3.type) {
                if (o2 = n3.done ? s : l2, p3.arg === y2)
                  continue;
                return {
                  value: p3.arg,
                  done: n3.done
                };
              }
              "throw" === p3.type && (o2 = s, n3.method = "throw", n3.arg = p3.arg);
            }
          };
        }
        function maybeInvokeDelegate(e3, r3) {
          var n3 = r3.method, o2 = e3.iterator[n3];
          if (o2 === t2)
            return r3.delegate = null, "throw" === n3 && e3.iterator["return"] && (r3.method = "return", r3.arg = t2, maybeInvokeDelegate(e3, r3), "throw" === r3.method) || "return" !== n3 && (r3.method = "throw", r3.arg = new TypeError("The iterator does not provide a '" + n3 + "' method")), y2;
          var i2 = tryCatch(o2, e3.iterator, r3.arg);
          if ("throw" === i2.type)
            return r3.method = "throw", r3.arg = i2.arg, r3.delegate = null, y2;
          var a2 = i2.arg;
          return a2 ? a2.done ? (r3[e3.resultName] = a2.value, r3.next = e3.nextLoc, "return" !== r3.method && (r3.method = "next", r3.arg = t2), r3.delegate = null, y2) : a2 : (r3.method = "throw", r3.arg = new TypeError("iterator result is not an object"), r3.delegate = null, y2);
        }
        function pushTryEntry(t3) {
          var e3 = {
            tryLoc: t3[0]
          };
          1 in t3 && (e3.catchLoc = t3[1]), 2 in t3 && (e3.finallyLoc = t3[2], e3.afterLoc = t3[3]), this.tryEntries.push(e3);
        }
        function resetTryEntry(t3) {
          var e3 = t3.completion || {};
          e3.type = "normal", delete e3.arg, t3.completion = e3;
        }
        function Context(t3) {
          this.tryEntries = [{
            tryLoc: "root"
          }], t3.forEach(pushTryEntry, this), this.reset(true);
        }
        function values2(e3) {
          if (e3 || "" === e3) {
            var r3 = e3[a];
            if (r3)
              return r3.call(e3);
            if ("function" == typeof e3.next)
              return e3;
            if (!isNaN(e3.length)) {
              var o2 = -1, i2 = function next() {
                for (; ++o2 < e3.length; )
                  if (n2.call(e3, o2))
                    return next.value = e3[o2], next.done = false, next;
                return next.value = t2, next.done = true, next;
              };
              return i2.next = i2;
            }
          }
          throw new TypeError(_typeof4(e3) + " is not iterable");
        }
        return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g2, "constructor", {
          value: GeneratorFunctionPrototype,
          configurable: true
        }), o(GeneratorFunctionPrototype, "constructor", {
          value: GeneratorFunction,
          configurable: true
        }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e2.isGeneratorFunction = function(t3) {
          var e3 = "function" == typeof t3 && t3.constructor;
          return !!e3 && (e3 === GeneratorFunction || "GeneratorFunction" === (e3.displayName || e3.name));
        }, e2.mark = function(t3) {
          return Object.setPrototypeOf ? Object.setPrototypeOf(t3, GeneratorFunctionPrototype) : (t3.__proto__ = GeneratorFunctionPrototype, define(t3, u, "GeneratorFunction")), t3.prototype = Object.create(g2), t3;
        }, e2.awrap = function(t3) {
          return {
            __await: t3
          };
        }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c2, function() {
          return this;
        }), e2.AsyncIterator = AsyncIterator, e2.async = function(t3, r3, n3, o2, i2) {
          void 0 === i2 && (i2 = Promise);
          var a2 = new AsyncIterator(wrap2(t3, r3, n3, o2), i2);
          return e2.isGeneratorFunction(r3) ? a2 : a2.next().then(function(t4) {
            return t4.done ? t4.value : a2.next();
          });
        }, defineIteratorMethods(g2), define(g2, u, "Generator"), define(g2, a, function() {
          return this;
        }), define(g2, "toString", function() {
          return "[object Generator]";
        }), e2.keys = function(t3) {
          var e3 = Object(t3), r3 = [];
          for (var n3 in e3)
            r3.push(n3);
          return r3.reverse(), function next() {
            for (; r3.length; ) {
              var t4 = r3.pop();
              if (t4 in e3)
                return next.value = t4, next.done = false, next;
            }
            return next.done = true, next;
          };
        }, e2.values = values2, Context.prototype = {
          constructor: Context,
          reset: function reset(e3) {
            if (this.prev = 0, this.next = 0, this.sent = this._sent = t2, this.done = false, this.delegate = null, this.method = "next", this.arg = t2, this.tryEntries.forEach(resetTryEntry), !e3)
              for (var r3 in this)
                "t" === r3.charAt(0) && n2.call(this, r3) && !isNaN(+r3.slice(1)) && (this[r3] = t2);
          },
          stop: function stop() {
            this.done = true;
            var t3 = this.tryEntries[0].completion;
            if ("throw" === t3.type)
              throw t3.arg;
            return this.rval;
          },
          dispatchException: function dispatchException(e3) {
            if (this.done)
              throw e3;
            var r3 = this;
            function handle(n3, o3) {
              return a2.type = "throw", a2.arg = e3, r3.next = n3, o3 && (r3.method = "next", r3.arg = t2), !!o3;
            }
            for (var o2 = this.tryEntries.length - 1; o2 >= 0; --o2) {
              var i2 = this.tryEntries[o2], a2 = i2.completion;
              if ("root" === i2.tryLoc)
                return handle("end");
              if (i2.tryLoc <= this.prev) {
                var c3 = n2.call(i2, "catchLoc"), u2 = n2.call(i2, "finallyLoc");
                if (c3 && u2) {
                  if (this.prev < i2.catchLoc)
                    return handle(i2.catchLoc, true);
                  if (this.prev < i2.finallyLoc)
                    return handle(i2.finallyLoc);
                } else if (c3) {
                  if (this.prev < i2.catchLoc)
                    return handle(i2.catchLoc, true);
                } else {
                  if (!u2)
                    throw new Error("try statement without catch or finally");
                  if (this.prev < i2.finallyLoc)
                    return handle(i2.finallyLoc);
                }
              }
            }
          },
          abrupt: function abrupt(t3, e3) {
            for (var r3 = this.tryEntries.length - 1; r3 >= 0; --r3) {
              var o2 = this.tryEntries[r3];
              if (o2.tryLoc <= this.prev && n2.call(o2, "finallyLoc") && this.prev < o2.finallyLoc) {
                var i2 = o2;
                break;
              }
            }
            i2 && ("break" === t3 || "continue" === t3) && i2.tryLoc <= e3 && e3 <= i2.finallyLoc && (i2 = null);
            var a2 = i2 ? i2.completion : {};
            return a2.type = t3, a2.arg = e3, i2 ? (this.method = "next", this.next = i2.finallyLoc, y2) : this.complete(a2);
          },
          complete: function complete(t3, e3) {
            if ("throw" === t3.type)
              throw t3.arg;
            return "break" === t3.type || "continue" === t3.type ? this.next = t3.arg : "return" === t3.type ? (this.rval = this.arg = t3.arg, this.method = "return", this.next = "end") : "normal" === t3.type && e3 && (this.next = e3), y2;
          },
          finish: function finish(t3) {
            for (var e3 = this.tryEntries.length - 1; e3 >= 0; --e3) {
              var r3 = this.tryEntries[e3];
              if (r3.finallyLoc === t3)
                return this.complete(r3.completion, r3.afterLoc), resetTryEntry(r3), y2;
            }
          },
          "catch": function _catch(t3) {
            for (var e3 = this.tryEntries.length - 1; e3 >= 0; --e3) {
              var r3 = this.tryEntries[e3];
              if (r3.tryLoc === t3) {
                var n3 = r3.completion;
                if ("throw" === n3.type) {
                  var o2 = n3.arg;
                  resetTryEntry(r3);
                }
                return o2;
              }
            }
            throw new Error("illegal catch attempt");
          },
          delegateYield: function delegateYield(e3, r3, n3) {
            return this.delegate = {
              iterator: values2(e3),
              resultName: r3,
              nextLoc: n3
            }, "next" === this.method && (this.arg = t2), y2;
          }
        }, e2;
      }
      module.exports = _regeneratorRuntime, module.exports.__esModule = true, module.exports["default"] = module.exports;
    })(regeneratorRuntime$1);
    return regeneratorRuntime$1.exports;
  }
  var regenerator;
  var hasRequiredRegenerator;
  function requireRegenerator() {
    if (hasRequiredRegenerator)
      return regenerator;
    hasRequiredRegenerator = 1;
    var runtime = requireRegeneratorRuntime()();
    regenerator = runtime;
    try {
      regeneratorRuntime = runtime;
    } catch (accidentalStrictMode) {
      if (typeof globalThis === "object") {
        globalThis.regeneratorRuntime = runtime;
      } else {
        Function("r", "regeneratorRuntime = r")(runtime);
      }
    }
    return regenerator;
  }
  var asyncToGenerator = { exports: {} };
  var hasRequiredAsyncToGenerator;
  function requireAsyncToGenerator() {
    if (hasRequiredAsyncToGenerator)
      return asyncToGenerator.exports;
    hasRequiredAsyncToGenerator = 1;
    (function(module) {
      function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
        try {
          var info = gen[key](arg);
          var value = info.value;
        } catch (error) {
          reject(error);
          return;
        }
        if (info.done) {
          resolve(value);
        } else {
          Promise.resolve(value).then(_next, _throw);
        }
      }
      function _asyncToGenerator(fn) {
        return function() {
          var self2 = this, args = arguments;
          return new Promise(function(resolve, reject) {
            var gen = fn.apply(self2, args);
            function _next(value) {
              asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
            }
            function _throw(err) {
              asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
            }
            _next(void 0);
          });
        };
      }
      module.exports = _asyncToGenerator, module.exports.__esModule = true, module.exports["default"] = module.exports;
    })(asyncToGenerator);
    return asyncToGenerator.exports;
  }
  var defineProperty4 = { exports: {} };
  var toPropertyKey = { exports: {} };
  var toPrimitive = { exports: {} };
  var hasRequiredToPrimitive;
  function requireToPrimitive() {
    if (hasRequiredToPrimitive)
      return toPrimitive.exports;
    hasRequiredToPrimitive = 1;
    (function(module) {
      var _typeof4 = require_typeof()["default"];
      function _toPrimitive2(input, hint) {
        if (_typeof4(input) !== "object" || input === null)
          return input;
        var prim = input[Symbol.toPrimitive];
        if (prim !== void 0) {
          var res = prim.call(input, hint || "default");
          if (_typeof4(res) !== "object")
            return res;
          throw new TypeError("@@toPrimitive must return a primitive value.");
        }
        return (hint === "string" ? String : Number)(input);
      }
      module.exports = _toPrimitive2, module.exports.__esModule = true, module.exports["default"] = module.exports;
    })(toPrimitive);
    return toPrimitive.exports;
  }
  var hasRequiredToPropertyKey;
  function requireToPropertyKey() {
    if (hasRequiredToPropertyKey)
      return toPropertyKey.exports;
    hasRequiredToPropertyKey = 1;
    (function(module) {
      var _typeof4 = require_typeof()["default"];
      var toPrimitive2 = requireToPrimitive();
      function _toPropertyKey(arg) {
        var key = toPrimitive2(arg, "string");
        return _typeof4(key) === "symbol" ? key : String(key);
      }
      module.exports = _toPropertyKey, module.exports.__esModule = true, module.exports["default"] = module.exports;
    })(toPropertyKey);
    return toPropertyKey.exports;
  }
  var hasRequiredDefineProperty;
  function requireDefineProperty() {
    if (hasRequiredDefineProperty)
      return defineProperty4.exports;
    hasRequiredDefineProperty = 1;
    (function(module) {
      var toPropertyKey2 = requireToPropertyKey();
      function _defineProperty3(obj2, key, value) {
        key = toPropertyKey2(key);
        if (key in obj2) {
          Object.defineProperty(obj2, key, {
            value,
            enumerable: true,
            configurable: true,
            writable: true
          });
        } else {
          obj2[key] = value;
        }
        return obj2;
      }
      module.exports = _defineProperty3, module.exports.__esModule = true, module.exports["default"] = module.exports;
    })(defineProperty4);
    return defineProperty4.exports;
  }
  var slicedToArray = { exports: {} };
  var arrayWithHoles = { exports: {} };
  var hasRequiredArrayWithHoles;
  function requireArrayWithHoles() {
    if (hasRequiredArrayWithHoles)
      return arrayWithHoles.exports;
    hasRequiredArrayWithHoles = 1;
    (function(module) {
      function _arrayWithHoles(arr) {
        if (Array.isArray(arr))
          return arr;
      }
      module.exports = _arrayWithHoles, module.exports.__esModule = true, module.exports["default"] = module.exports;
    })(arrayWithHoles);
    return arrayWithHoles.exports;
  }
  var iterableToArrayLimit = { exports: {} };
  var hasRequiredIterableToArrayLimit;
  function requireIterableToArrayLimit() {
    if (hasRequiredIterableToArrayLimit)
      return iterableToArrayLimit.exports;
    hasRequiredIterableToArrayLimit = 1;
    (function(module) {
      function _iterableToArrayLimit(r2, l2) {
        var t2 = null == r2 ? null : "undefined" != typeof Symbol && r2[Symbol.iterator] || r2["@@iterator"];
        if (null != t2) {
          var e2, n2, i, u, a = [], f2 = true, o = false;
          try {
            if (i = (t2 = t2.call(r2)).next, 0 === l2) {
              if (Object(t2) !== t2)
                return;
              f2 = false;
            } else
              for (; !(f2 = (e2 = i.call(t2)).done) && (a.push(e2.value), a.length !== l2); f2 = true)
                ;
          } catch (r3) {
            o = true, n2 = r3;
          } finally {
            try {
              if (!f2 && null != t2["return"] && (u = t2["return"](), Object(u) !== u))
                return;
            } finally {
              if (o)
                throw n2;
            }
          }
          return a;
        }
      }
      module.exports = _iterableToArrayLimit, module.exports.__esModule = true, module.exports["default"] = module.exports;
    })(iterableToArrayLimit);
    return iterableToArrayLimit.exports;
  }
  var unsupportedIterableToArray = { exports: {} };
  var arrayLikeToArray = { exports: {} };
  var hasRequiredArrayLikeToArray;
  function requireArrayLikeToArray() {
    if (hasRequiredArrayLikeToArray)
      return arrayLikeToArray.exports;
    hasRequiredArrayLikeToArray = 1;
    (function(module) {
      function _arrayLikeToArray2(arr, len) {
        if (len == null || len > arr.length)
          len = arr.length;
        for (var i = 0, arr2 = new Array(len); i < len; i++)
          arr2[i] = arr[i];
        return arr2;
      }
      module.exports = _arrayLikeToArray2, module.exports.__esModule = true, module.exports["default"] = module.exports;
    })(arrayLikeToArray);
    return arrayLikeToArray.exports;
  }
  var hasRequiredUnsupportedIterableToArray;
  function requireUnsupportedIterableToArray() {
    if (hasRequiredUnsupportedIterableToArray)
      return unsupportedIterableToArray.exports;
    hasRequiredUnsupportedIterableToArray = 1;
    (function(module) {
      var arrayLikeToArray2 = requireArrayLikeToArray();
      function _unsupportedIterableToArray2(o, minLen) {
        if (!o)
          return;
        if (typeof o === "string")
          return arrayLikeToArray2(o, minLen);
        var n2 = Object.prototype.toString.call(o).slice(8, -1);
        if (n2 === "Object" && o.constructor)
          n2 = o.constructor.name;
        if (n2 === "Map" || n2 === "Set")
          return Array.from(o);
        if (n2 === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n2))
          return arrayLikeToArray2(o, minLen);
      }
      module.exports = _unsupportedIterableToArray2, module.exports.__esModule = true, module.exports["default"] = module.exports;
    })(unsupportedIterableToArray);
    return unsupportedIterableToArray.exports;
  }
  var nonIterableRest = { exports: {} };
  var hasRequiredNonIterableRest;
  function requireNonIterableRest() {
    if (hasRequiredNonIterableRest)
      return nonIterableRest.exports;
    hasRequiredNonIterableRest = 1;
    (function(module) {
      function _nonIterableRest() {
        throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
      }
      module.exports = _nonIterableRest, module.exports.__esModule = true, module.exports["default"] = module.exports;
    })(nonIterableRest);
    return nonIterableRest.exports;
  }
  var hasRequiredSlicedToArray;
  function requireSlicedToArray() {
    if (hasRequiredSlicedToArray)
      return slicedToArray.exports;
    hasRequiredSlicedToArray = 1;
    (function(module) {
      var arrayWithHoles2 = requireArrayWithHoles();
      var iterableToArrayLimit2 = requireIterableToArrayLimit();
      var unsupportedIterableToArray2 = requireUnsupportedIterableToArray();
      var nonIterableRest2 = requireNonIterableRest();
      function _slicedToArray(arr, i) {
        return arrayWithHoles2(arr) || iterableToArrayLimit2(arr, i) || unsupportedIterableToArray2(arr, i) || nonIterableRest2();
      }
      module.exports = _slicedToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
    })(slicedToArray);
    return slicedToArray.exports;
  }
  var classCallCheck = { exports: {} };
  var hasRequiredClassCallCheck;
  function requireClassCallCheck() {
    if (hasRequiredClassCallCheck)
      return classCallCheck.exports;
    hasRequiredClassCallCheck = 1;
    (function(module) {
      function _classCallCheck(instance2, Constructor) {
        if (!(instance2 instanceof Constructor)) {
          throw new TypeError("Cannot call a class as a function");
        }
      }
      module.exports = _classCallCheck, module.exports.__esModule = true, module.exports["default"] = module.exports;
    })(classCallCheck);
    return classCallCheck.exports;
  }
  var createClass = { exports: {} };
  var hasRequiredCreateClass;
  function requireCreateClass() {
    if (hasRequiredCreateClass)
      return createClass.exports;
    hasRequiredCreateClass = 1;
    (function(module) {
      var toPropertyKey2 = requireToPropertyKey();
      function _defineProperties(target, props) {
        for (var i = 0; i < props.length; i++) {
          var descriptor2 = props[i];
          descriptor2.enumerable = descriptor2.enumerable || false;
          descriptor2.configurable = true;
          if ("value" in descriptor2)
            descriptor2.writable = true;
          Object.defineProperty(target, toPropertyKey2(descriptor2.key), descriptor2);
        }
      }
      function _createClass(Constructor, protoProps, staticProps) {
        if (protoProps)
          _defineProperties(Constructor.prototype, protoProps);
        if (staticProps)
          _defineProperties(Constructor, staticProps);
        Object.defineProperty(Constructor, "prototype", {
          writable: false
        });
        return Constructor;
      }
      module.exports = _createClass, module.exports.__esModule = true, module.exports["default"] = module.exports;
    })(createClass);
    return createClass.exports;
  }
  var lib = {};
  var util = {};
  var hasRequiredUtil;
  function requireUtil() {
    if (hasRequiredUtil)
      return util;
    hasRequiredUtil = 1;
    var _interopRequireDefault2 = interopRequireDefaultExports;
    Object.defineProperty(util, "__esModule", {
      value: true
    });
    util.asyncMap = asyncMap;
    util.asyncMapPromise = asyncMapPromise;
    util.complementError = complementError;
    util.format = format2;
    util.processErrorResults = processErrorResults;
    var _regenerator2 = _interopRequireDefault2(requireRegenerator());
    var _asyncToGenerator22 = _interopRequireDefault2(requireAsyncToGenerator());
    var formatRegExp = /%[sdj%]/g;
    function format2() {
      for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
        args[_key] = arguments[_key];
      }
      var i = 1;
      var f2 = args[0];
      var len = args.length;
      if (typeof f2 === "function") {
        return f2(args.slice(1));
      }
      if (typeof f2 === "string") {
        var str = String(f2).replace(formatRegExp, function(x2) {
          if (x2 === "%%") {
            return "%";
          }
          if (i >= len) {
            return x2;
          }
          switch (x2) {
            case "%s":
              return String(args[i++]);
            case "%d":
              return Number(args[i++]);
            case "%j":
              try {
                return JSON.stringify(args[i++]);
              } catch (_) {
                return "[Circular]";
              }
            default:
              return x2;
          }
        });
        return str;
      }
      return f2;
    }
    function _asyncValidateSerials(arr, validator2, callback) {
      var index2 = 0;
      var arrLength = arr.length;
      function next(errors) {
        if (errors && errors.length) {
          return callback(errors);
        }
        var original = index2;
        index2 = index2 + 1;
        if (original < arrLength) {
          validator2(arr[original], next);
        } else {
          return callback([]);
        }
      }
      next([]);
    }
    function _promiseValidateSeries(_x, _x2) {
      return _promiseValidateSeries2.apply(this, arguments);
    }
    function _promiseValidateSeries2() {
      _promiseValidateSeries2 = (0, _asyncToGenerator22.default)(/* @__PURE__ */ _regenerator2.default.mark(function _callee2(arr, validator2) {
        return _regenerator2.default.wrap(function _callee2$(_context2) {
          while (1) {
            switch (_context2.prev = _context2.next) {
              case 0:
                return _context2.abrupt("return", arr.reduce(/* @__PURE__ */ function() {
                  var _ref = (0, _asyncToGenerator22.default)(/* @__PURE__ */ _regenerator2.default.mark(function _callee(prevPromise, next) {
                    var errors;
                    return _regenerator2.default.wrap(function _callee$(_context) {
                      while (1) {
                        switch (_context.prev = _context.next) {
                          case 0:
                            _context.prev = 0;
                            _context.next = 3;
                            return prevPromise;
                          case 3:
                            errors = _context.sent;
                            _context.next = 9;
                            break;
                          case 6:
                            _context.prev = 6;
                            _context.t0 = _context["catch"](0);
                            errors = _context.t0;
                          case 9:
                            if (!(errors && errors.length)) {
                              _context.next = 11;
                              break;
                            }
                            return _context.abrupt("return", errors);
                          case 11:
                            return _context.abrupt("return", validator2(next));
                          case 12:
                          case "end":
                            return _context.stop();
                        }
                      }
                    }, _callee, null, [[0, 6]]);
                  }));
                  return function(_x6, _x7) {
                    return _ref.apply(this, arguments);
                  };
                }(), []));
              case 1:
              case "end":
                return _context2.stop();
            }
          }
        }, _callee2);
      }));
      return _promiseValidateSeries2.apply(this, arguments);
    }
    function flattenObjArr(objArr) {
      var ret = [];
      Object.keys(objArr).forEach(function(k2) {
        Object.keys(objArr[k2]).forEach(function(r2) {
          ret.push(objArr[k2][r2]);
        });
      });
      return ret;
    }
    function asyncMap(objArr, option, validator2, callback) {
      if (option.first) {
        var flattenArr = flattenObjArr(objArr);
        return _asyncValidateSerials(flattenArr, validator2, callback);
      }
      var objArrKeys = Object.keys(objArr);
      var objArrLength = objArrKeys.length;
      var total = 0;
      var results = [];
      var next = function next2(errors) {
        results.push(errors);
        total++;
        if (total === objArrLength) {
          return callback(results);
        }
      };
      objArrKeys.forEach(function(key) {
        var arr = objArr[key];
        _asyncValidateSerials(arr, validator2, next);
      });
    }
    function asyncMapPromise(_x3, _x4, _x5) {
      return _asyncMapPromise.apply(this, arguments);
    }
    function _asyncMapPromise() {
      _asyncMapPromise = (0, _asyncToGenerator22.default)(/* @__PURE__ */ _regenerator2.default.mark(function _callee3(objArr, option, validator2) {
        var flatObjArr, objArrValues;
        return _regenerator2.default.wrap(function _callee3$(_context3) {
          while (1) {
            switch (_context3.prev = _context3.next) {
              case 0:
                if (!option.first) {
                  _context3.next = 5;
                  break;
                }
                flatObjArr = flattenObjArr(objArr);
                _context3.next = 4;
                return _promiseValidateSeries(flatObjArr, validator2);
              case 4:
                return _context3.abrupt("return", _context3.sent);
              case 5:
                objArrValues = Object.values(objArr);
                _context3.next = 8;
                return Promise.all(objArrValues.map(function(val) {
                  return _promiseValidateSeries(val, validator2);
                }));
              case 8:
                return _context3.abrupt("return", _context3.sent);
              case 9:
              case "end":
                return _context3.stop();
            }
          }
        }, _callee3);
      }));
      return _asyncMapPromise.apply(this, arguments);
    }
    function complementError(rule) {
      return function(oe) {
        if (oe && oe.message) {
          oe.field = rule.field;
          return oe;
        }
        return {
          message: oe,
          field: rule.field
        };
      };
    }
    function processErrorResults() {
      var results = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [];
      var errors = [];
      var fields = {};
      function add(e2) {
        if (Array.isArray(e2)) {
          errors = errors.concat(e2);
        } else {
          errors.push(e2);
        }
      }
      for (var i = 0; i < results.length; i++) {
        add(results[i]);
      }
      if (!errors.length) {
        errors = null;
        fields = null;
      } else {
        for (var _i = 0; _i < errors.length; _i++) {
          var field = errors[_i].field;
          if (field) {
            fields[field] = fields[field] || [];
            fields[field].push(errors[_i]);
          }
        }
      }
      return {
        errors,
        fields
      };
    }
    return util;
  }
  var messages = {};
  var hasRequiredMessages;
  function requireMessages() {
    if (hasRequiredMessages)
      return messages;
    hasRequiredMessages = 1;
    Object.defineProperty(messages, "__esModule", {
      value: true
    });
    messages.default = void 0;
    var _default2 = {
      default: "%s 校验失败",
      required: "%s 是必填字段",
      format: {
        number: "%s 不是合法的数字",
        email: "%s 不是合法的 email 地址",
        url: "%s 不是合法的 URL 地址",
        tel: "%s 不是合法的电话号码",
        IDNumber: "%s 不是合法的身份证号码"
      },
      number: {
        length: "%s 长度必须是 %s",
        min: "%s 字段数值不得小于 %s",
        max: "%s 字段数值不得大于 %s",
        minLength: "%s 字段字符长度不得少于 %s",
        maxLength: "%s 字段字符长度不得超过 %s"
      },
      string: {
        length: "%s 长度必须是 %s",
        min: "%s 字段数值不得小于 %s",
        max: "%s 字段数值不得大于 %s",
        minLength: "%s 字段字符长度不得少于 %s",
        maxLength: "%s 字段字符长度不得超过 %s"
      },
      array: {
        length: "%s 个数必须是 %s",
        minLength: "%s 个数不得少于 %s",
        maxLength: "%s 个数不得超过 %s"
      },
      pattern: "%s 字段数值 %s 不匹配正则 %s"
    };
    messages.default = _default2;
    return messages;
  }
  var validator = {};
  var rules = {};
  var required = {};
  var hasRequiredRequired;
  function requireRequired() {
    if (hasRequiredRequired)
      return required;
    hasRequiredRequired = 1;
    var _typeof4 = require_typeof();
    Object.defineProperty(required, "__esModule", {
      value: true
    });
    required.default = void 0;
    var util2 = _interopRequireWildcard2(requireUtil());
    function _getRequireWildcardCache(nodeInterop) {
      if (typeof WeakMap !== "function")
        return null;
      var cacheBabelInterop = /* @__PURE__ */ new WeakMap();
      var cacheNodeInterop = /* @__PURE__ */ new WeakMap();
      return (_getRequireWildcardCache = function _getRequireWildcardCache2(nodeInterop2) {
        return nodeInterop2 ? cacheNodeInterop : cacheBabelInterop;
      })(nodeInterop);
    }
    function _interopRequireWildcard2(obj2, nodeInterop) {
      if (!nodeInterop && obj2 && obj2.__esModule) {
        return obj2;
      }
      if (obj2 === null || _typeof4(obj2) !== "object" && typeof obj2 !== "function") {
        return { default: obj2 };
      }
      var cache = _getRequireWildcardCache(nodeInterop);
      if (cache && cache.has(obj2)) {
        return cache.get(obj2);
      }
      var newObj = {};
      var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
      for (var key in obj2) {
        if (key !== "default" && Object.prototype.hasOwnProperty.call(obj2, key)) {
          var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj2, key) : null;
          if (desc && (desc.get || desc.set)) {
            Object.defineProperty(newObj, key, desc);
          } else {
            newObj[key] = obj2[key];
          }
        }
      }
      newObj.default = obj2;
      if (cache) {
        cache.set(obj2, newObj);
      }
      return newObj;
    }
    function required$1(rule, value, errors, options) {
      if (value === void 0 || value === null || value === "" || value.length === 0) {
        errors.push(util2.format(options.messages.required, rule.aliasName || rule.field));
      }
    }
    var _default2 = required$1;
    required.default = _default2;
    return required;
  }
  var format = {};
  var hasRequiredFormat;
  function requireFormat() {
    if (hasRequiredFormat)
      return format;
    hasRequiredFormat = 1;
    var _typeof4 = require_typeof();
    Object.defineProperty(format, "__esModule", {
      value: true
    });
    format.default = void 0;
    var util2 = _interopRequireWildcard2(requireUtil());
    function _getRequireWildcardCache(nodeInterop) {
      if (typeof WeakMap !== "function")
        return null;
      var cacheBabelInterop = /* @__PURE__ */ new WeakMap();
      var cacheNodeInterop = /* @__PURE__ */ new WeakMap();
      return (_getRequireWildcardCache = function _getRequireWildcardCache2(nodeInterop2) {
        return nodeInterop2 ? cacheNodeInterop : cacheBabelInterop;
      })(nodeInterop);
    }
    function _interopRequireWildcard2(obj2, nodeInterop) {
      if (!nodeInterop && obj2 && obj2.__esModule) {
        return obj2;
      }
      if (obj2 === null || _typeof4(obj2) !== "object" && typeof obj2 !== "function") {
        return { default: obj2 };
      }
      var cache = _getRequireWildcardCache(nodeInterop);
      if (cache && cache.has(obj2)) {
        return cache.get(obj2);
      }
      var newObj = {};
      var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
      for (var key in obj2) {
        if (key !== "default" && Object.prototype.hasOwnProperty.call(obj2, key)) {
          var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj2, key) : null;
          if (desc && (desc.get || desc.set)) {
            Object.defineProperty(newObj, key, desc);
          } else {
            newObj[key] = obj2[key];
          }
        }
      }
      newObj.default = obj2;
      if (cache) {
        cache.set(obj2, newObj);
      }
      return newObj;
    }
    var pattern2 = {
      email: /[\w\u4E00-\u9FA5]+([-+.][\w\u4E00-\u9FA5]+)*@[\w\u4E00-\u9FA5]+([-.][\w\u4E00-\u9FA5]+)*\.[\w\u4E00-\u9FA5]+([-.][\w\u4E00-\u9FA5]+)*/,
      url: /^(?:(?:http|https|ftp):\/\/|\/\/)(?:(?:(?:[-\w\u00a1-\uffff]+)(?:\.[-\w\u00a1-\uffff]+)+|localhost)(?::\d{2,5})?(?:(?:\/|#)[^\s]*)?)$/,
      number: /\d*/,
      tel: /^(1\d{10})$|(((400)-(\d{3})-(\d{4}))|^((\d{7,8})|(\d{3,4})-(\d{7,8})|(\d{7,8})-(\d{1,4}))$)$|^([ ]?)$/
    };
    var types = {
      number: function number(value) {
        if (isNaN(value)) {
          return false;
        }
        return typeof value === "number" || typeof value === "string" && !!value.match(pattern2.number);
      },
      email: function email(value) {
        return typeof value === "string" && !!value.match(pattern2.email) && value.length < 255;
      },
      url: function url(value) {
        return typeof value === "string" && !!value.match(pattern2.url);
      },
      tel: function tel(value) {
        return typeof value === "string" && !!value.match(pattern2.tel);
      },
      IDNumber: function IDNumber(value) {
        return validatorIDNumber(value);
      }
    };
    function format$1(rule, value, errors, options) {
      var custom = ["email", "number", "url", "tel", "IDNumber"];
      var ruleType = rule.format;
      if (custom.indexOf(ruleType) > -1 && !types[ruleType](value)) {
        errors.push(util2.format(options.messages.format[ruleType], rule.aliasName || rule.field, rule.format));
      }
    }
    function validatorIDNumber(idCode) {
      if (typeof idCode !== "string") {
        return false;
      }
      var idCardPatter = /^[1-9][0-9]{5}([1][9][0-9]{2}|[2][0][0|1][0-9])([0][1-9]|[1][0|1|2])([0][1-9]|[1|2][0-9]|[3][0|1])[0-9]{3}([0-9]|[X])$/;
      var format2 = idCardPatter.test(idCode);
      if (!format2) {
        return false;
      }
      var weightFactor = [7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2];
      var checkCode = ["1", "0", "X", "9", "8", "7", "6", "5", "4", "3", "2"];
      var last = idCode[17];
      var seventeen = idCode.substring(0, 17);
      var arr = seventeen.split("");
      var len = arr.length;
      var num = 0;
      for (var i = 0; i < len; i++) {
        num += arr[i] * weightFactor[i];
      }
      var lastNo = checkCode[num % 11];
      return last === lastNo;
    }
    var _default2 = format$1;
    format.default = _default2;
    return format;
  }
  var size = {};
  var hasRequiredSize;
  function requireSize() {
    if (hasRequiredSize)
      return size;
    hasRequiredSize = 1;
    var _typeof4 = require_typeof();
    Object.defineProperty(size, "__esModule", {
      value: true
    });
    size.default = void 0;
    var util2 = _interopRequireWildcard2(requireUtil());
    function _getRequireWildcardCache(nodeInterop) {
      if (typeof WeakMap !== "function")
        return null;
      var cacheBabelInterop = /* @__PURE__ */ new WeakMap();
      var cacheNodeInterop = /* @__PURE__ */ new WeakMap();
      return (_getRequireWildcardCache = function _getRequireWildcardCache2(nodeInterop2) {
        return nodeInterop2 ? cacheNodeInterop : cacheBabelInterop;
      })(nodeInterop);
    }
    function _interopRequireWildcard2(obj2, nodeInterop) {
      if (!nodeInterop && obj2 && obj2.__esModule) {
        return obj2;
      }
      if (obj2 === null || _typeof4(obj2) !== "object" && typeof obj2 !== "function") {
        return { default: obj2 };
      }
      var cache = _getRequireWildcardCache(nodeInterop);
      if (cache && cache.has(obj2)) {
        return cache.get(obj2);
      }
      var newObj = {};
      var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
      for (var key in obj2) {
        if (key !== "default" && Object.prototype.hasOwnProperty.call(obj2, key)) {
          var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj2, key) : null;
          if (desc && (desc.get || desc.set)) {
            Object.defineProperty(newObj, key, desc);
          } else {
            newObj[key] = obj2[key];
          }
        }
      }
      newObj.default = obj2;
      if (cache) {
        cache.set(obj2, newObj);
      }
      return newObj;
    }
    function size$1(rule, value, errors, options) {
      var key = null;
      var isNum = typeof value === "number";
      var isStr = typeof value === "string";
      if (isNum) {
        key = "number";
      } else if (isStr) {
        key = "string";
      }
      if (!key) {
        return false;
      }
      if (typeof rule.min !== "undefined" || typeof rule.max !== "undefined") {
        var val = value;
        var max2 = Number(rule.max);
        var min2 = Number(rule.min);
        if (isStr) {
          val = Number(val);
        }
        if (val < min2) {
          errors.push(util2.format(options.messages[key].min, rule.aliasName || rule.field, rule.min));
        } else if (val > max2) {
          errors.push(util2.format(options.messages[key].max, rule.aliasName || rule.field, rule.max));
        }
      }
    }
    var _default2 = size$1;
    size.default = _default2;
    return size;
  }
  var length = {};
  var hasRequiredLength;
  function requireLength() {
    if (hasRequiredLength)
      return length;
    hasRequiredLength = 1;
    var _typeof4 = require_typeof();
    Object.defineProperty(length, "__esModule", {
      value: true
    });
    length.default = void 0;
    var util2 = _interopRequireWildcard2(requireUtil());
    function _getRequireWildcardCache(nodeInterop) {
      if (typeof WeakMap !== "function")
        return null;
      var cacheBabelInterop = /* @__PURE__ */ new WeakMap();
      var cacheNodeInterop = /* @__PURE__ */ new WeakMap();
      return (_getRequireWildcardCache = function _getRequireWildcardCache2(nodeInterop2) {
        return nodeInterop2 ? cacheNodeInterop : cacheBabelInterop;
      })(nodeInterop);
    }
    function _interopRequireWildcard2(obj2, nodeInterop) {
      if (!nodeInterop && obj2 && obj2.__esModule) {
        return obj2;
      }
      if (obj2 === null || _typeof4(obj2) !== "object" && typeof obj2 !== "function") {
        return { default: obj2 };
      }
      var cache = _getRequireWildcardCache(nodeInterop);
      if (cache && cache.has(obj2)) {
        return cache.get(obj2);
      }
      var newObj = {};
      var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
      for (var key in obj2) {
        if (key !== "default" && Object.prototype.hasOwnProperty.call(obj2, key)) {
          var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj2, key) : null;
          if (desc && (desc.get || desc.set)) {
            Object.defineProperty(newObj, key, desc);
          } else {
            newObj[key] = obj2[key];
          }
        }
      }
      newObj.default = obj2;
      if (cache) {
        cache.set(obj2, newObj);
      }
      return newObj;
    }
    function length$1(rule, value, errors, options) {
      var key = null;
      var isNum = typeof value === "number";
      var isStr = typeof value === "string";
      var isArr = Array.isArray(value);
      if (isNum) {
        key = "number";
      } else if (isStr) {
        key = "string";
      } else if (isArr) {
        key = "array";
      }
      if (!key) {
        return false;
      }
      var val = value;
      var length2 = Number(rule.length);
      var maxLength = Number(rule.maxLength);
      var minLength = Number(rule.minLength);
      if (minLength || maxLength || length2) {
        if (isNum) {
          val = "".concat(val);
        }
        val = val.length;
        if (length2 && val !== rule.length) {
          errors.push(util2.format(options.messages[key].length, rule.aliasName || rule.field, rule.length));
        } else if (val < minLength) {
          errors.push(util2.format(options.messages[key].minLength, rule.aliasName || rule.field, rule.minLength));
        } else if (val > maxLength) {
          errors.push(util2.format(options.messages[key].maxLength, rule.aliasName || rule.field, rule.maxLength));
        }
      }
    }
    var _default2 = length$1;
    length.default = _default2;
    return length;
  }
  var pattern = {};
  var hasRequiredPattern;
  function requirePattern() {
    if (hasRequiredPattern)
      return pattern;
    hasRequiredPattern = 1;
    var _typeof4 = require_typeof();
    Object.defineProperty(pattern, "__esModule", {
      value: true
    });
    pattern.default = void 0;
    var util2 = _interopRequireWildcard2(requireUtil());
    function _getRequireWildcardCache(nodeInterop) {
      if (typeof WeakMap !== "function")
        return null;
      var cacheBabelInterop = /* @__PURE__ */ new WeakMap();
      var cacheNodeInterop = /* @__PURE__ */ new WeakMap();
      return (_getRequireWildcardCache = function _getRequireWildcardCache2(nodeInterop2) {
        return nodeInterop2 ? cacheNodeInterop : cacheBabelInterop;
      })(nodeInterop);
    }
    function _interopRequireWildcard2(obj2, nodeInterop) {
      if (!nodeInterop && obj2 && obj2.__esModule) {
        return obj2;
      }
      if (obj2 === null || _typeof4(obj2) !== "object" && typeof obj2 !== "function") {
        return { default: obj2 };
      }
      var cache = _getRequireWildcardCache(nodeInterop);
      if (cache && cache.has(obj2)) {
        return cache.get(obj2);
      }
      var newObj = {};
      var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
      for (var key in obj2) {
        if (key !== "default" && Object.prototype.hasOwnProperty.call(obj2, key)) {
          var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj2, key) : null;
          if (desc && (desc.get || desc.set)) {
            Object.defineProperty(newObj, key, desc);
          } else {
            newObj[key] = obj2[key];
          }
        }
      }
      newObj.default = obj2;
      if (cache) {
        cache.set(obj2, newObj);
      }
      return newObj;
    }
    function pattern$1(rule, value, errors, options) {
      if (rule.pattern) {
        if (rule.pattern instanceof RegExp) {
          if (!rule.pattern.test(value)) {
            errors.push(util2.format(options.messages.pattern, rule.aliasName || rule.field, value, rule.pattern));
          }
        } else if (typeof rule.pattern === "string") {
          var _pattern = new RegExp(rule.pattern);
          if (!_pattern.test(value)) {
            errors.push(util2.format(options.messages.pattern, rule.aliasName || rule.field, value, rule.pattern));
          }
        }
      }
    }
    var _default2 = pattern$1;
    pattern.default = _default2;
    return pattern;
  }
  var hasRequiredRules;
  function requireRules() {
    if (hasRequiredRules)
      return rules;
    hasRequiredRules = 1;
    var _interopRequireDefault2 = interopRequireDefaultExports;
    Object.defineProperty(rules, "__esModule", {
      value: true
    });
    rules.default = void 0;
    var _required = _interopRequireDefault2(requireRequired());
    var _format = _interopRequireDefault2(requireFormat());
    var _size = _interopRequireDefault2(requireSize());
    var _length = _interopRequireDefault2(requireLength());
    var _pattern = _interopRequireDefault2(requirePattern());
    var _default2 = {
      required: _required.default,
      format: _format.default,
      min: _size.default,
      max: _size.default,
      minLength: _length.default,
      maxLength: _length.default,
      length: _length.default,
      pattern: _pattern.default
    };
    rules.default = _default2;
    return rules;
  }
  var hasRequiredValidator;
  function requireValidator() {
    if (hasRequiredValidator)
      return validator;
    hasRequiredValidator = 1;
    var _interopRequireDefault2 = interopRequireDefaultExports;
    Object.defineProperty(validator, "__esModule", {
      value: true
    });
    validator.getValidationMethod = getValidationMethod;
    validator.validateFunc = validateFunc;
    var _rules = _interopRequireDefault2(requireRules());
    function validateFunc(validator2, ruleType) {
      return function(rule, value, cb, options) {
        var errors = [];
        if (ruleType !== "required") {
          var _errors = [];
          _rules.default.required(rule, value, _errors, options);
          if (_errors.length > 0) {
            if ("required" in rule && rule.required) {
              if (cb) {
                return cb(_errors);
              } else {
                return Promise.reject(_errors);
              }
            } else if (cb) {
              return cb([]);
            } else {
              return Promise.resolve(null);
            }
          }
        }
        validator2(rule, value, errors, options);
        if (cb) {
          return cb(errors);
        }
        if (Promise) {
          return Promise.resolve(errors);
        }
      };
    }
    function getValidationMethod(rule) {
      if (typeof rule.validator === "function") {
        return rule.validator;
      }
      var keys3 = Object.keys(rule);
      for (var i = 0; i < keys3.length; i++) {
        var ruleType = keys3[i];
        if (ruleType === "required") {
          continue;
        }
        if (ruleType in _rules.default) {
          return validateFunc(_rules.default[ruleType], ruleType);
        }
      }
      if ("required" in rule && rule.required) {
        return validateFunc(_rules.default.required, "required");
      }
      return null;
    }
    return validator;
  }
  var hasRequiredLib;
  function requireLib() {
    if (hasRequiredLib)
      return lib;
    hasRequiredLib = 1;
    var _interopRequireDefault2 = interopRequireDefaultExports;
    Object.defineProperty(lib, "__esModule", {
      value: true
    });
    lib.default = void 0;
    var _regenerator2 = _interopRequireDefault2(requireRegenerator());
    var _asyncToGenerator22 = _interopRequireDefault2(requireAsyncToGenerator());
    var _defineProperty22 = _interopRequireDefault2(requireDefineProperty());
    var _classCallCheck22 = _interopRequireDefault2(requireClassCallCheck());
    var _createClass22 = _interopRequireDefault2(requireCreateClass());
    var _util = requireUtil();
    var _messages2 = _interopRequireDefault2(requireMessages());
    var _validator = requireValidator();
    function ownKeys(object, enumerableOnly) {
      var keys3 = Object.keys(object);
      if (Object.getOwnPropertySymbols) {
        var symbols = Object.getOwnPropertySymbols(object);
        enumerableOnly && (symbols = symbols.filter(function(sym) {
          return Object.getOwnPropertyDescriptor(object, sym).enumerable;
        })), keys3.push.apply(keys3, symbols);
      }
      return keys3;
    }
    function _objectSpread(target) {
      for (var i = 1; i < arguments.length; i++) {
        var source = null != arguments[i] ? arguments[i] : {};
        i % 2 ? ownKeys(Object(source), true).forEach(function(key) {
          (0, _defineProperty22.default)(target, key, source[key]);
        }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function(key) {
          Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
        });
      }
      return target;
    }
    function noop15() {
    }
    function serializeRules(source, rules2) {
      var arr;
      var value;
      var series = {};
      var names = Object.keys(rules2);
      names.forEach(function(name) {
        arr = rules2[name];
        value = source[name];
        if (!Array.isArray(arr)) {
          arr = [arr];
        }
        arr.forEach(function(rule) {
          rule.validator = (0, _validator.getValidationMethod)(rule);
          rule.field = name;
          if (!rule.validator) {
            return;
          }
          series[name] = series[name] || [];
          series[name].push({
            rule,
            value,
            source,
            field: name
          });
        });
      });
      return series;
    }
    var Schema = /* @__PURE__ */ function() {
      function Schema2(rules2) {
        var options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
        (0, _classCallCheck22.default)(this, Schema2);
        this._rules = rules2;
        this._options = _objectSpread(_objectSpread({}, options), {}, {
          messages: _objectSpread(_objectSpread({}, _messages2.default), options.messages)
        });
        this.complete = [];
      }
      (0, _createClass22.default)(Schema2, [{
        key: "abort",
        value: function abort() {
          for (var i = 0; i < this.complete.length; i++) {
            this.complete[i] = noop15;
          }
        }
      }, {
        key: "messages",
        value: function messages2(_messages) {
          this._options.messages = Object.assign({}, this._options.messages, _messages);
        }
        /**
         *
         * @param {Object} source - map of field names and values to use in validation
         * @param {Function} callback - OPTIONAL - callback to run after all
         * @returns {null | Promise}
         *          - { null } - if using callbacks
         *          - { Promise }
         *              - { errors: null } - if no rules or no errors
         *              - { errors: Array, fields: Object } - errors from validation and fields that have errors
         */
      }, {
        key: "validate",
        value: function validate(source, callback) {
          var _this2 = this;
          if (!callback) {
            return this.validatePromise(source);
          }
          if (!this._rules || Object.keys(this._rules).length === 0) {
            if (callback) {
              callback(null);
            }
            return;
          }
          var series = serializeRules(source, this._rules);
          if (Object.keys(series).length === 0) {
            callback(null);
          }
          function complete(results) {
            var i;
            var field;
            var errors = [];
            var fields = {};
            function add(e2) {
              if (Array.isArray(e2)) {
                errors = errors.concat(e2);
              } else {
                errors.push(e2);
              }
            }
            for (i = 0; i < results.length; i++) {
              add(results[i]);
            }
            if (!errors.length) {
              errors = null;
              fields = null;
            } else {
              for (i = 0; i < errors.length; i++) {
                field = errors[i].field;
                fields[field] = fields[field] || [];
                fields[field].push(errors[i]);
              }
            }
            callback(errors, fields);
          }
          this.complete.push(complete);
          var idx = this.complete.length;
          (0, _util.asyncMap)(series, this._options, function(data, next) {
            var rule = data.rule;
            rule.field = data.field;
            function cb(e2) {
              var errors = e2;
              if (typeof errors !== "boolean" && !errors) {
                errors = [];
              }
              if (!Array.isArray(errors)) {
                errors = [errors];
              }
              if (errors.length && rule.message) {
                errors = [].concat(rule.message);
              }
              errors = errors.map((0, _util.complementError)(rule));
              next(errors);
            }
            var res = rule.validator(rule, data.value, cb, _this2._options);
            if (res && res.then) {
              res.then(function() {
                return cb();
              }, function(e2) {
                return cb(e2);
              });
            }
          }, function(results) {
            _this2.complete[idx - 1](results);
          });
        }
        /**
         *
         * @param {Object} source - map of field names and values to use in validation
         * @returns {Promise}
         *          - { errors: null } if no rules or no errors
         *          - { errors: Array, fields: Object } - errors from validation and fields that have errors
         */
      }, {
        key: "validatePromise",
        value: function() {
          var _validatePromise = (0, _asyncToGenerator22.default)(/* @__PURE__ */ _regenerator2.default.mark(function _callee2(source) {
            var _this2 = this;
            var series, results;
            return _regenerator2.default.wrap(function _callee2$(_context2) {
              while (1) {
                switch (_context2.prev = _context2.next) {
                  case 0:
                    if (!(!this._rules || Object.keys(this._rules).length === 0)) {
                      _context2.next = 2;
                      break;
                    }
                    return _context2.abrupt("return", {
                      errors: null
                    });
                  case 2:
                    series = serializeRules(source, this._rules);
                    if (!(Object.keys(series).length === 0)) {
                      _context2.next = 5;
                      break;
                    }
                    return _context2.abrupt("return", {
                      errors: null
                    });
                  case 5:
                    _context2.next = 7;
                    return (0, _util.asyncMapPromise)(series, this._options, /* @__PURE__ */ function() {
                      var _ref = (0, _asyncToGenerator22.default)(/* @__PURE__ */ _regenerator2.default.mark(function _callee(data) {
                        var rule, errors;
                        return _regenerator2.default.wrap(function _callee$(_context) {
                          while (1) {
                            switch (_context.prev = _context.next) {
                              case 0:
                                rule = data.rule;
                                rule.field = data.field;
                                _context.prev = 2;
                                _context.next = 5;
                                return new Promise(function(resolve, reject) {
                                  function cb(e2) {
                                    resolve(e2);
                                  }
                                  var res = rule.validator(rule, data.value, cb, _this2._options);
                                  if (res && res.then) {
                                    res.then(function() {
                                      return cb();
                                    }, function(e2) {
                                      return cb(e2);
                                    });
                                  }
                                });
                              case 5:
                                errors = _context.sent;
                                _context.next = 11;
                                break;
                              case 8:
                                _context.prev = 8;
                                _context.t0 = _context["catch"](2);
                                errors = _context.t0;
                              case 11:
                                if (!errors) {
                                  _context.next = 18;
                                  break;
                                }
                                if (typeof errors !== "boolean" && !errors) {
                                  errors = [];
                                }
                                if (!Array.isArray(errors)) {
                                  errors = [errors];
                                }
                                if (errors.length && rule.message) {
                                  errors = [].concat(rule.message);
                                }
                                return _context.abrupt("return", errors.map((0, _util.complementError)(rule)));
                              case 18:
                                return _context.abrupt("return", []);
                              case 19:
                              case "end":
                                return _context.stop();
                            }
                          }
                        }, _callee, null, [[2, 8]]);
                      }));
                      return function(_x2) {
                        return _ref.apply(this, arguments);
                      };
                    }());
                  case 7:
                    results = _context2.sent;
                    return _context2.abrupt("return", (0, _util.processErrorResults)(results));
                  case 9:
                  case "end":
                    return _context2.stop();
                }
              }
            }, _callee2, this);
          }));
          function validatePromise(_x) {
            return _validatePromise.apply(this, arguments);
          }
          return validatePromise;
        }()
      }]);
      return Schema2;
    }();
    var _default2 = Schema;
    lib.default = _default2;
    return lib;
  }
  var utils$1 = {};
  var hasRequiredUtils;
  function requireUtils() {
    if (hasRequiredUtils)
      return utils$1;
    hasRequiredUtils = 1;
    var _interopRequireDefault2 = interopRequireDefaultExports;
    Object.defineProperty(utils$1, "__esModule", {
      value: true
    });
    utils$1.getIn = getIn;
    utils$1.setIn = setIn;
    utils$1.deleteIn = deleteIn;
    utils$1.getErrorStrs = getErrorStrs;
    utils$1.getParams = getParams;
    utils$1.getValueFromEvent = getValueFromEvent;
    utils$1.mapValidateRules = mapValidateRules;
    utils$1.cloneToRuleArr = cloneToRuleArr;
    utils$1.warning = void 0;
    var _defineProperty22 = _interopRequireDefault2(requireDefineProperty());
    function ownKeys(object, enumerableOnly) {
      var keys3 = Object.keys(object);
      if (Object.getOwnPropertySymbols) {
        var symbols = Object.getOwnPropertySymbols(object);
        if (enumerableOnly)
          symbols = symbols.filter(function(sym) {
            return Object.getOwnPropertyDescriptor(object, sym).enumerable;
          });
        keys3.push.apply(keys3, symbols);
      }
      return keys3;
    }
    function _objectSpread(target) {
      for (var i = 1; i < arguments.length; i++) {
        var source = arguments[i] != null ? arguments[i] : {};
        if (i % 2) {
          ownKeys(source, true).forEach(function(key) {
            (0, _defineProperty22.default)(target, key, source[key]);
          });
        } else if (Object.getOwnPropertyDescriptors) {
          Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
        } else {
          ownKeys(source).forEach(function(key) {
            Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
          });
        }
      }
      return target;
    }
    function getIn(state, name) {
      if (!state) {
        return state;
      }
      var path = typeof name === "string" ? name.replace(/\[/, ".").replace(/\]/, "").split(".") : "";
      var length2 = path.length;
      if (!length2) {
        return void 0;
      }
      var result = state;
      for (var i = 0; i < length2 && !!result; ++i) {
        result = result[path[i]];
      }
      return result;
    }
    var setInWithPath = function setInWithPath2(state, value, path, pathIndex) {
      if (pathIndex >= path.length) {
        return value;
      }
      var first = path[pathIndex];
      var next = setInWithPath2(state && state[first], value, path, pathIndex + 1);
      if (!state) {
        var initialized = isNaN(first) ? {} : [];
        initialized[first] = next;
        return initialized;
      }
      if (Array.isArray(state)) {
        var copy = [].concat(state);
        copy[first] = next;
        return copy;
      }
      return Object.assign({}, state, (0, _defineProperty22.default)({}, first, next));
    };
    function setIn(state, name, value) {
      return setInWithPath(state, value, typeof name === "string" ? name.replace(/\[/, ".").replace(/\]/, "").split(".") : "", 0);
    }
    function deleteIn(state, name) {
      if (!state) {
        return;
      }
      var path = typeof name === "string" ? name.replace(/\[/, ".").replace(/\]/, "").split(".") : "";
      var length2 = path.length;
      if (!length2) {
        return state;
      }
      var result = state;
      for (var i = 0; i < length2 && !!result; ++i) {
        if (i === length2 - 1) {
          delete result[path[i]];
        } else {
          result = result[path[i]];
        }
      }
      return state;
    }
    function getErrorStrs(errors, processErrorMessage) {
      if (errors) {
        return errors.map(function(e2) {
          var message2 = typeof e2.message !== "undefined" ? e2.message : e2;
          if (typeof processErrorMessage === "function") {
            return processErrorMessage(message2);
          }
          return message2;
        });
      }
      return errors;
    }
    function getParams(ns, cb) {
      var names = typeof ns === "string" ? [ns] : ns;
      var callback = cb;
      if (cb === void 0 && typeof names === "function") {
        callback = names;
        names = void 0;
      }
      return {
        names,
        callback
      };
    }
    function getValueFromEvent(e2) {
      if (!e2 || !e2.target || !e2.preventDefault) {
        return e2;
      }
      var target = e2.target;
      if (target.type === "checkbox") {
        return target.checked;
      } else if (target.type === "radio") {
        if (target.value) {
          return target.value;
        } else {
          return target.checked;
        }
      }
      return target.value;
    }
    function validateMap(rulesMap, rule, defaultTrigger) {
      var nrule = Object.assign({}, rule);
      if (!nrule.trigger) {
        nrule.trigger = [defaultTrigger];
      }
      if (typeof nrule.trigger === "string") {
        nrule.trigger = [nrule.trigger];
      }
      for (var i = 0; i < nrule.trigger.length; i++) {
        var trigger = nrule.trigger[i];
        if (trigger in rulesMap) {
          rulesMap[trigger].push(nrule);
        } else {
          rulesMap[trigger] = [nrule];
        }
      }
      delete nrule.trigger;
    }
    function mapValidateRules(rules2, defaultTrigger) {
      var rulesMap = {};
      rules2.forEach(function(rule) {
        validateMap(rulesMap, rule, defaultTrigger);
      });
      return rulesMap;
    }
    var warn = function warn2() {
    };
    if (typeof process !== "undefined" && process.env && false) {
      warn = function warn2() {
        if (typeof console !== "undefined" && console.error) {
          var _console;
          (_console = console).error.apply(_console, arguments);
        }
      };
    }
    var warning2 = warn;
    utils$1.warning = warning2;
    function cloneToRuleArr(rules2) {
      if (!rules2) {
        return [];
      }
      var rulesArr = Array.isArray(rules2) ? rules2 : [rules2];
      return rulesArr.map(function(rule) {
        return _objectSpread({}, rule);
      });
    }
    return utils$1;
  }
  var _interopRequireDefault = interopRequireDefaultExports;
  Object.defineProperty(lib$1, "__esModule", {
    value: true
  });
  var default_1 = lib$1.default = void 0;
  var _regenerator = _interopRequireDefault(requireRegenerator());
  var _asyncToGenerator2 = _interopRequireDefault(requireAsyncToGenerator());
  var _typeof2 = _interopRequireDefault(require_typeof());
  var _defineProperty2 = _interopRequireDefault(requireDefineProperty());
  var _slicedToArray2 = _interopRequireDefault(requireSlicedToArray());
  var _classCallCheck2 = _interopRequireDefault(requireClassCallCheck());
  var _createClass2 = _interopRequireDefault(requireCreateClass());
  var _validate2 = _interopRequireDefault(requireLib());
  var _utils = requireUtils();
  var initMeta = {
    state: "",
    valueName: "value",
    trigger: "onChange",
    inputValues: []
  };
  var Field$1 = /* @__PURE__ */ function() {
    (0, _createClass2.default)(Field2, null, [{
      key: "create",
      value: function create6(com) {
        var options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
        return new this(com, options);
      }
    }, {
      key: "getUseField",
      value: function getUseField(_ref) {
        var _this2 = this;
        var useState2 = _ref.useState, useMemo2 = _ref.useMemo;
        return function() {
          var options = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
          var _useState = useState2(), _useState2 = (0, _slicedToArray2.default)(_useState, 2), setState = _useState2[1];
          var field = useMemo2(function() {
            return _this2.create({
              setState
            }, options);
          }, [setState]);
          return field;
        };
      }
    }]);
    function Field2(com) {
      var _this2 = this;
      var options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
      (0, _classCallCheck2.default)(this, Field2);
      if (!com) {
        (0, _utils.warning)("`this` is missing in `Field`, you should use like `new Field(this)`");
      }
      this.com = com;
      this.fieldsMeta = {};
      this.cachedBind = {};
      this.instance = {};
      this.instanceCount = {};
      this.reRenders = {};
      this.values = Object.assign({}, options.values);
      this.processErrorMessage = options.processErrorMessage;
      this.afterValidateRerender = options.afterValidateRerender;
      this.options = Object.assign({
        parseName: false,
        forceUpdate: false,
        scrollToFirstError: true,
        first: false,
        onChange: function onChange6() {
        },
        autoUnmount: true,
        autoValidate: true
      }, options);
      ["init", "getValue", "getValues", "setValue", "setValues", "getError", "getErrors", "setError", "setErrors", "validateCallback", "validatePromise", "getState", "reset", "resetToDefault", "remove", "spliceArray", "addArrayValue", "deleteArrayValue", "getNames"].forEach(function(m2) {
        _this2[m2] = _this2[m2].bind(_this2);
      });
    }
    (0, _createClass2.default)(Field2, [{
      key: "setOptions",
      value: function setOptions(options) {
        Object.assign(this.options, options);
      }
      /**
       * Controlled Component
       * @param {String} name
       * @param {Object} fieldOption
       * @returns {Object} {value, onChange}
       */
    }, {
      key: "init",
      value: function init(name) {
        var _this3 = this;
        var fieldOption = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
        var rprops = arguments.length > 2 ? arguments[2] : void 0;
        var id2 = fieldOption.id, initValue = fieldOption.initValue, _fieldOption$valueNam = fieldOption.valueName, valueName = _fieldOption$valueNam === void 0 ? "value" : _fieldOption$valueNam, _fieldOption$trigger = fieldOption.trigger, trigger = _fieldOption$trigger === void 0 ? "onChange" : _fieldOption$trigger, _fieldOption$rules = fieldOption.rules, rules2 = _fieldOption$rules === void 0 ? [] : _fieldOption$rules, _fieldOption$props = fieldOption.props, props = _fieldOption$props === void 0 ? {} : _fieldOption$props, _fieldOption$getValue = fieldOption.getValueFromEvent, getValueFromEvent = _fieldOption$getValue === void 0 ? null : _fieldOption$getValue, _fieldOption$getValue2 = fieldOption.getValueFormatter, getValueFormatter = _fieldOption$getValue2 === void 0 ? getValueFromEvent : _fieldOption$getValue2, setValueFormatter = fieldOption.setValueFormatter, _fieldOption$autoVali = fieldOption.autoValidate, autoValidate = _fieldOption$autoVali === void 0 ? true : _fieldOption$autoVali, reRender = fieldOption.reRender;
        var parseName = this.options.parseName;
        if (getValueFromEvent) {
          (0, _utils.warning)("`getValueFromEvent` has been deprecated in `Field`, use `getValueFormatter` instead of it");
        }
        var originalProps = Object.assign({}, props, rprops);
        var defaultValueName = "default".concat(valueName[0].toUpperCase()).concat(valueName.slice(1));
        var defaultValue;
        if (typeof initValue !== "undefined") {
          defaultValue = initValue;
        } else if (typeof originalProps[defaultValueName] !== "undefined") {
          defaultValue = originalProps[defaultValueName];
        }
        var field = this._getInitMeta(name);
        Object.assign(field, {
          valueName,
          initValue: defaultValue,
          disabled: "disabled" in originalProps ? originalProps.disabled : false,
          getValueFormatter,
          setValueFormatter,
          rules: (0, _utils.cloneToRuleArr)(rules2),
          ref: originalProps.ref
        });
        if (valueName in originalProps) {
          field.value = originalProps[valueName];
          if (parseName) {
            this.values = (0, _utils.setIn)(this.values, name, field.value);
          } else {
            this.values[name] = field.value;
          }
        }
        if (!("value" in field)) {
          if (parseName) {
            var cachedValue = (0, _utils.getIn)(this.values, name);
            if (typeof cachedValue !== "undefined") {
              field.value = cachedValue;
            } else {
              field.value = defaultValue;
              this.values = (0, _utils.setIn)(this.values, name, field.value);
            }
          } else {
            var _cachedValue = this.values[name];
            if (typeof _cachedValue !== "undefined") {
              field.value = _cachedValue;
            } else if (typeof defaultValue !== "undefined") {
              field.value = defaultValue;
              this.values[name] = field.value;
            }
          }
        }
        var inputProps = (0, _defineProperty2.default)({
          "data-meta": "Field",
          id: id2 || name,
          ref: this._getCacheBind(name, "".concat(name, "__ref"), this._saveRef)
        }, valueName, setValueFormatter ? setValueFormatter(field.value, field.inputValues) : field.value);
        var rulesMap = {};
        if (this.options.autoValidate && autoValidate !== false) {
          rulesMap = (0, _utils.mapValidateRules)(field.rules, trigger);
          var _loop = function _loop2(action2) {
            if (action2 === trigger) {
              return "continue";
            }
            var actionRule = rulesMap[action2];
            inputProps[action2] = function() {
              for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
                args[_key] = arguments[_key];
              }
              _this3._callNativePropsEvent.apply(_this3, [action2, originalProps].concat(args));
              _this3._validate(name, actionRule, action2);
            };
          };
          for (var action in rulesMap) {
            var _ret = _loop(action);
            if (_ret === "continue")
              continue;
          }
        }
        inputProps[trigger] = function() {
          for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
            args[_key2] = arguments[_key2];
          }
          _this3._updateFieldValue.apply(_this3, [name].concat(args));
          _this3._resetError(name);
          _this3._callNativePropsEvent.apply(_this3, [trigger, originalProps].concat(args));
          _this3.options.onChange(name, field.value);
          var rule = rulesMap[trigger];
          rule && _this3._validate(name, rule, trigger);
          _this3._reRender(name, trigger);
        };
        if (reRender && typeof reRender === "function") {
          this.reRenders[name] = reRender;
        }
        delete originalProps[defaultValueName];
        return Object.assign({}, originalProps, inputProps);
      }
      /**
       * call native event from props.onXx
       * eg: props.onChange props.onBlur props.onFocus
       */
    }, {
      key: "_callNativePropsEvent",
      value: function _callNativePropsEvent(action, props) {
        for (var _len3 = arguments.length, args = new Array(_len3 > 2 ? _len3 - 2 : 0), _key3 = 2; _key3 < _len3; _key3++) {
          args[_key3 - 2] = arguments[_key3];
        }
        action in props && typeof props[action] === "function" && props[action].apply(props, args);
      }
    }, {
      key: "_getInitMeta",
      value: function _getInitMeta(name) {
        if (!(name in this.fieldsMeta)) {
          this.fieldsMeta[name] = Object.assign({}, initMeta);
        }
        return this.fieldsMeta[name];
      }
      /**
       * update field.value and validate
       */
    }, {
      key: "_updateFieldValue",
      value: function _updateFieldValue(name) {
        for (var _len4 = arguments.length, others = new Array(_len4 > 1 ? _len4 - 1 : 0), _key4 = 1; _key4 < _len4; _key4++) {
          others[_key4 - 1] = arguments[_key4];
        }
        var e2 = others[0];
        var field = this._get(name);
        if (!field) {
          return;
        }
        field.value = field.getValueFormatter ? field.getValueFormatter.apply(this, others) : (0, _utils.getValueFromEvent)(e2);
        field.inputValues = others;
        if (this.options.parseName) {
          this.values = (0, _utils.setIn)(this.values, name, field.value);
        } else {
          this.values[name] = field.value;
        }
      }
      /**
       * ref must always be the same function, or if not it will be triggerd every time.
       * @param {String} name name of component
       * @param {String} action key to find ref
       * @param {Function} fn saveRef
       */
    }, {
      key: "_getCacheBind",
      value: function _getCacheBind(name, action, fn) {
        var cache = this.cachedBind[name] = this.cachedBind[name] || {};
        if (!cache[action]) {
          cache[action] = fn.bind(this, name);
        }
        return cache[action];
      }
    }, {
      key: "_setCache",
      value: function _setCache(name, action, hander) {
        var cache = this.cachedBind[name] = this.cachedBind[name] || {};
        cache[action] = hander;
      }
    }, {
      key: "_getCache",
      value: function _getCache(name, action) {
        var cache = this.cachedBind[name] || {};
        return cache[action];
      }
      /**
       * NOTE: saveRef is async function. it will be called after render
       * @param {String} name name of component
       * @param {Function} component ref
       */
    }, {
      key: "_saveRef",
      value: function _saveRef(name, component) {
        var key = "".concat(name, "_field");
        var autoUnmount = this.options.autoUnmount;
        if (!component && autoUnmount) {
          this.instanceCount[name] && this.instanceCount[name]--;
          if (this.instanceCount[name] > 0) {
            return;
          }
          var cache = this.fieldsMeta[name];
          cache && this._setCache(name, key, cache);
          delete this.instance[name];
          delete this.reRenders[name];
          this.remove(name);
          return;
        }
        if (autoUnmount && !this.fieldsMeta[name] && this._getCache(name, key)) {
          this.fieldsMeta[name] = this._getCache(name, key);
          this.setValue(name, this.fieldsMeta[name] && this.fieldsMeta[name].value, false);
        }
        var field = this._get(name);
        if (field) {
          var ref = field.ref;
          if (ref) {
            if (typeof ref === "string") {
              throw new Error("can not set string ref for ".concat(name));
            } else if (typeof ref === "function") {
              ref(component);
            } else if ((0, _typeof2.default)(ref) === "object" && "current" in ref) {
              ref.current = component;
            }
          }
          if (autoUnmount && component) {
            var cnt = this.instanceCount[name];
            if (!cnt) {
              cnt = 0;
            }
            this.instanceCount[name] = cnt + 1;
          }
          this.instance[name] = component;
        }
      }
      /**
       * validate one Component
       * @param {String} name name of Component
       * @param {Array} rule
       * @param {String} trigger onChange/onBlur/onItemClick/...
       */
    }, {
      key: "_validate",
      value: function _validate(name, rule, trigger) {
        var _this4 = this;
        var field = this._get(name);
        if (!field) {
          return;
        }
        var value = field.value;
        field.state = "loading";
        var validate = this._getCache(name, trigger);
        if (validate && typeof validate.abort === "function") {
          validate.abort();
        }
        validate = new _validate2.default((0, _defineProperty2.default)({}, name, rule), {
          messages: this.options.messages
        });
        this._setCache(name, trigger, validate);
        validate.validate((0, _defineProperty2.default)({}, name, value), function(errors) {
          var newErrors, newState;
          if (errors && errors.length) {
            newErrors = (0, _utils.getErrorStrs)(errors, _this4.processErrorMessage);
            newState = "error";
          } else {
            newErrors = [];
            newState = "success";
          }
          var reRender = false;
          if (newState !== field.state || !field.errors || newErrors.length !== field.errors.length || newErrors.find(function(e2, idx) {
            return e2 !== field.errors[idx];
          })) {
            reRender = true;
          }
          field.errors = newErrors;
          field.state = newState;
          reRender && _this4._reRender(name, "validate");
        });
      }
    }, {
      key: "getValue",
      value: function getValue(name) {
        if (this.options.parseName) {
          return (0, _utils.getIn)(this.values, name);
        }
        return this.values[name];
      }
      /**
       * 1. get values by names.
       * 2. If no names passed, return shallow copy of `field.values`
       * @param {Array} names
       */
    }, {
      key: "getValues",
      value: function getValues(names) {
        var _this5 = this;
        var allValues = {};
        if (names && names.length) {
          names.forEach(function(name) {
            allValues[name] = _this5.getValue(name);
          });
        } else {
          Object.assign(allValues, this.values);
        }
        return allValues;
      }
    }, {
      key: "setValue",
      value: function setValue(name, value) {
        var reRender = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : true;
        if (name in this.fieldsMeta) {
          this.fieldsMeta[name].value = value;
        }
        if (this.options.parseName) {
          this.values = (0, _utils.setIn)(this.values, name, value);
        } else {
          this.values[name] = value;
        }
        reRender && this._reRender(name, "setValue");
      }
    }, {
      key: "setValues",
      value: function setValues() {
        var _this6 = this;
        var fieldsValue = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
        var reRender = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : true;
        if (!this.options.parseName) {
          Object.keys(fieldsValue).forEach(function(name) {
            _this6.setValue(name, fieldsValue[name], false);
          });
        } else {
          this.values = Object.assign({}, this.values, fieldsValue);
          var fields = this.getNames();
          fields.forEach(function(name) {
            var value = (0, _utils.getIn)(_this6.values, name);
            if (value !== void 0) {
              _this6.fieldsMeta[name].value = value;
            } else {
              _this6.values = (0, _utils.setIn)(_this6.values, name, _this6.fieldsMeta[name].value);
            }
          });
        }
        reRender && this._reRender();
      }
    }, {
      key: "setError",
      value: function setError(name, errors) {
        var err = Array.isArray(errors) ? errors : errors ? [errors] : [];
        if (name in this.fieldsMeta) {
          this.fieldsMeta[name].errors = err;
        } else {
          this.fieldsMeta[name] = {
            errors: err
          };
        }
        if (this.fieldsMeta[name].errors && this.fieldsMeta[name].errors.length > 0) {
          this.fieldsMeta[name].state = "error";
        } else {
          this.fieldsMeta[name].state = "";
        }
        this._reRender(name, "setError");
      }
    }, {
      key: "setErrors",
      value: function setErrors() {
        var _this7 = this;
        var fieldsErrors = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
        Object.keys(fieldsErrors).forEach(function(name) {
          _this7.setError(name, fieldsErrors[name]);
        });
      }
    }, {
      key: "getError",
      value: function getError(name) {
        var field = this._get(name);
        if (field && field.errors && field.errors.length) {
          return field.errors;
        }
        return null;
      }
    }, {
      key: "getErrors",
      value: function getErrors(names) {
        var _this8 = this;
        var fields = names || this.getNames();
        var allErrors = {};
        fields.forEach(function(f2) {
          allErrors[f2] = _this8.getError(f2);
        });
        return allErrors;
      }
    }, {
      key: "getState",
      value: function getState(name) {
        var field = this._get(name);
        if (field && field.state) {
          return field.state;
        }
        return "";
      }
      /**
       * Get errors using `getErrors` and format to match the structure of errors returned in field.validate
       * @param {Array} fieldNames
       * @return {Object || null} map of inputs and their errors
       */
    }, {
      key: "formatGetErrors",
      value: function formatGetErrors(fieldNames) {
        var errors = this.getErrors(fieldNames);
        var formattedErrors = null;
        for (var field in errors) {
          if (errors.hasOwnProperty(field) && errors[field]) {
            var errorsObj = errors[field];
            if (!formattedErrors) {
              formattedErrors = {};
            }
            formattedErrors[field] = {
              errors: errorsObj
            };
          }
        }
        return formattedErrors;
      }
      /**
       * validate by trigger
       * @param {Array} ns names
       * @param {Function} cb callback after validate
       */
    }, {
      key: "validateCallback",
      value: function validateCallback(ns, cb) {
        var _this9 = this;
        var _getParams = (0, _utils.getParams)(ns, cb), names = _getParams.names, callback = _getParams.callback;
        var fieldNames = names || this.getNames();
        var descriptor2 = {};
        var values2 = {};
        var hasRule = false;
        for (var i = 0; i < fieldNames.length; i++) {
          var name = fieldNames[i];
          var field = this._get(name);
          if (!field) {
            continue;
          }
          if (field.rules && field.rules.length) {
            descriptor2[name] = field.rules;
            values2[name] = this.getValue(name);
            hasRule = true;
            field.errors = [];
            field.state = "";
          }
        }
        if (!hasRule) {
          var errors = this.formatGetErrors(fieldNames);
          callback && callback(errors, this.getValues(names ? fieldNames : []));
          return;
        }
        var validate = new _validate2.default(descriptor2, {
          first: this.options.first,
          messages: this.options.messages
        });
        validate.validate(values2, function(errors2) {
          var errorsGroup = null;
          if (errors2 && errors2.length) {
            errorsGroup = {};
            errors2.forEach(function(e2) {
              var fieldName = e2.field;
              if (!errorsGroup[fieldName]) {
                errorsGroup[fieldName] = {
                  errors: []
                };
              }
              var fieldErrors = errorsGroup[fieldName].errors;
              fieldErrors.push(e2.message);
            });
          }
          if (errorsGroup) {
            Object.keys(errorsGroup).forEach(function(i2) {
              var field2 = _this9._get(i2);
              if (field2) {
                field2.errors = (0, _utils.getErrorStrs)(errorsGroup[i2].errors, _this9.processErrorMessage);
                field2.state = "error";
              }
            });
          }
          var formattedGetErrors = _this9.formatGetErrors(fieldNames);
          if (formattedGetErrors) {
            errorsGroup = Object.assign({}, formattedGetErrors, errorsGroup);
          }
          for (var _i = 0; _i < fieldNames.length; _i++) {
            var _name = fieldNames[_i];
            var _field = _this9._get(_name);
            if (_field && _field.rules && !(errorsGroup && _name in errorsGroup)) {
              _field.state = "success";
            }
          }
          callback && callback(errorsGroup, _this9.getValues(names ? fieldNames : []));
          _this9._reRender(names, "validate");
          if (typeof _this9.afterValidateRerender === "function") {
            _this9.afterValidateRerender({
              errorsGroup,
              options: _this9.options,
              instance: _this9.instance
            });
          }
        });
      }
      /**
       * validate by trigger - Promise version
       * NOTES:
       * - `afterValidateRerender` is not called in `validatePromise`. The rerender is called just before this function
       *      returns a promise, so use the returned promise to call any after rerender logic.
       *
       * @param {Array} ns names
       * @param {Function} cb (Optional) callback after validate, must return a promise or a value
       *                  - ({errors, values}) => Promise({errors, values}) | {errors, values}
       * @returns {Promise} - resolves with {errors, values}
       */
    }, {
      key: "validatePromise",
      value: function() {
        var _validatePromise = (0, _asyncToGenerator2.default)(
          /* @__PURE__ */ _regenerator.default.mark(function _callee(ns, cb) {
            var _getParams2, names, callback, fieldNames, descriptor2, values2, hasRule, i, name, field, _errors, validate, results, errors, errorsGroup, callbackResults;
            return _regenerator.default.wrap(function _callee$(_context) {
              while (1) {
                switch (_context.prev = _context.next) {
                  case 0:
                    _getParams2 = (0, _utils.getParams)(ns, cb), names = _getParams2.names, callback = _getParams2.callback;
                    fieldNames = names || this.getNames();
                    descriptor2 = {};
                    values2 = {};
                    hasRule = false;
                    i = 0;
                  case 6:
                    if (!(i < fieldNames.length)) {
                      _context.next = 15;
                      break;
                    }
                    name = fieldNames[i];
                    field = this._get(name);
                    if (field) {
                      _context.next = 11;
                      break;
                    }
                    return _context.abrupt("continue", 12);
                  case 11:
                    if (field.rules && field.rules.length) {
                      descriptor2[name] = field.rules;
                      values2[name] = this.getValue(name);
                      hasRule = true;
                      field.errors = [];
                      field.state = "";
                    }
                  case 12:
                    i++;
                    _context.next = 6;
                    break;
                  case 15:
                    if (hasRule) {
                      _context.next = 22;
                      break;
                    }
                    _errors = this.formatGetErrors(fieldNames);
                    if (!callback) {
                      _context.next = 21;
                      break;
                    }
                    return _context.abrupt("return", callback({
                      errors: _errors,
                      values: this.getValues(names ? fieldNames : [])
                    }));
                  case 21:
                    return _context.abrupt("return", {
                      errors: _errors,
                      values: this.getValues(names ? fieldNames : [])
                    });
                  case 22:
                    validate = new _validate2.default(descriptor2, {
                      first: this.options.first,
                      messages: this.options.messages
                    });
                    _context.next = 25;
                    return validate.validatePromise(values2);
                  case 25:
                    results = _context.sent;
                    errors = results && results.errors || [];
                    errorsGroup = this._getErrorsGroup({
                      errors,
                      fieldNames
                    });
                    callbackResults = {
                      errors: errorsGroup,
                      values: this.getValues(names ? fieldNames : [])
                    };
                    _context.prev = 29;
                    if (!callback) {
                      _context.next = 34;
                      break;
                    }
                    _context.next = 33;
                    return callback(callbackResults);
                  case 33:
                    callbackResults = _context.sent;
                  case 34:
                    _context.next = 39;
                    break;
                  case 36:
                    _context.prev = 36;
                    _context.t0 = _context["catch"](29);
                    return _context.abrupt("return", _context.t0);
                  case 39:
                    this._reRender(names, "validate");
                    return _context.abrupt("return", callbackResults);
                  case 41:
                  case "end":
                    return _context.stop();
                }
              }
            }, _callee, this, [[29, 36]]);
          })
        );
        function validatePromise(_x, _x2) {
          return _validatePromise.apply(this, arguments);
        }
        return validatePromise;
      }()
    }, {
      key: "_getErrorsGroup",
      value: function _getErrorsGroup(_ref3) {
        var _this10 = this;
        var errors = _ref3.errors, fieldNames = _ref3.fieldNames;
        var errorsGroup = null;
        if (errors && errors.length) {
          errorsGroup = {};
          errors.forEach(function(e2) {
            var fieldName = e2.field;
            if (!errorsGroup[fieldName]) {
              errorsGroup[fieldName] = {
                errors: []
              };
            }
            var fieldErrors = errorsGroup[fieldName].errors;
            fieldErrors.push(e2.message);
          });
        }
        if (errorsGroup) {
          Object.keys(errorsGroup).forEach(function(i2) {
            var field2 = _this10._get(i2);
            if (field2) {
              field2.errors = (0, _utils.getErrorStrs)(errorsGroup[i2].errors, _this10.processErrorMessage);
              field2.state = "error";
            }
          });
        }
        var formattedGetErrors = this.formatGetErrors(fieldNames);
        if (formattedGetErrors) {
          errorsGroup = Object.assign({}, formattedGetErrors, errorsGroup);
        }
        for (var i = 0; i < fieldNames.length; i++) {
          var name = fieldNames[i];
          var field = this._get(name);
          if (field && field.rules && !(errorsGroup && name in errorsGroup)) {
            field.state = "success";
          }
        }
        return errorsGroup;
      }
    }, {
      key: "_reset",
      value: function _reset(ns, backToDefault) {
        var _this11 = this;
        if (typeof ns === "string") {
          ns = [ns];
        }
        var changed = false;
        var names = ns || Object.keys(this.fieldsMeta);
        if (!ns) {
          this.values = {};
        }
        names.forEach(function(name) {
          var field = _this11._get(name);
          if (field) {
            changed = true;
            field.value = backToDefault ? field.initValue : void 0;
            field.state = "";
            delete field.errors;
            delete field.rules;
            delete field.rulesMap;
            if (_this11.options.parseName) {
              _this11.values = (0, _utils.setIn)(_this11.values, name, field.value);
            } else {
              _this11.values[name] = field.value;
            }
          }
        });
        if (changed) {
          this._reRender(names, "reset");
        }
      }
    }, {
      key: "reset",
      value: function reset(ns) {
        this._reset(ns, false);
      }
    }, {
      key: "resetToDefault",
      value: function resetToDefault(ns) {
        this._reset(ns, true);
      }
    }, {
      key: "getNames",
      value: function getNames() {
        var fieldsMeta = this.fieldsMeta;
        return Object.keys(fieldsMeta).filter(function() {
          return true;
        });
      }
    }, {
      key: "remove",
      value: function remove(ns) {
        var _this12 = this;
        if (typeof ns === "string") {
          ns = [ns];
        }
        if (!ns) {
          this.values = {};
        }
        var names = ns || Object.keys(this.fieldsMeta);
        names.forEach(function(name) {
          if (name in _this12.fieldsMeta) {
            delete _this12.fieldsMeta[name];
          }
          if (_this12.options.parseName) {
            _this12.values = (0, _utils.deleteIn)(_this12.values, name);
          } else {
            delete _this12.values[name];
          }
        });
      }
    }, {
      key: "addArrayValue",
      value: function addArrayValue(key, index2) {
        for (var _len5 = arguments.length, argv = new Array(_len5 > 2 ? _len5 - 2 : 0), _key5 = 2; _key5 < _len5; _key5++) {
          argv[_key5 - 2] = arguments[_key5];
        }
        return this._spliceArrayValue.apply(this, [key, index2, 0].concat(argv));
      }
    }, {
      key: "deleteArrayValue",
      value: function deleteArrayValue(key, index2) {
        var howmany = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : 1;
        return this._spliceArrayValue(key, index2, howmany);
      }
      /**
       * splice array
       * @param {String} key
       * @param {Number} startIndex
       * @param {Number} howmany
       * @param {Array} argv
       * @param {*} value
       */
    }, {
      key: "_spliceArrayValue",
      value: function _spliceArrayValue(key, index2, howmany) {
        var _this13 = this;
        for (var _len6 = arguments.length, argv = new Array(_len6 > 3 ? _len6 - 3 : 0), _key6 = 3; _key6 < _len6; _key6++) {
          argv[_key6 - 3] = arguments[_key6];
        }
        var argc = argv.length;
        var offset = howmany - argc;
        var startIndex = index2 + howmany;
        var listMap = {};
        var replacedReg = /\$/g;
        var replacedKey = key.replace(replacedReg, "\\$&");
        var keyReg = new RegExp("^(".concat(replacedKey, ".)(\\d+)"));
        var replaceArgv = [];
        var names = this.getNames();
        names.forEach(function(n2) {
          var ret = keyReg.exec(n2);
          if (ret) {
            var idx = parseInt(ret[2]);
            if (idx >= startIndex) {
              var l2 = listMap[idx];
              var item = {
                from: n2,
                to: n2.replace(keyReg, function(match, p1) {
                  return "".concat(p1).concat(idx - offset);
                })
              };
              if (!l2) {
                listMap[idx] = [item];
              } else {
                l2.push(item);
              }
            }
            if (offset > 0 && idx >= index2 && idx < index2 + howmany) {
              replaceArgv.push(n2);
            }
          }
        });
        var offsetList = Object.keys(listMap).map(function(i) {
          return {
            index: Number(i),
            list: listMap[i]
          };
        }).sort(function(a, b2) {
          return offset > 0 ? a.index - b2.index : b2.index - a.index;
        });
        offsetList.forEach(function(l2) {
          var list2 = l2.list;
          list2.forEach(function(i) {
            _this13.fieldsMeta[i.to] = _this13.fieldsMeta[i.from];
          });
        });
        if (offsetList.length > 0) {
          var removeList = offsetList.slice(offsetList.length - (offset < 0 ? -offset : offset), offsetList.length);
          removeList.forEach(function(item) {
            item.list.forEach(function(i) {
              delete _this13.fieldsMeta[i.from];
            });
          });
        } else {
          replaceArgv.forEach(function(i) {
            delete _this13.fieldsMeta[i];
          });
        }
        var p2 = this.getValue(key);
        if (p2) {
          p2.splice.apply(p2, [index2, howmany].concat(argv));
        }
        this._reRender();
      }
      /**
       * splice in a Array [deprecated]
       * @param {String} keyMatch like name.{index}
       * @param {Number} startIndex index
       */
    }, {
      key: "spliceArray",
      value: function spliceArray(keyMatch, startIndex, howmany) {
        var _this14 = this;
        if (keyMatch.match(/{index}$/) === -1) {
          (0, _utils.warning)("key should match /{index}$/");
          return;
        }
        var reg = keyMatch.replace("{index}", "(\\d+)");
        var keyReg = new RegExp("^".concat(reg));
        var listMap = {};
        var names = this.getNames();
        names.forEach(function(n2) {
          var ret = keyReg.exec(n2);
          if (ret) {
            var index2 = parseInt(ret[1]);
            if (index2 > startIndex) {
              var l2 = listMap[index2];
              var item = {
                from: n2,
                to: "".concat(keyMatch.replace("{index}", index2 - 1)).concat(n2.replace(ret[0], ""))
              };
              if (!l2) {
                listMap[index2] = [item];
              } else {
                l2.push(item);
              }
            }
          }
        });
        var idxList = Object.keys(listMap).map(function(i) {
          return {
            index: Number(i),
            list: listMap[i]
          };
        }).sort(function(a, b2) {
          return a.index < b2.index;
        });
        if (idxList.length > 0 && idxList[0].index === startIndex + 1) {
          idxList.forEach(function(l2) {
            var list2 = l2.list;
            list2.forEach(function(i) {
              var v2 = _this14.getValue(i.from);
              _this14.setValue(i.to, v2, false);
            });
          });
          var lastIdxList = idxList[idxList.length - 1];
          lastIdxList.list.forEach(function(i) {
            _this14.remove(i.from);
          });
          var parentName = keyMatch.replace(".{index}", "");
          parentName = parentName.replace("[{index}]", "");
          var parent = this.getValue(parentName);
          if (parent) {
            parent.length--;
          }
        }
      }
    }, {
      key: "_resetError",
      value: function _resetError(name) {
        var field = this._get(name);
        if (field) {
          delete field.errors;
          field.state = "";
        }
      }
      //trigger rerender
    }, {
      key: "_reRender",
      value: function _reRender(name, action) {
        var _this15 = this;
        if (name) {
          var names = Array.isArray(name) ? name : [name];
          if (names.length && names.every(function(n2) {
            return _this15.reRenders[n2];
          })) {
            names.forEach(function(n2) {
              var reRender = _this15.reRenders[n2];
              reRender(action);
            });
            return;
          }
        }
        if (this.com) {
          if (!this.options.forceUpdate && this.com.setState) {
            this.com.setState({});
          } else if (this.com.forceUpdate) {
            this.com.forceUpdate();
          }
        }
      }
    }, {
      key: "_get",
      value: function _get(name) {
        return name in this.fieldsMeta ? this.fieldsMeta[name] : null;
      }
    }, {
      key: "get",
      value: function get(name) {
        if (name) {
          return this._get(name);
        } else {
          return this.fieldsMeta;
        }
      }
    }]);
    return Field2;
  }();
  var _default = Field$1;
  default_1 = lib$1.default = _default;
  function cloneAndAddKey(element) {
    if (element && React.isValidElement(element)) {
      var key = element.key || "error";
      return React.cloneElement(element, { key });
    }
    return element;
  }
  function scrollToFirstError(_ref) {
    var errorsGroup = _ref.errorsGroup, options = _ref.options, instance2 = _ref.instance;
    if (errorsGroup && options.scrollToFirstError) {
      var firstNode = void 0;
      var firstTop = void 0;
      for (var i in errorsGroup) {
        if (errorsGroup.hasOwnProperty(i)) {
          var node = ReactDOM.findDOMNode(instance2[i]);
          if (!node) {
            return;
          }
          var top = node.offsetTop;
          if (firstTop === void 0 || firstTop > top) {
            firstTop = top;
            firstNode = node;
          }
        }
      }
      if (firstNode) {
        if (typeof options.scrollToFirstError === "number" && window && typeof window.scrollTo === "function") {
          var offsetLeft = document && document.body && document.body.offsetLeft ? document.body.offsetLeft : 0;
          window.scrollTo(offsetLeft, firstTop + options.scrollToFirstError);
        } else if (firstNode.scrollIntoViewIfNeeded) {
          firstNode.scrollIntoViewIfNeeded(true);
        }
      }
    }
  }
  var NextField = function(_Field) {
    _default$4(NextField2, _Field);
    NextField2.useField = function useField() {
      var options = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
      if (!React.useState || !React.useMemo) {
        log.warning("need react version > 16.8.0");
        return;
      }
      return this.getUseField({ useMemo: React.useMemo, useState: React.useState })(options);
    };
    function NextField2(com) {
      var options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
      _default$7(this, NextField2);
      var newOptions = _default$8({}, options, {
        afterValidateRerender: scrollToFirstError,
        processErrorMessage: cloneAndAddKey
      });
      var _this2 = _default$5(this, _Field.call(this, com, newOptions));
      _this2.validate = _this2.validate.bind(_this2);
      return _this2;
    }
    NextField2.prototype.validate = function validate(ns, cb) {
      this.validateCallback(ns, cb);
    };
    NextField2.prototype.reset = function reset(ns) {
      var backToDefault = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
      if (ns === true) {
        log.deprecated("reset(true)", "resetToDefault()", "Field");
        this.resetToDefault();
      } else if (backToDefault === true) {
        log.deprecated("reset(ns,true)", "resetToDefault(ns)", "Field");
        this.resetToDefault(ns);
      } else {
        this._reset(ns, false);
      }
    };
    return NextField2;
  }(default_1);
  const Field = NextField;
  var isPlainObject = obj.isPlainObject;
  function filterUndefinedValue(object) {
    if (!isPlainObject(object)) {
      return object;
    }
    var obj2 = {};
    Object.keys(object).forEach(function(key) {
      var value = object[key];
      if (value !== void 0) {
        obj2[key] = value;
      }
    });
    return obj2;
  }
  function stripObject(obj2, subObj) {
    var newObject = {};
    Object.keys(obj2).forEach(function(key) {
      if (!(key in subObj)) {
        newObject[key] = obj2[key];
      }
    });
    return newObject;
  }
  var ieVersion$3 = env.ieVersion;
  var getPadding = function getPadding2(padding) {
    if (!Array.isArray(padding)) {
      return {
        padding
      };
    }
    var attrs = ["paddingTop", "paddingRight", "paddingBottom", "paddingLeft"];
    var paddings = {};
    var value = void 0;
    attrs.forEach(function(attr, index2) {
      switch (padding.length) {
        case 1:
          value = padding[0] || 0;
          break;
        case 2:
          value = padding[index2] || padding[index2 - 2] || 0;
          break;
        case 3:
          value = index2 === 2 ? padding[2] : padding[index2] || padding[index2 - 2] || 0;
          break;
        case 4:
        default:
          value = padding[index2] || 0;
          break;
      }
      paddings[attr] = value;
    });
    return paddings;
  };
  var getMargin = function getMargin2(size2) {
    var _ref = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : { isNegative: false, half: false }, isNegative = _ref.isNegative, half = _ref.half;
    if (!size2) {
      return {};
    }
    var attrs = ["marginTop", "marginRight", "marginBottom", "marginLeft"];
    var margins = {};
    var param = 1 * (isNegative ? -1 : 1) * (half ? 0.5 : 1);
    var value = void 0;
    attrs.forEach(function(attr, index2) {
      if (!Array.isArray(size2)) {
        value = param * size2;
      } else {
        switch (size2.length) {
          case 1:
            value = param * (size2[0] || 0);
            break;
          case 2:
            value = param * (size2[index2] || size2[index2 - 2] || 0);
            break;
          case 3:
            value = param * (index2 === 2 ? size2[2] : size2[index2] || size2[index2 - 2] || 0);
            break;
          case 4:
          default:
            value = param * (size2[index2] || 0);
            break;
        }
      }
      margins[attr] = value;
    });
    return margins;
  };
  var getChildMargin = function getChildMargin2(spacing) {
    return getMargin(spacing, { half: true });
  };
  var getSpacingHelperMargin = function getSpacingHelperMargin2(spacing) {
    return getMargin(spacing, { isNegative: true, half: true });
  };
  var getFlexs = function getFlexs2(flex2) {
    if (!Array.isArray(flex2)) {
      return {
        flex: flex2
      };
    }
    var attrs = ["flexGrow", "flexShrink", "flexBasis"];
    var flexs = {};
    flex2.forEach(function(val, index2) {
      flexs[attrs[index2]] = val;
    });
    return flexs;
  };
  var getGridGap = function getGridGap2(gap) {
    if (!Array.isArray(gap)) {
      return {
        gap
      };
    }
    var attrs = ["rowGap", "columnGap"];
    var gaps = {};
    gap.forEach(function(val, index2) {
      gaps[attrs[index2]] = val;
    });
    return gaps;
  };
  var getTemplateCount = function getTemplateCount2(counts) {
    if (!isNaN(counts) || typeof counts === "string") {
      return "repeat(" + counts + ", minmax(0,1fr))";
    }
    return counts;
  };
  var helperProps = ["margin", "marginTop", "marginLeft", "marginRight", "marginBottom"];
  var innerProps = [
    "flexDirection",
    "flexWrap",
    // 'justifyContent',
    "alignContent",
    "alignItems",
    "display"
  ];
  var filterOuterStyle = function filterOuterStyle2(style) {
    var props = {};
    [].concat(innerProps).forEach(function(key) {
      props[key] = style[key];
    });
    return filterUndefinedValue(stripObject(style, props));
  };
  var filterHelperStyle = function filterHelperStyle2(style) {
    var props = {};
    helperProps.forEach(function(key) {
      props[key] = style[key];
    });
    return filterUndefinedValue(_default$8({}, props, {
      overflow: "hidden"
    }));
  };
  var filterInnerStyle = function filterInnerStyle2(style) {
    var props = {};
    innerProps.forEach(function(key) {
      props[key] = style[key];
    });
    return filterUndefinedValue(props);
  };
  var getGridChildProps = function getGridChildProps2(props, device, gap) {
    var _props$row = props.row, row = _props$row === void 0 ? "initial" : _props$row, _props$col = props.col, col = _props$col === void 0 ? "initial" : _props$col, _props$rowSpan = props.rowSpan, rowSpan = _props$rowSpan === void 0 ? 1 : _props$rowSpan, _props$colSpan = props.colSpan, colSpan = _props$colSpan === void 0 ? 1 : _props$colSpan;
    var totalSpan = 12;
    var newColSpan = (typeof colSpan === "undefined" ? "undefined" : _default$6(colSpan)) === "object" && "desktop" in colSpan ? colSpan.desktop : colSpan;
    ["tablet", "phone"].forEach(function(deviceKey) {
      if (deviceKey === device) {
        if ((typeof colSpan === "undefined" ? "undefined" : _default$6(colSpan)) === "object" && device in colSpan) {
          newColSpan = colSpan[device];
        } else {
          switch (deviceKey) {
            case "tablet":
              totalSpan = 8;
              newColSpan = colSpan > 5 ? 8 : colSpan > 2 ? 4 : 2;
              break;
            case "phone":
              totalSpan = 4;
              newColSpan = colSpan > 2 ? 4 : 2;
              break;
          }
        }
      }
    });
    var gapLeft = gap;
    if (Array.isArray(gap)) {
      gapLeft = gap[1];
    }
    var ieChildFix = ieVersion$3 && !(rowSpan === 1 && colSpan === 1) ? {
      display: "inline-block",
      width: gapLeft ? "calc(" + newColSpan / totalSpan * 100 + "% - " + gapLeft + "px)" : newColSpan / totalSpan * 100 + "%"
    } : {};
    return filterUndefinedValue(_default$8({
      gridRowStart: row,
      gridRowEnd: "span " + rowSpan,
      gridColumnStart: col,
      gridColumnEnd: "span " + newColSpan
    }, ieChildFix));
  };
  var getBoxChildProps = function getBoxChildProps2(props) {
    var alignSelf = props.alignSelf, flex2 = props.flex;
    return filterUndefinedValue(_default$8({
      alignSelf
    }, getFlexs(flex2)));
  };
  const createStyle = function(_ref2) {
    var device = _ref2.device, display = _ref2.display, gap = _ref2.gap, direction = _ref2.direction, dense = _ref2.dense, rowSpan = _ref2.rowSpan, colSpan = _ref2.colSpan, row = _ref2.row, col = _ref2.col, rows = _ref2.rows, columns = _ref2.columns, justify = _ref2.justify, align = _ref2.align, alignSelf = _ref2.alignSelf, wrap2 = _ref2.wrap, flex2 = _ref2.flex, padding = _ref2.padding, margin = _ref2.margin;
    var style = _default$8({}, getPadding(padding));
    var deviceColumns = "auto";
    switch (device) {
      case "phone":
        deviceColumns = 4;
        break;
      case "tablet":
        deviceColumns = 8;
        break;
      case "desktop":
        deviceColumns = 12;
        break;
    }
    var newColumns = !isNaN(columns) || typeof columns === "string" ? columns : deviceColumns;
    switch (display) {
      case "grid":
        style = _default$8({}, getGridGap(gap), {
          gridTemplateRows: getTemplateCount(rows),
          gridTemplateColumns: getTemplateCount(newColumns),
          gridAutoFlow: "" + (direction || "") + (dense && " dense")
        }, getGridChildProps({
          row,
          rowSpan,
          col,
          colSpan
          // justifySelf,
          // alignSelf,
        }, device), style);
        break;
      case "flex":
        style = _default$8({
          // parent
          msFlexDirection: direction,
          flexDirection: direction,
          msFlexWrap: wrap2 ? "wrap" : "none",
          flexWrap: wrap2 ? "wrap" : "nowrap",
          msFlexPack: justify,
          justifyContent: justify,
          msFlexAlign: align,
          alignItems: align
        }, getMargin(margin), getBoxChildProps({
          alignSelf,
          flex: flex2
        }), style);
        break;
    }
    return filterUndefinedValue(style);
  };
  var _class$D, _temp$q;
  var pickOthers$2 = obj.pickOthers;
  var createChildren$1 = function createChildren(children, _ref) {
    var spacing = _ref.spacing, direction = _ref.direction, wrap2 = _ref.wrap;
    _ref.device;
    var array = React.Children.toArray(children);
    if (!children) {
      return null;
    }
    return array.map(function(child, index2) {
      var spacingMargin = {};
      spacingMargin = getChildMargin(spacing);
      if (!wrap2) {
        var isNone = [index2 === 0, index2 === array.length - 1];
        var props = direction === "row" ? ["marginLeft", "marginRight"] : ["marginTop", "marginBottom"];
        ["marginTop", "marginRight", "marginBottom", "marginLeft"].forEach(function(prop) {
          if (prop in spacingMargin && props.indexOf(prop) === -1) {
            spacingMargin[prop] = 0;
          }
          props.forEach(function(key, i) {
            if (key in spacingMargin && isNone[i]) {
              spacingMargin[key] = 0;
            }
          });
        });
      }
      if (React.isValidElement(child)) {
        var propsMargin = child.props.margin;
        var childPropsMargin = getMargin(propsMargin);
        var gridProps = {};
        if (["function", "object"].indexOf(_default$6(child.type)) > -1 && child.type._typeMark === "responsive_grid") {
          gridProps = createStyle(_default$8({ display: "grid" }, child.props));
        }
        return React.cloneElement(child, {
          style: _default$8({}, spacingMargin, childPropsMargin, gridProps, child.props.style || {})
        });
      }
      return child;
    });
  };
  var getStyle$1 = function getStyle() {
    var style = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
    var props = arguments[1];
    return _default$8({}, createStyle(_default$8({ display: "flex" }, props)), style);
  };
  var getOuterStyle = function getOuterStyle2(style, styleProps) {
    var sheet = getStyle$1(style, styleProps);
    return filterOuterStyle(sheet);
  };
  var getHelperStyle = function getHelperStyle2(style, styleProps) {
    var sheet = getStyle$1(style, styleProps);
    return filterHelperStyle(_default$8({}, sheet, getSpacingHelperMargin(styleProps.spacing)));
  };
  var getInnerStyle = function getInnerStyle2(style, styleProps) {
    var sheet = getStyle$1(style, styleProps);
    return filterInnerStyle(sheet);
  };
  var Box = (_temp$q = _class$D = function(_Component) {
    _default$4(Box2, _Component);
    function Box2() {
      _default$7(this, Box2);
      return _default$5(this, _Component.apply(this, arguments));
    }
    Box2.prototype.render = function render2() {
      var _cx;
      var _props = this.props, prefix = _props.prefix, direction = _props.direction, justify = _props.justify, align = _props.align, wrap2 = _props.wrap, flex2 = _props.flex, spacing = _props.spacing, padding = _props.padding, margin = _props.margin, style = _props.style, className = _props.className, children = _props.children, device = _props.device, component = _props.component;
      var styleProps = {
        direction,
        justify,
        align,
        wrap: wrap2,
        flex: flex2,
        spacing,
        padding,
        margin
      };
      var View = component;
      var others = pickOthers$2(Object.keys(Box2.propTypes), this.props);
      var styleSheet = getStyle$1(style, styleProps);
      var boxs = createChildren$1(children, {
        spacing,
        direction,
        wrap: wrap2,
        device
      });
      var cls = classnames((_cx = {}, _cx[prefix + "box"] = true, _cx), className);
      if (wrap2 && spacing) {
        var outerStyle = getOuterStyle(style, styleProps);
        var helperStyle = getHelperStyle(style, styleProps);
        var innerStyle = getInnerStyle(style, styleProps);
        return React.createElement(
          View,
          _default$8({ style: outerStyle, className: cls }, others),
          React.createElement(
            "div",
            { style: helperStyle },
            React.createElement(
              "div",
              { style: innerStyle, className: prefix + "box" },
              boxs
            )
          )
        );
      }
      return React.createElement(
        View,
        _default$8({ style: styleSheet, className: cls }, others),
        boxs
      );
    };
    return Box2;
  }(React.Component), _class$D.propTypes = {
    prefix: PropTypes$1.string,
    style: PropTypes$1.object,
    className: PropTypes$1.any,
    /**
     * 布局属性
     */
    flex: PropTypes$1.oneOfType([PropTypes$1.arrayOf(PropTypes$1.oneOfType([PropTypes$1.number, PropTypes$1.string])), PropTypes$1.number]),
    /**
     * 布局方向,默认为 column ,一个元素占据一整行
     * @default column
     */
    direction: PropTypes$1.oneOf(["row", "column", "row-reverse"]),
    /**
     * 是否折行 支持IE11+
     */
    wrap: PropTypes$1.bool,
    /**
     * 元素之间的间距 [bottom&top, right&left]
     */
    spacing: PropTypes$1.oneOfType([PropTypes$1.arrayOf(PropTypes$1.number), PropTypes$1.number]),
    /**
     * 设置 margin [bottom&top, right&left]
     */
    margin: PropTypes$1.oneOfType([PropTypes$1.arrayOf(PropTypes$1.number), PropTypes$1.number]),
    /**
     * 设置 padding [bottom&top, right&left]
     */
    padding: PropTypes$1.oneOfType([PropTypes$1.arrayOf(PropTypes$1.number), PropTypes$1.number]),
    /**
     * 沿着主轴方向,子元素们的排布关系 (兼容性同 justify-content )
     */
    justify: PropTypes$1.oneOf(["flex-start", "center", "flex-end", "space-between", "space-around"]),
    /**
     * 垂直主轴方向,子元素们的排布关系 (兼容性同 align-items )
     */
    align: PropTypes$1.oneOf(["flex-start", "center", "flex-end", "baseline", "stretch"]),
    device: PropTypes$1.oneOf(["phone", "tablet", "desktop"]),
    /**
     * 定制标签名, 例如section等
     */
    component: PropTypes$1.string
  }, _class$D.defaultProps = {
    prefix: "next-",
    direction: "column",
    wrap: false,
    component: "div"
  }, _temp$q);
  Box.displayName = "Box";
  const Box$1 = ConfigProvider$1.config(Box);
  var _class$C, _temp$p;
  var pickOthers$1 = obj.pickOthers;
  var Cell$2 = (_temp$p = _class$C = function(_Component) {
    _default$4(Cell2, _Component);
    function Cell2() {
      _default$7(this, Cell2);
      return _default$5(this, _Component.apply(this, arguments));
    }
    Cell2.prototype.render = function render2() {
      var _props = this.props, View = _props.component, children = _props.children;
      var others = pickOthers$1(Object.keys(Cell2.propTypes), this.props);
      return React.createElement(
        View,
        others,
        children
      );
    };
    return Cell2;
  }(React.Component), _class$C._typeMark = "responsive_grid_cell", _class$C.propTypes = {
    device: PropTypes$1.oneOf(["phone", "tablet", "desktop"]),
    /**
     * 横向,占据几列
     */
    colSpan: PropTypes$1.oneOfType([PropTypes$1.number, PropTypes$1.object]),
    /**
     * 纵向,占据几行
     */
    rowSpan: PropTypes$1.number,
    /**
     * 设置标签类型
     */
    component: PropTypes$1.elementType
  }, _class$C.defaultProps = {
    component: "div",
    device: "desktop"
  }, _temp$p);
  Cell$2.displayName = "Cell";
  const Cell$3 = ConfigProvider$1.config(Cell$2);
  var _class$B, _temp$o;
  var ieVersion$2 = env.ieVersion;
  var pickOthers = obj.pickOthers, isReactFragment = obj.isReactFragment;
  var createChildren2 = function createChildren3(children, device, gap) {
    var array = React.Children.toArray(children);
    if (!children) {
      return null;
    }
    return array.map(function(child) {
      if (isReactFragment(child)) {
        return createChildren3(child.props.children, device, gap);
      }
      if (React.isValidElement(child) && ["function", "object"].indexOf(_default$6(child.type)) > -1 && ["form_item", "responsive_grid_cell"].indexOf(child.type._typeMark) > -1) {
        return React.cloneElement(child, {
          style: _default$8({}, getGridChildProps(child.props, device, gap), child.props.style || {})
        });
      }
      return child;
    });
  };
  var getStyle2 = function getStyle3() {
    var style = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
    var props = arguments[1];
    return _default$8({}, createStyle(_default$8({ display: "grid" }, props)), style);
  };
  var ResponsiveGrid = (_temp$o = _class$B = function(_Component) {
    _default$4(ResponsiveGrid2, _Component);
    function ResponsiveGrid2() {
      _default$7(this, ResponsiveGrid2);
      return _default$5(this, _Component.apply(this, arguments));
    }
    ResponsiveGrid2.prototype.render = function render2() {
      var _classNames;
      var _props = this.props, prefix = _props.prefix, View = _props.component, style = _props.style, className = _props.className, children = _props.children, device = _props.device, rows = _props.rows, columns = _props.columns, gap = _props.gap, rowSpan = _props.rowSpan, colSpan = _props.colSpan, component = _props.component, dense = _props.dense;
      var styleProps = {
        rows,
        columns,
        gap,
        device,
        rowSpan,
        colSpan,
        component,
        dense
      };
      var others = pickOthers(Object.keys(ResponsiveGrid2.propTypes), this.props);
      var styleSheet = getStyle2(style, styleProps);
      var cls = classnames((_classNames = {}, _classNames[prefix + "responsive-grid"] = true, _classNames[prefix + "responsive-grid-ie"] = ieVersion$2, _classNames), className);
      return ieVersion$2 ? React.createElement(Box$1, _default$8({}, this.props, { direction: "row", wrap: true, spacing: gap, children: createChildren2(children, device, gap) })) : React.createElement(
        View,
        _default$8({ style: styleSheet, className: cls }, others),
        createChildren2(children, device, gap)
      );
    };
    return ResponsiveGrid2;
  }(React.Component), _class$B._typeMark = "responsive_grid", _class$B.propTypes = {
    prefix: PropTypes$1.string,
    className: PropTypes$1.any,
    /**
     * 设备,用来做自适应,默认为 PC
     * @enumdesc 手机, 平板, PC
     */
    device: PropTypes$1.oneOf(["phone", "tablet", "desktop"]),
    rows: PropTypes$1.oneOfType([PropTypes$1.number, PropTypes$1.string]),
    /**
     * 分为几列, 默认是 12 列
     */
    columns: PropTypes$1.oneOfType([PropTypes$1.number, PropTypes$1.string]),
    /**
     * 每个 cell 之间的间距, [bottom&top, right&left]
     */
    gap: PropTypes$1.oneOfType([PropTypes$1.arrayOf(PropTypes$1.number), PropTypes$1.number]),
    /**
     * 设置标签类型
     */
    component: PropTypes$1.elementType,
    /**
     * 是否开启紧密模式,开启后尽可能能紧密填满,尽量不出现空格
     */
    dense: PropTypes$1.bool,
    style: PropTypes$1.object
  }, _class$B.defaultProps = {
    prefix: "next-",
    component: "div",
    device: "desktop",
    dense: false
  }, _temp$o);
  ResponsiveGrid.displayName = "ResponsiveGrid";
  ResponsiveGrid.Cell = Cell$3;
  const RGrid = ConfigProvider$1.config(ResponsiveGrid);
  var _class$A, _temp$n;
  function pickerDefined(obj2) {
    var newObj = {};
    Object.keys(obj2).forEach(function(i) {
      if (typeof obj2[i] !== "undefined") {
        newObj[i] = obj2[i];
      }
    });
    return newObj;
  }
  function preventDefault(e2) {
    e2.preventDefault();
  }
  var getNewChildren2 = function getNewChildren3(children, props) {
    var size2 = props.size, device = props.device, labelAlign = props.labelAlign, labelTextAlign = props.labelTextAlign, labelCol = props.labelCol, wrapperCol = props.wrapperCol, responsive = props.responsive, colon = props.colon;
    return React.Children.map(children, function(child) {
      if (obj.isReactFragment(child)) {
        return getNewChildren3(child.props.children, props);
      }
      if (child && ["function", "object"].indexOf(_default$6(child.type)) > -1 && child.type._typeMark === "form_item") {
        var childrenProps = {
          labelCol: child.props.labelCol ? child.props.labelCol : labelCol,
          wrapperCol: child.props.wrapperCol ? child.props.wrapperCol : wrapperCol,
          labelAlign: child.props.labelAlign ? child.props.labelAlign : device === "phone" ? "top" : labelAlign,
          labelTextAlign: child.props.labelTextAlign ? child.props.labelTextAlign : labelTextAlign,
          colon: "colon" in child.props ? child.props.colon : colon,
          size: child.props.size ? child.props.size : size2,
          responsive
        };
        return React.cloneElement(child, pickerDefined(childrenProps));
      }
      return child;
    });
  };
  var Form$1 = (_temp$n = _class$A = function(_React$Component) {
    _default$4(Form2, _React$Component);
    function Form2(props) {
      _default$7(this, Form2);
      var _this2 = _default$5(this, _React$Component.call(this, props));
      _this2.onChange = function(name, value) {
        _this2.props.onChange(_this2._formField.getValues(), {
          name,
          value,
          field: _this2._formField
        });
      };
      _this2._formField = null;
      if (props.field !== false) {
        var options = _default$8({}, props.fieldOptions, {
          onChange: _this2.onChange
        });
        if (props.field) {
          _this2._formField = props.field;
          var onChange6 = _this2._formField.options.onChange;
          options.onChange = func.makeChain(onChange6, _this2.onChange);
          _this2._formField.setOptions && _this2._formField.setOptions(options);
        } else {
          if ("value" in props) {
            options.values = props.value;
          }
          _this2._formField = new Field(_this2, options);
        }
        if (props.locale && props.locale.Validate) {
          _this2._formField.setOptions({ messages: props.locale.Validate });
        }
        props.saveField(_this2._formField);
      }
      return _this2;
    }
    Form2.prototype.getChildContext = function getChildContext() {
      return {
        _formField: this.props.field ? this.props.field : this._formField,
        _formSize: this.props.size,
        _formDisabled: this.props.disabled,
        _formPreview: this.props.isPreview,
        _formFullWidth: this.props.fullWidth,
        _formLabelForErrorMessage: this.props.useLabelForErrorMessage
      };
    };
    Form2.prototype.componentDidUpdate = function componentDidUpdate(prevProps) {
      var props = this.props;
      if (this._formField) {
        if ("value" in props && props.value !== prevProps.value) {
          this._formField.setValues(props.value);
        }
        if ("error" in props && props.error !== prevProps.error) {
          this._formField.setValues(props.error);
        }
      }
    };
    Form2.prototype.render = function render2() {
      var _classNames;
      var _props = this.props, className = _props.className, inline = _props.inline, size2 = _props.size;
      _props.device;
      _props.labelAlign;
      _props.labelTextAlign;
      var onSubmit = _props.onSubmit, children = _props.children;
      _props.labelCol;
      _props.wrapperCol;
      var style = _props.style, prefix = _props.prefix, rtl = _props.rtl, isPreview = _props.isPreview, Tag = _props.component, responsive = _props.responsive, gap = _props.gap;
      _props.colon;
      var formClassName = classnames((_classNames = {}, _classNames[prefix + "form"] = true, _classNames[prefix + "inline"] = inline, _classNames["" + prefix + size2] = size2, _classNames[prefix + "form-responsive-grid"] = responsive, _classNames[prefix + "form-preview"] = isPreview, _classNames[className] = !!className, _classNames));
      var newChildren = getNewChildren2(children, this.props);
      return React.createElement(
        Tag,
        _default$8({
          role: "grid"
        }, obj.pickOthers(Form2.propTypes, this.props), {
          className: formClassName,
          style,
          dir: rtl ? "rtl" : void 0,
          onSubmit
        }),
        responsive ? React.createElement(
          RGrid,
          { gap },
          newChildren
        ) : newChildren
      );
    };
    return Form2;
  }(React.Component), _class$A.propTypes = {
    /**
     * 样式前缀
     */
    prefix: PropTypes$1.string,
    /**
     * 内联表单
     */
    inline: PropTypes$1.bool,
    /**
     * 单个 Item 的 size 自定义,优先级高于 Form 的 size, 并且当组件与 Item 一起使用时,组件自身设置 size 属性无效。
     * @enumdesc 大, 中, 小
     */
    size: PropTypes$1.oneOf(["large", "medium", "small"]),
    /**
     * 单个 Item 中表单类组件宽度是否是100%
     */
    fullWidth: PropTypes$1.bool,
    /**
     * 标签的位置, 如果不设置 labelCol 和 wrapperCol 那么默认是标签在上
     * @enumdesc 上, 左, 内
     */
    labelAlign: PropTypes$1.oneOf(["top", "left", "inset"]),
    /**
     * 标签的左右对齐方式
     * @enumdesc 左, 右
     */
    labelTextAlign: PropTypes$1.oneOf(["left", "right"]),
    /**
     * field 实例, 传 false 会禁用 field
     */
    field: PropTypes$1.any,
    /**
     * 保存 Form 自动生成的 field 对象
     */
    saveField: PropTypes$1.func,
    /**
     * 控制第一级 Item 的 labelCol
     */
    labelCol: PropTypes$1.object,
    /**
     * 控制第一级 Item 的 wrapperCol
     */
    wrapperCol: PropTypes$1.object,
    /**
     * form内有 `htmlType="submit"` 的元素的时候会触发
     */
    onSubmit: PropTypes$1.func,
    /**
     * 子元素
     */
    children: PropTypes$1.any,
    /**
     * 扩展class
     */
    className: PropTypes$1.string,
    /**
     * 自定义内联样式
     */
    style: PropTypes$1.object,
    /**
     * 表单数值
     */
    value: PropTypes$1.object,
    /**
     * 表单变化回调
     * @param {Object} values 表单数据
     * @param {Object} item 详细
     * @param {String} item.name 变化的组件名
     * @param {String} item.value 变化的数据
     * @param {Object} item.field field 实例
     */
    onChange: PropTypes$1.func,
    /**
     * 设置标签类型
     */
    component: PropTypes$1.oneOfType([PropTypes$1.string, PropTypes$1.func]),
    fieldOptions: PropTypes$1.object,
    rtl: PropTypes$1.bool,
    /**
     * 预设屏幕宽度
     */
    device: PropTypes$1.oneOf(["phone", "tablet", "desktop"]),
    /**
     * 是否开启内置的响应式布局 (使用ResponsiveGrid)
     * @version 1.19
     */
    responsive: PropTypes$1.bool,
    /**
     * 是否开启预览态
     * @version 1.19
     */
    isPreview: PropTypes$1.bool,
    /**
     * 是否使用 label 替换校验信息的 name 字段
     * @version 1.20
     */
    useLabelForErrorMessage: PropTypes$1.bool,
    /**
     * 表示是否显示 label 后面的冒号
     * @version 1.22
     */
    colon: PropTypes$1.bool,
    /**
     * 是否禁用表单
     */
    disabled: PropTypes$1.bool,
    // 在 responsive模式下,透传给 ResponsiveGrid的, 表示 每个 cell 之间的间距, [bottom&top, right&left]
    gap: PropTypes$1.oneOfType([PropTypes$1.arrayOf(PropTypes$1.number), PropTypes$1.number])
  }, _class$A.defaultProps = {
    prefix: "next-",
    onSubmit: preventDefault,
    size: "medium",
    labelAlign: "left",
    onChange: func.noop,
    component: "form",
    saveField: func.noop,
    device: "desktop",
    colon: false,
    disabled: false
  }, _class$A.childContextTypes = {
    _formField: PropTypes$1.object,
    _formSize: PropTypes$1.string,
    _formDisabled: PropTypes$1.bool,
    _formPreview: PropTypes$1.bool,
    _formFullWidth: PropTypes$1.bool,
    _formLabelForErrorMessage: PropTypes$1.bool
  }, _temp$n);
  Form$1.displayName = "Form";
  var _class$z, _temp$m;
  var Row$2 = (_temp$m = _class$z = function(_Component) {
    _default$4(Row2, _Component);
    function Row2() {
      _default$7(this, Row2);
      return _default$5(this, _Component.apply(this, arguments));
    }
    Row2.prototype.render = function render2() {
      var _extends2, _extends3;
      var _props = this.props, prefix = _props.prefix;
      _props.pure;
      var wrap2 = _props.wrap, fixed2 = _props.fixed, gutter = _props.gutter, fixedWidth = _props.fixedWidth, align = _props.align, justify = _props.justify, hidden = _props.hidden, className = _props.className, Tag = _props.component, children = _props.children, rtl = _props.rtl, others = _default$3(_props, ["prefix", "pure", "wrap", "fixed", "gutter", "fixedWidth", "align", "justify", "hidden", "className", "component", "children", "rtl"]);
      var hiddenClassObj = void 0;
      if (hidden === true) {
        var _hiddenClassObj;
        hiddenClassObj = (_hiddenClassObj = {}, _hiddenClassObj[prefix + "row-hidden"] = true, _hiddenClassObj);
      } else if (typeof hidden === "string") {
        var _hiddenClassObj2;
        hiddenClassObj = (_hiddenClassObj2 = {}, _hiddenClassObj2[prefix + "row-" + hidden + "-hidden"] = !!hidden, _hiddenClassObj2);
      } else if (Array.isArray(hidden)) {
        hiddenClassObj = hidden.reduce(function(ret, point) {
          ret[prefix + "row-" + point + "-hidden"] = !!point;
          return ret;
        }, {});
      }
      var newClassName = classnames(_default$8((_extends2 = {}, _extends2[prefix + "row"] = true, _extends2[prefix + "row-wrap"] = wrap2, _extends2[prefix + "row-fixed"] = fixed2, _extends2[prefix + "row-fixed-" + fixedWidth] = !!fixedWidth, _extends2[prefix + "row-justify-" + justify] = !!justify, _extends2[prefix + "row-align-" + align] = !!align, _extends2), hiddenClassObj, (_extends3 = {}, _extends3[className] = !!className, _extends3)));
      var newChildren = children;
      var gutterNumber = parseInt(gutter, 10);
      if (gutterNumber !== 0) {
        var halfGutterString = gutterNumber / 2 + "px";
        others.style = _default$8({
          marginLeft: "-" + halfGutterString,
          marginRight: "-" + halfGutterString
        }, others.style || {});
        newChildren = React.Children.map(children, function(child) {
          if (child && child.type && typeof child.type === "function" && child.type.isNextCol) {
            var newChild = React.cloneElement(child, {
              style: _default$8({
                paddingLeft: halfGutterString,
                paddingRight: halfGutterString
              }, child.style || {})
            });
            return newChild;
          }
          return child;
        });
      }
      return React.createElement(
        Tag,
        _default$8({ dir: rtl ? "rtl" : "ltr", role: "row", className: newClassName }, others),
        newChildren
      );
    };
    return Row2;
  }(React.Component), _class$z.propTypes = {
    prefix: PropTypes$1.string,
    pure: PropTypes$1.bool,
    rtl: PropTypes$1.bool,
    className: PropTypes$1.string,
    style: PropTypes$1.object,
    /**
     * 行内容
     */
    children: PropTypes$1.node,
    /**
     * 列间隔
     */
    gutter: PropTypes$1.oneOfType([PropTypes$1.string, PropTypes$1.number]),
    /**
     * 列在行中宽度溢出后是否换行
     */
    wrap: PropTypes$1.bool,
    /**
     * 行在某一断点下宽度是否保持不变(默认行宽度随视口变化而变化)
     */
    fixed: PropTypes$1.bool,
    /**
     * 固定行的宽度为某一断点的宽度,不受视口影响而变动
     * @enumdesc 320px, 480px, 720px, 990px, 1200px, 1500px
     */
    fixedWidth: PropTypes$1.oneOf(["xxs", "xs", "s", "m", "l", "xl"]),
    /**
     * (不支持IE9浏览器)多列垂直方向对齐方式
     * @enumdesc 顶部对齐, 居中对齐, 底部对齐, 按第一行文字基线对齐, 未设置高度或设为 auto,将占满整个容器的高度
     */
    align: PropTypes$1.oneOf(["top", "center", "bottom", "baseline", "stretch"]),
    /**
     * (不支持IE9浏览器)行内具有多余空间时的布局方式
     * @enumdesc 左对齐, 居中对齐, 右对齐, 两端对齐,列之间间距相等, 每列具有相同的左右间距,行两端间距是列间距的二分之一
     */
    justify: PropTypes$1.oneOf(["start", "center", "end", "space-between", "space-around"]),
    /**
     * 行在不同断点下的显示与隐藏<br><br>**可选值**:<br>true(在所有断点下隐藏)<br>false(在所有断点下显示)<br>'xs'(在 xs 断点下隐藏)<br>['xxs', 'xs', 's', 'm', 'l', 'xl'](在 xxs, xs, s, m, l, xl 断点下隐藏)
     */
    hidden: PropTypes$1.oneOfType([PropTypes$1.bool, PropTypes$1.string, PropTypes$1.array]),
    /**
     * 指定以何种元素渲染该节点
     * - 默认为 'div'
     */
    component: PropTypes$1.oneOfType([PropTypes$1.string, PropTypes$1.func])
  }, _class$z.defaultProps = {
    prefix: "next-",
    pure: false,
    fixed: false,
    gutter: 0,
    wrap: false,
    component: "div"
  }, _temp$m);
  Row$2.displayName = "Row";
  var _class$y, _temp$l;
  var breakPoints = ["xxs", "xs", "s", "m", "l", "xl"];
  var Col$1 = (_temp$l = _class$y = function(_Component) {
    _default$4(Col2, _Component);
    function Col2() {
      _default$7(this, Col2);
      return _default$5(this, _Component.apply(this, arguments));
    }
    Col2.prototype.render = function render2() {
      var _this2 = this, _extends2, _extends3;
      var _props = this.props, prefix = _props.prefix;
      _props.pure;
      var span = _props.span, offset = _props.offset, fixedSpan = _props.fixedSpan, fixedOffset = _props.fixedOffset, hidden = _props.hidden, align = _props.align;
      _props.xxs;
      _props.xs;
      _props.s;
      _props.m;
      _props.l;
      _props.xl;
      var Tag = _props.component, className = _props.className, children = _props.children, rtl = _props.rtl, others = _default$3(_props, ["prefix", "pure", "span", "offset", "fixedSpan", "fixedOffset", "hidden", "align", "xxs", "xs", "s", "m", "l", "xl", "component", "className", "children", "rtl"]);
      var pointClassObj = breakPoints.reduce(function(ret, point) {
        var pointProps = {};
        if (_default$6(_this2.props[point]) === "object") {
          pointProps = _this2.props[point];
        } else {
          pointProps.span = _this2.props[point];
        }
        ret[prefix + "col-" + point + "-" + pointProps.span] = !!pointProps.span;
        ret[prefix + "col-" + point + "-offset-" + pointProps.offset] = !!pointProps.offset;
        return ret;
      }, {});
      var hiddenClassObj = void 0;
      if (hidden === true) {
        var _hiddenClassObj;
        hiddenClassObj = (_hiddenClassObj = {}, _hiddenClassObj[prefix + "col-hidden"] = true, _hiddenClassObj);
      } else if (typeof hidden === "string") {
        var _hiddenClassObj2;
        hiddenClassObj = (_hiddenClassObj2 = {}, _hiddenClassObj2[prefix + "col-" + hidden + "-hidden"] = !!hidden, _hiddenClassObj2);
      } else if (Array.isArray(hidden)) {
        hiddenClassObj = hidden.reduce(function(ret, point) {
          ret[prefix + "col-" + point + "-hidden"] = !!point;
          return ret;
        }, {});
      }
      var classes = classnames(_default$8((_extends2 = {}, _extends2[prefix + "col"] = true, _extends2[prefix + "col-" + span] = !!span, _extends2[prefix + "col-fixed-" + fixedSpan] = !!fixedSpan, _extends2[prefix + "col-offset-" + offset] = !!offset, _extends2[prefix + "col-offset-fixed-" + fixedOffset] = !!fixedOffset, _extends2[prefix + "col-" + align] = !!align, _extends2), pointClassObj, hiddenClassObj, (_extends3 = {}, _extends3[className] = className, _extends3)));
      return React.createElement(
        Tag,
        _default$8({ dir: rtl ? "rtl" : "ltr", role: "gridcell", className: classes }, others),
        children
      );
    };
    return Col2;
  }(React.Component), _class$y.isNextCol = true, _class$y.propTypes = {
    prefix: PropTypes$1.string,
    pure: PropTypes$1.bool,
    rtl: PropTypes$1.bool,
    className: PropTypes$1.string,
    /**
     * 列内容
     */
    children: PropTypes$1.node,
    /**
     * 列宽度<br><br>**可选值**:<br>1, 2, 3, ..., 22, 23, 24
     */
    span: PropTypes$1.oneOfType([PropTypes$1.string, PropTypes$1.number]),
    /**
     * 固定列宽度,宽度值为20 * 栅格数<br><br>**可选值**:<br>1, 2, 3, ..., 28, 29, 30
     */
    fixedSpan: PropTypes$1.oneOfType([PropTypes$1.string, PropTypes$1.number]),
    /**
     * (不支持IE9浏览器)列偏移<br><br>**可选值**:<br>1, 2, 3, ..., 22, 23, 24
     */
    offset: PropTypes$1.oneOfType([PropTypes$1.string, PropTypes$1.number]),
    /**
     * (不支持IE9浏览器)固定列偏移,宽度值为20 * 栅格数<br><br>**可选值**:<br>1, 2, 3, ..., 28, 29, 30
     */
    fixedOffset: PropTypes$1.oneOfType([PropTypes$1.string, PropTypes$1.number]),
    /**
     * (不支持IE9浏览器)多列垂直方向对齐方式,可覆盖Row的align属性
     */
    align: PropTypes$1.oneOf(["top", "center", "bottom", "baseline", "stretch"]),
    /**
     * 列在不同断点下的显示与隐藏<br><br>**可选值**:<br>true(在所有断点下隐藏)<br>false(在所有断点下显示)<br>'xs'(在 xs 断点下隐藏)<br>['xxs', 'xs', 's', 'm', 'l', 'xl'](在 xxs, xs, s, m, l, xl 断点下隐藏)
     */
    hidden: PropTypes$1.oneOfType([PropTypes$1.bool, PropTypes$1.string, PropTypes$1.array]),
    /**
     * >=320px,响应式栅格,可为栅格数(span)或一个包含栅格数(span)和偏移栅格数(offset)对象
     */
    xxs: PropTypes$1.oneOfType([PropTypes$1.string, PropTypes$1.number, PropTypes$1.object]),
    /**
     * >=480px,响应式栅格,可为栅格数(span)或一个包含栅格数(span)和偏移栅格数(offset)对象
     */
    xs: PropTypes$1.oneOfType([PropTypes$1.string, PropTypes$1.number, PropTypes$1.object]),
    /**
     * >=720px,响应式栅格,可为栅格数(span)或一个包含栅格数(span)和偏移栅格数(offset)对象
     */
    s: PropTypes$1.oneOfType([PropTypes$1.string, PropTypes$1.number, PropTypes$1.object]),
    /**
     * >=990px,响应式栅格,可为栅格数(span)或一个包含栅格数(span)和偏移栅格数(offset)对象
     */
    m: PropTypes$1.oneOfType([PropTypes$1.string, PropTypes$1.number, PropTypes$1.object]),
    /**
     * >=1200px,响应式栅格,可为栅格数(span)或一个包含栅格数(span)和偏移栅格数(offset)对象
     */
    l: PropTypes$1.oneOfType([PropTypes$1.string, PropTypes$1.number, PropTypes$1.object]),
    /**
     * >=1500px,响应式栅格,可为栅格数(span)或一个包含栅格数(span)和偏移栅格数(offset)对象
     */
    xl: PropTypes$1.oneOfType([PropTypes$1.string, PropTypes$1.number, PropTypes$1.object]),
    /**
     * 指定以何种元素渲染该节点,默认为 'div'
     */
    component: PropTypes$1.oneOfType([PropTypes$1.string, PropTypes$1.func])
  }, _class$y.defaultProps = {
    prefix: "next-",
    pure: false,
    component: "div"
  }, _temp$l);
  Col$1.displayName = "Col";
  var Grid = {
    Row: ConfigProvider$1.config(Row$2, {
      transform: (
        /* istanbul ignore next */
        function transform12(props, deprecated2) {
          if ("type" in props) {
            deprecated2("type", "fixed | wrap | gutter", "Row");
            var _props = props, type2 = _props.type, others = _default$3(_props, ["type"]);
            var types = Array.isArray(type2) ? type2 : [type2];
            var fixed2 = void 0;
            if (types.indexOf("fixed") > -1) {
              fixed2 = true;
            }
            var wrap2 = void 0;
            if (types.indexOf("wrap") > -1) {
              wrap2 = true;
            }
            props = _default$8({ fixed: fixed2, wrap: wrap2 }, others);
          }
          return props;
        }
      )
    }),
    Col: ConfigProvider$1.config(Col$1)
  };
  const Grid$1 = Grid;
  var _class$x, _temp2$c;
  var Error$1 = (_temp2$c = _class$x = function(_React$Component) {
    _default$4(Error2, _React$Component);
    function Error2() {
      var _temp3, _this2, _ret;
      _default$7(this, Error2);
      for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
        args[_key] = arguments[_key];
      }
      return _ret = (_temp3 = (_this2 = _default$5(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this2), _this2.itemRender = function(errors) {
        return errors.length ? errors : null;
      }, _temp3), _default$5(_this2, _ret);
    }
    Error2.prototype.render = function render2() {
      var _classNames;
      var _props = this.props, children = _props.children, name = _props.name, prefix = _props.prefix, style = _props.style, className = _props.className, _field = _props.field, others = _default$3(_props, ["children", "name", "prefix", "style", "className", "field"]);
      if (children && typeof children !== "function") {
        return React.createElement(
          "div",
          { className: prefix + "form-item-help" },
          children
        );
      }
      var field = this.context._formField || _field;
      if (!field || !name) {
        return null;
      }
      var isSingle = typeof name === "string";
      var names = isSingle ? [name] : name;
      var errorArr = [];
      if (names.length) {
        var errors = field.getErrors(names);
        Object.keys(errors).forEach(function(key) {
          if (errors[key]) {
            errorArr.push(errors[key]);
          }
        });
      }
      var result = null;
      if (typeof children === "function") {
        result = children(errorArr, isSingle ? field.getState(name) : void 0);
      } else {
        result = this.itemRender(errorArr);
      }
      if (!result) {
        return null;
      }
      var cls = classnames((_classNames = {}, _classNames[prefix + "form-item-help"] = true, _classNames[className] = className, _classNames));
      return React.createElement(
        "div",
        _default$8({}, others, { className: cls, style }),
        result
      );
    };
    return Error2;
  }(React.Component), _class$x.propTypes = {
    /**
     * 表单名
     */
    name: PropTypes$1.oneOfType([PropTypes$1.string, PropTypes$1.array]),
    /**
     * 自定义 field (在 Form 内不需要设置)
     */
    field: PropTypes$1.object,
    style: PropTypes$1.object,
    className: PropTypes$1.string,
    /**
     * 自定义错误渲染, 可以是 node 或者 function(errors, state)
     */
    children: PropTypes$1.oneOfType([PropTypes$1.node, PropTypes$1.func]),
    prefix: PropTypes$1.string
  }, _class$x.defaultProps = {
    prefix: "next-"
  }, _class$x.contextTypes = {
    _formField: PropTypes$1.object
  }, _class$x._typeMark = "form_error", _temp2$c);
  Error$1.displayName = "Error";
  const Error$2 = ConfigProvider$1.config(Error$1);
  function getCfgFromProps(props, type2) {
    if (type2 in props) {
      return props[type2];
    }
    return void 0;
  }
  function getRule(ruleName, props) {
    var _ref;
    return _ref = {}, _ref[ruleName] = props[ruleName], _ref.message = getCfgFromProps(props, ruleName + "Message"), _ref.trigger = getCfgFromProps(props, ruleName + "Trigger"), _ref;
  }
  function getValueName(props, displayName) {
    if (props.valueName) {
      return props.valueName;
    }
    if (typeof displayName === "string") {
      var componentName = displayName.replace(/Config\(/g, "").replace(/\)/g, "");
      if (["Switch", "Checkbox", "Radio"].indexOf(componentName) !== -1) {
        return "checked";
      }
    }
    return "value";
  }
  function getRules(props, labelForErrorMessage) {
    var result = [];
    if (props.required) {
      result.push(getRule("required", props));
    }
    var maxLength = Number(props.maxLength);
    var minLength = Number(props.minLength);
    if (minLength || maxLength) {
      result.push({
        minLength,
        maxLength,
        // minLengthMessage maxLengthMessage had been deprected, please use minmaxLength. TODO: removed in 2.0
        message: getCfgFromProps(props, "minmaxLengthMessage") || getCfgFromProps(props, "minLengthMessage") || getCfgFromProps(props, "maxLengthMessage"),
        trigger: getCfgFromProps(props, "minmaxLengthTrigger") || getCfgFromProps(props, "minLengthTrigger") || getCfgFromProps(props, "maxLengthTrigger")
      });
    }
    if (props.length) {
      result.push(getRule("length", props));
    }
    if (props.pattern) {
      result.push(getRule("pattern", props));
    }
    if (["number", "tel", "url", "email"].indexOf(props.format) > -1) {
      result.push(getRule("format", props));
    }
    var max2 = Number(props.max);
    var min2 = Number(props.min);
    if (max2 || min2) {
      result.push({
        min: min2,
        max: max2,
        // minMessage maxMessage had been deprected, please use minmaxLength. TODO: removed in 2.0
        message: getCfgFromProps(props, "minmaxMessage") || getCfgFromProps(props, "minMessage") || getCfgFromProps(props, "maxMessage"),
        trigger: getCfgFromProps(props, "minmaxTrigger") || getCfgFromProps(props, "minTrigger") || getCfgFromProps(props, "maxTrigger")
      });
    }
    if (props.validator && typeof props.validator === "function") {
      result.push({
        validator: props.validator,
        trigger: getCfgFromProps(props, "validatorTrigger")
      });
    }
    if (labelForErrorMessage) {
      result.forEach(function(r2) {
        r2.aliasName = labelForErrorMessage;
      });
    }
    return result;
  }
  function getFieldInitCfg(props, displayName, labelForErrorMessage) {
    return {
      valueName: getValueName(props, displayName),
      trigger: props.trigger ? props.trigger : "onChange",
      autoValidate: props.autoValidate,
      rules: getRules(props, labelForErrorMessage)
    };
  }
  var _class$w, _temp$k;
  var Row$1 = Grid$1.Row, Col = Grid$1.Col;
  var Cell$1 = RGrid.Cell;
  var isNil = obj.isNil;
  var Item = (_temp$k = _class$w = function(_React$Component) {
    _default$4(Item2, _React$Component);
    function Item2() {
      _default$7(this, Item2);
      return _default$5(this, _React$Component.apply(this, arguments));
    }
    Item2.prototype.getNames = function getNames(children) {
      var name = this.props.name;
      var childrenList = React.Children.toArray(children);
      var nameList = childrenList.filter(function(c2) {
        return c2.props && ("name" in c2.props || "data-meta" in c2.props);
      }).map(function(c2) {
        return c2.props.name || c2.props.id;
      });
      if (nameList.length) {
        return nameList;
      } else if (name) {
        return [name];
      }
      return [];
    };
    Item2.prototype.getHelper = function getHelper(children) {
      var help = this.props.help;
      var _formField = this.context._formField;
      return React.createElement(
        Error$2,
        { name: help === void 0 ? this.getNames(children) : void 0, field: _formField },
        help
      );
    };
    Item2.prototype.getState = function getState(children) {
      var validateState = this.props.validateState;
      if (validateState) {
        return validateState;
      }
      if (this.context._formField) {
        var getState2 = this.context._formField.getState;
        var names = this.getNames(children);
        if (!names.length) {
          return "";
        }
        return getState2(names[0]);
      }
      return void 0;
    };
    Item2.prototype.getSize = function getSize() {
      return this.props.size || this.context._formSize;
    };
    Item2.prototype.getDisabled = function getDisabled() {
      return "disabled" in this.props ? this.props.disabled : this.context._formDisabled;
    };
    Item2.prototype.getIsPreview = function getIsPreview() {
      return "isPreview" in this.props ? this.props.isPreview : this.context._formPreview;
    };
    Item2.prototype.getFullWidth = function getFullWidth() {
      return isNil(this.props.fullWidth) ? !!this.context._formFullWidth : this.props.fullWidth;
    };
    Item2.prototype.getLabelForErrorMessage = function getLabelForErrorMessage() {
      var _props = this.props, errorMessageName = _props.errorMessageName, label = _props.label, useLabelForErrorMessage = _props.useLabelForErrorMessage;
      if (errorMessageName) {
        return errorMessageName;
      }
      if (!label || typeof label !== "string") {
        return null;
      }
      var newLabel = label.replace(":", "").replace(":", "");
      var labelForErrorMessage = useLabelForErrorMessage !== void 0 ? useLabelForErrorMessage : this.context._formLabelForErrorMessage;
      if (labelForErrorMessage && newLabel) {
        return newLabel;
      }
      return null;
    };
    Item2.prototype.getItemLabel = function getItemLabel(children) {
      var _classNames;
      var _props2 = this.props, id2 = _props2.id, required2 = _props2.required, _props2$asterisk = _props2.asterisk, asterisk = _props2$asterisk === void 0 ? required2 : _props2$asterisk, label = _props2.label, labelCol = _props2.labelCol, wrapperCol = _props2.wrapperCol, prefix = _props2.prefix, responsive = _props2.responsive, labelWidth = _props2.labelWidth, labelTextAlign = _props2.labelTextAlign, colon = _props2.colon;
      var labelAlign = this.getLabelAlign(this.props.labelAlign, this.props.device);
      if (!label) {
        return null;
      }
      var ele = React.createElement(
        "label",
        { htmlFor: id2 || this.getNames(children)[0], required: asterisk, key: "label" },
        label
      );
      var cls = classnames((_classNames = {}, _classNames[prefix + "form-item-label"] = true, _classNames["has-colon"] = colon, _classNames[prefix + "left"] = labelTextAlign === "left", _classNames));
      if (responsive && labelWidth && labelAlign !== "top") {
        return React.createElement(
          "div",
          { className: cls, style: { width: labelWidth } },
          ele
        );
      }
      if ((wrapperCol || labelCol) && labelAlign !== "top") {
        return React.createElement(
          Col,
          _default$8({}, labelCol, { className: cls }),
          ele
        );
      }
      return React.createElement(
        "div",
        { className: cls },
        ele
      );
    };
    Item2.prototype.getItemWrapper = function getItemWrapper(children) {
      var _this2 = this;
      var _props3 = this.props, hasFeedback = _props3.hasFeedback, labelCol = _props3.labelCol, wrapperCol = _props3.wrapperCol, extra = _props3.extra, prefix = _props3.prefix, renderPreview = _props3.renderPreview, name = _props3.name;
      var labelAlign = this.getLabelAlign(this.props.labelAlign, this.props.device);
      var state = this.getState(children);
      var isPreview = this.getIsPreview();
      var childrenProps = {
        size: this.getSize()
      };
      if (isPreview) {
        childrenProps.isPreview = true;
      }
      if ("renderPreview" in this.props && typeof renderPreview === "function") {
        childrenProps.renderPreview = renderPreview;
      }
      if (state && (state === "error" || hasFeedback)) {
        childrenProps.state = state;
      }
      if (labelAlign === "inset") {
        childrenProps.label = this.getItemLabel(children);
      }
      if (this.getDisabled()) {
        childrenProps.disabled = true;
      }
      var labelForErrorMessage = this.getLabelForErrorMessage();
      var ele = React.Children.map(children, function(child, idx) {
        if (child && ["function", "object"].indexOf(_default$6(child.type)) > -1 && child.type._typeMark !== "form_item" && child.type._typeMark !== "form_error") {
          var extraProps = childrenProps;
          if (_this2.context._formField && !("data-meta" in child.props) && ("name" in child.props || name && idx === 0)) {
            var initName = "name" in child.props && child.props.name ? child.props.name : name;
            extraProps = _this2.context._formField.init(initName, _default$8({}, getFieldInitCfg(_this2.props, child.type.displayName, labelForErrorMessage), {
              props: _default$8({}, child.props, { ref: child.ref })
            }), childrenProps);
          } else {
            extraProps = _default$8({}, child.props, extraProps);
          }
          return React.cloneElement(child, extraProps);
        }
        return child;
      });
      var help = this.getHelper(children);
      if ((wrapperCol || labelCol) && labelAlign !== "top") {
        return React.createElement(
          Col,
          _default$8({}, wrapperCol, { className: prefix + "form-item-control", key: "item" }),
          ele,
          " ",
          help,
          " ",
          extra
        );
      }
      return React.createElement(
        "div",
        { className: prefix + "form-item-control" },
        ele,
        " ",
        help,
        " ",
        extra
      );
    };
    Item2.prototype.getLabelAlign = function getLabelAlign(labelAlign, device) {
      if (device === "phone") {
        return "top";
      }
      return labelAlign;
    };
    Item2.prototype.render = function render2() {
      var _classNames2;
      var _props4 = this.props, className = _props4.className, style = _props4.style, prefix = _props4.prefix, wrapperCol = _props4.wrapperCol, labelCol = _props4.labelCol, responsive = _props4.responsive, children = _props4.children;
      var labelAlign = this.getLabelAlign(this.props.labelAlign, this.props.device);
      var childrenNode = children;
      if (typeof children === "function" && this.context._formField) {
        childrenNode = children(this.context._formField.getValues());
      }
      var state = this.getState(childrenNode);
      var size2 = this.getSize();
      var fullWidth = this.getFullWidth();
      var isPreview = this.getIsPreview();
      var itemClassName = classnames((_classNames2 = {}, _classNames2[prefix + "form-item"] = true, _classNames2["" + prefix + labelAlign] = labelAlign, _classNames2["has-" + state] = !!state, _classNames2["" + prefix + size2] = !!size2, _classNames2[prefix + "form-item-fullwidth"] = fullWidth, _classNames2["" + className] = !!className, _classNames2[prefix + "form-preview"] = isPreview, _classNames2));
      var Tag = responsive ? Cell$1 : (wrapperCol || labelCol) && labelAlign !== "top" ? Row$1 : "div";
      var label = labelAlign === "inset" ? null : this.getItemLabel(childrenNode);
      return React.createElement(
        Tag,
        _default$8({}, obj.pickOthers(Item2.propTypes, this.props), { className: itemClassName, style }),
        label,
        this.getItemWrapper(childrenNode)
      );
    };
    return Item2;
  }(React.Component), _class$w.propTypes = {
    /**
     * 样式前缀
     */
    prefix: PropTypes$1.string,
    rtl: PropTypes$1.bool,
    /**
     * label 标签的文本
     */
    label: PropTypes$1.node,
    /**
     * label 标签布局,通 `<Col>` 组件,设置 span offset 值,如 {span: 8, offset: 16},该项仅在垂直表单有效
     */
    labelCol: PropTypes$1.object,
    /**
     * 需要为输入控件设置布局样式时,使用该属性,用法同 labelCol
     */
    wrapperCol: PropTypes$1.object,
    /**
     * 自定义提示信息,如不设置,则会根据校验规则自动生成.
     */
    help: PropTypes$1.node,
    /**
     * 字段名,默认赋值给第一个子元素
     */
    name: PropTypes$1.string,
    /**
     * 额外的提示信息,和 help 类似,当需要错误信息和提示文案同时出现时,可以使用这个。 位于错误信息后面
     */
    extra: PropTypes$1.node,
    /**
     * 校验状态,如不设置,则会根据校验规则自动生成
     * @enumdesc 失败, 成功, 校验中, 警告
     */
    validateState: PropTypes$1.oneOf(["error", "success", "loading", "warning"]),
    /**
     * 配合 validateState 属性使用,是否展示 success/loading 的校验状态图标, 目前只有Input支持
     */
    hasFeedback: PropTypes$1.bool,
    //TODO: hasFeedback => validateStatus=[error,success,loading]
    /**
     * 自定义内联样式
     */
    style: PropTypes$1.object,
    id: PropTypes$1.string,
    /**
     * node 或者 function(values)
     */
    children: PropTypes$1.oneOfType([PropTypes$1.node, PropTypes$1.func]),
    /**
     * 单个 Item 的 size 自定义,优先级高于 Form 的 size, 并且当组件与 Item 一起使用时,组件自身设置 size 属性无效。
     */
    size: PropTypes$1.oneOf(["large", "small", "medium"]),
    /**
     * 单个 Item 中表单类组件宽度是否是100%
     */
    fullWidth: PropTypes$1.bool,
    /**
     * 标签的位置, 如果不设置 labelCol 和 wrapperCol 那么默认是标签在上
     * @enumdesc 上, 左, 内
     */
    labelAlign: PropTypes$1.oneOf(["top", "left", "inset"]),
    /**
     * 标签的左右对齐方式
     * @enumdesc 左, 右
     */
    labelTextAlign: PropTypes$1.oneOf(["left", "right"]),
    /**
     * 扩展class
     */
    className: PropTypes$1.string,
    /**
     * [表单校验] 不能为空
     */
    required: PropTypes$1.bool,
    /**
     * required 的星号是否显示
     */
    asterisk: PropTypes$1.bool,
    /**
     * required 自定义错误信息
     */
    requiredMessage: PropTypes$1.string,
    /**
     * required 校验何时触发,默认值 onChange, 原生事件均可使用 onChange/onBlur/onFocus/...
     */
    requiredTrigger: PropTypes$1.oneOfType([PropTypes$1.string, PropTypes$1.array]),
    /**
     * [表单校验] 最小值
     */
    min: PropTypes$1.number,
    /**
     * [表单校验] 最大值
     */
    max: PropTypes$1.number,
    /**
     * min/max 自定义错误信息
     */
    minmaxMessage: PropTypes$1.string,
    /**
     * min/max 校验何时触发,默认值 onChange, 原生事件均可使用 onChange/onBlur/onFocus/...
     */
    minmaxTrigger: PropTypes$1.oneOfType([PropTypes$1.string, PropTypes$1.array]),
    /**
     * [表单校验] 字符串最小长度 / 数组最小个数
     */
    minLength: PropTypes$1.number,
    /**
     * [表单校验] 字符串最大长度 / 数组最大个数
     */
    maxLength: PropTypes$1.number,
    /**
     * minLength/maxLength 自定义错误信息
     */
    minmaxLengthMessage: PropTypes$1.string,
    /**
     * minLength/maxLength 校验何时触发,默认值 onChange, 原生事件均可使用 onChange/onBlur/onFocus/...
     */
    minmaxLengthTrigger: PropTypes$1.oneOfType([PropTypes$1.string, PropTypes$1.array]),
    /**
     * [表单校验] 字符串精确长度 / 数组精确个数
     */
    length: PropTypes$1.number,
    /**
     * length 自定义错误信息
     */
    lengthMessage: PropTypes$1.string,
    /**
     * length 校验何时触发,默认值 onChange, 原生事件均可使用 onChange/onBlur/onFocus/...
     */
    lengthTrigger: PropTypes$1.oneOfType([PropTypes$1.string, PropTypes$1.array]),
    /**
     * 正则校验
     */
    pattern: PropTypes$1.any,
    /**
     * pattern 自定义错误信息
     */
    patternMessage: PropTypes$1.string,
    /**
     * pattern 校验何时触发,默认值 onChange, 原生事件均可使用 onChange/onBlur/onFocus/...
     */
    patternTrigger: PropTypes$1.oneOfType([PropTypes$1.string, PropTypes$1.array]),
    /**
     * [表单校验] 四种常用的 pattern
     */
    format: PropTypes$1.oneOf(["number", "email", "url", "tel"]),
    /**
     * format 自定义错误信息
     */
    formatMessage: PropTypes$1.string,
    /**
     * format 校验何时触发,默认值 onChange, 原生事件均可使用 onChange/onBlur/onFocus/...
     */
    formatTrigger: PropTypes$1.oneOfType([PropTypes$1.string, PropTypes$1.array]),
    /**
     * [表单校验] 自定义校验函数
     */
    validator: PropTypes$1.func,
    /**
     * validator 校验何时触发,默认值 onChange, 原生事件均可使用 onChange/onBlur/onFocus/...
     */
    validatorTrigger: PropTypes$1.oneOfType([PropTypes$1.string, PropTypes$1.array]),
    /**
     * 是否修改数据时自动触发校验
     */
    autoValidate: PropTypes$1.bool,
    /**
     * 预设屏幕宽度
     */
    device: PropTypes$1.oneOf(["phone", "tablet", "desktop"]),
    responsive: PropTypes$1.bool,
    /**
     * 在响应式布局模式下,表单项占多少列
     */
    colSpan: PropTypes$1.number,
    /**
     * 在响应式布局下,且label在左边时,label的宽度是多少
     */
    labelWidth: PropTypes$1.oneOfType([PropTypes$1.string, PropTypes$1.number]),
    /**
     * 是否开启预览态
     */
    isPreview: PropTypes$1.bool,
    /**
     * 预览态模式下渲染的内容
     * @param {any} value 根据包裹的组件的 value 类型而决定
     */
    renderPreview: PropTypes$1.func,
    /**
     * 替代校验信息的 name 字段,useLabelForErrorMessage 开启的情况下比 label 优先级高
     */
    errorMessageName: PropTypes$1.string,
    /**
     * 是否使用 label 替换校验信息的 name 字段
     */
    useLabelForErrorMessage: PropTypes$1.bool,
    /**
     * 表示是否显示 label 后面的冒号
     */
    colon: PropTypes$1.bool,
    /**
     * 是否禁用表单
     */
    disabled: PropTypes$1.bool,
    /**
     * 子元素的 value 名称
     */
    valueName: PropTypes$1.string
  }, _class$w.defaultProps = {
    prefix: "next-",
    hasFeedback: false,
    labelWidth: 100
  }, _class$w.contextTypes = {
    _formField: PropTypes$1.object,
    _formSize: PropTypes$1.oneOf(["large", "small", "medium"]),
    _formDisabled: PropTypes$1.bool,
    _formPreview: PropTypes$1.bool,
    _formFullWidth: PropTypes$1.bool,
    _formLabelForErrorMessage: PropTypes$1.bool
  }, _class$w._typeMark = "form_item", _temp$k);
  Item.displayName = "Item";
  var _class$v, _temp2$b;
  var Submit = (_temp2$b = _class$v = function(_React$Component) {
    _default$4(Submit2, _React$Component);
    function Submit2() {
      var _temp3, _this2, _ret;
      _default$7(this, Submit2);
      for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
        args[_key] = arguments[_key];
      }
      return _ret = (_temp3 = (_this2 = _default$5(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this2), _this2.handleClick = function() {
        var _this$props = _this2.props, onClick3 = _this$props.onClick, validate = _this$props.validate;
        var field = _this2.context._formField || _this2.props.field;
        if (!field) {
          onClick3();
          return;
        }
        if (validate === true) {
          field.validate(function(errors) {
            onClick3(field.getValues(), errors, field);
          });
        } else if (Array.isArray(validate)) {
          field.validate(validate, function(errors) {
            onClick3(field.getValues(), errors, field);
          });
        } else {
          onClick3(field.getValues(), null, field);
        }
      }, _temp3), _default$5(_this2, _ret);
    }
    Submit2.prototype.render = function render2() {
      var children = this.props.children;
      return React.createElement(
        Button,
        _default$8({}, obj.pickOthers(Submit2.propTypes, this.props), { onClick: this.handleClick }),
        children
      );
    };
    return Submit2;
  }(React.Component), _class$v.propTypes = {
    /**
     * 点击提交后触发
     * @param {Object} value 数据
     * @param {Object} errors 错误数据
     * @param {class} field 实例
     */
    onClick: PropTypes$1.func,
    /**
     * 是否校验/需要校验的 name 数组
     */
    validate: PropTypes$1.oneOfType([PropTypes$1.bool, PropTypes$1.array]),
    /**
     * 自定义 field (在 Form 内不需要设置)
     */
    field: PropTypes$1.object,
    children: PropTypes$1.node
  }, _class$v.defaultProps = {
    onClick: func.noop
  }, _class$v.contextTypes = {
    _formField: PropTypes$1.object
  }, _temp2$b);
  Submit.displayName = "Submit";
  const Submit$1 = Submit;
  var _class$u, _temp2$a;
  var Reset = (_temp2$a = _class$u = function(_React$Component) {
    _default$4(Reset2, _React$Component);
    function Reset2() {
      var _temp3, _this2, _ret;
      _default$7(this, Reset2);
      for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
        args[_key] = arguments[_key];
      }
      return _ret = (_temp3 = (_this2 = _default$5(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this2), _this2.handleClick = function() {
        var _this$props = _this2.props, names = _this$props.names, toDefault = _this$props.toDefault, onClick3 = _this$props.onClick;
        var field = _this2.context._formField || _this2.props.field;
        if (!field) {
          onClick3();
          return;
        }
        if (toDefault) {
          field.resetToDefault(names);
        } else {
          field.reset(names);
        }
        onClick3();
      }, _temp3), _default$5(_this2, _ret);
    }
    Reset2.prototype.render = function render2() {
      var children = this.props.children;
      return React.createElement(
        Button,
        _default$8({}, obj.pickOthers(Reset2.propTypes, this.props), { onClick: this.handleClick }),
        children
      );
    };
    return Reset2;
  }(React.Component), _class$u.propTypes = {
    /**
     * 自定义重置的字段
     */
    names: PropTypes$1.array,
    /**
     * 点击提交后触发
     */
    onClick: PropTypes$1.func,
    /**
     * 返回默认值
     */
    toDefault: PropTypes$1.bool,
    /**
     * 自定义 field (在 Form 内不需要设置)
     */
    field: PropTypes$1.object,
    children: PropTypes$1.node
  }, _class$u.defaultProps = {
    onClick: func.noop
  }, _class$u.contextTypes = {
    _formField: PropTypes$1.object
  }, _temp2$a);
  Reset.displayName = "Reset";
  const Reset$1 = Reset;
  Form$1.Item = ConfigProvider$1.config(Item, {
    transform: (
      /* istanbul ignore next */
      function transform13(props, deprecated2) {
        if ("validateStatus" in props) {
          deprecated2("validateStatus", "validateState", "Form.Item");
          var _props = props, validateStatus = _props.validateStatus, others = _default$3(_props, ["validateStatus"]);
          props = _default$8({ validateState: validateStatus }, others);
        }
        return props;
      }
    )
  });
  Form$1.Submit = Submit$1;
  Form$1.Reset = Reset$1;
  Form$1.Error = Error$2;
  const Form = ConfigProvider$1.config(Form$1, {
    transform: (
      /* istanbul ignore next */
      function transform14(props, deprecated2) {
        if ("direction" in props) {
          deprecated2("direction", "inline", "Form");
          var _props2 = props, direction = _props2.direction, others = _default$3(_props2, ["direction"]);
          if (direction === "hoz") {
            props = _default$8({ inline: true }, others);
          }
        }
        return props;
      }
    )
  });
  var _class$t, _temp$j;
  var Loading = (_temp$j = _class$t = function(_React$Component) {
    _default$4(Loading2, _React$Component);
    function Loading2() {
      _default$7(this, Loading2);
      return _default$5(this, _React$Component.apply(this, arguments));
    }
    Loading2.prototype.render = function render2() {
      var _classNames2, _classNames3, _classNames4;
      var _props = this.props, tip = _props.tip, visible = _props.visible, children = _props.children, className = _props.className, style = _props.style, indicator = _props.indicator, color = _props.color, prefix = _props.prefix, fullScreen = _props.fullScreen, disableScroll = _props.disableScroll, onVisibleChange = _props.onVisibleChange, tipAlign = _props.tipAlign, size2 = _props.size, inline = _props.inline, rtl = _props.rtl, safeNode = _props.safeNode;
      var indicatorDom = null;
      var dotCls = prefix + "loading-dot";
      if (indicator) {
        indicatorDom = indicator;
      } else {
        var _classNames;
        var backgroundColor = color;
        var fusionReactorCls = classnames((_classNames = {}, _classNames[prefix + "loading-fusion-reactor"] = true, _classNames[prefix + "loading-medium-fusion-reactor"] = size2 === "medium", _classNames));
        indicatorDom = React.createElement(
          "div",
          { className: fusionReactorCls, dir: rtl ? "rtl" : void 0 },
          React.createElement("span", { className: dotCls, style: { backgroundColor } }),
          React.createElement("span", { className: dotCls, style: { backgroundColor } }),
          React.createElement("span", { className: dotCls, style: { backgroundColor } }),
          React.createElement("span", { className: dotCls, style: { backgroundColor } })
        );
      }
      var loadingCls = classnames((_classNames2 = {}, _classNames2[prefix + "loading"] = true, _classNames2[prefix + "open"] = visible, _classNames2[prefix + "loading-inline"] = inline, _classNames2[className] = className, _classNames2));
      var tipCls = classnames((_classNames3 = {}, _classNames3[prefix + "loading-tip"] = true, _classNames3[prefix + "loading-tip-fullscreen"] = fullScreen, _classNames3[prefix + "loading-right-tip"] = tipAlign === "right", _classNames3));
      var others = obj.pickOthers(Loading2.propTypes, this.props);
      var contentCls = classnames((_classNames4 = {}, _classNames4[prefix + "loading-component"] = visible, _classNames4[prefix + "loading-wrap"] = true, _classNames4));
      return fullScreen ? [children, React.createElement(
        Overlay$1,
        _default$8({
          key: "overlay",
          hasMask: true,
          align: "cc cc",
          safeNode,
          disableScroll
        }, others, {
          className,
          style,
          visible,
          onRequestClose: onVisibleChange
        }),
        React.createElement(
          "div",
          { className: tipCls },
          React.createElement(
            "div",
            { className: prefix + "loading-indicator" },
            indicatorDom
          ),
          React.createElement(
            "div",
            { className: prefix + "loading-tip-content" },
            tip
          ),
          React.createElement(
            "div",
            { className: prefix + "loading-tip-placeholder" },
            tip
          )
        )
      )] : React.createElement(
        "div",
        _default$8({ className: loadingCls, style }, others),
        visible ? React.createElement(
          "div",
          { className: tipCls },
          React.createElement(
            "div",
            { className: prefix + "loading-indicator" },
            indicatorDom
          ),
          React.createElement(
            "div",
            { className: prefix + "loading-tip-content" },
            tip
          ),
          React.createElement(
            "div",
            { className: prefix + "loading-tip-placeholder" },
            tip
          )
        ) : null,
        React.createElement(
          "div",
          { className: contentCls },
          visible ? React.createElement("div", { className: prefix + "loading-masker" }) : null,
          children
        )
      );
    };
    return Loading2;
  }(React.Component), _class$t.propTypes = _default$8({}, ConfigProvider$1.propTypes, {
    /**
     * 样式前缀
     */
    prefix: PropTypes$1.string,
    /**
     * 自定义内容,可以传入string或reactElement
     */
    tip: PropTypes$1.any,
    /**
     * 自定义内容位置
     * @enumdesc 出现在动画右边, 出现在动画下面
     */
    tipAlign: PropTypes$1.oneOf(["right", "bottom"]),
    /**
     * loading 状态, 默认 true
     */
    visible: PropTypes$1.bool,
    /**
     * 全屏模式下,loading弹层请求关闭时触发的回调函数
     * @param {String} type 弹层关闭的来源
     * @param {Object} e DOM 事件
     */
    onVisibleChange: PropTypes$1.func,
    /**
     * 自定义class
     */
    className: PropTypes$1.string,
    /**
     * 自定义内联样式
     */
    style: PropTypes$1.object,
    /**
     * 设置动画尺寸
     * @description 仅仅对默认动画效果起作用
     * @enumdesc 大号, 中号
     */
    size: PropTypes$1.oneOf(["large", "medium"]),
    /**
     * 自定义动画
     */
    indicator: PropTypes$1.any,
    /**
     * 动画颜色
     */
    color: PropTypes$1.string,
    /**
     * 全屏展示
     */
    fullScreen: PropTypes$1.bool,
    /**
     * 当点击 document 的时候,如果包含该节点则不会关闭弹层,
     * 如果是函数需要返回 ref,如果是字符串则是该 DOM 的 id,也可以直接传入 DOM 节点,或者以上值组成的数组
     * 是否禁用滚动,仅在 fullScreen 模式下生效
     */
    disableScroll: PropTypes$1.bool,
    /**
     * 安全节点,fullScreen时有效,
     */
    safeNode: PropTypes$1.any,
    /**
     * 子元素
     */
    children: PropTypes$1.any,
    inline: PropTypes$1.bool,
    rtl: PropTypes$1.bool
  }), _class$t.defaultProps = {
    prefix: "next-",
    visible: true,
    onVisibleChange: func.noop,
    animate: null,
    tipAlign: "bottom",
    size: "large",
    inline: true,
    disableScroll: false
  }, _temp$j);
  Loading.displayName = "Loading";
  const Loading$1 = ConfigProvider$1.config(Loading);
  var hasOwnProperty$1 = Object.prototype.hasOwnProperty;
  function transformEntryEqual(a, b2) {
    for (var k2 in a) {
      if (hasOwnProperty$1.call(a, k2)) {
        return a[k2] === b2[k2];
      }
    }
    return false;
  }
  function transformEqual(a, b2) {
    if (!a && !b2 || a === b2) {
      return true;
    }
    if (!a !== !b2) {
      return false;
    }
    if (a.length !== b2.length) {
      return false;
    }
    for (var i = 0; i < a.length; i++) {
      if (!transformEntryEqual(a[i], b2[i])) {
        return false;
      }
    }
    return true;
  }
  function shallowObjectEquals(a, b2) {
    var k2;
    var i = 0;
    var j = 0;
    for (k2 in a) {
      if (hasOwnProperty$1.call(a, k2)) {
        switch (k2) {
          case "transform":
            if (!transformEqual(a[k2], b2[k2])) {
              return false;
            }
            break;
          case "shadowOffset":
            if (!shallowObjectEquals(a[k2], b2[k2])) {
              return false;
            }
            break;
          default:
            if (a[k2] !== b2[k2]) {
              return false;
            }
            break;
        }
        i++;
      }
    }
    for (k2 in b2) {
      if (hasOwnProperty$1.call(b2, k2)) {
        j++;
      }
    }
    return i === j;
  }
  function styleEqual$1(a, b2) {
    if (!a && !b2 || a === b2) {
      return true;
    }
    if (!a !== !b2) {
      return false;
    }
    switch (typeof a) {
      case "object":
        if (a instanceof Array) {
          for (var i = 0; i < a.length; i++) {
            if (!styleEqual$1(a[i], b2[i])) {
              return false;
            }
          }
          return a.length === b2.length;
        } else {
          return shallowObjectEquals(a, b2);
        }
      case "number":
      default:
        return a === b2;
    }
  }
  var styleEqual_1 = styleEqual$1;
  var styleEqual = styleEqual_1;
  var hasOwnProperty = Object.prototype.hasOwnProperty;
  function type(a) {
    return Array.isArray(a) ? "array" : typeof a;
  }
  function elementEquals(a, b2) {
    var typeOfA = type(a);
    var typeOfB = type(b2);
    if (typeOfA !== typeOfB)
      return false;
    switch (typeOfA) {
      case "array":
        if (a.length !== b2.length)
          return false;
        for (var i = 0; i < a.length; i++) {
          if (!elementEquals(a[i], b2[i]))
            return false;
        }
        return true;
      case "object":
        if (!a || !b2)
          return a === b2;
        if (a.type !== b2.type)
          return false;
        if (a.key !== b2.key)
          return false;
        if (a.ref !== b2.ref)
          return false;
        return shallowElementEquals(a.props, b2.props);
      default:
        return a === b2;
    }
  }
  function shallowElementEquals(a, b2) {
    var aCount = 0;
    var bCount = 0;
    for (var key in a) {
      if (hasOwnProperty.call(a, key)) {
        if (key === "style") {
          if (!styleEqual(a[key], b2[key]))
            return false;
        } else if (key === "children")
          ;
        else {
          if (a[key] !== b2[key])
            return false;
        }
        aCount++;
      }
    }
    for (var key in b2) {
      if (hasOwnProperty.call(b2, key)) {
        bCount++;
      }
    }
    if (aCount !== bCount)
      return false;
    return elementEquals(a.children, b2.children);
  }
  var shallowElementEquals_1 = shallowElementEquals;
  const shallowElementEquals$1 = /* @__PURE__ */ getDefaultExportFromCjs(shallowElementEquals_1);
  var blackList = ["defaultProps", "propTypes", "contextTypes", "childContextTypes", "displayName", "getDerivedStateFromProps"];
  var statics = function statics2(Target, Component2) {
    Object.keys(Component2).forEach(function(property) {
      if (blackList.indexOf(property) === -1) {
        Target[property] = Component2[property];
      }
    });
  };
  var fetchDataByPath = function fetchDataByPath2(object, path) {
    if (!object || !path) {
      return false;
    }
    path = path.toString();
    var field = path.split(".");
    var val = void 0, key = void 0;
    if (field.length) {
      key = field[0];
      if (key.indexOf("[") >= 0) {
        key = key.match(/(.*)\[(.*)\]/);
        if (key && _default$6(key[1]) === "object" && _default$6(object[key[1]]) === "object") {
          val = object[key[1]][key[2]];
        }
      } else {
        val = object[field[0]];
      }
      if (val) {
        for (var colIndex = 1; colIndex < field.length; colIndex++) {
          val = val[field[colIndex]];
          if (typeof val === "undefined") {
            break;
          }
        }
      }
    }
    return val;
  };
  var setStickyStyle = function setStickyStyle2(lockChildren, flatenChildren, dir) {
    var offsetArr = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : [];
    var prefix = arguments[4];
    var len = flatenChildren.length;
    flatenChildren.forEach(function(col, index2) {
      var _classnames;
      var isLeftLast = dir === "left" && index2 === len - 1;
      var isRightFirst = dir === "right" && index2 === 0;
      var style = {
        position: "sticky"
      };
      var offset = offsetArr[index2];
      if (offset > -1) {
        style[dir] = offset;
      }
      col.className = classnames(col.className, (_classnames = {}, _classnames[prefix + "table-fix-" + dir] = true, _classnames[prefix + "table-fix-left-last"] = isLeftLast, _classnames[prefix + "table-fix-right-first"] = isRightFirst, _classnames));
      col.style = _default$8({}, col.style, style);
      col.cellStyle = style;
    });
    var setOffset = function setOffset2(col, index2, dir2, isBorder) {
      var _classnames2;
      var style = {
        position: "sticky"
      };
      var offset = offsetArr[index2];
      if (offset > -1) {
        style[dir2] = offset;
      }
      col.className = classnames(col.className, (_classnames2 = {}, _classnames2[prefix + "table-fix-" + dir2] = true, _classnames2[prefix + "table-fix-left-last"] = dir2 === "left" && isBorder, _classnames2[prefix + "table-fix-right-first"] = dir2 === "right" && isBorder, _classnames2));
      col.style = _default$8({}, col.style, style);
      col.cellStyle = style;
    };
    var getLeafNodes = function getLeafNodes2(node) {
      var nodesLen = 0;
      var arrLen = Array.isArray(node && node.children) && node.children.length || 0;
      if (arrLen > 0) {
        nodesLen = node.children.reduce(function(ret, item, idx) {
          return ret + getLeafNodes2(item.children);
        }, 0);
      } else {
        nodesLen = 1;
      }
      return nodesLen;
    };
    var getPreNodes = function getPreNodes2(arr, idx) {
      return arr.reduce(function(ret, item, i) {
        if (i < idx) {
          return ret + getLeafNodes(item);
        }
        return ret;
      }, 0);
    };
    var loop = function loop2(arr, i) {
      dir === "right" && arr.reverse();
      arr.forEach(function(child, j) {
        var p2 = dir === "right" ? i - getPreNodes(arr, j) : i + getPreNodes(arr, j);
        if (child.children) {
          loop2(child.children, p2);
          setOffset(child, p2, dir, j === arr.length - 1);
        }
      });
      dir === "right" && arr.reverse();
    };
    loop(lockChildren, dir === "left" ? 0 : len - 1);
  };
  var _class$s, _temp2$9;
  var noop$6 = function noop7() {
  };
  var Row = (_temp2$9 = _class$s = function(_React$Component) {
    _default$4(Row2, _React$Component);
    function Row2() {
      var _temp3, _this2, _ret;
      _default$7(this, Row2);
      for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
        args[_key] = arguments[_key];
      }
      return _ret = (_temp3 = (_this2 = _default$5(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this2), _this2.onClick = function(e2) {
        var _this$props = _this2.props, record = _this$props.record, rowIndex = _this$props.rowIndex;
        _this2.props.onClick(record, rowIndex, e2);
      }, _this2.onMouseEnter = function(e2) {
        var _this$props2 = _this2.props, record = _this$props2.record, rowIndex = _this$props2.rowIndex, __rowIndex = _this$props2.__rowIndex;
        var row = __rowIndex || rowIndex;
        _this2.onRowHover(record, row, true, e2);
      }, _this2.onMouseLeave = function(e2) {
        var _this$props3 = _this2.props, record = _this$props3.record, rowIndex = _this$props3.rowIndex, __rowIndex = _this$props3.__rowIndex;
        var row = __rowIndex || rowIndex;
        _this2.onRowHover(record, row, false, e2);
      }, _temp3), _default$5(_this2, _ret);
    }
    Row2.prototype.shouldComponentUpdate = function shouldComponentUpdate(nextProps) {
      if (nextProps.pure) {
        var isEqual = obj.shallowEqual(this.props, nextProps);
        return !isEqual;
      }
      return true;
    };
    Row2.prototype.onRowHover = function onRowHover(record, index2, isEnter, e2) {
      var _props = this.props, onMouseEnter = _props.onMouseEnter, onMouseLeave = _props.onMouseLeave, currentRow = ReactDOM.findDOMNode(this);
      if (isEnter) {
        onMouseEnter(record, index2, e2);
        currentRow && dom.addClass(currentRow, "hovered");
      } else {
        onMouseLeave(record, index2, e2);
        currentRow && dom.removeClass(currentRow, "hovered");
      }
    };
    Row2.prototype.renderCells = function renderCells(record, rowIndex) {
      var _this2 = this;
      var _props2 = this.props, Cell2 = _props2.Cell, columns = _props2.columns, getCellProps = _props2.getCellProps, cellRef = _props2.cellRef, prefix = _props2.prefix, primaryKey = _props2.primaryKey, __rowIndex = _props2.__rowIndex, pure = _props2.pure, locale = _props2.locale, rtl = _props2.rtl;
      rowIndex = rowIndex !== void 0 ? rowIndex : this.props.rowIndex;
      var lockType = this.context.lockType;
      return columns.map(function(child, index2) {
        var _classnames;
        var dataIndex = child.dataIndex, align = child.align;
        child.alignHeader;
        var width = child.width;
        child.colSpan;
        child.style;
        var cellStyle = child.cellStyle, __colIndex = child.__colIndex, others = _default$3(child, ["dataIndex", "align", "alignHeader", "width", "colSpan", "style", "cellStyle", "__colIndex"]);
        var colIndex = "__colIndex" in child ? __colIndex : index2;
        var value = fetchDataByPath(record, dataIndex);
        var attrs = getCellProps(rowIndex, colIndex, dataIndex, record) || {};
        if (_this2.context.notRenderCellIndex) {
          var matchCellIndex = _this2.context.notRenderCellIndex.map(function(cellIndex) {
            return cellIndex.toString();
          }).indexOf([rowIndex, colIndex].toString());
          if (matchCellIndex > -1) {
            _this2.context.notRenderCellIndex.splice(matchCellIndex, 1);
            return null;
          }
        }
        if (attrs.colSpan && attrs.colSpan > 1 || attrs.rowSpan && attrs.rowSpan > 1) {
          _this2._getNotRenderCellIndex(colIndex, rowIndex, attrs.colSpan || 1, attrs.rowSpan || 1);
        }
        var cellClass = attrs.className;
        var className = classnames((_classnames = {
          first: lockType !== "right" && colIndex === 0,
          last: lockType !== "left" && (colIndex === columns.length - 1 || colIndex + attrs.colSpan === columns.length)
        }, _classnames[child.className] = child.className, _classnames[cellClass] = cellClass, _classnames));
        var newStyle = _default$8({}, attrs.style, cellStyle);
        return React.createElement(Cell2, _default$8({
          key: __rowIndex + "-" + colIndex
        }, others, attrs, {
          style: newStyle,
          "data-next-table-col": colIndex,
          "data-next-table-row": rowIndex,
          ref: function ref(cell5) {
            return cellRef(__rowIndex, colIndex, cell5);
          },
          prefix,
          pure,
          primaryKey,
          record,
          className,
          value,
          colIndex,
          rowIndex,
          align,
          locale,
          rtl,
          width
        }));
      });
    };
    Row2.prototype._getNotRenderCellIndex = function _getNotRenderCellIndex(colIndex, rowIndex, colSpan, rowSpan) {
      var maxColIndex = colSpan;
      var maxRowIndex = rowSpan;
      var notRenderCellIndex = [];
      for (var i = 0; i < maxColIndex; i++) {
        for (var j = 0; j < maxRowIndex; j++) {
          notRenderCellIndex.push([rowIndex + j, colIndex + i]);
        }
      }
      [].push.apply(this.context.notRenderCellIndex, notRenderCellIndex);
    };
    Row2.prototype.render = function render2() {
      var _classnames2;
      var _props3 = this.props, prefix = _props3.prefix, className = _props3.className;
      _props3.onClick;
      _props3.onMouseEnter;
      _props3.onMouseLeave;
      _props3.columns;
      _props3.Cell;
      _props3.getCellProps;
      _props3.rowIndex;
      var record = _props3.record;
      _props3.__rowIndex;
      var children = _props3.children;
      _props3.primaryKey;
      _props3.cellRef;
      _props3.colGroup;
      _props3.pure;
      _props3.locale;
      _props3.expandedIndexSimulate;
      _props3.tableEl;
      _props3.rtl;
      var wrapper2 = _props3.wrapper, others = _default$3(_props3, ["prefix", "className", "onClick", "onMouseEnter", "onMouseLeave", "columns", "Cell", "getCellProps", "rowIndex", "record", "__rowIndex", "children", "primaryKey", "cellRef", "colGroup", "pure", "locale", "expandedIndexSimulate", "tableEl", "rtl", "wrapper"]);
      var cls = classnames((_classnames2 = {}, _classnames2[prefix + "table-row"] = true, _classnames2[className] = className, _classnames2));
      var tr = React.createElement(
        "tr",
        _default$8({
          className: cls,
          role: "row"
        }, others, {
          onClick: this.onClick,
          onMouseEnter: this.onMouseEnter,
          onMouseLeave: this.onMouseLeave
        }),
        this.renderCells(record),
        children
      );
      return wrapper2(tr);
    };
    return Row2;
  }(React.Component), _class$s.propTypes = {
    prefix: PropTypes$1.string,
    pure: PropTypes$1.bool,
    primaryKey: PropTypes$1.oneOfType([PropTypes$1.symbol, PropTypes$1.string]),
    className: PropTypes$1.string,
    columns: PropTypes$1.array,
    record: PropTypes$1.any,
    Cell: PropTypes$1.func,
    rowIndex: PropTypes$1.number,
    getCellProps: PropTypes$1.func,
    onClick: PropTypes$1.func,
    onMouseEnter: PropTypes$1.func,
    onMouseLeave: PropTypes$1.func,
    children: PropTypes$1.any,
    cellRef: PropTypes$1.func,
    colGroup: PropTypes$1.object,
    locale: PropTypes$1.object,
    wrapper: PropTypes$1.func
  }, _class$s.defaultProps = {
    prefix: "next-",
    primaryKey: "id",
    columns: [],
    record: {},
    getCellProps: noop$6,
    onClick: noop$6,
    onMouseEnter: noop$6,
    onMouseLeave: noop$6,
    cellRef: noop$6,
    colGroup: {},
    wrapper: function wrapper(row) {
      return row;
    }
  }, _class$s.contextTypes = {
    notRenderCellIndex: PropTypes$1.array,
    lockType: PropTypes$1.oneOf(["left", "right"])
  }, _temp2$9);
  Row.displayName = "Row";
  var _class$r, _temp$i;
  var Cell = (_temp$i = _class$r = function(_React$Component) {
    _default$4(Cell2, _React$Component);
    function Cell2() {
      _default$7(this, Cell2);
      return _default$5(this, _React$Component.apply(this, arguments));
    }
    Cell2.prototype.shouldComponentUpdate = function shouldComponentUpdate(nextProps) {
      if (nextProps.pure) {
        var isEqual = obj.shallowEqual(this.props, nextProps);
        return !isEqual;
      }
      return true;
    };
    Cell2.prototype.render = function render2() {
      var _classnames;
      var _props = this.props, prefix = _props.prefix, className = _props.className, cell5 = _props.cell, value = _props.value;
      _props.resizable;
      _props.asyncResizable;
      _props.colIndex;
      var rowIndex = _props.rowIndex, __colIndex = _props.__colIndex, record = _props.record, context = _props.context, align = _props.align, _props$style = _props.style, style = _props$style === void 0 ? {} : _props$style, Tag = _props.component, children = _props.children;
      _props.title;
      _props.width;
      var innerStyle = _props.innerStyle;
      _props.primaryKey;
      _props.__normalized;
      _props.filterMode;
      _props.filterMenuProps;
      _props.filterProps;
      _props.filters;
      _props.sortable;
      _props.sortDirections;
      _props.lock;
      _props.pure;
      _props.locale;
      _props.expandedIndexSimulate;
      var rtl = _props.rtl, isIconLeft = _props.isIconLeft;
      _props.type;
      var htmlTitle = _props.htmlTitle, wordBreak = _props.wordBreak, others = _default$3(_props, ["prefix", "className", "cell", "value", "resizable", "asyncResizable", "colIndex", "rowIndex", "__colIndex", "record", "context", "align", "style", "component", "children", "title", "width", "innerStyle", "primaryKey", "__normalized", "filterMode", "filterMenuProps", "filterProps", "filters", "sortable", "sortDirections", "lock", "pure", "locale", "expandedIndexSimulate", "rtl", "isIconLeft", "type", "htmlTitle", "wordBreak"]);
      var tagStyle = _default$8({}, style);
      var cellProps = { value, index: rowIndex, record, context };
      var content = cell5;
      if (React.isValidElement(content)) {
        content = React.cloneElement(content, cellProps);
      } else if (typeof content === "function") {
        content = content(value, rowIndex, record, context);
      }
      if (align) {
        tagStyle.textAlign = align;
        if (rtl) {
          tagStyle.textAlign = align === "left" ? "right" : align === "right" ? "left" : align;
        }
      }
      var cls = classnames((_classnames = {}, _classnames[prefix + "table-cell"] = true, _classnames[prefix + "table-word-break-" + wordBreak] = !!wordBreak, _classnames[className] = className, _classnames));
      return React.createElement(
        Tag,
        _default$8({}, pickAttrs(others), { className: cls, style: tagStyle, role: "gridcell" }),
        React.createElement(
          "div",
          {
            className: prefix + "table-cell-wrapper",
            ref: this.props.getCellDomRef,
            style: innerStyle,
            title: htmlTitle,
            "data-next-table-col": __colIndex,
            "data-next-table-row": rowIndex
          },
          isIconLeft ? children : content,
          isIconLeft ? content : children
        )
      );
    };
    return Cell2;
  }(React.Component), _class$r.propTypes = {
    prefix: PropTypes$1.string,
    pure: PropTypes$1.bool,
    primaryKey: PropTypes$1.oneOfType([PropTypes$1.symbol, PropTypes$1.string]),
    className: PropTypes$1.string,
    record: PropTypes$1.any,
    value: PropTypes$1.any,
    isIconLeft: PropTypes$1.bool,
    colIndex: PropTypes$1.number,
    rowIndex: PropTypes$1.number,
    // 经过锁列调整后的列索引,lock right的列会从非0开始
    __colIndex: PropTypes$1.oneOfType([PropTypes$1.number, PropTypes$1.string]),
    title: PropTypes$1.any,
    width: PropTypes$1.oneOfType([PropTypes$1.number, PropTypes$1.string]),
    context: PropTypes$1.any,
    cell: PropTypes$1.oneOfType([PropTypes$1.element, PropTypes$1.node, PropTypes$1.func]),
    align: PropTypes$1.oneOf(["left", "center", "right"]),
    component: PropTypes$1.oneOf(["td", "th", "div"]),
    children: PropTypes$1.any,
    style: PropTypes$1.object,
    innerStyle: PropTypes$1.object,
    filterMode: PropTypes$1.oneOf(["single", "multiple"]),
    filterMenuProps: PropTypes$1.object,
    filterProps: PropTypes$1.object,
    filters: PropTypes$1.array,
    sortable: PropTypes$1.bool,
    sortDirections: PropTypes$1.arrayOf(PropTypes$1.oneOf(["desc", "asc", "default"])),
    lock: PropTypes$1.any,
    type: PropTypes$1.oneOf(["header", "body"]),
    resizable: PropTypes$1.bool,
    asyncResizable: PropTypes$1.bool,
    __normalized: PropTypes$1.bool
  }, _class$r.defaultProps = {
    component: "td",
    type: "body",
    isIconLeft: false,
    cell: function cell(value) {
      return value;
    },
    prefix: "next-"
  }, _temp$i);
  Cell.displayName = "Cell";
  var _class$q, _temp2$8;
  var noop$5 = function noop8() {
  };
  var Body = (_temp2$8 = _class$q = function(_React$Component) {
    _default$4(Body2, _React$Component);
    function Body2() {
      var _temp3, _this2, _ret;
      _default$7(this, Body2);
      for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
        args[_key] = arguments[_key];
      }
      return _ret = (_temp3 = (_this2 = _default$5(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this2), _this2.getRowRef = function(i, row) {
        _this2.props.rowRef(i, row);
      }, _this2.onRowClick = function(record, index2, e2) {
        _this2.props.onRowClick(record, index2, e2);
      }, _this2.onRowMouseEnter = function(record, index2, e2) {
        _this2.props.onRowMouseEnter(record, index2, e2);
      }, _this2.onRowMouseLeave = function(record, index2, e2) {
        _this2.props.onRowMouseLeave(record, index2, e2);
      }, _this2.onBodyMouseOver = function(e2) {
        _this2.props.onBodyMouseOver(e2);
      }, _this2.onBodyMouseOut = function(e2) {
        _this2.props.onBodyMouseOut(e2);
      }, _this2.getEmptyNode = function(ref) {
        _this2.emptyNode = ref;
      }, _this2.setEmptyDomStyle = function() {
        var tableEl = _this2.props.tableEl;
        var borderLeftWidth = dom.getStyle(tableEl, "borderLeftWidth");
        var tableWidth = tableEl && tableEl.getBoundingClientRect().width;
        var totalWidth = tableWidth - borderLeftWidth - 1 || "100%";
        dom.setStyle(_this2.emptyNode, { width: totalWidth });
      }, _temp3), _default$5(_this2, _ret);
    }
    Body2.prototype.componentDidMount = function componentDidMount() {
      events.on(window, "resize", this.setEmptyDomStyle);
    };
    Body2.prototype.componentDidUpdate = function componentDidUpdate() {
      this.setEmptyDomStyle();
    };
    Body2.prototype.componentWillUnmount = function componentWillUnmount() {
      events.off(window, "resize", this.setEmptyDomStyle);
    };
    Body2.prototype.render = function render2() {
      var _this2 = this;
      var _props = this.props, prefix = _props.prefix, className = _props.className, children = _props.children, Tag = _props.component, colGroup = _props.colGroup, loading = _props.loading, emptyContent = _props.emptyContent, components = _props.components, getCellProps = _props.getCellProps, primaryKey = _props.primaryKey, getRowProps = _props.getRowProps, dataSource = _props.dataSource, cellRef = _props.cellRef, columns = _props.columns;
      _props.rowRef;
      _props.onRowClick;
      _props.onRowMouseEnter;
      _props.onRowMouseLeave;
      _props.onBodyMouseOver;
      _props.onBodyMouseOut;
      var locale = _props.locale, pure = _props.pure, expandedIndexSimulate = _props.expandedIndexSimulate, tableEl = _props.tableEl, rtl = _props.rtl, crossline = _props.crossline;
      _props.tableWidth;
      var others = _default$3(_props, ["prefix", "className", "children", "component", "colGroup", "loading", "emptyContent", "components", "getCellProps", "primaryKey", "getRowProps", "dataSource", "cellRef", "columns", "rowRef", "onRowClick", "onRowMouseEnter", "onRowMouseLeave", "onBodyMouseOver", "onBodyMouseOut", "locale", "pure", "expandedIndexSimulate", "tableEl", "rtl", "crossline", "tableWidth"]);
      var totalWidth = +(tableEl && tableEl.clientWidth) - 1 || "100%";
      var _components$Row = components.Row, Row$12 = _components$Row === void 0 ? Row : _components$Row, _components$Cell = components.Cell, Cell$12 = _components$Cell === void 0 ? Cell : _components$Cell;
      var empty = loading ? React.createElement(
        "span",
        null,
        " "
      ) : emptyContent || locale.empty;
      var rows = React.createElement(
        "tr",
        null,
        React.createElement(
          "td",
          { colSpan: columns.length },
          React.createElement(
            "div",
            {
              ref: this.getEmptyNode,
              className: prefix + "table-empty",
              style: { position: "sticky", left: 0, overflow: "hidden", width: totalWidth }
            },
            empty
          )
        )
      );
      if (Tag === "div") {
        rows = React.createElement(
          "table",
          { role: "table" },
          React.createElement(
            "tbody",
            null,
            rows
          )
        );
      }
      if (dataSource.length) {
        rows = dataSource.map(function(record, index2) {
          var _classnames;
          var rowProps = {};
          var rowIndex = (typeof record === "undefined" ? "undefined" : _default$6(record)) === "object" && "__rowIndex" in record ? record.__rowIndex : index2;
          if (expandedIndexSimulate) {
            rowProps = record.__expanded ? {} : getRowProps(record, index2 / 2);
          } else {
            rowProps = getRowProps(record, rowIndex);
          }
          rowProps = rowProps || {};
          var rowClass = rowProps.className;
          var className2 = classnames((_classnames = {
            first: index2 === 0,
            last: index2 === dataSource.length - 1
          }, _classnames[rowClass] = rowClass, _classnames));
          var expanded2 = record.__expanded ? "expanded" : "";
          return React.createElement(Row$12, _default$8({
            key: "" + (record[primaryKey] || (record[primaryKey] === 0 ? 0 : rowIndex)) + expanded2
          }, rowProps, {
            ref: _this2.getRowRef.bind(_this2, expanded2 ? rowIndex + "_expanded" : rowIndex),
            colGroup,
            rtl,
            columns,
            primaryKey,
            record,
            rowIndex,
            __rowIndex: rowIndex,
            prefix,
            pure,
            cellRef,
            getCellProps,
            className: className2,
            Cell: Cell$12,
            tableEl,
            onClick: _this2.onRowClick,
            locale,
            onMouseEnter: _this2.onRowMouseEnter,
            onMouseLeave: _this2.onRowMouseLeave
          }));
        });
      } else {
        this.setEmptyDomStyle();
      }
      var event = crossline ? {
        onMouseOver: this.onBodyMouseOver,
        onMouseOut: this.onBodyMouseOut
      } : {};
      return React.createElement(
        Tag,
        _default$8({ className }, others, event),
        rows,
        children
      );
    };
    return Body2;
  }(React.Component), _class$q.propTypes = {
    loading: PropTypes$1.bool,
    emptyContent: PropTypes$1.any,
    tableEl: PropTypes$1.any,
    prefix: PropTypes$1.string,
    pure: PropTypes$1.bool,
    components: PropTypes$1.object,
    getCellProps: PropTypes$1.func,
    cellRef: PropTypes$1.func,
    primaryKey: PropTypes$1.oneOfType([PropTypes$1.symbol, PropTypes$1.string]),
    getRowProps: PropTypes$1.func,
    rowRef: PropTypes$1.func,
    dataSource: PropTypes$1.array,
    children: PropTypes$1.any,
    className: PropTypes$1.string,
    component: PropTypes$1.string,
    colGroup: PropTypes$1.object,
    columns: PropTypes$1.array,
    onRowClick: PropTypes$1.func,
    onRowMouseEnter: PropTypes$1.func,
    onRowMouseLeave: PropTypes$1.func,
    onBodyMouseOver: PropTypes$1.func,
    onBodyMouseOut: PropTypes$1.func,
    locale: PropTypes$1.object,
    crossline: PropTypes$1.bool,
    tableWidth: PropTypes$1.number
  }, _class$q.defaultProps = {
    loading: false,
    prefix: "next-",
    components: {},
    getCellProps: noop$5,
    cellRef: noop$5,
    primaryKey: "id",
    getRowProps: noop$5,
    rowRef: noop$5,
    dataSource: [],
    component: "tbody",
    columns: []
  }, _temp2$8);
  Body.displayName = "Body";
  var _class$p, _temp$h, _initialiseProps3;
  var Filter = (_temp$h = _class$p = function(_React$Component) {
    _default$4(Filter2, _React$Component);
    function Filter2(props) {
      _default$7(this, Filter2);
      var _this2 = _default$5(this, _React$Component.call(this, props));
      _initialiseProps3.call(_this2);
      var filterParams = props.filterParams || {};
      var filterConfig = filterParams[props.dataIndex] || {};
      _this2.state = {
        visible: filterConfig.visible || false,
        selectedKeys: filterConfig.selectedKeys || [],
        selectedKeysChangedByInner: true
      };
      _this2._selectedKeys = [].concat(_this2.state.selectedKeys);
      return _this2;
    }
    Filter2.getDerivedStateFromProps = function getDerivedStateFromProps(nextProps, prevState) {
      var state = {};
      if (nextProps.hasOwnProperty("filterParams") && typeof nextProps.filterParams !== "undefined") {
        var dataIndex = nextProps.dataIndex || this.props.dataIndex;
        var filterParams = nextProps.filterParams || {};
        var filterConfig = filterParams[dataIndex] || {};
        var selectedKeys = void 0;
        if (prevState.selectedKeysChangedByInner) {
          selectedKeys = prevState.selectedKeys || [];
          state.selectedKeysChangedByInner = false;
        } else {
          selectedKeys = filterConfig.selectedKeys || [];
        }
        state.selectedKeys = selectedKeys;
      }
      return state;
    };
    Filter2.prototype.componentDidUpdate = function componentDidUpdate(prevProps, prevState) {
      var selectedKeys = prevState.selectedKeys;
      this._selectedKeys = [].concat(selectedKeys);
    };
    Filter2.prototype.render = function render2() {
      var _classnames, _classnames2, _classnames3;
      var _props = this.props, filters = _props.filters, prefix = _props.prefix, locale = _props.locale, className = _props.className, filterMode = _props.filterMode, filterMenuProps = _props.filterMenuProps, filterProps = _props.filterProps, rtl = _props.rtl;
      var dropdownClassname = classnames(filterProps && filterProps.className, (_classnames = {}, _classnames[prefix + "table-filter-menu"] = true, _classnames));
      var _state = this.state, visible = _state.visible, selectedKeys = _state.selectedKeys;
      var _ref = filterMenuProps || {}, subMenuSelectable = _ref.subMenuSelectable, others = _default$3(_ref, ["subMenuSelectable"]);
      function renderMenuItem(item) {
        return React.createElement(
          Menu.Item,
          { key: item.value },
          item.label
        );
      }
      function renderSubMenu(parent, children) {
        return React.createElement(
          Menu.SubMenu,
          { label: parent.label, key: parent.value, selectable: subMenuSelectable },
          renderMenuContent(children)
        );
      }
      function renderMenuContent(list2) {
        return list2.map(function(item) {
          if (item.children) {
            return renderSubMenu(item, item.children);
          } else {
            return renderMenuItem(item);
          }
        });
      }
      var content = renderMenuContent(filters), footer = React.createElement(
        "div",
        { className: prefix + "table-filter-footer" },
        React.createElement(
          Button,
          { type: "primary", onClick: this.onFilterConfirm },
          locale.ok
        ),
        React.createElement(
          Button,
          { onClick: this.onFilterClear },
          locale.reset
        )
      );
      var cls = classnames((_classnames2 = {}, _classnames2[prefix + "table-filter"] = true, _classnames2[className] = className, _classnames2));
      var filterIconCls = classnames((_classnames3 = {}, _classnames3[prefix + "table-filter-active"] = selectedKeys && selectedKeys.length > 0, _classnames3));
      return React.createElement(
        Dropdown,
        _default$8({
          trigger: React.createElement(
            "span",
            {
              role: "button",
              "aria-label": locale.filter,
              onKeyDown: this.filterKeydown,
              tabIndex: "0",
              className: cls
            },
            React.createElement(Icon, { type: "filter", size: "small", className: filterIconCls })
          ),
          triggerType: "click",
          visible,
          autoFocus: true,
          rtl,
          needAdjust: false,
          onVisibleChange: this.onFilterVisible,
          className: dropdownClassname
        }, filterProps),
        React.createElement(
          Menu,
          _default$8({
            footer,
            rtl,
            selectedKeys,
            selectMode: filterMode,
            onSelect: this.onFilterSelect
          }, others),
          content
        )
      );
    };
    return Filter2;
  }(React.Component), _class$p.propTypes = {
    dataIndex: PropTypes$1.string,
    filters: PropTypes$1.array,
    filterMode: PropTypes$1.string,
    filterParams: PropTypes$1.object,
    filterMenuProps: PropTypes$1.object,
    filterProps: PropTypes$1.object,
    locale: PropTypes$1.object,
    onFilter: PropTypes$1.func,
    prefix: PropTypes$1.string,
    rtl: PropTypes$1.bool
  }, _class$p.defaultProps = {
    onFilter: function onFilter() {
    }
  }, _initialiseProps3 = function _initialiseProps4() {
    var _this2 = this;
    this.filterKeydown = function(e2) {
      e2.preventDefault();
      e2.stopPropagation();
      if (e2.keyCode === KEYCODE.ENTER) {
        _this2.setState({
          visible: !_this2.state.visible
        });
      }
    };
    this.onFilterVisible = function(visible) {
      _this2.setState({
        visible
      });
      if (!visible) {
        var selectedKeys = [].concat(_this2._selectedKeys);
        _this2.setState({
          selectedKeysChangedByInner: true,
          selectedKeys
        });
      }
    };
    this.onFilterSelect = function(selectedKeys) {
      _this2.setState({
        visible: true,
        selectedKeysChangedByInner: true,
        selectedKeys
      });
    };
    this.onFilterConfirm = function() {
      var selectedKeys = _this2.state.selectedKeys;
      var filterParams = {}, dataIndex = _this2.props.dataIndex;
      filterParams[dataIndex] = {
        visible: false,
        selectedKeys
      };
      _this2._selectedKeys = [].concat(selectedKeys);
      _this2.setState({
        visible: false,
        selectedKeysChangedByInner: true
      });
      _this2.props.onFilter(filterParams);
    };
    this.onFilterClear = function() {
      var filterParams = {}, dataIndex = _this2.props.dataIndex;
      filterParams[dataIndex] = {
        visible: false,
        selectedKeys: []
      };
      _this2._selectedKeys = [];
      _this2.setState({
        selectedKeys: [],
        visible: false,
        selectedKeysChangedByInner: true
      });
      _this2.props.onFilter(filterParams);
    };
  }, _temp$h);
  Filter.displayName = "Filter";
  const FilterComponent = polyfill(Filter);
  var _class$o, _temp2$7;
  var Sort = (_temp2$7 = _class$o = function(_React$Component) {
    _default$4(Sort2, _React$Component);
    function Sort2() {
      var _temp3, _this2, _ret;
      _default$7(this, Sort2);
      for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
        args[_key] = arguments[_key];
      }
      return _ret = (_temp3 = (_this2 = _default$5(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this2), _this2.handleClick = function() {
        var _this$props = _this2.props, sort = _this$props.sort, dataIndex = _this$props.dataIndex, sortDirections = _this$props.sortDirections;
        var nextSortType = "";
        sortDirections.forEach(function(dir, i) {
          if (sort[dataIndex] === dir) {
            nextSortType = sortDirections.length - 1 > i ? sortDirections[i + 1] : sortDirections[0];
          }
        });
        if (!sort[dataIndex]) {
          nextSortType = sortDirections[0];
        }
        _this2.onSort(dataIndex, nextSortType);
      }, _this2.keydownHandler = function(e2) {
        e2.preventDefault();
        e2.stopPropagation();
        if (e2.keyCode === KEYCODE.ENTER) {
          _this2.handleClick();
        }
      }, _this2.onSort = function(dataIndex, order) {
        var sort = {};
        sort[dataIndex] = order;
        _this2.props.onSort(dataIndex, order, sort);
      }, _temp3), _default$5(_this2, _ret);
    }
    Sort2.prototype.renderSort = function renderSort() {
      var _classnames;
      var _props = this.props, prefix = _props.prefix, sort = _props.sort, sortIcons = _props.sortIcons, className = _props.className, dataIndex = _props.dataIndex, locale = _props.locale, sortDirections = _props.sortDirections, rtl = _props.rtl, sortStatus = sort[dataIndex], map = {
        desc: "descending",
        asc: "ascending"
      };
      var icons = sortDirections.map(function(sortOrder) {
        return sortOrder === "default" ? null : React.createElement(
          "a",
          { key: sortOrder, className: sortStatus === sortOrder ? "current" : "" },
          sortIcons ? sortIcons[sortOrder] : React.createElement(Icon, { rtl, type: map[sortOrder], size: "xs" })
        );
      });
      var cls = classnames((_classnames = {}, _classnames[prefix + "table-sort"] = true, _classnames[className] = className, _classnames));
      return React.createElement(
        "span",
        {
          role: "button",
          tabIndex: "0",
          "aria-label": locale[sortStatus],
          className: cls,
          onClick: this.handleClick.bind(this),
          onKeyDown: this.keydownHandler
        },
        icons
      );
    };
    Sort2.prototype.render = function render2() {
      return this.renderSort();
    };
    return Sort2;
  }(React.Component), _class$o.propTypes = {
    prefix: PropTypes$1.string,
    rtl: PropTypes$1.bool,
    className: PropTypes$1.string,
    sort: PropTypes$1.object,
    sortIcons: PropTypes$1.object,
    onSort: PropTypes$1.func,
    sortDirections: PropTypes$1.arrayOf(PropTypes$1.oneOf(["desc", "asc", "default"])),
    dataIndex: PropTypes$1.string,
    locale: PropTypes$1.object
  }, _class$o.defaultProps = {
    sort: {},
    sortDirections: ["desc", "asc"]
  }, _temp2$7);
  Sort.displayName = "Sort";
  var _class$n, _temp$g;
  var Resize = (_temp$g = _class$n = function(_React$Component) {
    _default$4(Resize2, _React$Component);
    function Resize2() {
      _default$7(this, Resize2);
      var _this2 = _default$5(this, _React$Component.call(this));
      _this2.showResizeProxy = function() {
        _this2.props.resizeProxyDomRef.style.cssText = "display:block;left:" + _this2.startLeft + "px;";
      };
      _this2.moveResizeProxy = function() {
        var moveLeft = _this2.startLeft + _this2.changedPageX;
        _this2.props.resizeProxyDomRef.style.cssText = "left:" + moveLeft + "px;display:block;";
      };
      _this2.resetResizeProxy = function() {
        if (_this2.asyncResizeFlag) {
          _this2.props.onChange(_this2.props.dataIndex, _this2.changedPageX);
        }
        _this2.changedPageX = 0;
        _this2.tRight = 0;
        _this2.asyncResizeFlag = false;
        _this2.props.resizeProxyDomRef.style.cssText = "display:none;";
      };
      _this2.movingLimit = function() {
        var moveLeft = _this2.startLeft + _this2.changedPageX;
        if (moveLeft > _this2.tRight) {
          moveLeft = _this2.tRight;
          _this2.changedPageX = _this2.tRight - _this2.startLeft;
        }
        if (moveLeft - _this2.cellLeft < _this2.cellMinWidth) {
          _this2.changedPageX = _this2.cellLeft + _this2.cellMinWidth - _this2.startLeft;
        }
        if (moveLeft < 0) {
          _this2.changedPageX = 0 - _this2.startLeft;
        }
        if (_this2.props.col.width + _this2.changedPageX < _this2.cellMinWidth) {
          _this2.changedPageX = _this2.cellMinWidth - _this2.props.col.width;
        }
      };
      _this2.onMouseDown = function(e2) {
        var _this$props$tableEl$g = _this2.props.tableEl.getBoundingClientRect(), tableLeft = _this$props$tableEl$g.left, tableWidth = _this$props$tableEl$g.width;
        if (!_this2.props.cellDomRef || !_this2.props.cellDomRef.current) {
          return;
        }
        var _this$props$cellDomRe = _this2.props.cellDomRef.current.getBoundingClientRect(), cellDomLeft = _this$props$cellDomRe.left;
        _this2.lastPageX = e2.pageX;
        _this2.tLeft = tableLeft;
        _this2.tRight = tableWidth;
        _this2.startLeft = e2.pageX - tableLeft;
        _this2.cellLeft = cellDomLeft - tableLeft;
        if (_this2.props.asyncResizable)
          _this2.showResizeProxy();
        events.on(document, "mousemove", _this2.onMouseMove);
        events.on(document, "mouseup", _this2.onMouseUp);
        _this2.unSelect();
      };
      _this2.onMouseMove = function(e2) {
        var pageX = e2.pageX;
        _this2.changedPageX = pageX - _this2.lastPageX;
        if (_this2.props.rtl) {
          _this2.changedPageX = -_this2.changedPageX;
        }
        if (_this2.props.hasLock) {
          if (!_this2.props.asyncResizable) {
            _this2.cellLeft = _this2.props.cellDomRef.getBoundingClientRect().left - _this2.tLeft;
          }
        }
        _this2.movingLimit();
        if (_this2.props.asyncResizable) {
          _this2.asyncResizeFlag = true;
          _this2.moveResizeProxy();
          return;
        }
        _this2.props.onChange(_this2.props.dataIndex, _this2.changedPageX);
        _this2.lastPageX = pageX;
      };
      _this2.onMouseUp = function() {
        if (_this2.props.asyncResizable) {
          _this2.resetResizeProxy();
        }
        _this2.startLeft = 0;
        _this2.destory();
      };
      _this2.cellMinWidth = 40;
      _this2.lastPageX = 0;
      _this2.tRight = 0;
      _this2.tLeft = 0;
      _this2.cellLeft = 0;
      _this2.startLeft = 0;
      _this2.changedPageX = 0;
      _this2.asyncResizeFlag = false;
      return _this2;
    }
    Resize2.prototype.componentWillUnmount = function componentWillUnmount() {
      this.destory();
    };
    Resize2.prototype.destory = function destory2() {
      events.off(document, "mousemove", this.onMouseMove);
      events.off(document, "mouseup", this.onMouseUp);
      this.select();
    };
    Resize2.prototype.unSelect = function unSelect() {
      dom.setStyle(document.body, {
        userSelect: "none",
        cursor: "ew-resize"
      });
      document.body.setAttribute("unselectable", "on");
    };
    Resize2.prototype.select = function select() {
      dom.setStyle(document.body, {
        userSelect: "",
        cursor: ""
      });
      document.body.removeAttribute("unselectable");
    };
    Resize2.prototype.render = function render2() {
      var prefix = this.props.prefix;
      return React.createElement("a", { className: prefix + "table-resize-handler", onMouseDown: this.onMouseDown });
    };
    return Resize2;
  }(React.Component), _class$n.propTypes = {
    prefix: PropTypes$1.string,
    rtl: PropTypes$1.bool,
    onChange: PropTypes$1.func,
    dataIndex: PropTypes$1.string,
    tableEl: PropTypes$1.any,
    resizeProxyDomRef: PropTypes$1.any,
    cellDomRef: PropTypes$1.any,
    col: PropTypes$1.any,
    hasLock: PropTypes$1.bool,
    asyncResizable: PropTypes$1.bool
  }, _class$n.defaultProps = {
    onChange: function onChange5() {
    }
  }, _temp$g);
  Resize.displayName = "Resize";
  const ResizeComponent = Resize;
  var _class$m, _temp$f;
  var noop$4 = function noop9() {
  };
  var Header = (_temp$f = _class$m = function(_React$Component) {
    _default$4(Header2, _React$Component);
    function Header2() {
      _default$7(this, Header2);
      var _this2 = _default$5(this, _React$Component.call(this));
      _this2.checkHasLock = function() {
        var columns = _this2.props.columns;
        var hasLock = false;
        for (var i = 0; i < columns.length; i++) {
          var cols = columns[i];
          for (var j = 0; j < cols.length; j++) {
            var col = cols[j];
            if (col.lock) {
              hasLock = true;
              break;
            }
          }
          if (hasLock) {
            break;
          }
        }
        _this2.hasLock = hasLock;
      };
      _this2.getCellRef = function(i, j, cell5) {
        _this2.props.headerCellRef(i, j, cell5);
        var columns = _this2.props.columns;
        var columnProps = columns[i] && columns[i][j];
        if (columnProps && columnProps.ref && typeof columnProps.ref === "function") {
          columnProps.ref(cell5);
        }
      };
      _this2.createCellDomRef = function(i, j) {
        var cellRefKey = _this2.getCellDomRefKey(i, j);
        if (!_this2[cellRefKey]) {
          _this2[cellRefKey] = {};
        }
        return _this2[cellRefKey];
      };
      _this2.getCellDomRef = function(cellRef, cellDom) {
        if (!cellRef) {
          return;
        }
        cellRef.current = cellDom;
      };
      _this2.getCellDomRefKey = function(i, j) {
        return "header_cell_" + i + "_" + j;
      };
      _this2.onSort = function(dataIndex, order, sort) {
        _this2.props.onSort(dataIndex, order, sort);
      };
      _this2.hasLock = false;
      return _this2;
    }
    Header2.prototype.render = function render2() {
      var _this2 = this;
      var _props = this.props, prefix = _props.prefix, className = _props.className, children = _props.children, Tag = _props.component;
      _props.colGroup;
      var columns = _props.columns, locale = _props.locale, filterParams = _props.filterParams, onFilter2 = _props.onFilter, components = _props.components;
      _props.affixRef;
      _props.headerCellRef;
      _props.onSort;
      var sort = _props.sort, sortIcons = _props.sortIcons, onResizeChange = _props.onResizeChange, pure = _props.pure, rtl = _props.rtl;
      _props.tableWidth;
      var tableEl = _props.tableEl, resizeProxyDomRef = _props.resizeProxyDomRef, others = _default$3(_props, ["prefix", "className", "children", "component", "colGroup", "columns", "locale", "filterParams", "onFilter", "components", "affixRef", "headerCellRef", "onSort", "sort", "sortIcons", "onResizeChange", "pure", "rtl", "tableWidth", "tableEl", "resizeProxyDomRef"]);
      this.checkHasLock();
      var _components$Cell = components.Cell, Cell$12 = _components$Cell === void 0 ? Cell : _components$Cell, _components$Filter = components.Filter, Filter2 = _components$Filter === void 0 ? FilterComponent : _components$Filter, _components$Sort = components.Sort, Sort$1 = _components$Sort === void 0 ? Sort : _components$Sort, _components$Resize = components.Resize, Resize2 = _components$Resize === void 0 ? ResizeComponent : _components$Resize;
      var rowSpan = columns.length;
      var header = columns.map(function(cols, index2) {
        var col = cols.map(function(col2, j) {
          var _classnames;
          var cellRef = _this2.createCellDomRef(index2, j);
          var title = col2.title, colSpan = col2.colSpan, sortable = col2.sortable, sortDirections = col2.sortDirections, resizable = col2.resizable, asyncResizable = col2.asyncResizable, dataIndex = col2.dataIndex, filters = col2.filters, filterMode = col2.filterMode, filterMenuProps = col2.filterMenuProps, filterProps = col2.filterProps;
          col2.width;
          var align = col2.align, alignHeader = col2.alignHeader, className2 = col2.className;
          col2.__normalized;
          col2.lock;
          col2.cellStyle;
          var wordBreak = col2.wordBreak, others2 = _default$3(col2, ["title", "colSpan", "sortable", "sortDirections", "resizable", "asyncResizable", "dataIndex", "filters", "filterMode", "filterMenuProps", "filterProps", "width", "align", "alignHeader", "className", "__normalized", "lock", "cellStyle", "wordBreak"]);
          var order = sort ? sort[dataIndex] : "";
          className2 = classnames((_classnames = {}, _classnames[prefix + "table-header-node"] = true, _classnames[prefix + "table-header-resizable"] = resizable || asyncResizable, _classnames[prefix + "table-word-break-" + wordBreak] = !!wordBreak, _classnames[prefix + "table-header-sort-" + order] = sortable && order, _classnames[className2] = className2, _classnames));
          var attrs = {}, sortElement = void 0, filterElement = void 0, resizeElement = void 0;
          attrs.colSpan = colSpan;
          if (!(col2.children && col2.children.length)) {
            if (sortable) {
              sortElement = React.createElement(Sort$1, {
                prefix,
                className: prefix + "table-header-icon",
                dataIndex,
                onSort: _this2.onSort,
                sortDirections,
                sortIcons,
                sort,
                rtl,
                locale
              });
            }
            if (asyncResizable || resizable) {
              resizeElement = React.createElement(Resize2, {
                asyncResizable,
                hasLock: _this2.hasLock,
                col: col2,
                tableEl,
                prefix,
                rtl,
                dataIndex,
                resizeProxyDomRef,
                cellDomRef: cellRef,
                onChange: onResizeChange
              });
            }
            if (filters) {
              filterElement = filters.length ? React.createElement(Filter2, {
                dataIndex,
                className: prefix + "table-header-icon",
                filters,
                prefix,
                locale,
                rtl,
                filterParams,
                filterMode,
                filterMenuProps,
                filterProps,
                onFilter: onFilter2
              }) : null;
            }
            attrs.rowSpan = rowSpan - index2;
          }
          if (+attrs.colSpan === 0) {
            return null;
          }
          return React.createElement(
            Cell$12,
            _default$8({}, others2, attrs, {
              key: j,
              prefix,
              pure,
              rtl,
              cell: title,
              component: "th",
              align: alignHeader ? alignHeader : align,
              className: className2,
              ref: _this2.getCellRef.bind(_this2, index2, j),
              getCellDomRef: _this2.getCellDomRef.bind(_this2, cellRef),
              type: "header"
            }),
            sortElement,
            filterElement,
            resizeElement
          );
        });
        return React.createElement(
          "tr",
          { key: index2 },
          col
        );
      });
      return React.createElement(
        Tag,
        _default$8({ className }, others),
        header,
        children
      );
    };
    return Header2;
  }(React.Component), _class$m.propTypes = {
    children: PropTypes$1.any,
    prefix: PropTypes$1.string,
    pure: PropTypes$1.bool,
    className: PropTypes$1.string,
    component: PropTypes$1.string,
    columns: PropTypes$1.array,
    colGroup: PropTypes$1.object,
    headerCellRef: PropTypes$1.func,
    locale: PropTypes$1.object,
    filterParams: PropTypes$1.object,
    onFilter: PropTypes$1.func,
    components: PropTypes$1.object,
    sort: PropTypes$1.object,
    sortIcons: PropTypes$1.object,
    onSort: PropTypes$1.func,
    onResizeChange: PropTypes$1.func,
    tableWidth: PropTypes$1.number,
    tableEl: PropTypes$1.any
  }, _class$m.defaultProps = {
    component: "thead",
    columns: [],
    headerCellRef: noop$4,
    onFilter: noop$4,
    components: {},
    onSort: noop$4,
    onResizeChange: noop$4
  }, _temp$f);
  Header.displayName = "Header";
  var _class$l, _temp$e;
  var Wrapper = (_temp$e = _class$l = function(_Component) {
    _default$4(Wrapper2, _Component);
    function Wrapper2() {
      _default$7(this, Wrapper2);
      return _default$5(this, _Component.apply(this, arguments));
    }
    Wrapper2.prototype.render = function render2() {
      var _props = this.props, colGroup = _props.colGroup, children = _props.children, tableWidth = _props.tableWidth, Tag = _props.component;
      return React.createElement(
        Tag,
        { role: "table", style: { width: tableWidth } },
        colGroup,
        children
      );
    };
    return Wrapper2;
  }(React.Component), _class$l.propTypes = {
    tableWidth: PropTypes$1.number
  }, _temp$e);
  Wrapper.displayName = "Wrapper";
  Wrapper.defaultProps = {
    component: "table"
  };
  Wrapper.propTypes = {
    children: PropTypes$1.any,
    prefix: PropTypes$1.string,
    colGroup: PropTypes$1.any,
    component: PropTypes$1.string
  };
  var _class$k, _temp$d;
  var Column = (_temp$d = _class$k = function(_React$Component) {
    _default$4(Column2, _React$Component);
    function Column2() {
      _default$7(this, Column2);
      return _default$5(this, _React$Component.apply(this, arguments));
    }
    Column2.prototype.render = function render2() {
      return null;
    };
    return Column2;
  }(React.Component), _class$k.propTypes = {
    /**
     * 指定列对应的字段,支持`a.b`形式的快速取值
     */
    dataIndex: PropTypes$1.string,
    /**
     * 行渲染的逻辑
     * value, rowIndex, record, context四个属性只可读不可被更改
     * Function(value, index, record) => Element
     */
    cell: PropTypes$1.oneOfType([PropTypes$1.element, PropTypes$1.node, PropTypes$1.func]),
    /**
     * 表头显示的内容
     */
    title: PropTypes$1.oneOfType([PropTypes$1.element, PropTypes$1.node, PropTypes$1.func]),
    /**
     * 写到 header 单元格上的title属性
     */
    htmlTitle: PropTypes$1.string,
    /**
     * 是否支持排序
     */
    sortable: PropTypes$1.bool,
    /**
     * 排序的方向。
     * 设置 ['desc', 'asc'],表示降序、升序
     * 设置 ['desc', 'asc', 'default'],表示表示降序、升序、不排序
     * @version 1.23
     */
    sortDirections: PropTypes$1.arrayOf(PropTypes$1.oneOf(["desc", "asc", "default"])),
    /**
     * 列宽,注意在锁列的情况下一定需要配置宽度
     */
    width: PropTypes$1.oneOfType([PropTypes$1.number, PropTypes$1.string]),
    /**
     * 单元格的对齐方式
     */
    align: PropTypes$1.oneOf(["left", "center", "right"]),
    /**
     * 单元格标题的对齐方式, 不配置默认读取align值
     */
    alignHeader: PropTypes$1.oneOf(["left", "center", "right"]),
    /**
     * 生成标题过滤的菜单, 格式为`[{label:'xxx', value:'xxx'}]`
     */
    filters: PropTypes$1.arrayOf(PropTypes$1.shape({
      label: PropTypes$1.string,
      value: PropTypes$1.oneOfType([PropTypes$1.node, PropTypes$1.string])
    })),
    /**
     * 过滤的模式是单选还是多选
     */
    filterMode: PropTypes$1.oneOf(["single", "multiple"]),
    /**
     * filter 模式下传递给 Menu 菜单的属性, 默认继承 `Menu` 组件的API
     * @property {Boolean} subMenuSelectable 默认为`false` subMenu是否可选择
     * @property {Boolean} isSelectIconRight 默认为`false` 是否将选中图标居右。注意:SubMenu 上的选中图标一直居左,不受此API控制
     */
    filterMenuProps: PropTypes$1.object,
    filterProps: PropTypes$1.object,
    /**
     * 是否支持锁列,可选值为`left`,`right`, `true`
     */
    lock: PropTypes$1.oneOfType([PropTypes$1.bool, PropTypes$1.string]),
    /**
     * 是否支持列宽调整, 当该值设为true,table的布局方式会修改为fixed.
     */
    resizable: PropTypes$1.bool,
    /**
     * (推荐使用)是否支持异步列宽调整, 当该值设为true,table的布局方式会修改为fixed.
     * @version 1.24
     */
    asyncResizable: PropTypes$1.bool,
    /**
     * header cell 横跨的格数,设置为0表示不出现此 th
     */
    colSpan: PropTypes$1.number,
    /**
     * 设置该列单元格的word-break样式,对于id类、中文类适合用all,对于英文句子适合用word
     * @enumdesc all, word
     * @default all
     * @version 1.23
     */
    wordBreak: PropTypes$1.oneOf(["all", "word"])
  }, _class$k.contextTypes = {
    parent: PropTypes$1.any
  }, _class$k.defaultProps = {
    cell: function cell2(value) {
      return value;
    },
    filterMode: "multiple",
    filterMenuProps: {
      subMenuSelectable: false
    },
    filterProps: {},
    resizable: false,
    asyncResizable: false
  }, _class$k._typeMark = "column", _temp$d);
  Column.displayName = "Column";
  var _class$j, _temp$c;
  var ColumnGroup = (_temp$c = _class$j = function(_React$Component) {
    _default$4(ColumnGroup2, _React$Component);
    function ColumnGroup2() {
      _default$7(this, ColumnGroup2);
      return _default$5(this, _React$Component.apply(this, arguments));
    }
    ColumnGroup2.prototype.getChildContext = function getChildContext() {
      return {
        parent: this
      };
    };
    ColumnGroup2.prototype.render = function render2() {
      return null;
    };
    return ColumnGroup2;
  }(React.Component), _class$j.propTypes = {
    /**
     * 表头显示的内容
     */
    title: PropTypes$1.oneOfType([PropTypes$1.element, PropTypes$1.node, PropTypes$1.func])
  }, _class$j.childContextTypes = {
    parent: PropTypes$1.any
  }, _class$j.defaultProps = {
    title: "column-group"
  }, _class$j._typeMark = "columnGroup", _temp$c);
  ColumnGroup.displayName = "ColumnGroup";
  var _class$i, _temp$b;
  var Children = React.Children, noop$3 = function noop10() {
  };
  var Table$2 = (_temp$b = _class$i = function(_React$Component) {
    _default$4(Table2, _React$Component);
    function Table2(props, context) {
      _default$7(this, Table2);
      var _this2 = _default$5(this, _React$Component.call(this, props, context));
      _this2.state = {
        sort: _this2.props.sort || {}
      };
      _this2.onSort = function(dataIndex, order, sort) {
        if (typeof _this2.props.sort === "undefined") {
          _this2.setState({
            sort
          }, function() {
            _this2.props.onSort(dataIndex, order, sort);
          });
        } else {
          _this2.props.onSort(dataIndex, order, sort);
        }
      };
      _this2.onFilter = function(filterParams) {
        _this2.props.onFilter(filterParams);
      };
      _this2.onResizeChange = function(dataIndex, value) {
        _this2.props.onResizeChange(dataIndex, value);
      };
      _this2.getResizeProxyDomRef = function(resizeProxyDom) {
        if (!resizeProxyDom) {
          return _this2.resizeProxyDomRef;
        }
        _this2.resizeProxyDomRef = resizeProxyDom;
      };
      _this2.getWrapperRef = function(wrapper2) {
        if (!wrapper2) {
          return _this2.wrapper;
        }
        _this2.wrapper = wrapper2;
      };
      _this2.getAffixRef = function(affixRef) {
        if (!affixRef) {
          return _this2.affixRef;
        }
        _this2.affixRef = affixRef;
      };
      _this2.getHeaderCellRef = function(i, j, cell5) {
        var cellRef = "header_cell_" + i + "_" + j;
        if (!cell5) {
          return _this2[cellRef];
        }
        _this2[cellRef] = cell5;
      };
      _this2.getRowRef = function(i, row) {
        var rowRef = "row_" + i;
        if (!row) {
          return _this2[rowRef];
        }
        _this2[rowRef] = row;
      };
      _this2.getCellRef = function(i, j, cell5) {
        var cellRef = "cell_" + i + "_" + j;
        if (!cell5) {
          return _this2[cellRef];
        }
        _this2[cellRef] = cell5;
      };
      _this2.handleColHoverClass = function(rowIndex, colIndex, isAdd) {
        var crossline = _this2.props.crossline;
        var funcName = isAdd ? "addClass" : "removeClass";
        if (crossline) {
          _this2.props.entireDataSource.forEach(function(val, index2) {
            try {
              var currentCol = ReactDOM.findDOMNode(_this2.getCellRef(index2, colIndex));
              currentCol && dom[funcName](currentCol, "hovered");
            } catch (error) {
              return null;
            }
          });
        }
      };
      _this2.findEventTarget = function(e2) {
        var prefix = _this2.props.prefix;
        var target = dom.getClosest(e2.target, "td." + prefix + "table-cell");
        var colIndex = target && target.getAttribute("data-next-table-col");
        var rowIndex = target && target.getAttribute("data-next-table-row");
        try {
          var currentCol = ReactDOM.findDOMNode(_this2.getCellRef(rowIndex, colIndex));
          if (currentCol === target) {
            return {
              colIndex,
              rowIndex
            };
          }
        } catch (error) {
          return {};
        }
        return {};
      };
      _this2.onBodyMouseOver = function(e2) {
        var crossline = _this2.props.crossline;
        if (!crossline) {
          return;
        }
        var _this$findEventTarget = _this2.findEventTarget(e2), colIndex = _this$findEventTarget.colIndex, rowIndex = _this$findEventTarget.rowIndex;
        if (!colIndex || !rowIndex) {
          return;
        }
        _this2.handleColHoverClass(rowIndex, colIndex, true);
        _this2.colIndex = colIndex;
        _this2.rowIndex = rowIndex;
      };
      _this2.onBodyMouseOut = function(e2) {
        var crossline = _this2.props.crossline;
        if (!crossline) {
          return;
        }
        var _this$findEventTarget2 = _this2.findEventTarget(e2), colIndex = _this$findEventTarget2.colIndex, rowIndex = _this$findEventTarget2.rowIndex;
        if (!colIndex || !rowIndex) {
          return;
        }
        _this2.handleColHoverClass(_this2.rowIndex, _this2.colIndex, false);
        _this2.colIndex = -1;
        _this2.rowIndex = -1;
      };
      _this2.addColIndex = function(children) {
        var start = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0;
        children.forEach(function(child, i) {
          child.__colIndex = start + i;
        });
      };
      _this2.getTableEl = function(ref) {
        _this2.tableEl = ref;
      };
      var _this$context = _this2.context, getTableInstance = _this$context.getTableInstance, getTableInstanceForVirtual = _this$context.getTableInstanceForVirtual, getTableInstanceForFixed = _this$context.getTableInstanceForFixed, getTableInstanceForExpand = _this$context.getTableInstanceForExpand;
      getTableInstance && getTableInstance(props.lockType, _this2);
      getTableInstanceForFixed && getTableInstanceForFixed(props.lockType, _this2);
      getTableInstanceForVirtual && getTableInstanceForVirtual(props.lockType, _this2);
      getTableInstanceForExpand && getTableInstanceForExpand(_this2);
      _this2.notRenderCellIndex = [];
      return _this2;
    }
    Table2.prototype.getChildContext = function getChildContext() {
      return {
        notRenderCellIndex: this.notRenderCellIndex || [],
        lockType: this.props.lockType
      };
    };
    Table2.getDerivedStateFromProps = function getDerivedStateFromProps(nextProps) {
      var state = {};
      if (typeof nextProps.sort !== "undefined") {
        state.sort = nextProps.sort;
      }
      return state;
    };
    Table2.prototype.componentDidMount = function componentDidMount() {
      this.notRenderCellIndex = [];
    };
    Table2.prototype.shouldComponentUpdate = function shouldComponentUpdate(nextProps, nextState, nextContext) {
      if (nextProps.pure) {
        var isEqual = shallowElementEquals$1(nextProps, this.props) && obj.shallowEqual(nextState, this.state) && obj.shallowEqual(nextContext, this.context);
        return !isEqual;
      }
      return true;
    };
    Table2.prototype.componentDidUpdate = function componentDidUpdate() {
      this.notRenderCellIndex = [];
    };
    Table2.prototype.normalizeChildrenState = function normalizeChildrenState(props) {
      var columns = props.columns;
      if (props.children) {
        columns = this.normalizeChildren(props);
      }
      return this.fetchInfoFromBinaryChildren(columns);
    };
    Table2.prototype.normalizeChildren = function normalizeChildren(props) {
      var columns = props.columns;
      var getChildren = function getChildren2(children) {
        var ret = [];
        Children.forEach(children, function(child) {
          if (child) {
            var _props = _default$8({}, child.props);
            if (child.ref) {
              _props.ref = child.ref;
            }
            if (!(child && ["function", "object"].indexOf(_default$6(child.type)) > -1 && (child.type._typeMark === "column" || child.type._typeMark === "columnGroup"))) {
              log.warning("Use <Table.Column/>, <Table.ColumnGroup/> as child.");
            }
            ret.push(_props);
            if (child.props.children) {
              _props.children = getChildren2(child.props.children);
            }
          }
        });
        return ret;
      };
      if (props.children) {
        columns = getChildren(props.children);
      }
      return columns;
    };
    Table2.prototype.fetchInfoFromBinaryChildren = function fetchInfoFromBinaryChildren(children) {
      var hasGroupHeader = false;
      var flatChildren = [], groupChildren = [], getChildren = function getChildren2() {
        var propsChildren = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [];
        var level = arguments[1];
        groupChildren[level] = groupChildren[level] || [];
        propsChildren.forEach(function(child) {
          if (child.children) {
            hasGroupHeader = true;
            getChildren2(child.children, level + 1);
          } else {
            flatChildren.push(child);
          }
          groupChildren[level].push(child);
        });
      }, getColSpan = function getColSpan2(children2, colSpan) {
        colSpan = colSpan || 0;
        children2.forEach(function(child) {
          if (child.children) {
            colSpan = getColSpan2(child.children, colSpan);
          } else {
            colSpan += 1;
          }
        });
        return colSpan;
      };
      getChildren(children, 0);
      groupChildren.forEach(function(groupChild, i) {
        groupChild.forEach(function(child, j) {
          var colSpan = void 0;
          var children2 = child.children;
          if (children2) {
            colSpan = getColSpan(children2);
            child.colSpan = colSpan;
            groupChildren[i][j] = child;
          }
        });
      });
      var _props2 = this.props, lockType = _props2.lockType, lengths = _props2.lengths;
      var start = lockType === "right" ? lengths.origin - lengths.right : 0;
      this.addColIndex(flatChildren, start);
      return {
        flatChildren,
        groupChildren,
        hasGroupHeader
      };
    };
    Table2.prototype.renderColGroup = function renderColGroup(flatChildren) {
      var cols = flatChildren.map(function(col, index2) {
        var width = col.width;
        var style = {};
        if (width) {
          style = {
            width
          };
        }
        return React.createElement("col", { style, key: index2 });
      });
      return React.createElement(
        "colgroup",
        { key: "table-colgroup" },
        cols
      );
    };
    Table2.prototype.renderTable = function renderTable(groupChildren, flatChildren) {
      if (flatChildren.length || !flatChildren.length && !this.props.lockType) {
        var _props3 = this.props, hasHeader = _props3.hasHeader, components = _props3.components, prefix = _props3.prefix, wrapperContent = _props3.wrapperContent, filterParams = _props3.filterParams, locale = _props3.locale, dataSource = _props3.dataSource, emptyContent = _props3.emptyContent, loading = _props3.loading, primaryKey = _props3.primaryKey, cellProps = _props3.cellProps, rowProps = _props3.rowProps, onRowClick = _props3.onRowClick, onRowMouseEnter = _props3.onRowMouseEnter, onRowMouseLeave = _props3.onRowMouseLeave, expandedIndexSimulate = _props3.expandedIndexSimulate, pure = _props3.pure, rtl = _props3.rtl, crossline = _props3.crossline, sortIcons = _props3.sortIcons, tableWidth = _props3.tableWidth;
        var sort = this.state.sort;
        var _components$Header = components.Header, Header$1 = _components$Header === void 0 ? Header : _components$Header, _components$Wrapper = components.Wrapper, Wrapper$1 = _components$Wrapper === void 0 ? Wrapper : _components$Wrapper, _components$Body = components.Body, Body$1 = _components$Body === void 0 ? Body : _components$Body;
        var colGroup = this.renderColGroup(flatChildren);
        return [React.createElement("div", {
          key: prefix + "table-column-resize-proxy",
          ref: this.getResizeProxyDomRef,
          className: prefix + "table-column-resize-proxy"
        }), React.createElement(
          Wrapper$1,
          {
            key: prefix + "table-wrapper",
            colGroup,
            ref: this.getWrapperRef,
            prefix,
            tableWidth
          },
          hasHeader ? React.createElement(Header$1, {
            prefix,
            rtl,
            pure,
            affixRef: this.getAffixRef,
            colGroup,
            className: prefix + "table-header",
            filterParams,
            tableEl: this.tableEl,
            columns: groupChildren,
            locale,
            headerCellRef: this.getHeaderCellRef,
            components,
            onFilter: this.onFilter,
            sort,
            onResizeChange: this.onResizeChange,
            onSort: this.onSort,
            sortIcons,
            tableWidth,
            resizeProxyDomRef: this.resizeProxyDomRef
          }) : null,
          React.createElement(Body$1, {
            prefix,
            rtl,
            pure,
            crossline,
            colGroup,
            className: prefix + "table-body",
            components,
            loading,
            emptyContent,
            getCellProps: cellProps,
            primaryKey,
            getRowProps: rowProps,
            columns: flatChildren,
            rowRef: this.getRowRef,
            cellRef: this.getCellRef,
            onRowClick,
            expandedIndexSimulate,
            tableEl: this.tableEl,
            onRowMouseEnter,
            onRowMouseLeave,
            dataSource,
            locale,
            onBodyMouseOver: this.onBodyMouseOver,
            onBodyMouseOut: this.onBodyMouseOut,
            tableWidth
          }),
          wrapperContent
        )];
      } else {
        return null;
      }
    };
    Table2.prototype.render = function render2() {
      var _classnames, _classnames2;
      var ret = this.normalizeChildrenState(this.props);
      this.groupChildren = ret.groupChildren;
      this.flatChildren = ret.flatChildren;
      var table = this.renderTable(ret.groupChildren, ret.flatChildren), _props4 = this.props, className = _props4.className, style = _props4.style, hasBorder = _props4.hasBorder, isZebra = _props4.isZebra, loading = _props4.loading, size2 = _props4.size, hasHeader = _props4.hasHeader, prefix = _props4.prefix;
      _props4.dataSource;
      _props4.entireDataSource;
      _props4.onSort;
      _props4.onResizeChange;
      _props4.onRowClick;
      _props4.onRowMouseEnter;
      _props4.onRowMouseLeave;
      _props4.onFilter;
      _props4.rowProps;
      _props4.cellProps;
      _props4.scrollToRow;
      _props4.primaryKey;
      _props4.components;
      _props4.wrapperContent;
      _props4.lockType;
      _props4.locale;
      _props4.expandedIndexSimulate;
      _props4.refs;
      _props4.pure;
      var rtl = _props4.rtl;
      _props4.emptyContent;
      _props4.filterParams;
      _props4.columns;
      _props4.sortIcons;
      var _props4$loadingCompon = _props4.loadingComponent, LoadingComponent = _props4$loadingCompon === void 0 ? Loading$1 : _props4$loadingCompon, tableLayout = _props4.tableLayout;
      _props4.tableWidth;
      var ref = _props4.ref, others = _default$3(_props4, ["className", "style", "hasBorder", "isZebra", "loading", "size", "hasHeader", "prefix", "dataSource", "entireDataSource", "onSort", "onResizeChange", "onRowClick", "onRowMouseEnter", "onRowMouseLeave", "onFilter", "rowProps", "cellProps", "scrollToRow", "primaryKey", "components", "wrapperContent", "lockType", "locale", "expandedIndexSimulate", "refs", "pure", "rtl", "emptyContent", "filterParams", "columns", "sortIcons", "loadingComponent", "tableLayout", "tableWidth", "ref"]), cls = classnames((_classnames = {}, _classnames[prefix + "table"] = true, _classnames[prefix + "table-" + size2] = size2, _classnames[prefix + "table-layout-" + tableLayout] = tableLayout, _classnames[prefix + "table-loading"] = loading, _classnames["only-bottom-border"] = !hasBorder, _classnames["no-header"] = !hasHeader, _classnames.zebra = isZebra, _classnames[className] = className, _classnames));
      if (rtl) {
        others.dir = "rtl";
      }
      var loadingcls = classnames((_classnames2 = {}, _classnames2[prefix + "table-loading-content"] = true, _classnames2));
      return React.createElement(
        "div",
        _default$8({
          className: cls,
          style,
          ref: ref || this.getTableEl
        }, obj.pickOthers(Object.keys(Table2.propTypes), others)),
        table,
        loading ? React.createElement(LoadingComponent, { className: loadingcls }) : null
      );
    };
    return Table2;
  }(React.Component), _class$i.Column = Column, _class$i.ColumnGroup = ColumnGroup, _class$i.Header = Header, _class$i.Body = Body, _class$i.Wrapper = Wrapper, _class$i.Row = Row, _class$i.Cell = Cell, _class$i.Filter = FilterComponent, _class$i.Sort = Sort, _class$i.propTypes = _default$8({}, ConfigProvider$1.propTypes, {
    /**
     * 样式类名的品牌前缀
     */
    prefix: PropTypes$1.string,
    pure: PropTypes$1.bool,
    rtl: PropTypes$1.bool,
    /**
     * 表格元素的 table-layout 属性,设为 fixed 表示内容不会影响列的布局
     */
    tableLayout: PropTypes$1.oneOf(["fixed", "auto"]),
    /**
     * 表格的总长度,可以这么用:设置表格总长度 、设置部分列的宽度,这样表格会按照剩余空间大小,自动其他列分配宽度
     */
    tableWidth: PropTypes$1.number,
    /**
     * 自定义类名
     */
    className: PropTypes$1.string,
    /**
     * 自定义内联样式
     */
    style: PropTypes$1.object,
    /**
     * 尺寸 small为紧凑模式
     */
    size: PropTypes$1.oneOf(["small", "medium"]),
    /**
     * 表格展示的数据源
     */
    dataSource: PropTypes$1.array,
    entireDataSource: PropTypes$1.array,
    /**
     * 点击表格每一行触发的事件
     * @param {Object} record 该行所对应的数据
     * @param {Number} index 该行所对应的序列
     * @param {Event} e DOM事件对象
     */
    onRowClick: PropTypes$1.func,
    /**
     * 悬浮在表格每一行的时候触发的事件
     * @param {Object} record 该行所对应的数据
     * @param {Number} index 该行所对应的序列
     * @param {Event} e DOM事件对象
     */
    onRowMouseEnter: PropTypes$1.func,
    /**
     * 离开表格每一行的时候触发的事件
     * @param {Object} record 该行所对应的数据
     * @param {Number} index 该行所对应的序列
     * @param {Event} e DOM事件对象
     */
    onRowMouseLeave: PropTypes$1.func,
    /**
     * 点击列排序触发的事件
     * @param {String} dataIndex 指定的排序的字段
     * @param {String} order 排序对应的顺序, 有`desc`和`asc`两种
     */
    onSort: PropTypes$1.func,
    /**
     * 点击过滤确认按钮触发的事件
     * @param {Object} filterParams 过滤的字段信息
     */
    onFilter: PropTypes$1.func,
    /**
     * 重设列尺寸的时候触发的事件
     * @param {String} dataIndex 指定重设的字段
     * @param {Number} value 列宽变动的数值
     */
    onResizeChange: PropTypes$1.func,
    /**
     * 设置每一行的属性,如果返回值和其他针对行操作的属性冲突则无效。
     * @param {Object} record 该行所对应的数据
     * @param {Number} index 该行所对应的序列
     * @returns {Object} 需要设置的行属性
     */
    rowProps: PropTypes$1.func,
    /**
     * 设置单元格的属性,通过该属性可以进行合并单元格
     * @param {Number} rowIndex 该行所对应的序列
     * @param {Number} colIndex 该列所对应的序列
     * @param {String} dataIndex 该列所对应的字段名称
     * @param {Object} record 该行对应的记录
     * @returns {Object} 返回td元素的所支持的属性对象
     */
    cellProps: PropTypes$1.func,
    /**
     * 表格是否具有边框
     */
    hasBorder: PropTypes$1.bool,
    /**
     * 表格是否具有头部
     */
    hasHeader: PropTypes$1.bool,
    /**
     * 表格是否是斑马线
     */
    isZebra: PropTypes$1.bool,
    /**
     * 表格是否在加载中
     */
    loading: PropTypes$1.bool,
    /**
     * 自定义 Loading 组件
     * 请务必传递 props, 使用方式: loadingComponent={props => <Loading {...props}/>}
     * @param {LoadingProps} props 需要透传给组件的参数
     * @return {React.ReactNode} 展示的组件
     */
    loadingComponent: PropTypes$1.func,
    /**
     * 当前过滤的的keys,使用此属性可以控制表格的头部的过滤选项中哪个菜单被选中,格式为 {dataIndex: {selectedKeys:[]}}
     * 示例:
     * 假设要控制dataIndex为id的列的过滤菜单中key为one的菜单项选中
     * `<Table filterParams={{id: {selectedKeys: ['one']}}}/>`
     */
    filterParams: PropTypes$1.object,
    /**
     * 当前排序的字段,使用此属性可以控制表格的字段的排序,格式为{[dataIndex]: 'asc' | 'desc' } , 例如  {id: 'desc'}
     */
    sort: PropTypes$1.object,
    /**
     * 自定义排序按钮,例如上下排布的: `{desc: <Icon style={{top: '6px', left: '4px'}} type={'arrow-down'} size="small" />, asc: <Icon style={{top: '-6px', left: '4px'}} type={'arrow-up'} size="small" />}`
     */
    sortIcons: PropTypes$1.object,
    /**
     * 自定义国际化文案对象
     * @property {String} ok 过滤器中确认按钮文案
     * @property {String} reset 过滤器中重置按钮文案
     * @property {String} empty 没有数据情况下 table内的文案
     * @property {String} asc 排序升序状态下的文案
     * @property {String} desc 排序将序状态下的文案
     * @property {String} expanded 可折叠行,展开状态下的文案
     * @property {String} folded 可折叠行,折叠状态下的文案
     * @property {String} filter 过滤器文案
     * @property {String} selectAll header里全选的按钮文案
     */
    locale: PropTypes$1.object,
    components: PropTypes$1.object,
    /**
     * 等同于写子组件 Table.Column ,子组件优先级更高
     */
    columns: PropTypes$1.array,
    /**
     * 设置数据为空的时候的表格内容展现
     */
    emptyContent: PropTypes$1.node,
    /**
     * dataSource当中数据的主键,如果给定的数据源中的属性不包含该主键,会造成选择状态全部选中
     */
    primaryKey: PropTypes$1.oneOfType([PropTypes$1.symbol, PropTypes$1.string]),
    lockType: PropTypes$1.oneOf(["left", "right"]),
    wrapperContent: PropTypes$1.any,
    refs: PropTypes$1.object,
    /**
     * 额外渲染行的渲染函数
     * @param {Object} record 该行所对应的数据
     * @param {Number} index 该行所对应的序列
     * @returns {Element} 渲染内容
     */
    expandedRowRender: PropTypes$1.func,
    /**
     * 设置行是否可展开,设置 false 为不可展开
     * @param {Object} record 该行所对应的数据
     * @param {Number} index 该行所对应的序列
     * @returns {Boolean} 是否可展开
     */
    rowExpandable: PropTypes$1.func,
    /**
     * 额外渲染行的缩进, 是个二维数组(eg:[1,1]) 分别表示左右两边的缩进
     */
    expandedRowIndent: PropTypes$1.array,
    /**
     * 是否显示点击展开额外渲染行的+号按钮
     */
    hasExpandedRowCtrl: PropTypes$1.bool,
    /**
     * 设置额外渲染行的属性
     * @param {Object} record 该行所对应的数据
     * @param {Number} index 该行所对应的序列
     * @returns {Object} 额外渲染行的属性
     */
    getExpandedColProps: PropTypes$1.func,
    /**
     * 当前展开的 Expand行 或者 Tree行 , 传入此属性为受控状态,一般配合 onRowOpen 使用
     */
    openRowKeys: PropTypes$1.array,
    /**
     * 默认情况下展开的 Expand行 或者 Tree行,非受控模式
     * @version 1.23.22
     */
    defaultOpenRowKeys: PropTypes$1.array,
    /**
     * 在 Expand行 或者 Tree行 展开或者收起的时候触发的事件
     * @param {Array} openRowKeys 展开的渲染行的key
     * @param {String} currentRowKey 当前点击的渲染行的key
     * @param {Boolean} expanded 当前点击是展开还是收起
     * @param {Object} currentRecord 当前点击额外渲染行的记录
     */
    onRowOpen: PropTypes$1.func,
    onExpandedRowClick: PropTypes$1.func,
    /**
     * 表头是否固定,该属性配合maxBodyHeight使用,当内容区域的高度超过maxBodyHeight的时候,在内容区域会出现滚动条
     */
    fixedHeader: PropTypes$1.bool,
    /**
     * 最大内容区域的高度,在`fixedHeader`为`true`的时候,超过这个高度会出现滚动条
     */
    maxBodyHeight: PropTypes$1.oneOfType([PropTypes$1.number, PropTypes$1.string]),
    /**
     * 是否启用选择模式
     * @property {Function} getProps `Function(record, index)=>Object` 获取selection的默认属性
     * @property {Function} onChange `Function(selectedRowKeys:Array, records:Array)` 选择改变的时候触发的事件,**注意:** 其中records只会包含当前dataSource的数据,很可能会小于selectedRowKeys的长度。
     * @property {Function} onSelect `Function(selected:Boolean, record:Object, records:Array)` 用户手动选择/取消选择某行的回调
     * @property {Function} onSelectAll `Function(selected:Boolean, records:Array)` 用户手动选择/取消选择所有行的回调
     * @property {Array} selectedRowKeys 设置了此属性,将rowSelection变为受控状态,接收值为该行数据的primaryKey的值
     * @property {String} mode 选择selection的模式, 可选值为`single`, `multiple`,默认为`multiple`
     * @property {Function} columnProps `Function()=>Object` 选择列 的props,例如锁列、对齐等,可使用`Table.Column` 的所有参数
     * @property {Function} titleProps `Function()=>Object` 选择列 表头的props,仅在 `multiple` 模式下生效
     * @property {Function} titleAddons `Function()=>Node` 选择列 表头添加的元素,在`single` `multiple` 下都生效
     */
    rowSelection: PropTypes$1.object,
    /**
     * 表头是否是sticky
     */
    stickyHeader: PropTypes$1.bool,
    /**
     * 距离窗口顶部达到指定偏移量后触发
     */
    offsetTop: PropTypes$1.number,
    /**
     * affix组件的的属性
     */
    affixProps: PropTypes$1.object,
    /**
     * 在tree模式下的缩进尺寸, 仅在isTree为true时候有效
     */
    indent: PropTypes$1.number,
    /**
     * 开启Table的tree模式, 接收的数据格式中包含children则渲染成tree table
     */
    isTree: PropTypes$1.bool,
    /**
     * 是否开启虚拟滚动
     */
    useVirtual: PropTypes$1.bool,
    rowHeight: PropTypes$1.oneOfType([PropTypes$1.number, PropTypes$1.func]),
    /**
     * 滚动到第几行,需要保证行高相同。1.22.15 版本之前仅在虚拟滚动场景下生效,之后在所有情况下生效
     * @version 1.22.15
     */
    scrollToRow: PropTypes$1.number,
    /**
     * 在内容区域滚动的时候触发的函数
     */
    onBodyScroll: PropTypes$1.func,
    /**
     * 开启时,getExpandedColProps() / rowProps() / expandedRowRender() 的第二个参数 index (该行所对应的序列) 将按照01,2,3,4...的顺序返回,否则返回真实index(0,2,4,6... / 1,3,5,7...)
     */
    expandedIndexSimulate: PropTypes$1.bool,
    /**
     * 在 hover 时出现十字参考轴,适用于表头比较复杂,需要做表头分类的场景。
     */
    crossline: PropTypes$1.bool,
    lengths: PropTypes$1.object
  }), _class$i.defaultProps = {
    dataSource: [],
    onRowClick: noop$3,
    onRowMouseEnter: noop$3,
    onRowMouseLeave: noop$3,
    onSort: noop$3,
    onFilter: noop$3,
    onResizeChange: noop$3,
    size: "medium",
    rowProps: noop$3,
    cellProps: noop$3,
    prefix: "next-",
    hasBorder: true,
    hasHeader: true,
    isZebra: false,
    loading: false,
    expandedIndexSimulate: false,
    primaryKey: "id",
    components: {},
    locale: defaultLocale.Table,
    crossline: false
  }, _class$i.childContextTypes = {
    notRenderCellIndex: PropTypes$1.array,
    lockType: PropTypes$1.oneOf(["left", "right"])
  }, _class$i.contextTypes = {
    getTableInstance: PropTypes$1.func,
    getTableInstanceForFixed: PropTypes$1.func,
    getTableInstanceForVirtual: PropTypes$1.func,
    getTableInstanceForExpand: PropTypes$1.func
  }, _temp$b);
  Table$2.displayName = "Table";
  const Base = polyfill(Table$2);
  var _class$h, _temp2$6;
  var LockRow = (_temp2$6 = _class$h = function(_React$Component) {
    _default$4(LockRow2, _React$Component);
    function LockRow2() {
      var _temp3, _this2, _ret;
      _default$7(this, LockRow2);
      for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
        args[_key] = arguments[_key];
      }
      return _ret = (_temp3 = (_this2 = _default$5(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this2), _this2.onMouseEnter = function(record, index2, e2) {
        var onRowMouseEnter = _this2.context.onRowMouseEnter;
        var onMouseEnter = _this2.props.onMouseEnter;
        onRowMouseEnter && onRowMouseEnter(record, index2, e2);
        onMouseEnter(record, index2, e2);
      }, _this2.onMouseLeave = function(record, index2, e2) {
        var onRowMouseLeave = _this2.context.onRowMouseLeave;
        var onMouseLeave = _this2.props.onMouseLeave;
        onRowMouseLeave && onRowMouseLeave(record, index2, e2);
        onMouseLeave(record, index2, e2);
      }, _temp3), _default$5(_this2, _ret);
    }
    LockRow2.prototype.render = function render2() {
      return React.createElement(Row, _default$8({}, this.props, { onMouseEnter: this.onMouseEnter, onMouseLeave: this.onMouseLeave }));
    };
    return LockRow2;
  }(React.Component), _class$h.propTypes = _default$8({}, Row.propTypes), _class$h.contextTypes = {
    onRowMouseEnter: PropTypes$1.func,
    onRowMouseLeave: PropTypes$1.func
  }, _class$h.defaultProps = _default$8({}, Row.defaultProps), _temp2$6);
  LockRow.displayName = "LockRow";
  var _class$g, _temp2$5;
  var ExpandedRow = (_temp2$5 = _class$g = function(_React$Component) {
    _default$4(ExpandedRow2, _React$Component);
    function ExpandedRow2() {
      var _temp3, _this2, _ret;
      _default$7(this, ExpandedRow2);
      for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
        args[_key] = arguments[_key];
      }
      return _ret = (_temp3 = (_this2 = _default$5(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this2), _this2.getExpandedRow = function(parentKey, ref) {
        var getExpandedRowRef = _this2.context.getExpandedRowRef;
        getExpandedRowRef && getExpandedRowRef(parentKey, ref);
      }, _temp3), _default$5(_this2, _ret);
    }
    ExpandedRow2.prototype.renderExpandedRow = function renderExpandedRow(record, rowIndex) {
      var _context = this.context, expandedRowRender = _context.expandedRowRender, expandedRowIndent = _context.expandedRowIndent, openRowKeys = _context.openRowKeys, lockType = _context.lockType, expandedIndexSimulate = _context.expandedIndexSimulate, expandedRowWidthEquals2Table = _context.expandedRowWidthEquals2Table;
      var expandedIndex = expandedIndexSimulate ? (rowIndex - 1) / 2 : rowIndex;
      var _props = this.props, columns = _props.columns, cellRef = _props.cellRef;
      var colSpan = columns.length;
      var expandedCols = columns[0] && columns[0].__colIndex || 0;
      if (expandedRowRender) {
        var _props2 = this.props, primaryKey = _props2.primaryKey, prefix = _props2.prefix, leftIndent = expandedRowIndent[0], rightIndent = expandedRowIndent[1], totalIndent = leftIndent + rightIndent, renderCols = function renderCols2(number) {
          var start = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0;
          var ret = [];
          var _loop = function _loop2(i2) {
            ret.push(React.createElement(
              "td",
              { key: i2, ref: function ref(cell5) {
                return cellRef(rowIndex, i2 + start, cell5);
              } },
              " "
            ));
          };
          for (var i = 0; i < number; i++) {
            _loop(i);
          }
          return ret;
        };
        var content = void 0;
        if (totalIndent > colSpan && !lockType) {
          log.warning("It's not allowed expandedRowIndent is more than the number of columns.");
        }
        if (leftIndent < columns.length && lockType === "left") {
          log.warning("expandedRowIndent left is less than the number of left lock columns.");
        }
        if (rightIndent < columns.length && lockType === "right") {
          log.warning("expandedRowIndent right is less than the number of right lock columns.");
        }
        if (lockType) {
          return openRowKeys.indexOf(record[primaryKey]) > -1 ? React.createElement(
            "tr",
            { className: prefix + "table-expanded-row", key: "expanded-" + expandedIndex },
            React.createElement(
              "td",
              { colSpan, ref: function ref(cell5) {
                return cellRef(rowIndex, expandedCols, cell5);
              } },
              " "
            )
          ) : null;
        }
        var expandedRowStyle = {
          position: "sticky",
          left: 0
        };
        content = expandedRowRender(record, expandedIndex);
        if (!React.isValidElement(content)) {
          content = React.createElement(
            "div",
            {
              className: prefix + "table-cell-wrapper",
              ref: this.getExpandedRow.bind(this, record[primaryKey]),
              style: expandedRowWidthEquals2Table && expandedRowStyle
            },
            content
          );
        } else {
          content = expandedRowWidthEquals2Table ? React.createElement(
            "div",
            {
              className: prefix + "table-expanded-area",
              ref: this.getExpandedRow.bind(this, record[primaryKey]),
              style: expandedRowStyle
            },
            content
          ) : content;
        }
        var rightStart = columns.length;
        columns.forEach(function(col) {
          col.lock === "right" && rightStart--;
        });
        return openRowKeys.indexOf(record[primaryKey]) > -1 ? React.createElement(
          "tr",
          { className: prefix + "table-expanded-row", key: "expanded-" + (record[primaryKey] || expandedIndex) },
          renderCols(leftIndent),
          React.createElement(
            "td",
            { colSpan: colSpan - totalIndent },
            content
          ),
          renderCols(rightIndent, rightStart)
        ) : null;
      } else {
        return null;
      }
    };
    ExpandedRow2.prototype.render = function render2() {
      var _props3 = this.props, record = _props3.record, rowIndex = _props3.rowIndex, columns = _props3.columns, others = _default$3(_props3, ["record", "rowIndex", "columns"]);
      var expandedIndexSimulate = this.context.expandedIndexSimulate;
      if (record.__expanded) {
        return this.renderExpandedRow(record, rowIndex, columns);
      }
      var newRowIndex = expandedIndexSimulate ? rowIndex / 2 : rowIndex;
      return React.createElement(LockRow, _default$8({}, others, { record, columns, __rowIndex: rowIndex, rowIndex: newRowIndex }));
    };
    return ExpandedRow2;
  }(React.Component), _class$g.propTypes = _default$8({}, LockRow.propTypes), _class$g.defaultProps = _default$8({}, LockRow.defaultProps), _class$g.contextTypes = {
    openRowKeys: PropTypes$1.array,
    expandedRowRender: PropTypes$1.func,
    expandedRowIndent: PropTypes$1.array,
    expandedIndexSimulate: PropTypes$1.bool,
    expandedRowWidthEquals2Table: PropTypes$1.bool,
    lockType: PropTypes$1.oneOf(["left", "right"]),
    getExpandedRowRef: PropTypes$1.func
  }, _temp2$5);
  ExpandedRow.displayName = "ExpandedRow";
  var _class$f, _temp$a;
  var SelectionRow = (_temp$a = _class$f = function(_React$Component) {
    _default$4(SelectionRow2, _React$Component);
    function SelectionRow2() {
      _default$7(this, SelectionRow2);
      return _default$5(this, _React$Component.apply(this, arguments));
    }
    SelectionRow2.prototype.render = function render2() {
      var _classnames;
      var _props = this.props, className = _props.className, record = _props.record, primaryKey = _props.primaryKey;
      var selectedRowKeys = this.context.selectedRowKeys;
      var cls = classnames((_classnames = {
        selected: selectedRowKeys.indexOf(record[primaryKey]) > -1
      }, _classnames[className] = className, _classnames));
      return React.createElement(ExpandedRow, _default$8({}, this.props, { className: cls }));
    };
    return SelectionRow2;
  }(React.Component), _class$f.propTypes = _default$8({}, ExpandedRow.propTypes), _class$f.defaultProps = _default$8({}, ExpandedRow.defaultProps), _class$f.contextTypes = {
    selectedRowKeys: PropTypes$1.array
  }, _temp$a);
  SelectionRow.displayName = "SelectionRow";
  var _class$e, _temp$9;
  var TreeRow = (_temp$9 = _class$e = function(_React$Component) {
    _default$4(TreeRow2, _React$Component);
    function TreeRow2() {
      _default$7(this, TreeRow2);
      return _default$5(this, _React$Component.apply(this, arguments));
    }
    TreeRow2.prototype.render = function render2() {
      var _classnames;
      var _props = this.props, className = _props.className, record = _props.record, primaryKey = _props.primaryKey, prefix = _props.prefix, others = _default$3(_props, ["className", "record", "primaryKey", "prefix"]);
      var _context = this.context, treeStatus = _context.treeStatus, openRowKeys = _context.openRowKeys;
      var cls = classnames((_classnames = {
        hidden: !(treeStatus.indexOf(record[primaryKey]) > -1) && record.__level !== 0
      }, _classnames[prefix + "table-row-level-" + record.__level] = true, _classnames.opened = openRowKeys.indexOf(record[primaryKey]) > -1, _classnames[className] = className, _classnames));
      return React.createElement(SelectionRow, _default$8({}, others, { record, className: cls, primaryKey, prefix }));
    };
    return TreeRow2;
  }(React.Component), _class$e.propTypes = _default$8({}, SelectionRow.propTypes), _class$e.defaultProps = _default$8({}, SelectionRow.defaultProps), _class$e.contextTypes = {
    treeStatus: PropTypes$1.array,
    openRowKeys: PropTypes$1.array
  }, _temp$9);
  TreeRow.displayName = "TreeRow";
  var _class$d, _temp2$4;
  var TreeCell = (_temp2$4 = _class$d = function(_React$Component) {
    _default$4(TreeCell2, _React$Component);
    function TreeCell2() {
      var _temp3, _this2, _ret;
      _default$7(this, TreeCell2);
      for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
        args[_key] = arguments[_key];
      }
      return _ret = (_temp3 = (_this2 = _default$5(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this2), _this2.onTreeNodeClick = function(record, e2) {
        e2.stopPropagation();
        _this2.context.onTreeNodeClick(record);
      }, _this2.expandedKeydown = function(record, e2) {
        e2.preventDefault();
        e2.stopPropagation();
        if (e2.keyCode === KEYCODE.ENTER) {
          _this2.onTreeNodeClick(record, e2);
        }
      }, _temp3), _default$5(_this2, _ret);
    }
    TreeCell2.prototype.render = function render2() {
      var _this2 = this;
      var _props = this.props, colIndex = _props.colIndex, record = _props.record, prefix = _props.prefix, primaryKey = _props.primaryKey, locale = _props.locale, rtl = _props.rtl, children = _props.children;
      var _context = this.context, openRowKeys = _context.openTreeRowKeys, indent = _context.indent, isTree = _context.isTree, rowSelection = _context.rowSelection;
      var treeArrowNodeIndex = rowSelection ? 1 : 0;
      var firstCellStyle = void 0, treeArrowNode = void 0;
      if (colIndex === treeArrowNodeIndex) {
        var treeArrowType = void 0;
        if (isTree) {
          var _firstCellStyle;
          var paddingType = rtl ? "paddingRight" : "paddingLeft";
          firstCellStyle = (_firstCellStyle = {}, _firstCellStyle[paddingType] = indent * (record.__level + 1), _firstCellStyle);
          treeArrowNode = React.createElement(Icon, { size: "xs", rtl, className: prefix + "table-tree-placeholder", type: "arrow-right" });
          if (record.children && record.children.length) {
            var hasExpanded = openRowKeys.indexOf(record[primaryKey]) > -1;
            treeArrowType = hasExpanded ? "arrow-down" : "arrow-right";
            treeArrowNode = React.createElement(Icon, {
              className: prefix + "table-tree-arrow",
              type: treeArrowType,
              size: "xs",
              rtl,
              onClick: function onClick3(e2) {
                return _this2.onTreeNodeClick(record, e2);
              },
              onKeyDown: function onKeyDown(e2) {
                return _this2.expandedKeydown(record, e2);
              },
              role: "button",
              tabIndex: "0",
              "aria-expanded": hasExpanded,
              "aria-label": hasExpanded ? locale.expanded : locale.folded
            });
          }
        }
      }
      return React.createElement(
        Cell,
        _default$8({}, this.props, { innerStyle: firstCellStyle, isIconLeft: !!treeArrowNode }),
        children,
        treeArrowNode
      );
    };
    return TreeCell2;
  }(React.Component), _class$d.propTypes = _default$8({
    indent: PropTypes$1.number,
    locale: PropTypes$1.object
  }, Cell.propTypes), _class$d.defaultProps = _default$8({}, Cell.defaultProps, {
    component: "td",
    indent: 20
  }), _class$d.contextTypes = {
    openTreeRowKeys: PropTypes$1.array,
    indent: PropTypes$1.number,
    onTreeNodeClick: PropTypes$1.func,
    isTree: PropTypes$1.bool,
    rowSelection: PropTypes$1.object
  }, _temp2$4);
  TreeCell.displayName = "TreeCell";
  var noop$2 = function noop11() {
  };
  function tree(BaseComponent) {
    var _class2, _temp3;
    var TreeTable = (_temp3 = _class2 = function(_React$Component) {
      _default$4(TreeTable2, _React$Component);
      function TreeTable2(props, context) {
        _default$7(this, TreeTable2);
        var _this2 = _default$5(this, _React$Component.call(this, props, context));
        _this2.onTreeNodeClick = function(record) {
          var primaryKey = _this2.props.primaryKey, id2 = record[primaryKey], dataSource = _this2.ds, openRowKeys = [].concat(_this2.state.openRowKeys), index2 = openRowKeys.indexOf(id2), getChildrenKeyById = function getChildrenKeyById2(id3) {
            var ret = [id3];
            var loop = function loop2(data) {
              data.forEach(function(item) {
                ret.push(item[primaryKey]);
                if (item.children) {
                  loop2(item.children);
                }
              });
            };
            dataSource.forEach(function(item) {
              if (item[primaryKey] === id3) {
                if (item.children) {
                  loop(item.children);
                }
              }
            });
            return ret;
          };
          if (index2 > -1) {
            var ids = getChildrenKeyById(id2);
            ids.forEach(function(id3) {
              var i = openRowKeys.indexOf(id3);
              if (i > -1) {
                openRowKeys.splice(i, 1);
              }
            });
          } else {
            openRowKeys.push(id2);
          }
          if (!("openRowKeys" in _this2.props)) {
            _this2.setState({
              openRowKeys
            });
          }
          _this2.props.onRowOpen(openRowKeys, id2, index2 === -1, record);
        };
        _this2.state = {
          openRowKeys: props.openRowKeys || props.defaultOpenRowKeys || []
        };
        return _this2;
      }
      TreeTable2.prototype.getChildContext = function getChildContext() {
        return {
          openTreeRowKeys: this.state.openRowKeys,
          indent: this.props.indent,
          treeStatus: this.getTreeNodeStatus(this.ds),
          onTreeNodeClick: this.onTreeNodeClick,
          isTree: this.props.isTree
        };
      };
      TreeTable2.getDerivedStateFromProps = function getDerivedStateFromProps(nextProps) {
        if ("openRowKeys" in nextProps) {
          return {
            openRowKeys: nextProps.openRowKeys || []
          };
        }
        return null;
      };
      TreeTable2.prototype.normalizeDataSource = function normalizeDataSource(dataSource) {
        var openRowKeys = this.state.openRowKeys;
        var primaryKey = this.props.primaryKey;
        var ret = [], loop = function loop2(dataSource2, level) {
          var parentId = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : null;
          dataSource2.forEach(function(item) {
            item.__level = level;
            if (level === 0 || openRowKeys.indexOf(parentId) > -1) {
              item.__hidden = false;
            } else {
              item.__hidden = true;
            }
            ret.push(item);
            if (item.children) {
              loop2(item.children, level + 1, item[primaryKey]);
            }
          });
        };
        loop(dataSource, 0);
        this.ds = ret;
        return ret;
      };
      TreeTable2.prototype.getTreeNodeStatus = function getTreeNodeStatus() {
        var dataSource = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [];
        var openRowKeys = this.state.openRowKeys, primaryKey = this.props.primaryKey, ret = [];
        openRowKeys.forEach(function(openKey) {
          dataSource.forEach(function(item) {
            if (item[primaryKey] === openKey) {
              if (item.children) {
                item.children.forEach(function(child) {
                  ret.push(child[primaryKey]);
                });
              }
            }
          });
        });
        return ret;
      };
      TreeTable2.prototype.render = function render2() {
        var _props = this.props, components = _props.components, isTree = _props.isTree, dataSource = _props.dataSource;
        _props.indent;
        var others = _default$3(_props, ["components", "isTree", "dataSource", "indent"]);
        if (isTree) {
          components = _default$8({}, components);
          if (!components.Row) {
            components.Row = TreeRow;
          }
          if (!components.Cell) {
            components.Cell = TreeCell;
          }
          dataSource = this.normalizeDataSource(dataSource);
        }
        return React.createElement(BaseComponent, _default$8({}, others, { dataSource, components }));
      };
      return TreeTable2;
    }(React.Component), _class2.TreeRow = TreeRow, _class2.TreeCell = TreeCell, _class2.propTypes = _default$8({
      /**
       * 默认情况下展开的树形表格,传入了此属性代表tree的展开为受控操作
       */
      openRowKeys: PropTypes$1.array,
      /**
       * 默认情况下展开的 Expand行 或者 Tree行,非受控模式
       * @version 1.23.22
       */
      defaultOpenRowKeys: PropTypes$1.array,
      /**
       * 点击tree展开或者关闭的时候触发的事件
       * @param {Array} openRowKeys tree模式下展开的key
       * @param {String} currentRowKey 当前点击行的key
       * @param {Boolean} opened 当前点击是展开还是收起
       * @param {Object} currentRecord 当前点击行的记录
       */
      onRowOpen: PropTypes$1.func,
      /**
       * dataSource当中数据的主键,如果给定的数据源中的属性不包含该主键,会造成选择状态全部选中
       */
      primaryKey: PropTypes$1.oneOfType([PropTypes$1.symbol, PropTypes$1.string]),
      /**
       * 在tree模式下的缩进尺寸, 仅在isTree为true时候有效
       */
      indent: PropTypes$1.number,
      /**
       * 开启Table的tree模式, 接收的数据格式中包含children则渲染成tree table
       */
      isTree: PropTypes$1.bool,
      locale: PropTypes$1.object
    }, BaseComponent.propTypes), _class2.defaultProps = _default$8({}, BaseComponent.defaultProps, {
      primaryKey: "id",
      onRowOpen: noop$2,
      components: {},
      indent: 12
    }), _class2.childContextTypes = {
      openTreeRowKeys: PropTypes$1.array,
      indent: PropTypes$1.number,
      treeStatus: PropTypes$1.array,
      onTreeNodeClick: PropTypes$1.func,
      isTree: PropTypes$1.bool
    }, _temp3);
    TreeTable.displayName = "TreeTable";
    statics(TreeTable, BaseComponent);
    return polyfill(TreeTable);
  }
  var _class$c, _temp$8;
  var FixedHeader = (_temp$8 = _class$c = function(_React$Component) {
    _default$4(FixedHeader2, _React$Component);
    function FixedHeader2() {
      _default$7(this, FixedHeader2);
      return _default$5(this, _React$Component.apply(this, arguments));
    }
    FixedHeader2.prototype.componentDidMount = function componentDidMount() {
      this.context.getNode("header", ReactDOM.findDOMNode(this));
    };
    FixedHeader2.prototype.render = function render2() {
      var _props = this.props, prefix = _props.prefix, className = _props.className, colGroup = _props.colGroup, tableWidth = _props.tableWidth, others = _default$3(_props, ["prefix", "className", "colGroup", "tableWidth"]);
      var _context = this.context, onFixedScrollSync = _context.onFixedScrollSync, lockType = _context.lockType;
      return React.createElement(
        "div",
        { className, onScroll: onFixedScrollSync },
        React.createElement(
          "div",
          { className: prefix + "table-header-inner", style: { overflow: "unset" } },
          React.createElement(
            "table",
            { style: { width: tableWidth } },
            colGroup,
            React.createElement(Header, _default$8({}, others, { prefix }))
          )
        ),
        !lockType && React.createElement("div", { className: prefix + "table-header-fixer", style: { position: "absolute", right: 0 } })
      );
    };
    return FixedHeader2;
  }(React.Component), _class$c.propTypes = {
    children: PropTypes$1.any,
    prefix: PropTypes$1.string,
    className: PropTypes$1.string,
    colGroup: PropTypes$1.any,
    tableWidth: PropTypes$1.number
  }, _class$c.contextTypes = {
    getNode: PropTypes$1.func,
    onFixedScrollSync: PropTypes$1.func,
    lockType: PropTypes$1.oneOf(["left", "right"])
  }, _temp$8);
  FixedHeader.displayName = "FixedHeader";
  var _class$b, _temp2$3;
  var FixedBody = (_temp2$3 = _class$b = function(_React$Component) {
    _default$4(FixedBody2, _React$Component);
    function FixedBody2() {
      var _temp3, _this2, _ret;
      _default$7(this, FixedBody2);
      for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
        args[_key] = arguments[_key];
      }
      return _ret = (_temp3 = (_this2 = _default$5(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this2), _this2.onBodyScroll = function(event) {
        var onFixedScrollSync = _this2.context.onFixedScrollSync;
        onFixedScrollSync && onFixedScrollSync(event);
        if ("onLockScroll" in _this2.props && typeof _this2.props.onLockScroll === "function") {
          _this2.props.onLockScroll(event);
        }
      }, _temp3), _default$5(_this2, _ret);
    }
    FixedBody2.prototype.componentDidMount = function componentDidMount() {
      var getNode = this.context.getNode;
      getNode && getNode("body", ReactDOM.findDOMNode(this));
    };
    FixedBody2.prototype.render = function render2() {
      var _props = this.props, className = _props.className, colGroup = _props.colGroup;
      _props.onLockScroll;
      var tableWidth = _props.tableWidth, others = _default$3(_props, ["className", "colGroup", "onLockScroll", "tableWidth"]);
      var _context = this.context, maxBodyHeight = _context.maxBodyHeight, fixedHeader = _context.fixedHeader;
      var style = {};
      if (fixedHeader) {
        style.maxHeight = maxBodyHeight;
        style.position = "relative";
      }
      return React.createElement(
        "div",
        { style, className, onScroll: this.onBodyScroll },
        React.createElement(
          "table",
          { style: { width: tableWidth } },
          colGroup,
          React.createElement(Body, _default$8({}, others, { colGroup }))
        )
      );
    };
    return FixedBody2;
  }(React.Component), _class$b.propTypes = {
    children: PropTypes$1.any,
    prefix: PropTypes$1.string,
    className: PropTypes$1.string,
    colGroup: PropTypes$1.any,
    onLockScroll: PropTypes$1.func,
    tableWidth: PropTypes$1.number
  }, _class$b.contextTypes = {
    fixedHeader: PropTypes$1.bool,
    maxBodyHeight: PropTypes$1.oneOfType([PropTypes$1.number, PropTypes$1.string]),
    onFixedScrollSync: PropTypes$1.func,
    getNode: PropTypes$1.func
  }, _temp2$3);
  FixedBody.displayName = "FixedBody";
  var _class$a, _temp$7;
  var FixedWrapper = (_temp$7 = _class$a = function(_React$Component) {
    _default$4(FixedWrapper2, _React$Component);
    function FixedWrapper2() {
      _default$7(this, FixedWrapper2);
      return _default$5(this, _React$Component.apply(this, arguments));
    }
    FixedWrapper2.prototype.render = function render2() {
      var _props = this.props, children = _props.children, wrapperContent = _props.wrapperContent, prefix = _props.prefix;
      return React.createElement(
        "div",
        { className: prefix + "table-inner" },
        children,
        wrapperContent
      );
    };
    return FixedWrapper2;
  }(React.Component), _class$a.propTypes = {
    children: PropTypes$1.any,
    prefix: PropTypes$1.string,
    colGroup: PropTypes$1.any,
    wrapperContent: PropTypes$1.any
  }, _temp$7);
  FixedWrapper.displayName = "FixedWrapper";
  function fixed(BaseComponent, stickyLock2) {
    var _class2, _temp22;
    var FixedTable = (_temp22 = _class2 = function(_React$Component) {
      _default$4(FixedTable2, _React$Component);
      function FixedTable2() {
        var _temp3, _this2, _ret;
        _default$7(this, FixedTable2);
        for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
          args[_key] = arguments[_key];
        }
        return _ret = (_temp3 = (_this2 = _default$5(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this2), _this2.state = {}, _this2.getNode = function(type2, node, lockType) {
          lockType = lockType ? lockType.charAt(0).toUpperCase() + lockType.substr(1) : "";
          _this2["" + type2 + lockType + "Node"] = node;
        }, _this2.getTableInstance = function(type2, instance2) {
          type2 = "";
          _this2["table" + type2 + "Inc"] = instance2;
        }, _this2.onFixedScrollSync = function() {
          var current = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : { currentTarget: {} };
          var currentTarget = current.currentTarget || {}, headerNode = _this2.headerNode, bodyNode = _this2.bodyNode;
          var scrollLeft = currentTarget.scrollLeft, scrollWidth = currentTarget.scrollWidth, clientWidth = currentTarget.clientWidth;
          var scrollToRightEnd = !(scrollLeft < scrollWidth - clientWidth);
          var _this$props = _this2.props, prefix = _this$props.prefix, loading = _this$props.loading;
          if (!loading && scrollToRightEnd !== _this2.scrollToRightEnd) {
            _this2.scrollToRightEnd = scrollToRightEnd;
            var table = _this2.getTableNode();
            var leftFunc = scrollToRightEnd ? "removeClass" : "addClass";
            dom[leftFunc](table, prefix + "table-scrolling-to-right");
          }
          if (!_this2.scrollTarget || _this2.scrollTarget === currentTarget) {
            _this2.scrollTarget = currentTarget;
            window.clearTimeout(_this2.timeoutId);
            _this2.timeoutId = window.setTimeout(function() {
              _this2.scrollTarget = null;
              _this2.timeoutId = void 0;
            }, 100);
            if (currentTarget === bodyNode) {
              if (headerNode && scrollLeft !== headerNode.scrollLeft) {
                headerNode.scrollLeft = scrollLeft;
              }
            } else if (currentTarget === headerNode) {
              if (bodyNode && scrollLeft !== bodyNode.scrollLeft) {
                bodyNode.scrollLeft = scrollLeft;
              }
            }
          }
        }, _temp3), _default$5(_this2, _ret);
      }
      FixedTable2.prototype.getChildContext = function getChildContext() {
        return {
          fixedHeader: this.props.fixedHeader,
          maxBodyHeight: this.props.maxBodyHeight,
          getTableInstanceForFixed: this.getTableInstance,
          onFixedScrollSync: this.onFixedScrollSync,
          getNode: this.getNode
        };
      };
      FixedTable2.prototype.componentDidMount = function componentDidMount() {
        this.adjustFixedHeaderSize();
        this.scrollToRightEnd = void 0;
        this.onFixedScrollSync({ currentTarget: this.bodyNode, target: this.bodyNode });
      };
      FixedTable2.prototype.componentDidUpdate = function componentDidUpdate() {
        this.adjustFixedHeaderSize();
        this.onFixedScrollSync({ currentTarget: this.bodyNode, target: this.bodyNode });
      };
      FixedTable2.prototype.getTableNode = function getTableNode() {
        var table = this.tableInc;
        try {
          return ReactDOM.findDOMNode(table.tableEl);
        } catch (error) {
          return null;
        }
      };
      FixedTable2.prototype.adjustFixedHeaderSize = function adjustFixedHeaderSize() {
        var _props = this.props, hasHeader = _props.hasHeader, rtl = _props.rtl, prefix = _props.prefix;
        var paddingName = rtl ? "paddingLeft" : "paddingRight";
        var marginName = rtl ? "marginLeft" : "marginRight";
        var body = this.bodyNode;
        var scrollBarSize = +dom.scrollbar().width || 0;
        if (hasHeader && !this.props.lockType && body) {
          var hasVerScroll = body.scrollHeight > body.clientHeight, hasHozScroll = body.scrollWidth > body.clientWidth;
          var style = {};
          if (!hasVerScroll) {
            style[paddingName] = 0;
            style[marginName] = 0;
          }
          if (+scrollBarSize) {
            style.marginBottom = -scrollBarSize;
            if (hasHozScroll) {
              style.paddingBottom = scrollBarSize;
            } else {
              style.paddingBottom = scrollBarSize;
            }
            if (hasVerScroll) {
              style[marginName] = scrollBarSize;
            }
          }
          dom.setStyle(this.headerNode, style);
        }
        if (hasHeader && !this.props.lockType && this.headerNode) {
          var fixer = this.headerNode.querySelector("." + prefix + "table-header-fixer");
          var height = dom.getStyle(this.headerNode, "height");
          var paddingBottom = dom.getStyle(this.headerNode, "paddingBottom");
          dom.setStyle(fixer, {
            width: scrollBarSize,
            height: height - paddingBottom
          });
        }
      };
      FixedTable2.prototype.render = function render2() {
        var _props2 = this.props, components = _props2.components, className = _props2.className, prefix = _props2.prefix, fixedHeader = _props2.fixedHeader, lockType = _props2.lockType, dataSource = _props2.dataSource;
        _props2.maxBodyHeight;
        var others = _default$3(_props2, ["components", "className", "prefix", "fixedHeader", "lockType", "dataSource", "maxBodyHeight"]);
        if (fixedHeader) {
          var _classnames;
          components = _default$8({}, components);
          if (!components.Header) {
            components.Header = FixedHeader;
          }
          if (!components.Body) {
            components.Body = FixedBody;
          }
          if (!components.Wrapper) {
            components.Wrapper = FixedWrapper;
          }
          className = classnames((_classnames = {}, _classnames[prefix + "table-fixed"] = true, _classnames[prefix + "table-wrap-empty"] = !dataSource.length, _classnames[className] = className, _classnames));
        }
        return React.createElement(BaseComponent, _default$8({}, others, {
          dataSource,
          lockType,
          components,
          className,
          prefix
        }));
      };
      return FixedTable2;
    }(React.Component), _class2.FixedHeader = FixedHeader, _class2.FixedBody = FixedBody, _class2.FixedWrapper = FixedWrapper, _class2.propTypes = _default$8({
      /**
       * 是否具有表头
       */
      hasHeader: PropTypes$1.bool,
      /**
       * 表头是否固定,该属性配合maxBodyHeight使用,当内容区域的高度超过maxBodyHeight的时候,在内容区域会出现滚动条
       */
      fixedHeader: PropTypes$1.bool,
      /**
       * 最大内容区域的高度,在`fixedHeader`为`true`的时候,超过这个高度会出现滚动条
       */
      maxBodyHeight: PropTypes$1.oneOfType([PropTypes$1.number, PropTypes$1.string])
    }, BaseComponent.propTypes), _class2.defaultProps = _default$8({}, BaseComponent.defaultProps, {
      hasHeader: true,
      fixedHeader: false,
      maxBodyHeight: 200,
      components: {},
      refs: {},
      prefix: "next-"
    }), _class2.childContextTypes = {
      fixedHeader: PropTypes$1.bool,
      getNode: PropTypes$1.func,
      onFixedScrollSync: PropTypes$1.func,
      getTableInstanceForFixed: PropTypes$1.func,
      maxBodyHeight: PropTypes$1.oneOfType([PropTypes$1.number, PropTypes$1.string])
    }, _temp22);
    FixedTable.displayName = "FixedTable";
    statics(FixedTable, BaseComponent);
    return FixedTable;
  }
  var makeChain = func.makeChain;
  var unique = function unique2(arr) {
    var key = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "this";
    var temp = {}, ret = [];
    arr.forEach(function(item) {
      var value = void 0;
      if (key === "this") {
        value = item;
      } else {
        value = item[key];
      }
      if (!temp[value]) {
        ret.push(item);
        temp[value] = true;
      }
    });
    return ret;
  };
  function selection(BaseComponent) {
    var _class2, _temp3;
    var SelectionTable = (_temp3 = _class2 = function(_React$Component) {
      _default$4(SelectionTable2, _React$Component);
      function SelectionTable2(props, context) {
        _default$7(this, SelectionTable2);
        var _this2 = _default$5(this, _React$Component.call(this, props, context));
        _this2.addSelection = function(columns) {
          var _this$props = _this2.props, prefix = _this$props.prefix, rowSelection = _this$props.rowSelection, size2 = _this$props.size;
          var attrs = rowSelection.columnProps && rowSelection.columnProps() || {};
          if (!columns.find(function(record) {
            return record.key === "selection";
          })) {
            columns.unshift(_default$8({
              key: "selection",
              title: _this2.renderSelectionHeader.bind(_this2),
              cell: _this2.renderSelectionBody.bind(_this2),
              width: size2 === "small" ? 34 : 50,
              className: prefix + "table-selection " + prefix + "table-prerow",
              __normalized: true
            }, attrs));
          }
        };
        _this2.renderSelectionHeader = function() {
          var onChange6 = _this2.selectAllRow, attrs = {}, _this$props2 = _this2.props, rowSelection = _this$props2.rowSelection, primaryKey = _this$props2.primaryKey, dataSource = _this$props2.dataSource, entireDataSource = _this$props2.entireDataSource, locale = _this$props2.locale, selectedRowKeys = _this2.state.selectedRowKeys, mode = rowSelection.mode ? rowSelection.mode : "multiple";
          var checked = !!selectedRowKeys.length;
          var indeterminate = false;
          var source = entireDataSource || dataSource;
          _this2.flatDataSource(source).filter(function(record, index2) {
            if (!rowSelection.getProps) {
              return true;
            } else {
              return !(rowSelection.getProps(record, index2) || {}).disabled;
            }
          }).map(function(record) {
            return record[primaryKey];
          }).forEach(function(id2) {
            if (selectedRowKeys.indexOf(id2) === -1) {
              checked = false;
            } else {
              indeterminate = true;
            }
          });
          attrs.onClick = makeChain(function(e2) {
            e2.stopPropagation();
          }, attrs.onClick);
          var userAttrs = rowSelection.titleProps && rowSelection.titleProps() || {};
          if (checked) {
            indeterminate = false;
          }
          return [mode === "multiple" ? React.createElement(Checkbox$1, _default$8({
            key: "_total",
            indeterminate,
            "aria-label": locale.selectAll,
            checked,
            onChange: onChange6
          }, attrs, userAttrs)) : null, rowSelection.titleAddons && rowSelection.titleAddons()];
        };
        _this2.renderSelectionBody = function(value, index2, record) {
          var _this$props3 = _this2.props, rowSelection = _this$props3.rowSelection, primaryKey = _this$props3.primaryKey;
          var selectedRowKeys = _this2.state.selectedRowKeys;
          var mode = rowSelection.mode ? rowSelection.mode : "multiple";
          var checked = selectedRowKeys.indexOf(record[primaryKey]) > -1;
          var onChange6 = _this2.selectOneRow.bind(_this2, index2, record);
          var attrs = rowSelection.getProps ? rowSelection.getProps(record, index2) || {} : {};
          attrs.onClick = makeChain(function(e2) {
            e2.stopPropagation();
          }, attrs.onClick);
          return mode === "multiple" ? React.createElement(Checkbox$1, _default$8({ checked, onChange: onChange6 }, attrs)) : React.createElement(Radio$1, _default$8({ checked, onChange: onChange6 }, attrs));
        };
        _this2.selectAllRow = function(checked, e2) {
          var ret = [].concat(_this2.state.selectedRowKeys), _this$props4 = _this2.props, rowSelection = _this$props4.rowSelection, primaryKey = _this$props4.primaryKey, dataSource = _this$props4.dataSource, entireDataSource = _this$props4.entireDataSource, selectedRowKeys = _this2.state.selectedRowKeys, getProps = rowSelection.getProps;
          var attrs = {}, records = [];
          var source = entireDataSource ? entireDataSource : dataSource;
          _this2.flatDataSource(source).forEach(function(record, index2) {
            var id2 = record[primaryKey];
            if (getProps) {
              attrs = getProps(record, index2) || {};
            }
            if (checked && (!attrs.disabled || selectedRowKeys.indexOf(id2) > -1)) {
              ret.push(id2);
              records.push(record);
            } else if (attrs.disabled && selectedRowKeys.indexOf(id2) > -1) {
              ret.push(id2);
              records.push(record);
            } else {
              var i = ret.indexOf(id2);
              i > -1 && ret.splice(i, 1);
            }
          });
          records = unique(records, primaryKey);
          if (typeof rowSelection.onSelectAll === "function") {
            rowSelection.onSelectAll(checked, records);
          }
          _this2.triggerSelection(rowSelection, unique(ret), records);
          e2.stopPropagation();
        };
        _this2.state = {
          selectedRowKeys: props.rowSelection && "selectedRowKeys" in props.rowSelection ? props.rowSelection.selectedRowKeys || [] : []
        };
        return _this2;
      }
      SelectionTable2.prototype.getChildContext = function getChildContext() {
        return {
          rowSelection: this.props.rowSelection,
          selectedRowKeys: this.state.selectedRowKeys
        };
      };
      SelectionTable2.getDerivedStateFromProps = function getDerivedStateFromProps(nextProps) {
        if (nextProps.rowSelection && "selectedRowKeys" in nextProps.rowSelection) {
          var selectedRowKeys = nextProps.rowSelection.selectedRowKeys || [];
          return {
            selectedRowKeys
          };
        }
        return null;
      };
      SelectionTable2.prototype.normalizeChildren = function normalizeChildren(children) {
        var _props = this.props, prefix = _props.prefix, rowSelection = _props.rowSelection, size2 = _props.size;
        if (rowSelection) {
          children = React.Children.map(children, function(child, index2) {
            return React.cloneElement(child, {
              key: index2
            });
          });
          var attrs = rowSelection.columnProps && rowSelection.columnProps() || {};
          children.unshift(React.createElement(Column, _default$8({
            key: "selection",
            title: this.renderSelectionHeader.bind(this),
            cell: this.renderSelectionBody.bind(this),
            width: size2 === "small" ? 34 : 50,
            className: prefix + "table-selection " + prefix + "table-prerow",
            __normalized: true
          }, attrs)));
          return children;
        }
        return children;
      };
      SelectionTable2.prototype.selectOneRow = function selectOneRow(index2, record, checked, e2) {
        var selectedRowKeys = [].concat(this.state.selectedRowKeys), i = void 0;
        var _props2 = this.props, primaryKey = _props2.primaryKey, rowSelection = _props2.rowSelection, dataSource = _props2.dataSource, entireDataSource = _props2.entireDataSource, mode = rowSelection.mode ? rowSelection.mode : "multiple", id2 = record[primaryKey];
        if (!id2) {
          log.warning("Can't get value from record using given " + primaryKey + " as primaryKey.");
        }
        if (mode === "multiple") {
          if (checked) {
            selectedRowKeys.push(id2);
          } else {
            i = selectedRowKeys.indexOf(id2);
            selectedRowKeys.splice(i, 1);
          }
        } else if (checked) {
          selectedRowKeys = [id2];
        }
        var totalDS = dataSource;
        if (Array.isArray(entireDataSource) && entireDataSource.length > dataSource.length) {
          totalDS = entireDataSource;
        }
        var records = unique(totalDS.filter(function(item) {
          return selectedRowKeys.indexOf(item[primaryKey]) > -1;
        }), primaryKey);
        if (typeof rowSelection.onSelect === "function") {
          rowSelection.onSelect(checked, record, records);
        }
        this.triggerSelection(rowSelection, selectedRowKeys, records);
        e2.stopPropagation();
      };
      SelectionTable2.prototype.triggerSelection = function triggerSelection(rowSelection, selectedRowKeys, records) {
        if (!("selectedRowKeys" in rowSelection)) {
          this.setState({
            selectedRowKeys
          });
        }
        if (typeof rowSelection.onChange === "function") {
          rowSelection.onChange(selectedRowKeys, records);
        }
      };
      SelectionTable2.prototype.flatDataSource = function flatDataSource(dataSource) {
        var ret = dataSource;
        var listHeader = this.context.listHeader;
        if (listHeader) {
          ret = [];
          var hasChildrenSelection = listHeader.hasChildrenSelection, hasSelection = listHeader.hasSelection;
          dataSource.forEach(function(item) {
            var children = item.children;
            if (hasSelection) {
              ret.push(item);
            }
            if (children && hasChildrenSelection) {
              ret = ret.concat(children);
            }
          });
        }
        return ret;
      };
      SelectionTable2.prototype.render = function render2() {
        var _props3 = this.props, rowSelection = _props3.rowSelection, components = _props3.components, children = _props3.children, columns = _props3.columns, others = _default$3(_props3, ["rowSelection", "components", "children", "columns"]);
        var useColumns = columns && !children;
        if (rowSelection) {
          if (useColumns) {
            this.addSelection(columns);
          } else {
            children = this.normalizeChildren(children || []);
          }
          components = _default$8({}, components);
          components.Row = components.Row || SelectionRow;
        }
        return React.createElement(BaseComponent, _default$8({}, others, { columns, components, children }));
      };
      return SelectionTable2;
    }(React.Component), _class2.SelectionRow = SelectionRow, _class2.propTypes = _default$8({
      /**
       * 是否启用选择模式
       * @property {Function} getProps `Function(record, index)=>Object` 获取selection的默认属性
       * @property {Function} onChange `Function(selectedRowKeys:Array, records:Array)` 选择改变的时候触发的事件,**注意:** 其中records只会包含当前dataSource的数据,很可能会小于selectedRowKeys的长度。
       * @property {Function} onSelect `Function(selected:Boolean, record:Object, records:Array)` 用户手动选择/取消选择某行的回调
       * @property {Function} onSelectAll `Function(selected:Boolean, records:Array)` 用户手动选择/取消选择所有行的回调
       * @property {Array} selectedRowKeys 设置了此属性,将rowSelection变为受控状态,接收值为该行数据的primaryKey的值
       * @property {String} mode 选择selection的模式, 可选值为`single`, `multiple`,默认为`multiple`
       * @property {Function} columnProps `Function()=>Object` 选择列 的props,例如锁列、对齐等,可使用`Table.Column` 的所有参数
       * @property {Function} titleProps `Function()=>Object` 选择列 表头的props,仅在 `multiple` 模式下生效
       */
      rowSelection: PropTypes$1.object,
      primaryKey: PropTypes$1.oneOfType([PropTypes$1.symbol, PropTypes$1.string]),
      dataSource: PropTypes$1.array,
      entireDataSource: PropTypes$1.array
    }, BaseComponent.propTypes), _class2.defaultProps = _default$8({}, BaseComponent.defaultProps, {
      locale: defaultLocale.Table,
      primaryKey: "id",
      prefix: "next-"
    }), _class2.contextTypes = {
      listHeader: PropTypes$1.any
    }, _class2.childContextTypes = {
      rowSelection: PropTypes$1.object,
      selectedRowKeys: PropTypes$1.array
    }, _temp3);
    SelectionTable.displayName = "SelectionTable";
    statics(SelectionTable, BaseComponent);
    return polyfill(SelectionTable);
  }
  var noop$1 = function noop12() {
  };
  function expanded(BaseComponent, stickyLock2) {
    var _class2, _temp22;
    var ExpandedTable = (_temp22 = _class2 = function(_React$Component) {
      _default$4(ExpandedTable2, _React$Component);
      function ExpandedTable2() {
        var _temp3, _this2, _ret;
        _default$7(this, ExpandedTable2);
        for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
          args[_key] = arguments[_key];
        }
        return _ret = (_temp3 = (_this2 = _default$5(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this2), _this2.state = {
          openRowKeys: _this2.props.openRowKeys || _this2.props.defaultOpenRowKeys || []
        }, _this2.saveExpandedRowRef = function(key, rowRef) {
          if (!_this2.expandedRowRefs) {
            _this2.expandedRowRefs = {};
          }
          _this2.expandedRowRefs[key] = rowRef;
        }, _this2.setExpandedWidth = function() {
          var prefix = _this2.props.prefix;
          var tableEl = _this2.getTableNode();
          var totalWidth = +(tableEl && tableEl.clientWidth) - 1 || "100%";
          var bodyNode = tableEl && tableEl.querySelector("." + prefix + "table-body");
          Object.keys(_this2.expandedRowRefs || {}).forEach(function(key) {
            dom.setStyle(_this2.expandedRowRefs[key], { width: bodyNode && bodyNode.clientWidth || totalWidth });
          });
        }, _this2.getTableInstance = function(instance2) {
          _this2.tableInc = instance2;
        }, _this2.expandedKeydown = function(value, record, index2, e2) {
          e2.preventDefault();
          e2.stopPropagation();
          if (e2.keyCode === KEYCODE.ENTER) {
            _this2.onExpandedClick(value, record, index2, e2);
          }
        }, _this2.renderExpandedCell = function(value, index2, record) {
          var _classnames;
          var _this$props = _this2.props, getExpandedColProps = _this$props.getExpandedColProps, prefix = _this$props.prefix, locale = _this$props.locale, rowExpandable = _this$props.rowExpandable;
          if (typeof rowExpandable === "function" && !rowExpandable(record, index2)) {
            return "";
          }
          var openRowKeys = _this2.state.openRowKeys, primaryKey = _this2.props.primaryKey, hasExpanded = openRowKeys.indexOf(record[primaryKey]) > -1, switchNode = hasExpanded ? React.createElement(Icon, { type: "minus", size: "xs", className: prefix + "table-expand-unfold" }) : React.createElement(Icon, { type: "add", size: "xs", className: prefix + "table-expand-fold" }), attrs = getExpandedColProps(record, index2) || {};
          var cls = classnames((_classnames = {}, _classnames[prefix + "table-expanded-ctrl"] = true, _classnames.disabled = attrs.disabled, _classnames[attrs.className] = attrs.className, _classnames));
          if (!attrs.disabled) {
            attrs.onClick = _this2.onExpandedClick.bind(_this2, value, record, index2);
          }
          return React.createElement(
            "span",
            _default$8({}, attrs, {
              role: "button",
              tabIndex: "0",
              onKeyDown: _this2.expandedKeydown.bind(_this2, value, record, index2),
              "aria-label": hasExpanded ? locale.expanded : locale.folded,
              "aria-expanded": hasExpanded,
              className: cls
            }),
            switchNode
          );
        }, _this2.addExpandCtrl = function(columns) {
          var _this$props2 = _this2.props, prefix = _this$props2.prefix, size2 = _this$props2.size;
          if (!columns.find(function(record) {
            return record.key === "expanded";
          })) {
            columns.unshift({
              key: "expanded",
              title: "",
              cell: _this2.renderExpandedCell.bind(_this2),
              width: size2 === "small" ? 34 : 50,
              className: prefix + "table-expanded " + prefix + "table-prerow",
              __normalized: true
            });
          }
        }, _temp3), _default$5(_this2, _ret);
      }
      ExpandedTable2.prototype.getChildContext = function getChildContext() {
        return {
          openRowKeys: this.state.openRowKeys,
          expandedRowRender: this.props.expandedRowRender,
          expandedIndexSimulate: this.props.expandedIndexSimulate,
          expandedRowWidthEquals2Table: stickyLock2,
          getExpandedRowRef: this.saveExpandedRowRef,
          getTableInstanceForExpand: this.getTableInstance,
          expandedRowIndent: stickyLock2 ? [0, 0] : this.props.expandedRowIndent
        };
      };
      ExpandedTable2.getDerivedStateFromProps = function getDerivedStateFromProps(nextProps) {
        if ("openRowKeys" in nextProps) {
          return {
            openRowKeys: nextProps.openRowKeys || []
          };
        }
        return null;
      };
      ExpandedTable2.prototype.componentDidMount = function componentDidMount() {
        this.setExpandedWidth();
        events.on(window, "resize", this.setExpandedWidth);
      };
      ExpandedTable2.prototype.componentDidUpdate = function componentDidUpdate() {
        this.setExpandedWidth();
      };
      ExpandedTable2.prototype.componentWillUnmount = function componentWillUnmount() {
        events.off(window, "resize", this.setExpandedWidth);
      };
      ExpandedTable2.prototype.getTableNode = function getTableNode() {
        var table = this.tableInc;
        try {
          return ReactDOM.findDOMNode(table.tableEl);
        } catch (error) {
          return null;
        }
      };
      ExpandedTable2.prototype.onExpandedClick = function onExpandedClick(value, record, i, e2) {
        var openRowKeys = [].concat(this.state.openRowKeys), primaryKey = this.props.primaryKey, id2 = record[primaryKey], index2 = openRowKeys.indexOf(id2);
        if (index2 > -1) {
          openRowKeys.splice(index2, 1);
        } else {
          openRowKeys.push(id2);
        }
        if (!("openRowKeys" in this.props)) {
          this.setState({
            openRowKeys
          });
        }
        this.props.onRowOpen(openRowKeys, id2, index2 === -1, record);
        e2.stopPropagation();
      };
      ExpandedTable2.prototype.normalizeChildren = function normalizeChildren(children) {
        var _props = this.props, prefix = _props.prefix, size2 = _props.size;
        var toArrayChildren = React.Children.map(children, function(child, index2) {
          return React.cloneElement(child, {
            key: index2
          });
        });
        toArrayChildren.unshift(React.createElement(Column, {
          title: "",
          key: "expanded",
          cell: this.renderExpandedCell.bind(this),
          width: size2 === "small" ? 34 : 50,
          className: prefix + "table-expanded " + prefix + "table-prerow",
          __normalized: true
        }));
        return toArrayChildren;
      };
      ExpandedTable2.prototype.normalizeDataSource = function normalizeDataSource(ds) {
        var ret = [];
        ds.forEach(function(item) {
          var itemCopy = _default$8({}, item);
          itemCopy.__expanded = true;
          ret.push(item, itemCopy);
        });
        return ret;
      };
      ExpandedTable2.prototype.render = function render2() {
        var _props2 = this.props, components = _props2.components;
        _props2.openRowKeys;
        var expandedRowRender = _props2.expandedRowRender;
        _props2.rowExpandable;
        var hasExpandedRowCtrl = _props2.hasExpandedRowCtrl, children = _props2.children, columns = _props2.columns, dataSource = _props2.dataSource, entireDataSource = _props2.entireDataSource;
        _props2.getExpandedColProps;
        _props2.expandedRowIndent;
        _props2.onRowOpen;
        _props2.onExpandedRowClick;
        var others = _default$3(_props2, ["components", "openRowKeys", "expandedRowRender", "rowExpandable", "hasExpandedRowCtrl", "children", "columns", "dataSource", "entireDataSource", "getExpandedColProps", "expandedRowIndent", "onRowOpen", "onExpandedRowClick"]);
        if (expandedRowRender && !components.Row) {
          components = _default$8({}, components);
          components.Row = ExpandedRow;
          dataSource = this.normalizeDataSource(dataSource);
          entireDataSource = this.normalizeDataSource(entireDataSource);
        }
        if (expandedRowRender && hasExpandedRowCtrl) {
          var useColumns = columns && !children;
          if (useColumns) {
            this.addExpandCtrl(columns);
          } else {
            children = this.normalizeChildren(children || []);
          }
        }
        return React.createElement(
          BaseComponent,
          _default$8({}, others, {
            columns,
            dataSource,
            entireDataSource,
            components
          }),
          children
        );
      };
      return ExpandedTable2;
    }(React.Component), _class2.ExpandedRow = ExpandedRow, _class2.propTypes = _default$8({
      /**
       * 额外渲染行的渲染函数
       * @param {Object} record 该行所对应的数据
       * @param {Number} index 该行所对应的序列
       * @returns {Element}
       */
      expandedRowRender: PropTypes$1.func,
      /**
       * 设置行是否可展开,设置 false 为不可展开
       * @param {Object} record 该行所对应的数据
       * @param {Number} index 该行所对应的序列
       * @returns {Boolean} 是否可展开
       * @version 1.21
       */
      rowExpandable: PropTypes$1.func,
      /**
       * 额外渲染行的缩进
       */
      expandedRowIndent: PropTypes$1.array,
      /**
       * 默认情况下展开的渲染行或者Tree, 传入此属性为受控状态
       */
      openRowKeys: PropTypes$1.array,
      /**
       * 默认情况下展开的 Expand行 或者 Tree行,非受控模式
       * @version 1.23.22
       */
      defaultOpenRowKeys: PropTypes$1.array,
      /**
       * 是否显示点击展开额外渲染行的+号按钮
       */
      hasExpandedRowCtrl: PropTypes$1.bool,
      /**
       * 设置额外渲染行的属性
       */
      getExpandedColProps: PropTypes$1.func,
      /**
       * 在额外渲染行或者Tree展开或者收起的时候触发的事件
       * @param {Array} openRowKeys 展开的渲染行的key
       * @param {String} currentRowKey 当前点击的渲染行的key
       * @param {Boolean} expanded 当前点击是展开还是收起
       * @param {Object} currentRecord 当前点击额外渲染行的记录
       */
      onRowOpen: PropTypes$1.func,
      onExpandedRowClick: PropTypes$1.func,
      locale: PropTypes$1.object
    }, BaseComponent.propTypes), _class2.defaultProps = _default$8({}, BaseComponent.defaultProps, {
      getExpandedColProps: noop$1,
      onRowOpen: noop$1,
      hasExpandedRowCtrl: true,
      components: {},
      expandedRowIndent: stickyLock2 ? [0, 0] : [1, 0],
      prefix: "next-"
    }), _class2.childContextTypes = {
      openRowKeys: PropTypes$1.array,
      expandedRowRender: PropTypes$1.func,
      expandedIndexSimulate: PropTypes$1.bool,
      expandedRowWidthEquals2Table: PropTypes$1.bool,
      expandedRowIndent: PropTypes$1.array,
      getExpandedRowRef: PropTypes$1.func,
      getTableInstanceForExpand: PropTypes$1.func
    }, _temp22);
    ExpandedTable.displayName = "ExpandedTable";
    statics(ExpandedTable, BaseComponent);
    return polyfill(ExpandedTable);
  }
  var _class$9, _temp2$2;
  var VirtualBody = (_temp2$2 = _class$9 = function(_React$Component) {
    _default$4(VirtualBody2, _React$Component);
    function VirtualBody2() {
      var _temp3, _this2, _ret;
      _default$7(this, VirtualBody2);
      for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
        args[_key] = arguments[_key];
      }
      return _ret = (_temp3 = (_this2 = _default$5(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this2), _this2.tableRef = function(table) {
        _this2.tableNode = table;
      }, _this2.virtualScrollRef = function(virtualScroll) {
        _this2.virtualScrollNode = virtualScroll;
      }, _this2.onScroll = function(current) {
        _this2.context.onFixedScrollSync(current);
        _this2.context.onLockBodyScroll(current);
        _this2.context.onVirtualScroll();
      }, _temp3), _default$5(_this2, _ret);
    }
    VirtualBody2.prototype.componentDidMount = function componentDidMount() {
      var bodyNode = ReactDOM.findDOMNode(this);
      this.context.getNode("body", bodyNode);
      this.context.getBodyNode(bodyNode, this.context.lockType);
      this.context.getLockNode("body", bodyNode, this.context.lockType);
    };
    VirtualBody2.prototype.render = function render2() {
      var _props = this.props, prefix = _props.prefix, className = _props.className, colGroup = _props.colGroup, tableWidth = _props.tableWidth, others = _default$3(_props, ["prefix", "className", "colGroup", "tableWidth"]);
      var _context = this.context, maxBodyHeight = _context.maxBodyHeight, bodyHeight = _context.bodyHeight, innerTop = _context.innerTop;
      var style = {
        width: tableWidth
      };
      var wrapperStyle = {
        position: "relative"
      };
      if (bodyHeight > maxBodyHeight) {
        wrapperStyle.height = bodyHeight;
      }
      return React.createElement(
        "div",
        { style: { maxHeight: maxBodyHeight }, className, onScroll: this.onScroll },
        React.createElement(
          "div",
          { style: wrapperStyle, ref: this.virtualScrollRef },
          React.createElement(
            "div",
            {
              style: {
                position: "relative",
                transform: "translateY(" + innerTop + "px)",
                willChange: "transform"
              }
            },
            React.createElement(
              "table",
              { ref: this.tableRef, style },
              colGroup,
              React.createElement(Body, _default$8({}, others, { prefix }))
            )
          )
        )
      );
    };
    return VirtualBody2;
  }(React.Component), _class$9.propTypes = {
    children: PropTypes$1.any,
    prefix: PropTypes$1.string,
    className: PropTypes$1.string,
    colGroup: PropTypes$1.any,
    tableWidth: PropTypes$1.number
  }, _class$9.contextTypes = {
    maxBodyHeight: PropTypes$1.oneOfType([PropTypes$1.number, PropTypes$1.string]),
    onBodyScroll: PropTypes$1.func,
    onFixedScrollSync: PropTypes$1.func,
    onVirtualScroll: PropTypes$1.func,
    onLockBodyScroll: PropTypes$1.func,
    bodyHeight: PropTypes$1.number,
    innerTop: PropTypes$1.number,
    getNode: PropTypes$1.func,
    getBodyNode: PropTypes$1.func,
    getLockNode: PropTypes$1.func,
    lockType: PropTypes$1.oneOf(["left", "right"])
  }, _temp2$2);
  VirtualBody.displayName = "VirtualBody";
  var noop13 = function noop14() {
  };
  var THRESHOLD = 10;
  function virtual(BaseComponent) {
    var _class2, _temp3;
    var VirtualTable = (_temp3 = _class2 = function(_React$Component) {
      _default$4(VirtualTable2, _React$Component);
      function VirtualTable2(props, context) {
        _default$7(this, VirtualTable2);
        var _this2 = _default$5(this, _React$Component.call(this, props, context));
        _this2.onScroll = function() {
          var scrollTop = _this2.bodyNode.scrollTop;
          if (scrollTop === _this2.lastScrollTop) {
            return;
          }
          var start = _this2.computeScrollToRow(scrollTop);
          if (!("scrollToRow" in _this2.props)) {
            _this2.setState({
              scrollToRow: start
            });
          }
          _this2.props.onBodyScroll(start);
          _this2.lastScrollTop = scrollTop;
        };
        _this2.getBodyNode = function(node, lockType) {
          lockType = lockType ? lockType.charAt(0).toUpperCase() + lockType.substr(1) : "";
          _this2["body" + lockType + "Node"] = node;
        };
        _this2.getTableInstance = function(type2, instance2) {
          type2 = type2 ? type2.charAt(0).toUpperCase() + type2.substr(1) : "";
          _this2["table" + type2 + "Inc"] = instance2;
        };
        var useVirtual = props.useVirtual, dataSource = props.dataSource;
        var hasVirtualData = useVirtual && dataSource && dataSource.length > 0;
        _this2.state = {
          rowHeight: _this2.props.rowHeight,
          scrollToRow: _this2.props.scrollToRow,
          height: _this2.props.maxBodyHeight,
          hasVirtualData
        };
        return _this2;
      }
      VirtualTable2.prototype.getChildContext = function getChildContext() {
        return {
          onVirtualScroll: this.onScroll,
          bodyHeight: this.computeBodyHeight(),
          innerTop: this.computeInnerTop(),
          getBodyNode: this.getBodyNode,
          getTableInstanceForVirtual: this.getTableInstance,
          rowSelection: this.rowSelection
        };
      };
      VirtualTable2.getDerivedStateFromProps = function getDerivedStateFromProps(nextProps, prevState) {
        var state = {};
        if ("maxBodyHeight" in nextProps) {
          if (prevState.height !== nextProps.maxBodyHeight) {
            state.height = nextProps.maxBodyHeight;
          }
        }
        if ("scrollToRow" in nextProps) {
          state.scrollToRow = nextProps.scrollToRow;
        }
        if (prevState.useVirtual !== nextProps.useVirtual || prevState.dataSource !== nextProps.dataSource) {
          state.hasVirtualData = nextProps.useVirtual && nextProps.dataSource && nextProps.dataSource.length > 0;
        }
        return state;
      };
      VirtualTable2.prototype.componentDidMount = function componentDidMount() {
        if (this.state.hasVirtualData && this.bodyNode) {
          this.lastScrollTop = this.bodyNode.scrollTop;
        }
        this.adjustScrollTop();
        this.adjustSize();
        this.reComputeSize();
      };
      VirtualTable2.prototype.componentDidUpdate = function componentDidUpdate() {
        this.adjustScrollTop();
        this.adjustSize();
        this.reComputeSize();
      };
      VirtualTable2.prototype.reComputeSize = function reComputeSize() {
        var _state = this.state, rowHeight = _state.rowHeight, hasVirtualData = _state.hasVirtualData;
        if (typeof rowHeight === "function" && hasVirtualData) {
          var row = this.getRowNode();
          var rowClientHeight = row && row.clientHeight;
          if (rowClientHeight !== this.state.rowHeight) {
            this.setState({
              rowHeight: rowClientHeight
            });
          }
        }
      };
      VirtualTable2.prototype.computeBodyHeight = function computeBodyHeight() {
        var rowHeight = this.state.rowHeight;
        var dataSource = this.props.dataSource;
        if (typeof rowHeight === "function") {
          return 0;
        }
        var count = 0;
        dataSource.forEach(function(item) {
          if (!item.__hidden) {
            count += 1;
          }
        });
        return count * rowHeight;
      };
      VirtualTable2.prototype.computeInnerTop = function computeInnerTop() {
        var rowHeight = this.state.rowHeight;
        if (typeof rowHeight === "function") {
          return 0;
        }
        var start = Math.max(this.start - THRESHOLD, 0);
        return start * rowHeight;
      };
      VirtualTable2.prototype.getVisibleRange = function getVisibleRange(ExpectStart) {
        var _state2 = this.state, height = _state2.height, rowHeight = _state2.rowHeight;
        var len = this.props.dataSource.length;
        var end = void 0, visibleCount = 0;
        var start = 0;
        if (typeof rowHeight === "function") {
          end = 1;
        } else {
          visibleCount = parseInt(dom.getPixels(height) / rowHeight, 10);
          if ("number" === typeof ExpectStart) {
            start = ExpectStart < len ? ExpectStart : 0;
          }
          end = Math.min(+start + 1 + visibleCount + 10, len);
        }
        this.end = end;
        this.visibleCount = visibleCount;
        return {
          start,
          end
        };
      };
      VirtualTable2.prototype.adjustScrollTop = function adjustScrollTop() {
        if (this.state.hasVirtualData && this.bodyNode) {
          this.bodyNode.scrollTop = this.lastScrollTop % this.state.rowHeight + this.state.rowHeight * this.state.scrollToRow;
        }
      };
      VirtualTable2.prototype.adjustSize = function adjustSize() {
        if (this.state.hasVirtualData && this.bodyNode) {
          var body = this.bodyNode;
          var virtualScrollNode = body.querySelector("div");
          var clientHeight = body.clientHeight, clientWidth = body.clientWidth;
          var tableInc = this.tableInc;
          var tableNode = ReactDOM.findDOMNode(tableInc);
          var prefix = this.props.prefix;
          var headerNode = tableNode.querySelector("." + prefix + "table-header table");
          var headerClientWidth = headerNode && headerNode.clientWidth;
          if (clientWidth < headerClientWidth) {
            dom.setStyle(virtualScrollNode, "min-width", headerClientWidth);
            var leftNode = this.bodyLeftNode;
            var rightNode = this.bodyRightNode;
            leftNode && dom.setStyle(leftNode, "max-height", clientHeight);
            rightNode && dom.setStyle(rightNode, "max-height", clientHeight);
          } else {
            dom.setStyle(virtualScrollNode, "min-width", "auto");
          }
        }
      };
      VirtualTable2.prototype.computeScrollToRow = function computeScrollToRow(offset) {
        var rowHeight = this.state.rowHeight;
        var start = parseInt(offset / rowHeight);
        this.start = start;
        return start;
      };
      VirtualTable2.prototype.getRowNode = function getRowNode() {
        try {
          return ReactDOM.findDOMNode(this.tableInc.getRowRef(0));
        } catch (error) {
          return null;
        }
      };
      VirtualTable2.prototype.render = function render2() {
        var _props = this.props;
        _props.useVirtual;
        var components = _props.components, dataSource = _props.dataSource, fixedHeader = _props.fixedHeader;
        _props.rowHeight;
        var scrollToRow = _props.scrollToRow;
        _props.onBodyScroll;
        var others = _default$3(_props, ["useVirtual", "components", "dataSource", "fixedHeader", "rowHeight", "scrollToRow", "onBodyScroll"]);
        var entireDataSource = dataSource;
        var newDataSource = dataSource;
        this.rowSelection = this.props.rowSelection;
        if (this.state.hasVirtualData) {
          newDataSource = [];
          components = _default$8({}, components);
          var _getVisibleRange = this.getVisibleRange(this.state.scrollToRow), start = _getVisibleRange.start, end = _getVisibleRange.end;
          var count = -1;
          dataSource.forEach(function(current, index2, record) {
            if (!current.__hidden) {
              count += 1;
              if (count >= Math.max(start - THRESHOLD, 0) && count < end) {
                newDataSource.push(current);
              }
            }
            current.__rowIndex = index2;
          });
          if (!components.Body) {
            components.Body = VirtualBody;
          }
          fixedHeader = true;
        }
        return React.createElement(BaseComponent, _default$8({}, others, {
          scrollToRow,
          dataSource: newDataSource,
          entireDataSource,
          components,
          fixedHeader
        }));
      };
      return VirtualTable2;
    }(React.Component), _class2.VirtualBody = VirtualBody, _class2.propTypes = _default$8({
      /**
       * 是否开启虚拟滚动
       */
      useVirtual: PropTypes$1.bool,
      /**
       * 设置行高
       */
      rowHeight: PropTypes$1.oneOfType([PropTypes$1.number, PropTypes$1.func]),
      maxBodyHeight: PropTypes$1.oneOfType([PropTypes$1.number, PropTypes$1.string]),
      primaryKey: PropTypes$1.oneOfType([PropTypes$1.symbol, PropTypes$1.string]),
      dataSource: PropTypes$1.array,
      /**
       * 在内容区域滚动的时候触发的函数
       */
      onBodyScroll: PropTypes$1.func
    }, BaseComponent.propTypes), _class2.defaultProps = _default$8({}, BaseComponent.defaultProps, {
      primaryKey: "id",
      rowHeight: noop13,
      maxBodyHeight: 200,
      components: {},
      prefix: "next-",
      onBodyScroll: noop13
    }), _class2.childContextTypes = {
      onVirtualScroll: PropTypes$1.func,
      bodyHeight: PropTypes$1.number,
      innerTop: PropTypes$1.number,
      getBodyNode: PropTypes$1.func,
      getTableInstanceForVirtual: PropTypes$1.func,
      rowSelection: PropTypes$1.object
    }, _temp3);
    VirtualTable.displayName = "VirtualTable";
    statics(VirtualTable, BaseComponent);
    return polyfill(VirtualTable);
  }
  var _class$8, _temp2$1;
  var LockBody = (_temp2$1 = _class$8 = function(_React$Component) {
    _default$4(LockBody2, _React$Component);
    function LockBody2() {
      var _temp3, _this2, _ret;
      _default$7(this, LockBody2);
      for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
        args[_key] = arguments[_key];
      }
      return _ret = (_temp3 = (_this2 = _default$5(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this2), _this2.onBodyScroll = function(event) {
        _this2.context.onLockBodyScroll(event);
      }, _temp3), _default$5(_this2, _ret);
    }
    LockBody2.prototype.componentDidMount = function componentDidMount() {
      this.context.getLockNode("body", ReactDOM.findDOMNode(this), this.context.lockType);
    };
    LockBody2.prototype.render = function render2() {
      var event = {
        onLockScroll: this.onBodyScroll
      };
      return React.createElement(FixedBody, _default$8({}, this.props, event));
    };
    return LockBody2;
  }(React.Component), _class$8.propTypes = _default$8({}, FixedBody.propTypes), _class$8.contextTypes = _default$8({}, FixedBody.contextTypes, {
    getLockNode: PropTypes$1.func,
    onLockBodyScroll: PropTypes$1.func,
    lockType: PropTypes$1.oneOf(["left", "right"])
  }), _temp2$1);
  LockBody.displayName = "LockBody";
  var _class$7, _temp$6;
  var LockHeader = (_temp$6 = _class$7 = function(_FixedHeader) {
    _default$4(LockHeader2, _FixedHeader);
    function LockHeader2() {
      _default$7(this, LockHeader2);
      return _default$5(this, _FixedHeader.apply(this, arguments));
    }
    LockHeader2.prototype.componentDidMount = function componentDidMount() {
      var _context = this.context, getNode = _context.getNode, getLockNode = _context.getLockNode;
      getNode && getNode("header", ReactDOM.findDOMNode(this), this.context.lockType);
      getLockNode && getLockNode("header", ReactDOM.findDOMNode(this), this.context.lockType);
    };
    return LockHeader2;
  }(FixedHeader), _class$7.propTypes = _default$8({}, FixedHeader.propTypes), _class$7.contextTypes = _default$8({}, FixedHeader.contextTypes, {
    getLockNode: PropTypes$1.func,
    lockType: PropTypes$1.oneOf(["left", "right"])
  }), _temp$6);
  var ieVersion$1 = env.ieVersion;
  function lock(BaseComponent) {
    var _class2, _temp3;
    var LockTable = (_temp3 = _class2 = function(_React$Component) {
      _default$4(LockTable2, _React$Component);
      function LockTable2(props, context) {
        _default$7(this, LockTable2);
        var _this2 = _default$5(this, _React$Component.call(this, props, context));
        _this2.state = {};
        _this2.getTableInstance = function(type2, instance2) {
          type2 = type2 ? type2.charAt(0).toUpperCase() + type2.substr(1) : "";
          _this2["table" + type2 + "Inc"] = instance2;
        };
        _this2.getNode = function(type2, node, lockType) {
          lockType = lockType ? lockType.charAt(0).toUpperCase() + lockType.substr(1) : "";
          _this2["" + type2 + lockType + "Node"] = node;
          if (type2 === "header" && !_this2.innerHeaderNode && !lockType) {
            _this2.innerHeaderNode = _this2.headerNode.querySelector("div");
          }
        };
        _this2.onRowMouseEnter = function(record, index2) {
          if (_this2.isLock()) {
            var row = _this2.getRowNode(index2);
            var leftRow = _this2.getRowNode(index2, "left");
            var rightRow = _this2.getRowNode(index2, "right");
            [row, leftRow, rightRow].forEach(function(row2) {
              row2 && dom.addClass(row2, "hovered");
            });
          }
        };
        _this2.onRowMouseLeave = function(record, index2) {
          if (_this2.isLock()) {
            var row = _this2.getRowNode(index2);
            var leftRow = _this2.getRowNode(index2, "left");
            var rightRow = _this2.getRowNode(index2, "right");
            [row, leftRow, rightRow].forEach(function(row2) {
              row2 && dom.removeClass(row2, "hovered");
            });
          }
        };
        _this2.onLockBodyScrollTop = function(event) {
          var target = event.target;
          if (event.currentTarget !== target) {
            return;
          }
          var distScrollTop = target.scrollTop;
          if (_this2.isLock() && distScrollTop !== _this2.lastScrollTop) {
            var lockRightBody = _this2.bodyRightNode, lockLeftBody = _this2.bodyLeftNode, bodyNode = _this2.bodyNode;
            var arr = [lockLeftBody, lockRightBody, bodyNode];
            arr.forEach(function(node) {
              if (node && node.scrollTop !== distScrollTop) {
                node.scrollTop = distScrollTop;
              }
            });
            _this2.lastScrollTop = distScrollTop;
          }
        };
        _this2.onLockBodyScrollLeft = function() {
          if (_this2.isLock()) {
            var rtl = _this2.props.rtl;
            var lockRightTable = rtl ? _this2.getWrapperNode("left") : _this2.getWrapperNode("right"), lockLeftTable = rtl ? _this2.getWrapperNode("right") : _this2.getWrapperNode("left"), shadowClassName = "shadow";
            var x2 = _this2.bodyNode.scrollLeft;
            if (x2 === 0) {
              lockLeftTable && dom.removeClass(lockLeftTable, shadowClassName);
              lockRightTable && dom.addClass(lockRightTable, shadowClassName);
            } else if (x2 === _this2.bodyNode.scrollWidth - _this2.bodyNode.clientWidth) {
              lockLeftTable && dom.addClass(lockLeftTable, shadowClassName);
              lockRightTable && dom.removeClass(lockRightTable, shadowClassName);
            } else {
              lockLeftTable && dom.addClass(lockLeftTable, shadowClassName);
              lockRightTable && dom.addClass(lockRightTable, shadowClassName);
            }
          }
        };
        _this2.onLockBodyScroll = function(event) {
          _this2.onLockBodyScrollTop(event);
          _this2.onLockBodyScrollLeft();
        };
        _this2.adjustSize = function() {
          if (!_this2.adjustIfTableNotNeedLock()) {
            _this2.adjustHeaderSize();
            _this2.adjustBodySize();
            _this2.adjustRowHeight();
            _this2.onLockBodyScrollLeft();
          }
        };
        _this2.getFlatenChildrenLength = function() {
          var children = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [];
          var loop = function loop2(arr) {
            var newArray = [];
            arr.forEach(function(child) {
              if (child && child.children) {
                newArray.push.apply(newArray, loop2(child.children));
              } else {
                newArray.push(child);
              }
            });
            return newArray;
          };
          return loop(children).length;
        };
        _this2.saveLockLeftRef = function(ref) {
          _this2.lockLeftEl = ref;
        };
        _this2.saveLockRightRef = function(ref) {
          _this2.lockRightEl = ref;
        };
        _this2.lockLeftChildren = [];
        _this2.lockRightChildren = [];
        return _this2;
      }
      LockTable2.prototype.getChildContext = function getChildContext() {
        return {
          getTableInstance: this.getTableInstance,
          getLockNode: this.getNode,
          onLockBodyScroll: this.onLockBodyScroll,
          onRowMouseEnter: this.onRowMouseEnter,
          onRowMouseLeave: this.onRowMouseLeave
        };
      };
      LockTable2.prototype.componentDidMount = function componentDidMount() {
        events.on(window, "resize", this.adjustSize);
        this.scroll();
        this.adjustSize();
        this.forceUpdate();
      };
      LockTable2.prototype.shouldComponentUpdate = function shouldComponentUpdate(nextProps, nextState, nextContext) {
        if (nextProps.pure) {
          var isEqual = shallowElementEquals$1(nextProps, this.props);
          return !(isEqual && obj.shallowEqual(nextContext, this.context));
        }
        return true;
      };
      LockTable2.prototype.componentDidUpdate = function componentDidUpdate() {
        this.adjustSize();
        this._isLock = false;
      };
      LockTable2.prototype.componentWillUnmount = function componentWillUnmount() {
        events.off(window, "resize", this.adjustSize);
      };
      LockTable2.prototype.normalizeChildrenState = function normalizeChildrenState(props) {
        var columns = this.normalizeChildren(props);
        var splitChildren = this.splitFromNormalizeChildren(columns);
        var lockLeftChildren = splitChildren.lockLeftChildren, lockRightChildren = splitChildren.lockRightChildren;
        return {
          lockLeftChildren,
          lockRightChildren,
          children: this.mergeFromSplitLockChildren(splitChildren)
        };
      };
      LockTable2.prototype.normalizeChildren = function normalizeChildren(props) {
        var children = props.children, columns = props.columns;
        var isLock = false, ret = void 0;
        var checkLock = function checkLock2(col) {
          if ([true, "left", "right"].indexOf(col.lock) > -1) {
            if (!("width" in col)) {
              log.warning("Should config width for lock column named [ " + col.dataIndex + " ].");
            }
            isLock = true;
          }
        };
        if (columns && !children) {
          ret = columns;
          var getColumns = function getColumns2(cols) {
            cols.forEach(function() {
              var col = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
              checkLock(col);
              if (col.children) {
                getColumns2(col.children);
              }
            });
          };
          getColumns(columns);
        } else {
          var getChildren = function getChildren2(children2) {
            var ret2 = [];
            React.Children.forEach(children2, function(child) {
              if (child) {
                var _props = _default$8({}, child.props);
                checkLock(_props);
                ret2.push(_props);
                if (child.props.children) {
                  _props.children = getChildren2(child.props.children);
                }
              }
            });
            return ret2;
          };
          ret = getChildren(children);
        }
        ret.forEach(function(child) {
          if (child.__normalized && isLock) {
            child.lock = child.lock || "left";
            delete child.__normalized;
          }
        });
        this._isLock = isLock;
        return ret;
      };
      LockTable2.prototype.splitFromNormalizeChildren = function splitFromNormalizeChildren(children) {
        var originChildren = deepCopy$1(children);
        var lockLeftChildren = deepCopy$1(children);
        var lockRightChildren = deepCopy$1(children);
        var loop = function loop2(lockChildren, condition) {
          var ret = [];
          lockChildren.forEach(function(child) {
            if (child.children) {
              var res = loop2(child.children, condition);
              if (!res.length) {
                ret.push(child);
              }
            } else {
              var order = condition(child);
              if (!order) {
                ret.push(child);
              }
            }
          });
          ret.forEach(function(res) {
            var index2 = lockChildren.indexOf(res);
            lockChildren.splice(index2, 1);
          });
          return lockChildren;
        };
        loop(lockLeftChildren, function(child) {
          if (child.lock === true || child.lock === "left") {
            return "left";
          }
        });
        loop(lockRightChildren, function(child) {
          if (child.lock === "right") {
            return "right";
          }
        });
        loop(originChildren, function(child) {
          return child.lock !== true && child.lock !== "left" && child.lock !== "right";
        });
        return {
          lockLeftChildren,
          lockRightChildren,
          originChildren
        };
      };
      LockTable2.prototype.mergeFromSplitLockChildren = function mergeFromSplitLockChildren(splitChildren) {
        var lockLeftChildren = splitChildren.lockLeftChildren, lockRightChildren = splitChildren.lockRightChildren;
        var originChildren = splitChildren.originChildren;
        Array.prototype.unshift.apply(originChildren, lockLeftChildren);
        originChildren = originChildren.concat(lockRightChildren);
        return originChildren;
      };
      LockTable2.prototype.scroll = function scroll() {
        var _props2 = this.props, _props2$scrollToCol = _props2.scrollToCol, scrollToCol = _props2$scrollToCol === void 0 ? 0 : _props2$scrollToCol, _props2$scrollToRow = _props2.scrollToRow, scrollToRow = _props2$scrollToRow === void 0 ? 0 : _props2$scrollToRow;
        if (!scrollToCol && !scrollToRow || !this.bodyNode) {
          return;
        }
        var colCellNode = this.getCellNode(0, scrollToCol);
        var rowCellNode = this.getCellNode(scrollToRow, 0);
        var bodyNodeOffset = this.bodyNode.getBoundingClientRect() || {};
        if (colCellNode) {
          var cellNodeoffset = colCellNode.getBoundingClientRect();
          var scrollLeft = cellNodeoffset.left - bodyNodeOffset.left;
          this.bodyNode.scrollLeft = scrollLeft;
        }
        if (rowCellNode) {
          var _cellNodeoffset = rowCellNode.getBoundingClientRect();
          var scrollTop = _cellNodeoffset.top - bodyNodeOffset.top;
          this.bodyNode.scrollTop = scrollTop;
        }
      };
      LockTable2.prototype.isLock = function isLock() {
        return this.lockLeftChildren.length || this.lockRightChildren.length;
      };
      LockTable2.prototype.isOriginLock = function isOriginLock() {
        return this._isLock;
      };
      LockTable2.prototype.removeLockTable = function removeLockTable() {
        var lockLeftLen = this.lockLeftChildren.length;
        var lockRightLen = this.lockRightChildren.length;
        if (lockLeftLen) {
          this._notNeedAdjustLockLeft = true;
        }
        if (lockRightLen) {
          this._notNeedAdjustLockRight = true;
        }
        if (lockRightLen || lockLeftLen) {
          this.forceUpdate();
          return true;
        }
      };
      LockTable2.prototype.adjustIfTableNotNeedLock = function adjustIfTableNotNeedLock() {
        var _this2 = this;
        if (this.isOriginLock()) {
          var widthObj = this.tableInc.flatChildren.map(function(item, index2) {
            var cell5 = _this2.getCellNode(0, index2) || {};
            var headerCell = _this2.getHeaderCellNode(0, index2) || {};
            try {
              return {
                cellWidths: parseFloat(getComputedStyle(cell5).width) || 0,
                headerWidths: parseFloat(getComputedStyle(headerCell).width) || 0
              };
            } catch (error) {
              return {
                cellWidths: cell5.clientWidth || 0,
                headerWidths: headerCell.clientWidth || 0
              };
            }
          }).reduce(function(a, b2) {
            return {
              cellWidths: a.cellWidths + b2.cellWidths,
              headerWidths: a.headerWidths + b2.headerWidths
            };
          }, {
            cellWidths: 0,
            headerWidths: 0
          });
          var node = void 0, width = void 0;
          try {
            node = ReactDOM.findDOMNode(this);
            width = node.clientWidth;
          } catch (err) {
            node = null;
            width = 0;
          }
          if (width === 0) {
            return true;
          }
          var configWidths = parseInt(widthObj.cellWidths) || parseInt(widthObj.headerWidths);
          if (configWidths <= width && configWidths > 0) {
            this.removeLockTable();
          } else if (this._notNeedAdjustLockLeft || this._notNeedAdjustLockRight) {
            this._notNeedAdjustLockLeft = this._notNeedAdjustLockRight = false;
            this.forceUpdate();
          } else {
            this._notNeedAdjustLockLeft = this._notNeedAdjustLockRight = false;
            return false;
          }
        }
        return false;
      };
      LockTable2.prototype.adjustBodySize = function adjustBodySize() {
        var _style;
        var _props3 = this.props, rtl = _props3.rtl, hasHeader = _props3.hasHeader;
        var header = this.headerNode;
        var paddingName = rtl ? "paddingLeft" : "paddingRight";
        var marginName = rtl ? "marginLeft" : "marginRight";
        var scrollBarSize = +dom.scrollbar().width || 0;
        var style = (_style = {}, _style[paddingName] = scrollBarSize, _style[marginName] = scrollBarSize, _style);
        var body = this.bodyNode, hasVerScroll = body && body.scrollHeight > body.clientHeight;
        if (this.isLock()) {
          var lockLeftBody = this.bodyLeftNode, lockRightBody = this.bodyRightNode, lockRightBodyWrapper = this.getWrapperNode("right"), bodyHeight = body.offsetHeight, width = hasVerScroll ? scrollBarSize : 0, lockBodyHeight = bodyHeight - scrollBarSize;
          if (!hasVerScroll) {
            style[paddingName] = 0;
            style[marginName] = 0;
          }
          if (+scrollBarSize) {
            style.marginBottom = -scrollBarSize;
            style.paddingBottom = scrollBarSize;
          } else {
            style.marginBottom = -20;
            style.paddingBottom = 20;
          }
          var lockStyle = {
            "max-height": lockBodyHeight
          };
          if (!hasHeader && !+scrollBarSize) {
            lockStyle[marginName] = 0;
          }
          if (+scrollBarSize) {
            lockStyle[marginName] = -scrollBarSize;
          }
          lockLeftBody && dom.setStyle(lockLeftBody, lockStyle);
          lockRightBody && dom.setStyle(lockRightBody, lockStyle);
          lockRightBodyWrapper && +scrollBarSize && dom.setStyle(lockRightBodyWrapper, rtl ? "left" : "right", width + "px");
        } else {
          style.marginBottom = -scrollBarSize;
          style.paddingBottom = scrollBarSize;
          style[marginName] = 0;
          if (!hasVerScroll) {
            style[paddingName] = 0;
          }
        }
        header && dom.setStyle(header, style);
      };
      LockTable2.prototype.adjustHeaderSize = function adjustHeaderSize() {
        var _this3 = this;
        if (this.isLock()) {
          this.tableInc.groupChildren.forEach(function(child, index2) {
            var lastIndex = _this3.tableInc.groupChildren[index2].length - 1;
            var headerRightRow = _this3.getHeaderCellNode(index2, lastIndex), headerLeftRow = _this3.getHeaderCellNode(index2, 0), headerRightLockRow = _this3.getHeaderCellNode(index2, 0, "right"), headerLeftLockRow = _this3.getHeaderCellNode(index2, 0, "left");
            if (headerRightRow && headerRightLockRow) {
              var maxRightRowHeight = headerRightRow.offsetHeight;
              dom.setStyle(headerRightLockRow, "height", maxRightRowHeight);
              setTimeout(function() {
                var affixRef = _this3.tableRightInc.affixRef;
                return affixRef && affixRef.getInstance() && affixRef.getInstance().updatePosition();
              });
            }
            if (headerLeftRow && headerLeftLockRow) {
              var maxLeftRowHeight = headerLeftRow.offsetHeight;
              dom.setStyle(headerLeftLockRow, "height", maxLeftRowHeight);
              setTimeout(function() {
                var affixRef = _this3.tableLeftInc.affixRef;
                return affixRef && affixRef.getInstance() && affixRef.getInstance().updatePosition();
              });
            }
          });
        }
      };
      LockTable2.prototype.adjustRowHeight = function adjustRowHeight() {
        var _this4 = this;
        if (this.isLock()) {
          this.tableInc.props.dataSource.forEach(function(item, index2) {
            var rowIndex = "" + ((typeof item === "undefined" ? "undefined" : _default$6(item)) === "object" && "__rowIndex" in item ? item.__rowIndex : index2) + (item.__expanded ? "_expanded" : "");
            _this4.setRowHeight(rowIndex, "left");
            _this4.setRowHeight(rowIndex, "right");
          });
        }
      };
      LockTable2.prototype.setRowHeight = function setRowHeight(rowIndex, dir) {
        var lockRow = this.getRowNode(rowIndex, dir), row = this.getRowNode(rowIndex), rowHeight = (ieVersion$1 ? row && row.offsetHeight : row && parseFloat(getComputedStyle(row).height)) || "auto", lockHeight = (ieVersion$1 ? lockRow && lockRow.offsetHeight : lockRow && parseFloat(getComputedStyle(lockRow).height)) || "auto";
        if (lockRow && rowHeight !== lockHeight) {
          dom.setStyle(lockRow, "height", rowHeight);
        }
      };
      LockTable2.prototype.getWrapperNode = function getWrapperNode(type2) {
        type2 = type2 ? type2.charAt(0).toUpperCase() + type2.substr(1) : "";
        try {
          return ReactDOM.findDOMNode(this["lock" + type2 + "El"]);
        } catch (error) {
          return null;
        }
      };
      LockTable2.prototype.getRowNode = function getRowNode(index2, type2) {
        type2 = type2 ? type2.charAt(0).toUpperCase() + type2.substr(1) : "";
        var table = this["table" + type2 + "Inc"];
        try {
          return ReactDOM.findDOMNode(table.getRowRef(index2));
        } catch (error) {
          return null;
        }
      };
      LockTable2.prototype.getHeaderCellNode = function getHeaderCellNode(index2, i, type2) {
        type2 = type2 ? type2.charAt(0).toUpperCase() + type2.substr(1) : "";
        var table = this["table" + type2 + "Inc"];
        try {
          return ReactDOM.findDOMNode(table.getHeaderCellRef(index2, i));
        } catch (error) {
          return null;
        }
      };
      LockTable2.prototype.getCellNode = function getCellNode(index2, i, type2) {
        type2 = type2 ? type2.charAt(0).toUpperCase() + type2.substr(1) : "";
        var table = this["table" + type2 + "Inc"];
        try {
          return ReactDOM.findDOMNode(table.getCellRef(index2, i));
        } catch (error) {
          return null;
        }
      };
      LockTable2.prototype.render = function render2() {
        var _props4 = this.props;
        _props4.children;
        _props4.columns;
        var prefix = _props4.prefix, components = _props4.components, className = _props4.className, dataSource = _props4.dataSource, tableWidth = _props4.tableWidth, others = _default$3(_props4, ["children", "columns", "prefix", "components", "className", "dataSource", "tableWidth"]);
        var _normalizeChildrenSta = this.normalizeChildrenState(this.props), lockLeftChildren = _normalizeChildrenSta.lockLeftChildren, lockRightChildren = _normalizeChildrenSta.lockRightChildren, normalizedChildren = _normalizeChildrenSta.children;
        var leftLen = this.getFlatenChildrenLength(lockLeftChildren);
        var rightLen = this.getFlatenChildrenLength(lockRightChildren);
        var originLen = this.getFlatenChildrenLength(normalizedChildren);
        var lengths = {
          left: leftLen,
          right: rightLen,
          origin: originLen
        };
        if (this._notNeedAdjustLockLeft) {
          lockLeftChildren = [];
        }
        if (this._notNeedAdjustLockRight) {
          lockRightChildren = [];
        }
        this.lockLeftChildren = lockLeftChildren;
        this.lockRightChildren = lockRightChildren;
        if (this.isOriginLock()) {
          var _classnames;
          components = _default$8({}, components);
          components.Body = components.Body || LockBody;
          components.Header = components.Header || LockHeader;
          components.Wrapper = components.Wrapper || FixedWrapper;
          components.Row = components.Row || LockRow;
          className = classnames((_classnames = {}, _classnames[prefix + "table-lock"] = true, _classnames[prefix + "table-wrap-empty"] = !dataSource.length, _classnames[className] = className, _classnames));
          var content = [React.createElement(BaseComponent, _default$8({}, others, {
            dataSource,
            key: "lock-left",
            columns: lockLeftChildren,
            className: prefix + "table-lock-left",
            lengths,
            prefix,
            lockType: "left",
            components,
            ref: this.saveLockLeftRef,
            loading: false,
            "aria-hidden": true
          })), React.createElement(BaseComponent, _default$8({}, others, {
            dataSource,
            key: "lock-right",
            columns: lockRightChildren,
            className: prefix + "table-lock-right",
            lengths,
            prefix,
            lockType: "right",
            components,
            ref: this.saveLockRightRef,
            loading: false,
            "aria-hidden": true
          }))];
          return React.createElement(BaseComponent, _default$8({}, others, {
            tableWidth,
            dataSource,
            columns: normalizedChildren,
            prefix,
            lengths,
            wrapperContent: content,
            components,
            className
          }));
        }
        return React.createElement(BaseComponent, this.props);
      };
      return LockTable2;
    }(React.Component), _class2.LockRow = LockRow, _class2.LockBody = LockBody, _class2.LockHeader = LockHeader, _class2.propTypes = _default$8({
      scrollToCol: PropTypes$1.number,
      /**
       * 指定滚动到某一行,仅在`useVirtual`的时候生效
       */
      scrollToRow: PropTypes$1.number
    }, BaseComponent.propTypes), _class2.defaultProps = _default$8({}, BaseComponent.defaultProps), _class2.childContextTypes = {
      getTableInstance: PropTypes$1.func,
      getLockNode: PropTypes$1.func,
      onLockBodyScroll: PropTypes$1.func,
      onRowMouseEnter: PropTypes$1.func,
      onRowMouseLeave: PropTypes$1.func
    }, _temp3);
    LockTable.displayName = "LockTable";
    statics(LockTable, BaseComponent);
    return LockTable;
  }
  function deepCopy$1(arr) {
    var copy = function copy2(arr2) {
      return arr2.map(function(item) {
        var newItem = _default$8({}, item);
        if (item.children) {
          item.children = copy2(item.children);
        }
        return newItem;
      });
    };
    return copy(arr);
  }
  function stickyLock(BaseComponent) {
    var _class2, _temp3;
    var LockTable = (_temp3 = _class2 = function(_React$Component) {
      _default$4(LockTable2, _React$Component);
      function LockTable2(props, context) {
        _default$7(this, LockTable2);
        var _this2 = _default$5(this, _React$Component.call(this, props));
        _this2.state = {};
        _this2.updateOffsetArr = function() {
          var _ref = _this2.splitChildren || {}, lockLeftChildren = _ref.lockLeftChildren, lockRightChildren = _ref.lockRightChildren, originChildren = _ref.originChildren;
          var leftLen = _this2.getFlatenChildren(lockLeftChildren).length;
          var rightLen = _this2.getFlatenChildren(lockRightChildren).length;
          var totalLen = leftLen + rightLen + _this2.getFlatenChildren(originChildren).length;
          var hasLockLeft = leftLen > 0;
          var hasLockRight = rightLen > 0;
          var leftOffsetArr = _this2.getStickyWidth(lockLeftChildren, "left", totalLen);
          var rightOffsetArr = _this2.getStickyWidth(lockRightChildren, "right", totalLen);
          var state = {};
          if ("" + leftOffsetArr !== "" + _this2.state.leftOffsetArr) {
            state.leftOffsetArr = leftOffsetArr;
          }
          if ("" + rightOffsetArr !== "" + _this2.state.rightOffsetArr) {
            state.rightOffsetArr = rightOffsetArr;
          }
          if (hasLockLeft !== _this2.state.hasLockLeft) {
            state.hasLockLeft = hasLockLeft;
          }
          if (hasLockRight !== _this2.state.hasLockRight) {
            state.hasLockRight = hasLockRight;
          }
          if (Object.keys(state).length > 0) {
            _this2.setState(state);
          }
        };
        _this2.onLockBodyScroll = function(e2, forceSet) {
          var _ref2 = e2.currentTarget || {}, scrollLeft = _ref2.scrollLeft, scrollWidth = _ref2.scrollWidth, clientWidth = _ref2.clientWidth;
          var pingRight = _this2.pingRight, pingLeft = _this2.pingLeft;
          var pingLeftNext = scrollLeft > 0 && _this2.state.hasLockLeft;
          var pingRightNext = scrollLeft < scrollWidth - clientWidth && _this2.state.hasLockRight;
          if (forceSet || pingLeft !== pingLeftNext || pingRight !== pingRightNext) {
            var prefix = _this2.props.prefix;
            var table = _this2.getTableNode();
            _this2.pingLeft = pingLeftNext;
            _this2.pingRight = pingRightNext;
            var leftFunc = pingLeftNext ? "addClass" : "removeClass";
            dom[leftFunc](table, prefix + "table-ping-left");
            var rightFunc = pingRightNext ? "addClass" : "removeClass";
            dom[rightFunc](table, prefix + "table-ping-right");
          }
        };
        _this2.getStickyWidth = function(lockChildren, dir, totalLen) {
          var _this$props = _this2.props, dataSource = _this$props.dataSource, scrollToRow = _this$props.scrollToRow;
          var offsetArr = [];
          var flatenChildren = _this2.getFlatenChildren(lockChildren);
          var len = flatenChildren.length;
          flatenChildren.reduce(function(ret, col, index2) {
            var tag = dir === "left" ? index2 : len - 1 - index2;
            var tagNext = dir === "left" ? tag - 1 : tag + 1;
            var nodeToGetWidth = dir === "left" ? tag - 1 : totalLen - index2;
            if (dir === "left" && tag === 0) {
              ret[0] = 0;
              return ret;
            } else if (dir === "right" && tag === len - 1) {
              ret[tag] = 0;
              return ret;
            }
            var isEmpty = !(dataSource && dataSource.length > 0);
            var node = isEmpty ? _this2.getHeaderCellNode(0, nodeToGetWidth) : _this2.getCellNode(scrollToRow || dataSource[0] && dataSource[0].__rowIndex || 0, nodeToGetWidth);
            var colWidth = node && parseFloat(getComputedStyle(node).width) || 0;
            ret[tag] = (ret[tagNext] || 0) + colWidth;
            return ret;
          }, offsetArr);
          return offsetArr;
        };
        _this2.getTableInstance = function(type2, instance2) {
          type2 = "";
          _this2["table" + type2 + "Inc"] = instance2;
        };
        _this2.getNode = function(type2, node) {
          _this2[type2 + "Node"] = node;
        };
        _this2.getFlatenChildren = function() {
          var children = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [];
          var loop = function loop2(arr) {
            var newArray = [];
            arr.forEach(function(child) {
              if (child.children) {
                newArray.push.apply(newArray, loop2(child.children));
              } else {
                newArray.push(child);
              }
            });
            return newArray;
          };
          return loop(children);
        };
        _this2.state = {
          hasLockLeft: true,
          hasLockRight: true
        };
        _this2.pingLeft = false;
        _this2.pingRight = false;
        return _this2;
      }
      LockTable2.prototype.getChildContext = function getChildContext() {
        return {
          getTableInstance: this.getTableInstance,
          getLockNode: this.getNode,
          onLockBodyScroll: this.onLockBodyScroll
        };
      };
      LockTable2.prototype.componentDidMount = function componentDidMount() {
        var dataSource = this.props.dataSource;
        var isEmpty = !(dataSource && dataSource.length > 0);
        this.updateOffsetArr();
        this.onLockBodyScroll(isEmpty ? { currentTarget: this.headerNode } : { currentTarget: this.bodyNode });
        this.forceUpdate();
        events.on(window, "resize", this.updateOffsetArr);
      };
      LockTable2.prototype.shouldComponentUpdate = function shouldComponentUpdate(nextProps, nextState, nextContext) {
        if (nextProps.pure) {
          var isEqual = shallowElementEquals$1(nextProps, this.props);
          return !(isEqual && obj.shallowEqual(nextContext, this.context));
        }
        return true;
      };
      LockTable2.prototype.componentDidUpdate = function componentDidUpdate() {
        this.updateOffsetArr();
        this.onLockBodyScroll(this.bodyNode ? { currentTarget: this.bodyNode } : { currentTarget: this.headerNode }, true);
      };
      LockTable2.prototype.componentWillUnmount = function componentWillUnmount() {
        this.pingLeft = false;
        this.pingRight = false;
        events.off(window, "resize", this.updateOffsetArr);
      };
      LockTable2.prototype.normalizeChildrenState = function normalizeChildrenState(props) {
        var columns = this.normalizeChildren(props);
        this.splitChildren = this.splitFromNormalizeChildren(columns);
        return this.mergeFromSplitLockChildren(this.splitChildren, props.prefix);
      };
      LockTable2.prototype.normalizeChildren = function normalizeChildren(props) {
        var children = props.children, columns = props.columns;
        var isLock = false, ret = void 0;
        var getChildren = function getChildren2(children2) {
          var ret2 = [];
          React.Children.forEach(children2, function(child) {
            if (child) {
              var _props = _default$8({}, child.props);
              if ([true, "left", "right"].indexOf(_props.lock) > -1) {
                isLock = true;
                if (!("width" in _props)) {
                  log.warning("Should config width for lock column named [ " + _props.dataIndex + " ].");
                }
              }
              ret2.push(_props);
              if (child.props.children) {
                _props.children = getChildren2(child.props.children);
              }
            }
          });
          return ret2;
        };
        if (columns && !children) {
          ret = columns;
          isLock = columns.find(function(record) {
            return [true, "left", "right"].indexOf(record.lock) > -1;
          });
        } else {
          ret = getChildren(children);
        }
        ret.forEach(function(child) {
          if (child.__normalized && isLock) {
            child.lock = child.lock || "left";
            delete child.__normalized;
          }
        });
        return ret;
      };
      LockTable2.prototype.splitFromNormalizeChildren = function splitFromNormalizeChildren(children) {
        var originChildren = deepCopy(children);
        var lockLeftChildren = deepCopy(children);
        var lockRightChildren = deepCopy(children);
        var loop = function loop2(lockChildren, condition) {
          var ret = [];
          lockChildren.forEach(function(child) {
            if (child.children) {
              var res = loop2(child.children, condition);
              if (!res.length) {
                ret.push(child);
              }
            } else {
              var order = condition(child);
              if (!order) {
                ret.push(child);
              }
            }
          });
          ret.forEach(function(res) {
            var index2 = lockChildren.indexOf(res);
            lockChildren.splice(index2, 1);
          });
          return lockChildren;
        };
        loop(lockLeftChildren, function(child) {
          if (child.lock === true || child.lock === "left") {
            return "left";
          }
        });
        loop(lockRightChildren, function(child) {
          if (child.lock === "right") {
            return "right";
          }
        });
        loop(originChildren, function(child) {
          return child.lock !== true && child.lock !== "left" && child.lock !== "right";
        });
        return {
          lockLeftChildren,
          lockRightChildren,
          originChildren
        };
      };
      LockTable2.prototype.mergeFromSplitLockChildren = function mergeFromSplitLockChildren(splitChildren, prefix) {
        var lockLeftChildren = splitChildren.lockLeftChildren, lockRightChildren = splitChildren.lockRightChildren;
        var originChildren = splitChildren.originChildren;
        var flatenLeftChildren = this.getFlatenChildren(lockLeftChildren);
        var flatenRightChildren = this.getFlatenChildren(lockRightChildren);
        setStickyStyle(lockLeftChildren, flatenLeftChildren, "left", this.state.leftOffsetArr, prefix);
        setStickyStyle(lockRightChildren, flatenRightChildren, "right", this.state.rightOffsetArr, prefix);
        return [].concat(lockLeftChildren, originChildren, lockRightChildren);
      };
      LockTable2.prototype.getCellNode = function getCellNode(index2, i) {
        var table = this.tableInc;
        try {
          return ReactDOM.findDOMNode(table.getCellRef(index2, i));
        } catch (error) {
          return null;
        }
      };
      LockTable2.prototype.getTableNode = function getTableNode() {
        var table = this.tableInc;
        try {
          return ReactDOM.findDOMNode(table.tableEl);
        } catch (error) {
          return null;
        }
      };
      LockTable2.prototype.getHeaderCellNode = function getHeaderCellNode(index2, i) {
        var table = this.tableInc;
        try {
          return ReactDOM.findDOMNode(table.getHeaderCellRef(index2, i));
        } catch (error) {
          return null;
        }
      };
      LockTable2.prototype.render = function render2() {
        var _classnames;
        var _props2 = this.props;
        _props2.children;
        _props2.columns;
        var prefix = _props2.prefix, components = _props2.components;
        _props2.scrollToRow;
        var className = _props2.className, dataSource = _props2.dataSource, others = _default$3(_props2, ["children", "columns", "prefix", "components", "scrollToRow", "className", "dataSource"]);
        var normalizedChildren = this.normalizeChildrenState(this.props);
        components = _default$8({}, components);
        components.Body = components.Body || LockBody;
        components.Header = components.Header || LockHeader;
        components.Wrapper = components.Wrapper || FixedWrapper;
        components.Row = components.Row || LockRow;
        className = classnames((_classnames = {}, _classnames[prefix + "table-lock"] = true, _classnames[prefix + "table-stickylock"] = true, _classnames[prefix + "table-wrap-empty"] = !dataSource.length, _classnames[className] = className, _classnames));
        return React.createElement(BaseComponent, _default$8({}, others, {
          dataSource,
          columns: normalizedChildren,
          prefix,
          components,
          className
        }));
      };
      return LockTable2;
    }(React.Component), _class2.LockRow = LockRow, _class2.LockBody = LockBody, _class2.LockHeader = LockHeader, _class2.propTypes = _default$8({
      scrollToCol: PropTypes$1.number,
      /**
       * 指定滚动到某一行,仅在`useVirtual`的时候生效
       */
      scrollToRow: PropTypes$1.number
    }, BaseComponent.propTypes), _class2.defaultProps = _default$8({}, BaseComponent.defaultProps), _class2.childContextTypes = {
      getTableInstance: PropTypes$1.func,
      getLockNode: PropTypes$1.func,
      onLockBodyScroll: PropTypes$1.func
    }, _temp3);
    LockTable.displayName = "LockTable";
    statics(LockTable, BaseComponent);
    return LockTable;
  }
  function deepCopy(arr) {
    var copy = function copy2(arr2) {
      return arr2.map(function(item) {
        var newItem = _default$8({}, item);
        if (item.children) {
          item.children = copy2(item.children);
        }
        return newItem;
      });
    };
    return copy(arr);
  }
  var _class$6, _temp$5;
  var ListHeader = (_temp$5 = _class$6 = function(_React$Component) {
    _default$4(ListHeader2, _React$Component);
    function ListHeader2() {
      _default$7(this, ListHeader2);
      return _default$5(this, _React$Component.apply(this, arguments));
    }
    ListHeader2.prototype.render = function render2() {
      return null;
    };
    return ListHeader2;
  }(React.Component), _class$6.propTypes = {
    /**
     * 行渲染的逻辑
     */
    cell: PropTypes$1.oneOfType([PropTypes$1.element, PropTypes$1.node, PropTypes$1.func]),
    /**
     * 是否在Children上面渲染selection
     */
    hasChildrenSelection: PropTypes$1.bool,
    /**
     * 是否在GroupHeader上面渲染selection
     */
    hasSelection: PropTypes$1.bool,
    /**
     * 当 dataSouce 里没有 children 时,是否使用内容作为数据
     */
    useFirstLevelDataWhenNoChildren: PropTypes$1.bool
  }, _class$6.defaultProps = {
    cell: function cell3() {
      return "";
    },
    hasSelection: true,
    hasChildrenSelection: false,
    useFirstLevelDataWhenNoChildren: false
  }, _class$6._typeMark = "listHeader", _temp$5);
  ListHeader.displayName = "ListHeader";
  var _class$5, _temp$4;
  var ListFooter = (_temp$4 = _class$5 = function(_React$Component) {
    _default$4(ListFooter2, _React$Component);
    function ListFooter2() {
      _default$7(this, ListFooter2);
      return _default$5(this, _React$Component.apply(this, arguments));
    }
    ListFooter2.prototype.render = function render2() {
      return null;
    };
    return ListFooter2;
  }(React.Component), _class$5.propTypes = {
    /**
     * 行渲染的逻辑
     */
    cell: PropTypes$1.oneOfType([PropTypes$1.element, PropTypes$1.node, PropTypes$1.func])
  }, _class$5.defaultProps = {
    cell: function cell4() {
      return "";
    }
  }, _class$5._typeMark = "listFooter", _temp$4);
  ListFooter.displayName = "ListFooter";
  var _class$4, _temp$3;
  var GroupListRow = (_temp$3 = _class$4 = function(_Row) {
    _default$4(GroupListRow2, _Row);
    function GroupListRow2() {
      _default$7(this, GroupListRow2);
      return _default$5(this, _Row.apply(this, arguments));
    }
    GroupListRow2.prototype.render = function render2() {
      var _classnames;
      var _props = this.props, prefix = _props.prefix, className = _props.className;
      _props.onClick;
      _props.onMouseEnter;
      _props.onMouseLeave;
      _props.columns;
      _props.Cell;
      _props.rowIndex;
      _props.__rowIndex;
      _props.record;
      _props.children;
      _props.primaryKey;
      var colGroup = _props.colGroup;
      _props.cellRef;
      _props.getCellProps;
      _props.locale;
      _props.wrapper;
      _props.rtl;
      _props.tableEl;
      var others = _default$3(_props, ["prefix", "className", "onClick", "onMouseEnter", "onMouseLeave", "columns", "Cell", "rowIndex", "__rowIndex", "record", "children", "primaryKey", "colGroup", "cellRef", "getCellProps", "locale", "wrapper", "rtl", "tableEl"]);
      var cls = classnames((_classnames = {}, _classnames[prefix + "table-row"] = true, _classnames[className] = className, _classnames));
      this.context.notRenderCellIndex = [];
      return React.createElement(
        "table",
        _default$8({
          className: cls,
          role: "row"
        }, others, {
          onClick: this.onClick,
          onMouseEnter: this.onMouseEnter,
          onMouseLeave: this.onMouseLeave
        }),
        colGroup,
        React.createElement(
          "tbody",
          null,
          this.renderContent("header"),
          this.renderChildren(),
          this.renderContent("footer")
        )
      );
    };
    GroupListRow2.prototype.isChildrenSelection = function isChildrenSelection() {
      return this.context.listHeader && this.context.listHeader.hasChildrenSelection;
    };
    GroupListRow2.prototype.isFirstLevelDataWhenNoChildren = function isFirstLevelDataWhenNoChildren() {
      return this.context.listHeader && this.context.listHeader.useFirstLevelDataWhenNoChildren;
    };
    GroupListRow2.prototype.isSelection = function isSelection() {
      return this.context.listHeader && this.context.listHeader.hasSelection;
    };
    GroupListRow2.prototype.renderChildren = function renderChildren() {
      var _this2 = this;
      var _props2 = this.props, record = _props2.record, primaryKey = _props2.primaryKey;
      var children = record.children;
      var toRenderList = children;
      if (this.isFirstLevelDataWhenNoChildren()) {
        log.warning("useFirstLevelDataWhenNoChildren is deprecated, change your dataSource structure, make sure there is 'children' in your dataSource.");
        toRenderList = children || [record];
      }
      if (toRenderList) {
        return toRenderList.map(function(child, index2) {
          var cells = _this2.renderCells(child, index2);
          if (_this2.isChildrenSelection()) {
            if (!child[primaryKey]) {
              log.warning("record.children/recored should contains primaryKey when childrenSelection is true.");
            }
            return React.createElement(
              "tr",
              { key: child[primaryKey] },
              cells
            );
          }
          if (_this2.context.rowSelection) {
            cells.shift();
            cells[0] = cells[0] && React.cloneElement(cells[0], _default$8({
              colSpan: 2
            }, cells[0].props));
          }
          return React.createElement(
            "tr",
            { key: index2 },
            cells
          );
        });
      }
      return null;
    };
    GroupListRow2.prototype.renderContent = function renderContent(type2) {
      var _props3 = this.props, columns = _props3.columns, prefix = _props3.prefix, record = _props3.record, rowIndex = _props3.rowIndex;
      var cameType = type2.charAt(0).toUpperCase() + type2.substr(1);
      var list2 = this.context["list" + cameType];
      var listNode = void 0;
      if (list2) {
        if (React.isValidElement(list2.cell)) {
          listNode = React.cloneElement(list2.cell, {
            record,
            index: rowIndex
          });
        } else if (typeof list2.cell === "function") {
          listNode = list2.cell(record, rowIndex);
        }
        if (listNode) {
          var cells = this.renderCells(record);
          if (type2 === "header" && this.context.rowSelection && this.isSelection()) {
            cells = cells.slice(0, 1);
            cells.push(React.createElement(
              "td",
              { colSpan: columns.length - 1, key: "listNode" },
              React.createElement(
                "div",
                { className: prefix + "table-cell-wrapper" },
                listNode
              )
            ));
            listNode = React.createElement(
              "tr",
              { className: prefix + "table-group-" + type2 },
              cells
            );
          } else {
            listNode = React.createElement(
              "tr",
              { className: prefix + "table-group-" + type2 },
              React.createElement(
                "td",
                { colSpan: columns.length },
                React.createElement(
                  "div",
                  { className: prefix + "table-cell-wrapper" },
                  listNode
                )
              )
            );
          }
        }
      }
      return listNode;
    };
    return GroupListRow2;
  }(Row), _class$4.contextTypes = {
    listHeader: PropTypes$1.any,
    listFooter: PropTypes$1.any,
    rowSelection: PropTypes$1.object,
    notRenderCellIndex: PropTypes$1.array,
    lockType: PropTypes$1.oneOf(["left", "right"])
  }, _temp$3);
  function ListBody(props) {
    return React.createElement(Body, _default$8({ component: "div" }, props));
  }
  function list(BaseComponent) {
    var _class2, _temp22;
    var ListTable = (_temp22 = _class2 = function(_React$Component) {
      _default$4(ListTable2, _React$Component);
      function ListTable2() {
        var _temp3, _this2, _ret;
        _default$7(this, ListTable2);
        for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
          args[_key] = arguments[_key];
        }
        return _ret = (_temp3 = (_this2 = _default$5(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this2), _this2.state = {}, _temp3), _default$5(_this2, _ret);
      }
      ListTable2.prototype.getChildContext = function getChildContext() {
        return {
          listHeader: this.listHeader,
          listFooter: this.listFooter,
          rowSelection: this.rowSelection
        };
      };
      ListTable2.prototype.normalizeDataSource = function normalizeDataSource(dataSource) {
        var ret = [];
        var loop = function loop2(dataSource2, level) {
          dataSource2.forEach(function(item) {
            var itemCopy = _default$8({}, item);
            itemCopy.__level = level;
            ret.push(itemCopy);
            if (itemCopy.children) {
              loop2(itemCopy.children, level + 1);
            }
          });
        };
        loop(dataSource, 0);
        this.ds = ret;
        return ret;
      };
      ListTable2.prototype.render = function render2() {
        var _this2 = this;
        var _props = this.props, components = _props.components, children = _props.children, className = _props.className, prefix = _props.prefix, others = _default$3(_props, ["components", "children", "className", "prefix"]);
        var isList = false, ret = [];
        React.Children.forEach(children, function(child) {
          if (child) {
            if (["function", "object"].indexOf(_default$6(child.type)) > -1) {
              if (child.type._typeMark === "listHeader") {
                _this2.listHeader = child.props;
                isList = true;
              } else if (child.type._typeMark === "listFooter") {
                _this2.listFooter = child.props;
              } else {
                ret.push(child);
              }
            } else {
              ret.push(child);
            }
          }
        });
        this.rowSelection = this.props.rowSelection;
        if (isList) {
          var _classnames;
          components = _default$8({}, components);
          components.Row = components.Row || GroupListRow;
          components.Body = components.Body || ListBody;
          components.Header = components.Header || FixedHeader;
          components.Wrapper = components.Wrapper || FixedWrapper;
          className = classnames((_classnames = {}, _classnames[prefix + "table-group"] = true, _classnames[className] = className, _classnames));
        }
        return React.createElement(BaseComponent, _default$8({}, others, {
          components,
          children: ret.length > 0 ? ret : void 0,
          className,
          prefix
        }));
      };
      return ListTable2;
    }(React.Component), _class2.ListHeader = ListHeader, _class2.ListFooter = ListFooter, _class2.ListRow = GroupListRow, _class2.ListBody = ListBody, _class2.propTypes = _default$8({}, BaseComponent.propTypes), _class2.defaultProps = _default$8({}, BaseComponent.defaultProps), _class2.childContextTypes = {
      listHeader: PropTypes$1.any,
      listFooter: PropTypes$1.any,
      rowSelection: PropTypes$1.object
    }, _temp22);
    ListTable.displayName = "ListTable";
    statics(ListTable, BaseComponent);
    return ListTable;
  }
  var _class$3, _temp2;
  var StickHeader = (_temp2 = _class$3 = function(_React$Component) {
    _default$4(StickHeader2, _React$Component);
    function StickHeader2() {
      var _temp3, _this2, _ret;
      _default$7(this, StickHeader2);
      for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
        args[_key] = arguments[_key];
      }
      return _ret = (_temp3 = (_this2 = _default$5(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this2), _this2.getAffixRef = function(ref) {
        _this2.props.affixRef && _this2.props.affixRef(ref);
      }, _temp3), _default$5(_this2, _ret);
    }
    StickHeader2.prototype.render = function render2() {
      var _classnames;
      var prefix = this.props.prefix;
      var _context = this.context, Header2 = _context.Header, offsetTop = _context.offsetTop, affixProps = _context.affixProps;
      var newAffixProps = affixProps || {};
      var className = newAffixProps.className, others = _default$3(newAffixProps, ["className"]);
      var cls = classnames((_classnames = {}, _classnames[prefix + "table-affix"] = true, _classnames.className = className, _classnames));
      return React.createElement(
        Affix$1,
        _default$8({ ref: this.getAffixRef }, others, { className: cls, offsetTop }),
        React.createElement(Header2, this.props)
      );
    };
    return StickHeader2;
  }(React.Component), _class$3.propTypes = {
    prefix: PropTypes$1.string
  }, _class$3.contextTypes = {
    Header: PropTypes$1.any,
    offsetTop: PropTypes$1.number,
    affixProps: PropTypes$1.object
  }, _temp2);
  StickHeader.displayName = "StickHeader";
  function sticky(BaseComponent) {
    var _class2, _temp22;
    var StickyTable = (_temp22 = _class2 = function(_React$Component) {
      _default$4(StickyTable2, _React$Component);
      function StickyTable2() {
        var _temp3, _this2, _ret;
        _default$7(this, StickyTable2);
        for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
          args[_key] = arguments[_key];
        }
        return _ret = (_temp3 = (_this2 = _default$5(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this2), _this2.state = {}, _temp3), _default$5(_this2, _ret);
      }
      StickyTable2.prototype.getChildContext = function getChildContext() {
        return {
          Header: this.props.components.Header || FixedHeader,
          offsetTop: this.props.offsetTop,
          affixProps: this.props.affixProps
        };
      };
      StickyTable2.prototype.render = function render2() {
        var _props = this.props, stickyHeader = _props.stickyHeader;
        _props.offsetTop;
        _props.affixProps;
        var others = _default$3(_props, ["stickyHeader", "offsetTop", "affixProps"]);
        var _props2 = this.props, components = _props2.components, maxBodyHeight = _props2.maxBodyHeight, fixedHeader = _props2.fixedHeader;
        if (stickyHeader) {
          components = _default$8({}, components);
          components.Header = StickHeader;
          fixedHeader = true;
          maxBodyHeight = Math.max(maxBodyHeight, 1e4);
        }
        return React.createElement(BaseComponent, _default$8({}, others, {
          components,
          fixedHeader,
          maxBodyHeight
        }));
      };
      return StickyTable2;
    }(React.Component), _class2.StickyHeader = StickHeader, _class2.propTypes = _default$8({
      /**
       * 表头是否是sticky
       */
      stickyHeader: PropTypes$1.bool,
      /**
       * 距离窗口顶部达到指定偏移量后触发
       */
      offsetTop: PropTypes$1.number,
      /**
       * affix组件的的属性
       */
      affixProps: PropTypes$1.object,
      components: PropTypes$1.object
    }, BaseComponent.propTypes), _class2.defaultProps = _default$8({
      components: {}
    }, BaseComponent.defaultProps), _class2.childContextTypes = {
      Header: PropTypes$1.any,
      offsetTop: PropTypes$1.number,
      affixProps: PropTypes$1.object
    }, _temp22);
    StickyTable.displayName = "StickyTable";
    statics(StickyTable, BaseComponent);
    return StickyTable;
  }
  var ieVersion = env.ieVersion;
  var ORDER_LIST = [fixed, lock, selection, expanded, virtual, tree, list, sticky];
  var Table = ORDER_LIST.reduce(function(ret, current) {
    ret = current(ret);
    return ret;
  }, Base);
  lock._typeMark = "lock";
  expanded._typeMark = "expanded";
  fixed._typeMark = "fixed";
  var StickyLockTable = ORDER_LIST.reduce(function(ret, current) {
    var newLock = !ieVersion;
    if (current._typeMark === "lock") {
      ret = newLock ? stickyLock(ret) : lock(ret);
    } else if (current._typeMark === "expanded") {
      ret = newLock ? expanded(ret, true) : expanded(ret);
    } else if (current._typeMark === "fixed") {
      ret = newLock ? fixed(ret) : fixed(ret);
    } else {
      ret = current(ret);
    }
    return ret;
  }, Base);
  Table.Base = Base;
  Table.fixed = fixed;
  Table.lock = lock;
  Table.selection = selection;
  Table.expanded = expanded;
  Table.tree = tree;
  Table.virtual = virtual;
  Table.list = list;
  Table.sticky = sticky;
  Table.GroupHeader = ListHeader;
  Table.GroupFooter = ListFooter;
  Table.StickyLock = ConfigProvider$1.config(StickyLockTable, {
    componentName: "Table"
  });
  const Table$1 = ConfigProvider$1.config(Table, {
    componentName: "Table",
    transform: (
      /* istanbul ignore next */
      function transform15(props, deprecated2) {
        if ("columns" in props && typeof props.columns !== "undefined") {
          var _props = props, columns = _props.columns, others = _default$3(_props, ["columns"]);
          var newColumns = [].concat(columns);
          props = _default$8({
            columns: newColumns
          }, others);
        }
        if ("expandedRowKeys" in props) {
          deprecated2("expandedRowKeys", "openRowKeys", "Table");
          var _props2 = props, expandedRowKeys = _props2.expandedRowKeys, _others = _default$3(_props2, ["expandedRowKeys"]);
          props = _default$8({ openRowKeys: expandedRowKeys }, _others);
        }
        if ("onExpandedChange" in props) {
          deprecated2("onExpandedChange", "onRowOpen", "Table");
          var _props3 = props, onExpandedChange = _props3.onExpandedChange, _others2 = _default$3(_props3, ["onExpandedChange"]);
          props = _default$8({ onRowOpen: onExpandedChange }, _others2);
        }
        if ("isLoading" in props) {
          deprecated2("isLoading", "loading", "Table");
          var _props4 = props, isLoading = _props4.isLoading, _others3 = _default$3(_props4, ["isLoading"]);
          props = _default$8({ loading: isLoading }, _others3);
        }
        if ("indentSize" in props) {
          deprecated2("indentSize", "indent", "Table");
          var _props5 = props, indentSize = _props5.indentSize, _others4 = _default$3(_props5, ["indentSize"]);
          props = _default$8({ indent: indentSize }, _others4);
        }
        if ("optimization" in props) {
          deprecated2("optimization", "pure", "Table");
          var _props6 = props, optimization = _props6.optimization, _others5 = _default$3(_props6, ["optimization"]);
          props = _default$8({ pure: optimization }, _others5);
        }
        if ("getRowClassName" in props) {
          deprecated2("getRowClassName", "getRowProps", "Table");
          var _props7 = props, getRowClassName = _props7.getRowClassName, getRowProps = _props7.getRowProps, _others6 = _default$3(_props7, ["getRowClassName", "getRowProps"]);
          if (getRowClassName) {
            var newGetRowProps = function newGetRowProps2() {
              return _default$8({
                className: getRowClassName.apply(void 0, arguments)
              }, getRowProps ? getRowProps.apply(void 0, arguments) : {});
            };
            props = _default$8({ getRowProps: newGetRowProps }, _others6);
          } else {
            props = _default$8({ getRowProps }, _others6);
          }
        }
        if ("getRowProps" in props) {
          deprecated2("getRowProps", "rowProps", "Table in 1.15.0");
          var _props8 = props, _getRowProps = _props8.getRowProps, _others7 = _default$3(_props8, ["getRowProps"]);
          props = _default$8({ rowProps: _getRowProps }, _others7);
        }
        if ("getCellProps" in props) {
          deprecated2("getCellProps", "cellProps", "Table in 1.15.0");
          var _props9 = props, getCellProps = _props9.getCellProps, _others8 = _default$3(_props9, ["getCellProps"]);
          props = _default$8({ cellProps: getCellProps }, _others8);
        }
        return props;
      }
    )
  });
  var _class$2, _temp$2;
  var Text = (_temp$2 = _class$2 = function(_Component) {
    _default$4(Text2, _Component);
    function Text2() {
      _default$7(this, Text2);
      return _default$5(this, _Component.apply(this, arguments));
    }
    Text2.prototype.render = function render2() {
      var _props = this.props, prefix = _props.prefix, className = _props.className, component = _props.component, strong = _props.strong, underline = _props.underline, deleteProp = _props.delete, code = _props.code, mark = _props.mark, rtl = _props.rtl, others = _default$3(_props, ["prefix", "className", "component", "strong", "underline", "delete", "code", "mark", "rtl"]);
      var Tag = component;
      var children = this.props.children;
      if (strong) {
        children = React.createElement(
          "strong",
          null,
          children
        );
      }
      if (underline) {
        children = React.createElement(
          "u",
          null,
          children
        );
      }
      if (deleteProp) {
        children = React.createElement(
          "del",
          null,
          children
        );
      }
      if (code) {
        children = React.createElement(
          "code",
          null,
          children
        );
      }
      if (mark) {
        children = React.createElement(
          "mark",
          null,
          children
        );
      }
      if (rtl) {
        others.dir = "rtl";
      }
      return React.createElement(
        Tag,
        _default$8({}, others, { className: (className || "") + " " + prefix + "typography" }),
        children
      );
    };
    return Text2;
  }(React.Component), _class$2.propTypes = {
    prefix: PropTypes$1.string,
    /**
     * 添加删除线样式
     */
    delete: PropTypes$1.bool,
    /**
     * 添加标记样式
     */
    mark: PropTypes$1.bool,
    /**
     * 添加下划线样式
     */
    underline: PropTypes$1.bool,
    /**
     * 是否加粗
     */
    strong: PropTypes$1.bool,
    /**
     * 添加代码样式
     */
    code: PropTypes$1.bool,
    /**
     * 设置标签类型
     */
    component: PropTypes$1.elementType,
    children: PropTypes$1.node,
    rtl: PropTypes$1.bool
  }, _class$2.defaultProps = {
    prefix: "next-",
    delete: false,
    mark: false,
    underline: false,
    strong: false,
    code: false,
    component: "span",
    rtl: false
  }, _temp$2);
  Text.displayName = "Text";
  const Text$1 = ConfigProvider$1.config(Text);
  var _class$1, _temp$1;
  var Typography = (_temp$1 = _class$1 = function(_Component) {
    _default$4(Typography2, _Component);
    function Typography2() {
      _default$7(this, Typography2);
      return _default$5(this, _Component.apply(this, arguments));
    }
    Typography2.prototype.render = function render2() {
      return React.createElement(Text$1, this.props);
    };
    return Typography2;
  }(React.Component), _class$1.propTypes = {
    /**
     * 设置标签类型
     */
    component: PropTypes$1.elementType
  }, _class$1.defaultProps = {
    component: "article"
  }, _temp$1);
  Typography.displayName = "Typography";
  const Typography$1 = Typography;
  var _class, _temp;
  var Paragraph = (_temp = _class = function(_React$Component) {
    _default$4(Paragraph2, _React$Component);
    function Paragraph2() {
      _default$7(this, Paragraph2);
      return _default$5(this, _React$Component.apply(this, arguments));
    }
    Paragraph2.prototype.render = function render2() {
      var _props = this.props, prefix = _props.prefix, className = _props.className, component = _props.component, others = _default$3(_props, ["prefix", "className", "component"]);
      var cls = classnames(prefix + "typography-paragraph", className);
      return React.createElement(Text$1, _default$8({}, others, { className: cls, component }));
    };
    return Paragraph2;
  }(React.Component), _class.propTypes = {
    prefix: PropTypes$1.string,
    /**
     * 设置标签类型
     */
    component: PropTypes$1.elementType
  }, _class.defaultProps = {
    prefix: "next-",
    type: "long",
    size: "medium",
    component: "p"
  }, _temp);
  Paragraph.displayName = "Paragraph";
  const Paragraph$1 = ConfigProvider$1.config(Paragraph);
  const createTitle = function(Tag) {
    var _class2, _temp3;
    var Title = (_temp3 = _class2 = function(_Component) {
      _default$4(Title2, _Component);
      function Title2() {
        _default$7(this, Title2);
        return _default$5(this, _Component.apply(this, arguments));
      }
      Title2.prototype.render = function render2() {
        var _props = this.props, prefix = _props.prefix, className = _props.className, others = _default$3(_props, ["prefix", "className"]);
        return React.createElement(Text$1, _default$8({}, others, { component: Tag, className: (className || "") + " " + prefix + "typography-title" }));
      };
      return Title2;
    }(React.Component), _class2.propTypes = {
      prefix: PropTypes$1.string
    }, _class2.defaultProps = {
      prefix: "next-"
    }, _temp3);
    Title.displayName = "Title";
    Title.displayName = Tag.toUpperCase();
    return ConfigProvider$1.config(Title);
  };
  Typography$1.Paragraph = Paragraph$1;
  Typography$1.H1 = createTitle("h1");
  Typography$1.H2 = createTitle("h2");
  Typography$1.H3 = createTitle("h3");
  Typography$1.H4 = createTitle("h4");
  Typography$1.H5 = createTitle("h5");
  Typography$1.H6 = createTitle("h6");
  Typography$1.Text = Text$1;
  const SetDataPool = (y2, name, description, method, parVariable, urlVariable, isInit) => {
    return {
      "id": "",
      name,
      description,
      formUuid: _unsafeWindow.pageConfig.formUuid,
      "protocal": "REMOTE",
      "options": {
        "shouldFetch": true,
        method,
        "params": parVariable ? {
          "type": "variable",
          "variable": parVariable,
          "value": []
        } : y2 && {} || [],
        "isSync": false,
        "url": urlVariable ? {
          "type": "variable",
          "variable": urlVariable,
          "value": ""
        } : {},
        "loadType": ""
      },
      isInit,
      "dpType": "REMOTE",
      "type": "legao",
      "requestHandler": {
        "type": "JSExpression",
        "value": "this.utils.legaoBuiltin.dataSourceHandler"
      },
      "dataHandler": {
        "type": "js",
        "source": `function(data, err) { this.setState({${name}: data}); return data; }`,
        "compiled": `function(data, err) { this.setState({${name}: data}); return data; }`
      }
    };
  };
  const CreateTable = (fieldValues, dataSource) => {
    const { project, skeleton } = AliLowCodeEngine;
    let projectSchema = project.getSchema();
    let urlVariable;
    let name;
    let appType = _unsafeWindow.pageConfig.appType || _unsafeWindow.g_config.appKey;
    if (fieldValues.process) {
      if (appType == fieldValues.appKey)
        urlVariable = "`/${window.pageConfig.appType || window.g_config.appKey}/v1/process/getInstances.json`";
      else
        urlVariable = `"/${appType}/v1/process/getInstances.json"`;
      name = "getInstances";
    } else {
      if (appType == fieldValues.appKey)
        urlVariable = "`/${window.pageConfig.appType || window.g_config.appKey}/v1/form/searchFormDatas.json`";
      else
        urlVariable = `"/${appType}/v1/form/searchFormDatas.json"`;
      name = "searchFormDatas";
    }
    let parVariable = JSON.stringify({
      formUuid: fieldValues.formUuid
      // 表单 ID,
    }, null, 2);
    fetch(`/${fieldValues.appKey}/query/formdesign/getLatestFormWithNavNew.json?formUuid=${fieldValues.formUuid}`).then((res) => res.json()).then(({ content: { pages } }) => {
      const allComponent = pages[0].componentsTree[0].children[1].children[0].children;
      let tableSchemaObj = {
        "componentsTree": [{
          "componentName": "TablePc",
          "props": {
            "noPadding": true,
            "columns": [],
            "dataSourceType": "data",
            "data": {
              "type": "JSExpression",
              "value": "state." + name,
              "currentPage": 1,
              "totalCount": 2,
              "data": []
            },
            "actionColumn": [{
              "title": {
                "type": "i18n",
                "zh_CN": "详情",
                "en_US": "Detail",
                "use": "zh_CN"
              },
              "option": "callback"
            }],
            "showActionBar": true,
            "actionBar": [{
              "title": {
                "zh_CN": "操作1",
                "en_US": "Action 1",
                "type": "i18n",
                "use": "zh_CN"
              },
              "option": "callback"
            }, {
              "title": {
                "zh_CN": "操作2",
                "en_US": "Action 2",
                "type": "i18n",
                "use": "zh_CN"
              },
              "option": "callback"
            }],
            "showSearch": true,
            "searchBarPlaceholder": {
              "type": "i18n",
              "en_US": "Please Input",
              "zh_CN": "请搜索",
              "use": "zh_CN"
            }
          }
        }]
      };
      const formComponentList = ["TextField", "TextareaField", "NumberField", "RateField", "RadioField", "CheckboxField", "DateField", "CascadeDateField", "AttachmentField", "EmployeeField", "ImageField", "SelectField", "MultiSelectField", "CascadeSelectField", "PageSection", "CountrySelectField", "DepartmentSelectField", "AddressField", "LocationField", "AssociationFormField", "DigitalSignatureField", "SerialNumberField", "CompanyField"];
      const recursiveSearch = (obj2) => {
        if (typeof obj2 === "object") {
          if (obj2.hasOwnProperty("componentName")) {
            if (formComponentList.includes(obj2.componentName)) {
              try {
                tableSchemaObj.componentsTree[0].props.columns.push({
                  "dataKey": `${fieldValues.process ? "data" : "formData"}.${obj2.props.fieldId}`,
                  "title": {
                    "zh_CN": obj2.props.label.zh_CN,
                    "en_US": "",
                    "type": "i18n",
                    "use": "zh_CN"
                  },
                  "width": 100,
                  "dataType": "text"
                });
              } catch (e2) {
              }
            }
            if (obj2.componentName === "TableField")
              return;
          }
          for (let key in obj2) {
            if (obj2.hasOwnProperty(key)) {
              recursiveSearch(obj2[key]);
            }
          }
        }
      };
      if (dataSource) {
        const pl = SetDataPool(true, name, null, "POST", parVariable, urlVariable, true);
        projectSchema.componentsTree[0].dataSource.list.push(pl);
        projectSchema.componentsTree[0].dataSource.online.push(pl);
        project.setSchema(projectSchema);
        const dp = skeleton.getPanel("datapool");
        dp.parent.remove(dp);
        Message.success("数据源添加成功");
        setTimeout(() => dp.parent.add(dp), 100);
        recursiveSearch(allComponent);
      }
      _GM_setClipboard(JSON.stringify(tableSchemaObj));
      Message.success("生成成功,请粘贴入页面!");
    });
  };
  class TableTool extends React.Component {
    constructor() {
      super(...arguments);
      __publicField(this, "field", new Field(this));
    }
    render() {
      const { init, validate } = this.field;
      return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx("h6", { style: { margin: "8px 0" }, children: "生成表格" }),
        /* @__PURE__ */ jsxRuntimeExports.jsxs(Form, { size: "small", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsxs(Form.Item, { children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx(
              Input,
              {
                label: "AppKey",
                className: "input-style",
                ...init("appKey", {
                  initValue: _unsafeWindow.pageConfig.appType || _unsafeWindow.g_config.appKey,
                  rules: [{
                    required: true,
                    message: "AppKey 不能为空!"
                  }]
                })
              }
            ),
            this.field.getError("appKey") ? /* @__PURE__ */ jsxRuntimeExports.jsx("span", { style: {
              color: "red"
            }, children: this.field.getError("appKey").join(",") }) : ""
          ] }),
          /* @__PURE__ */ jsxRuntimeExports.jsxs(Form.Item, { children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx(Input, { label: "FormUuid", className: "input-style", ...init("formUuid", {
              rules: [{
                required: true,
                message: "FormUuid 不能为空!"
              }]
            }) }),
            this.field.getError("formUuid") ? /* @__PURE__ */ jsxRuntimeExports.jsx("span", { style: {
              color: "red"
            }, children: this.field.getError("formUuid").join(",") }) : ""
          ] }),
          /* @__PURE__ */ jsxRuntimeExports.jsx(Form.Item, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(Checkbox$1, { ...init("process", { valueName: "checked" }), children: "流程" }) }),
          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "box-grid-2", children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx(Form.Submit, { onClick: () => {
              validate();
              CreateTable(this.field.getValues(), false);
            }, children: "仅生成表格" }),
            /* @__PURE__ */ jsxRuntimeExports.jsx(Form.Submit, { type: "primary", onClick: () => {
              CreateTable(this.field.getValues(), true);
            }, children: "创建数据源并生成表格" })
          ] })
        ] })
      ] });
    }
  }
  const ComponentsBox = () => {
    const componentsData = [
      {
        title: "容器",
        schema: JSON.stringify({
          "componentsTree": [{
            "componentName": "Div"
          }]
        })
      },
      {
        title: "选项卡",
        schema: JSON.stringify({
          "componentsTree": [{
            "componentName": "TabsLayout",
            "props": {
              "items": [{
                "primaryKey": "tab_lm4jmqz1",
                "title": { "zh_CN": "标签项", "en_US": "Tab Item", "type": "i18n", "use": "zh_CN" },
                "defaultActived": true
              }, {
                "primaryKey": "tab_lm4jmqz2",
                "title": { "zh_CN": "标签项", "en_US": "Tab Item", "type": "i18n", "use": "zh_CN" }
              }]
            },
            "children": [{
              "componentName": "Tab",
              "props": {
                "primaryKey": "tab_lm4jmqz1",
                "title": { "zh_CN": "标签项", "en_US": "Tab Item", "type": "i18n", "use": "zh_CN" }
              }
            }, {
              "componentName": "Tab",
              "props": {
                "primaryKey": "tab_lm4jmqz2",
                "title": { "zh_CN": "标签项", "en_US": "Tab Item", "type": "i18n", "use": "zh_CN" }
              }
            }]
          }]
        })
      },
      {
        title: "分组",
        schema: JSON.stringify({
          "componentsTree": [{
            "componentName": "PageSection",
            "props": {
              "showHeader": true,
              "title": { "type": "i18n", "en_US": "Group", "zh_CN": "分组", "use": "zh_CN" }
            }
          }]
        })
      },
      {
        title: "按钮",
        schema: JSON.stringify({
          "componentsTree": [{
            "componentName": "Button",
            "props": { "content": { "use": "zh_CN", "en_US": "Button", "zh_CN": "按 钮", "type": "i18n" } }
          }]
        })
      },
      {
        title: "文本",
        schema: JSON.stringify({
          "componentsTree": [{
            "componentName": "Text",
            "props": { "content": { "type": "i18n", "en_US": "Tips content", "zh_CN": "文本", "use": "zh_CN" } }
          }]
        })
      },
      {
        title: "HTML",
        schema: JSON.stringify({
          "componentsTree": [{
            "componentName": "Html",
            "props": { "content": "<div>这里可以写html</div>" }
          }]
        })
      },
      {
        title: "JSX",
        schema: JSON.stringify({ "componentsTree": [{ "componentName": "Jsx" }] })
      },
      {
        title: "关联表单",
        schema: JSON.stringify({ "componentsTree": [{ "componentName": "AssociationFormField" }] })
      }
    ];
    return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "box-grid-1", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "box-grid-2", children: componentsData.map((item) => {
        return /* @__PURE__ */ jsxRuntimeExports.jsx(
          Button,
          {
            onClick: () => {
              if (item.schema) {
                _GM_setClipboard(item.schema);
                Message.success("复制成功!");
              } else
                Message.error("复制失败,请联系开发者!");
            },
            children: item.title
          },
          item.title
        );
      }) }),
      /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "box-grid-1 border", children: /* @__PURE__ */ jsxRuntimeExports.jsx(TableTool, {}) })
    ] });
  };
  const CopyIcon = (hexColor) => {
    return /* @__PURE__ */ jsxRuntimeExports.jsxs(
      "svg",
      {
        t: "1699199896852",
        className: "icon",
        viewBox: "0 0 1024 1024",
        version: "1.1",
        xmlns: "http://www.w3.org/2000/svg",
        "p-id": "8255",
        width: "15",
        height: "15",
        children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("path", { d: "M96.1 575.7a32.2 32.1 0 1 0 64.4 0 32.2 32.1 0 1 0-64.4 0Z", fill: "#1296db", "p-id": "8256" }),
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            "path",
            {
              d: "M742.1 450.7l-269.5-2.1c-14.3-0.1-26 13.8-26 31s11.7 31.3 26 31.4l269.5 2.1c14.3 0.1 26-13.8 26-31s-11.7-31.3-26-31.4zM742.1 577.7l-269.5-2.1c-14.3-0.1-26 13.8-26 31s11.7 31.3 26 31.4l269.5 2.1c14.3 0.2 26-13.8 26-31s-11.7-31.3-26-31.4z",
              fill: hexColor,
              "p-id": "8257"
            }
          ),
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            "path",
            {
              d: "M736.1 63.9H417c-70.4 0-128 57.6-128 128h-64.9c-70.4 0-128 57.6-128 128v128c-0.1 17.7 14.4 32 32.2 32 17.8 0 32.2-14.4 32.2-32.1V320c0-35.2 28.8-64 64-64H289v447.8c0 70.4 57.6 128 128 128h255.1c-0.1 35.2-28.8 63.8-64 63.8H224.5c-35.2 0-64-28.8-64-64V703.5c0-17.7-14.4-32.1-32.2-32.1-17.8 0-32.3 14.4-32.3 32.1v128.3c0 70.4 57.6 128 128 128h384.1c70.4 0 128-57.6 128-128h65c70.4 0 128-57.6 128-128V255.9l-193-192z m0.1 63.4l127.7 128.3H800c-35.2 0-64-28.8-64-64v-64.3h0.2z m64 641H416.1c-35.2 0-64-28.8-64-64v-513c0-35.2 28.8-64 64-64H671V191c0 70.4 57.6 128 128 128h65.2v385.3c0 35.2-28.8 64-64 64z",
              fill: hexColor,
              "p-id": "8258"
            }
          )
        ]
      }
    );
  };
  const JsApiBox = () => {
    const jsApiData = [
      {
        title: "this.reloadDataSource()",
        description: "重新请求所有自动加载设置为 true 的远程 API,该方法也返回一个 Promise",
        code: `this.reloadDataSource().then(res => {
    this.utils.toast({
      type: 'success', 
      title: '刷新成功!'
    });
  });`
      },
      {
        title: "this.utils.dialog()",
        description: "弹出对话框",
        code: `this.utils.dialog({
  method: 'confirm', // 'alert', 'confirm', 'show'
  title: 'title',
  content: 'content', // 如需换行可传入 HTML/JSX 来实现
  onOk: () => {},
  onCancel: () => {},
});`
      },
      {
        title: "this.utils.getDateTimeRange(when, type)",
        description: "获取当前或指定日期的开始结束区间时间戳",
        code: `//when:支持时间戳、Date 日期类型,type:'year', 'month', 'week', 'day', 'date', 'hour', 'minute', 'second'
const [timeStart, timeEnd] = this.utils.getDateTimeRange(when:number, type:String);	`
      },
      {
        title: "this.utils.getLocale()",
        description: "获取当前页面的语言环境",
        code: `const locale = this.utils.getLocale();
  // 输出:locale: zh_CN`
      },
      {
        title: "this.utils.getLoginUserId()",
        description: "获取登录用户userId",
        code: `const userId = this.utils.getLoginUserId();
  // 输出:userId`
      },
      {
        title: "this.utils.getLoginUserName()",
        description: "获取登录用户名称",
        code: `const userName = this.utils.getLoginUserName();
  // 输出:userName`
      },
      {
        title: "this.utils.isMobile()",
        description: "判断当前访问环境是否是移动端",
        code: `this.utils.isMobile()`
      },
      {
        title: "this.utils.isSubmissionPage()",
        description: "判断当前页面是否是数据提交页面",
        code: `this.utils.isSubmissionPage()`
      },
      {
        title: "this.utils.isViewPage()",
        description: "判断当前页面是否是数据查看页面",
        code: `this.utils.isViewPage()`
      },
      {
        title: "this.utils.loadScript()",
        description: "动态加载远程脚本",
        code: `this.utils.loadScript('');`
      },
      {
        title: "this.utils.openPage()",
        description: "打开新页面,如果在钉钉环境下,会使用钉钉 API 打开新页面,体验会更友好一些",
        code: `this.utils.openPage('');`
      },
      {
        title: "this.utils.previewImage()",
        description: "图片预览,通过这个 API 我们可以实现一个简洁的图片预览效果",
        code: `this.utils.previewImage({ current: '' });`
      },
      {
        title: "this.utils.toast()",
        description: "信息提醒,会比 Dialog 对话框更加轻量,弹出后过一段时间会自动消失",
        code: `this.utils.toast({
  title: 'success', // 'success', 'warning', 'error', 'notice', 'help', 'loading'
  type: 'success',
  size: 'large',
  duration: 2000, // 毫秒, type 为 loding 时无效
});`
      }
    ];
    return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "box-grid-1", children: jsApiData.map((item, index2) => {
      return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "jsApiItem_Box", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "jsApiItemTitle_Box", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "jsApiItemTitle", children: item.title }),
          /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "jsApiIcon_Box", onClick: () => {
            if (item.code) {
              _GM_setClipboard(item.code);
              Message.success("复制成功!");
            } else
              Message.error("复制失败,请联系开发者!");
          }, children: CopyIcon("#3c99d8") })
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "jsApiItemDescription", children: item.description })
      ] }) }, index2);
    }) });
  };
  const InterfaceIcon = (hexColor) => {
    return /* @__PURE__ */ jsxRuntimeExports.jsx(
      "svg",
      {
        t: "1699203375797",
        className: "icon",
        viewBox: "0 0 1024 1024",
        version: "1.1",
        xmlns: "http://www.w3.org/2000/svg",
        "p-id": "9472",
        width: "15",
        height: "15",
        children: /* @__PURE__ */ jsxRuntimeExports.jsx(
          "path",
          {
            d: "M952.4 71.6c9.8 9.4 10.2 24.9 0.9 34.8l-84.8 84.8 27.4 27.4c73.8 73.8 73.8 193.4 0 267.2l-82.7 82.7c-28.1 28.1-73.6 28.1-101.7 0L453.8 310.9c-28.1-28.1-28.1-73.6 0-101.7l82.7-82.7c71.1-71.1 185.5-74 260.2-6.7l7.1 6.7 29.1 29.1 84.8-84.7c8.5-8.2 21.7-9.1 31.3-2.1l3.4 2.8zM862 252.5l-92.1-92.2-6-5.7c-55.8-49.6-140.6-47.1-193.4 5.7L487.8 243c-9.4 9.4-9.4 24.5 0 33.9l257.6 257.6c9.4 9.4 24.5 9.4 33.9 0l82.7-82.7c55-55 55-144.2 0-199.3zM615.7 543.7c9.8 9.4 10.2 24.9 0.9 34.8l-61.3 61.3 42.6 42.7c28.1 28.1 28.1 73.6 0 101.7l-97.4 97.4c-79.1 79.1-206.3 82.2-289.2 7.1l-7.4-7.1-12.7-12.7-84.8 84.8c-8.5 8.2-21.7 9.1-31.2 2.1l-3.5-2.9c-8.6-8.3-10.1-21.4-3.6-31.4l2.8-3.3 84.8-84.8-14.5-14.4c-81.9-81.9-81.9-214.6 0-296.5l97.4-97.4c28.1-28.1 73.6-28.1 101.7 0l49 49 61.4-61.3c8.5-8.2 21.8-9.1 31.3-2.1l3.5 2.9c8.6 8.3 10.1 21.5 3.6 31.4l-2.7 3.3-61.4 61.3 94.6 94.7 61.3-61.3c8.5-8.2 21.7-9 31.2-2l3.6 2.7z m-51.8 172.7L306.3 458.8c-9.4-9.4-24.5-9.4-33.9 0L175 556.2c-63.2 63.2-63.2 165.6 0 228.8l62.8 62.7 6.4 6.1c64 57.3 161.6 54.6 222.3-6.1l97.4-97.4c9.4-9.3 9.4-24.5 0-33.9z",
            "p-id": "9473",
            fill: hexColor
          }
        )
      }
    );
  };
  const DataSourceApiBox = () => {
    const DataSourceApiData = [
      {
        title: "表单相关 API",
        key: "1",
        content: [
          {
            apiName: "新建表单实例",
            InterfacePath: "/v1/form/saveFormData.json",
            requestType: "POST",
            params: [{
              parameterName: "formUuid",
              description: "表单 ID",
              requiredFields: "是"
            }, {
              parameterName: "appType",
              description: "应用 ID",
              requiredFields: "是"
            }, {
              parameterName: "formDataJson",
              description: "表单数据",
              requiredFields: "是"
            }]
          },
          {
            apiName: "更新表单中指定组件值",
            InterfacePath: "/v1/form/updateFormData.json",
            requestType: "POST",
            params: [{
              parameterName: "formInstId",
              description: "要更新的表单数据 ID",
              requiredFields: "是"
            }, {
              parameterName: "updateFormDataJson",
              description: "要更新的表单组件值,必填",
              requiredFields: "是"
            }, {
              parameterName: "useLatestVersion",
              description: "使用最新的表单版本进行更新",
              requiredFields: "否"
            }]
          },
          {
            apiName: "删除表单实例",
            InterfacePath: "/v1/form/deleteFormData.json",
            requestType: "POST",
            params: [{
              parameterName: "formInstId",
              description: "要删除的表单数据 ID",
              requiredFields: "是"
            }]
          },
          {
            apiName: "根据表单实例 ID 查询表单实例详情",
            InterfacePath: "/v1/form/getFormDataById.json",
            requestType: "GET",
            params: [{
              parameterName: "formInstId",
              description: "要查询的表单数据 ID",
              requiredFields: "是"
            }]
          },
          {
            apiName: "根据条件搜索表单实例 ID 列表",
            InterfacePath: "/v1/form/searchFormDataIds.json",
            requestType: "GET",
            params: [{
              parameterName: "formUuid",
              description: "表单 ID",
              requiredFields: "是"
            }, {
              parameterName: "searchFieldJson",
              description: "根据表单内组件值查询",
              requiredFields: "否"
            }, {
              parameterName: "currentPage",
              description: "当前页",
              requiredFields: "否"
            }, {
              parameterName: "pageSize",
              description: "每页记录数",
              requiredFields: "否"
            }, {
              parameterName: "originatorId",
              description: "根据数据提交人工号查询",
              requiredFields: "否"
            }, {
              parameterName: "createFrom",
              description: "createFrom 和 createTo 两个时间构造一个时间段。查询在该时间段创建的数据列表",
              requiredFields: "否"
            }, {
              parameterName: "createTo",
              description: "createFrom 和 createTo 两个时间构造一个时间段。查询在该时间段创建的数据列表",
              requiredFields: "否"
            }, {
              parameterName: "modifiedFrom",
              description: "modifiedFrom 和 modifiedTo 构成一个时间段,查询在该时间段有修改的数据列表",
              requiredFields: "否"
            }, {
              parameterName: "modifiedTo",
              description: "modifiedFrom 和 modifiedTo 构成一个时间段,查询在该时间段有修改的数据列表",
              requiredFields: "否"
            }, {
              parameterName: "dynamicOrder",
              description: "排序",
              requiredFields: "否"
            }]
          },
          {
            apiName: "根据条件搜索表单实例详情列表",
            InterfacePath: "/v1/form/searchFormDatas.json",
            requestType: "GET",
            params: [{
              parameterName: "formUuid",
              description: "表单 ID",
              requiredFields: "是"
            }, {
              parameterName: "searchFieldJson",
              description: "根据表单内组件值查询",
              requiredFields: "否"
            }, {
              parameterName: "currentPage",
              description: "当前页",
              requiredFields: "否"
            }, {
              parameterName: "pageSize",
              description: "每页记录数",
              requiredFields: "否"
            }, {
              parameterName: "originatorId",
              description: "根据数据提交人工号查询",
              requiredFields: "否"
            }, {
              parameterName: "createFrom",
              description: "createFrom 和 createTo 两个时间构造一个时间段。查询在该时间段创建的数据列表",
              requiredFields: "否"
            }, {
              parameterName: "createTo",
              description: "createFrom 和 createTo 两个时间构造一个时间段。查询在该时间段创建的数据列表",
              requiredFields: "否"
            }, {
              parameterName: "modifiedFrom",
              description: "modifiedFrom 和 modifiedTo 构成一个时间段,查询在该时间段有修改的数据列表",
              requiredFields: "否"
            }, {
              parameterName: "modifiedTo",
              description: "modifiedFrom 和 modifiedTo 构成一个时间段,查询在该时间段有修改的数据列表",
              requiredFields: "否"
            }, {
              parameterName: "dynamicOrder",
              description: "排序",
              requiredFields: "否"
            }]
          },
          {
            apiName: "获取表单定义",
            InterfacePath: "/v1/form/getFormComponentDefinationList.json",
            requestType: "GET",
            params: [{
              parameterName: "formUuid",
              description: "表单 ID",
              requiredFields: "是"
            }, {
              parameterName: "version",
              description: "表单版本",
              requiredFields: "否"
            }]
          },
          {
            apiName: "获取子表单数据",
            InterfacePath: "/v1/form/listTableDataByFormInstIdAndTableId.json",
            requestType: "GET",
            params: [{
              parameterName: "formUuid",
              description: "表单 ID",
              requiredFields: "是"
            }, {
              parameterName: "formInstanceId",
              description: "要查询的实例的实例 ID",
              requiredFields: "是"
            }, {
              parameterName: "tableFieldId",
              description: "需要查找的子表单组件的唯一标识",
              requiredFields: "是"
            }, {
              parameterName: "currentPage",
              description: "当前页",
              requiredFields: "否"
            }, {
              parameterName: "pageSize",
              description: "每页记录数",
              requiredFields: "否"
            }]
          }
        ]
      },
      {
        title: "流程相关 API",
        key: "2",
        content: [
          {
            apiName: "流程发起",
            InterfacePath: "/v1/process/startInstance.json",
            requestType: "POST",
            params: [{
              parameterName: "processCode",
              description: "流程 code",
              requiredFields: "是"
            }, {
              parameterName: "formUuid",
              description: "表单 ID",
              requiredFields: "是"
            }, {
              parameterName: "formDataJson",
              description: "表单数据",
              requiredFields: "是"
            }, {
              parameterName: "deptId",
              description: "发起人所在部门号",
              requiredFields: "否"
            }]
          },
          {
            apiName: "根据条件搜索流程实例 ID",
            InterfacePath: "/v1/process/getInstanceIds.json",
            requestType: "GET",
            params: [{
              parameterName: "formUuid",
              description: "表单 ID",
              requiredFields: "是"
            }, {
              parameterName: "searchFieldJson",
              description: "根据表单内组件值查询",
              requiredFields: "否"
            }, {
              parameterName: "taskId",
              description: "",
              requiredFields: "否"
            }, {
              parameterName: "instanceStatxus",
              description: "实例状态",
              requiredFields: "否"
            }, {
              parameterName: "approvedResult",
              description: "流程审批结果",
              requiredFields: "否"
            }, {
              parameterName: "currentPage",
              description: "当前页",
              requiredFields: "否"
            }, {
              parameterName: "pageSize",
              description: "每页记录数",
              requiredFields: "否"
            }, {
              parameterName: "originatorId",
              description: "根据流程发起人工号查询",
              requiredFields: "否"
            }, {
              parameterName: "createFrom",
              description: "createFrom 和 createTo 两个时间构造一个时间段。查询在该时间段创建的数据列表",
              requiredFields: "否"
            }, {
              parameterName: "createTo",
              description: "createFrom 和 createTo 两个时间构造一个时间段。查询在该时间段创建的数据列表",
              requiredFields: "否"
            }, {
              parameterName: "modifiedFrom",
              description: "modifiedFrom 和 modifiedTo 构成一个时间段,查询在该时间段有修改的数据列表",
              requiredFields: "否"
            }, {
              parameterName: "modifiedTo",
              description: "modifiedFrom 和 modifiedTo 构成一个时间段,查询在该时间段有修改的数据列表",
              requiredFields: "否"
            }]
          },
          {
            apiName: "根据搜索条件获取实例详情列表",
            InterfacePath: "/v1/process/getInstances.json",
            requestType: "GET",
            params: [{
              parameterName: "formUuid",
              description: "表单 ID",
              requiredFields: "是"
            }, {
              parameterName: "searchFieldJson",
              description: "根据表单内组件值查询",
              requiredFields: "否"
            }, {
              parameterName: "taskId",
              description: "任务 ID",
              requiredFields: "否"
            }, {
              parameterName: "instanceStatus",
              description: "实例状态",
              requiredFields: "否"
            }, {
              parameterName: "approvedResult",
              description: "流程审批结果",
              requiredFields: "否"
            }, {
              parameterName: "currentPage",
              description: "当前页",
              requiredFields: "否"
            }, {
              parameterName: "pageSize",
              description: "每页记录数",
              requiredFields: "否"
            }, {
              parameterName: "originatorId",
              description: "根据数据提交人工号查询",
              requiredFields: "否"
            }, {
              parameterName: "createFrom",
              description: "createFrom 和 createTo 两个时间构造一个时间段。查询在该时间段创建的数据列表",
              requiredFields: "否"
            }, {
              parameterName: "createTo",
              description: "createFrom 和 createTo 两个时间构造一个时间段。查询在该时间段创建的数据列表",
              requiredFields: "否"
            }, {
              parameterName: "modifiedFrom",
              description: "modifiedFrom 和 modifiedTo 构成一个时间段,查询在该时间段有修改的数据列表",
              requiredFields: "否"
            }, {
              parameterName: "modifiedTo",
              description: "modifiedFrom 和 modifiedTo 构成一个时间段,查询在该时间段有修改的数据列表",
              requiredFields: "否"
            }]
          },
          {
            apiName: "根据实例 ID 获取流程实例详情",
            InterfacePath: "/v1/process/getInstanceById.json",
            requestType: "GET",
            params: [{
              parameterName: "processInstanceId",
              description: "流程实例 ID",
              requiredFields: "是"
            }]
          },
          {
            apiName: "删除流程实例",
            InterfacePath: "/v1/process/deleteInstance.json",
            requestType: "POST",
            params: [{
              parameterName: "processInstanceId",
              description: "流程实例 ID",
              requiredFields: "是"
            }]
          },
          {
            apiName: "终止流程实例",
            InterfacePath: "/v1/process/terminateInstance.json",
            requestType: "POST",
            params: [{
              parameterName: "processInstanceId",
              description: "流程实例 ID",
              requiredFields: "是"
            }]
          },
          {
            apiName: "执行单个任务接口",
            InterfacePath: "/v1/task/executeTask.json",
            requestType: "POST",
            params: [{
              parameterName: "taskId",
              description: "任务 ID",
              requiredFields: "是"
            }, {
              parameterName: "procInstId",
              description: "实例 ID",
              requiredFields: "是"
            }, {
              parameterName: "outResult",
              description: "审批结果",
              requiredFields: "是"
            }, {
              parameterName: "remark",
              description: "审批意见",
              requiredFields: "是"
            }, {
              parameterName: "formDataJson",
              description: "表单数据",
              requiredFields: "否"
            }, {
              parameterName: "noExecuteExpressions",
              description: "是否不执行校验&关联操作",
              requiredFields: "否"
            }]
          },
          {
            apiName: "获取审批记录",
            InterfacePath: "/v1/process/getOperationRecords.json",
            requestType: "GET",
            params: [{
              parameterName: "processInstanceId",
              description: "流程实例 ID",
              requiredFields: "是"
            }]
          },
          {
            apiName: "流程实例更新",
            InterfacePath: "/v1/process/updateInstance.json",
            requestType: "POST",
            params: [{
              parameterName: "processInstanceId",
              description: "实例 ID",
              requiredFields: "是"
            }, {
              parameterName: "updateFormDataJson",
              description: "更新的表单数据",
              requiredFields: "是"
            }]
          }
        ]
      },
      {
        title: "任务中心相关 API",
        key: "3",
        content: [{
          apiName: "已提交任务",
          InterfacePath: "/v1/process/getMySubmitInApp.json",
          requestType: "GET",
          params: [{
            parameterName: "pageSize",
            description: "每页记录数",
            requiredFields: "是"
          }, {
            parameterName: "currentPage",
            description: "当前页",
            requiredFields: "是"
          }, {
            parameterName: "keyword",
            description: "关键词",
            requiredFields: "否"
          }]
        }, {
          apiName: "待办任务",
          InterfacePath: "/v1/task/getTodoTasksInApp.json",
          requestType: "GET",
          params: [{
            parameterName: "pageSize",
            description: "每页记录数",
            requiredFields: "是"
          }, {
            parameterName: "currentPage",
            description: "当前页",
            requiredFields: "是"
          }, {
            parameterName: "keyword",
            description: "关键词",
            requiredFields: "否"
          }]
        }, {
          apiName: "已完成任务",
          InterfacePath: "/v1/task/getDoneTasksInApp.json",
          requestType: "GET",
          params: [{
            parameterName: "pageSize",
            description: "每页记录数",
            requiredFields: "是"
          }, {
            parameterName: "currentPage",
            description: "当前页",
            requiredFields: "是"
          }, {
            parameterName: "keyword",
            description: "关键词",
            requiredFields: "否"
          }]
        }, {
          apiName: "抄送我的任务(应用纬度)",
          InterfacePath: "/v1/task/getNotifyMeTasksInApp.json",
          requestType: "GET",
          params: [{
            parameterName: "pageSize",
            description: "每页记录数",
            requiredFields: "是"
          }, {
            parameterName: "currentPage",
            description: "当前页",
            requiredFields: "是"
          }, {
            parameterName: "keyword",
            description: "关键词",
            requiredFields: "否"
          }]
        }]
      }
    ];
    return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "DataSourceApi-content-InterfacePath", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "AppType(变量)" }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "jsApiIcon_Box", onClick: () => {
          _GM_setClipboard("${window.pageConfig.appType || window.g_config.appKey}");
          Message.success("复制成功!");
        }, children: CopyIcon("#3c99d8") })
      ] }),
      /* @__PURE__ */ jsxRuntimeExports.jsx(_unsafeWindow.Deep.Menu, { openMode: "single", defaultOpenKeys: "0", embeddable: true, children: DataSourceApiData.map((item, index2) => {
        return /* @__PURE__ */ jsxRuntimeExports.jsx(_unsafeWindow.Deep.Menu.SubMenu, { label: item.title, children: item.content.map((content, index_content) => {
          return /* @__PURE__ */ jsxRuntimeExports.jsx(_unsafeWindow.Deep.Menu.PopupItem, { label: content.apiName, triggerType: "click", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "DataSourceApi-content box-grid-1", children: [
            /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "DataSourceApi-title", children: [
              /* @__PURE__ */ jsxRuntimeExports.jsx(
                "div",
                {
                  className: "DataSourceApi-content-apiName",
                  children: content.apiName
                }
              ),
              /* @__PURE__ */ jsxRuntimeExports.jsx(
                "div",
                {
                  className: "DataSourceApi-content-requestType",
                  children: content.requestType
                }
              )
            ] }),
            /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "DataSourceApi-content-InterfacePath", children: [
              /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: content.InterfacePath }),
              /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "jsApiIcon_Box", onClick: () => {
                if (content.InterfacePath) {
                  _GM_setClipboard("`/${window.pageConfig.appType || window.g_config.appKey}" + content.InterfacePath + "`");
                  Message.success("复制成功!");
                } else
                  Message.success("复制失败,请联系开发者!");
              }, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
                Balloon,
                {
                  trigger: CopyIcon("#3c99d8"),
                  closable: false,
                  align: "t",
                  children: "复制"
                }
              ) }),
              /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "jsApiIcon_Box", onClick: () => {
                const { project, skeleton } = AliLowCodeEngine;
                let projectSchema = project.getSchema();
                const pl = SetDataPool(true, content.InterfacePath.match(/\b([A-Za-z]+)/g)[2], content.apiName, content.requestType, null, "`/${window.pageConfig.appType || window.g_config.appKey}" + content.InterfacePath + "`", false);
                const pl2 = SetDataPool(false, content.InterfacePath.match(/\b([A-Za-z]+)/g)[2], content.apiName, content.requestType, null, "`/${window.pageConfig.appType || window.g_config.appKey}" + content.InterfacePath + "`", false);
                projectSchema.componentsTree[0].dataSource.list.push(pl);
                projectSchema.componentsTree[0].dataSource.online.push(pl2);
                project.setSchema(projectSchema);
                const dp = skeleton.getPanel("datapool");
                dp.parent.remove(dp);
                Message.success("数据源添加成功!");
                setTimeout(() => dp.parent.add(dp), 100);
              }, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
                Balloon,
                {
                  trigger: InterfaceIcon("#3c99d8"),
                  closable: false,
                  align: "t",
                  children: "一键创建数据源(无数据)"
                }
              ) }),
              /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "jsApiIcon_Box", onClick: () => {
                const { project, skeleton } = AliLowCodeEngine;
                let projectSchema = project.getSchema();
                const pl = SetDataPool(true, content.InterfacePath.match(/\b([A-Za-z]+)/g)[2], content.apiName, content.requestType, `{${content.params.map((param) => {
                return `
  "${param.parameterName}":"",//${param.description}`;
              })}
}`, "`/${window.pageConfig.appType || window.g_config.appKey}" + content.InterfacePath + "`", false);
                projectSchema.componentsTree[0].dataSource.list.push(pl);
                projectSchema.componentsTree[0].dataSource.online.push(pl);
                project.setSchema(projectSchema);
                const dp = skeleton.getPanel("datapool");
                dp.parent.remove(dp);
                Message.success("数据源添加成功!");
                setTimeout(() => dp.parent.add(dp), 100);
              }, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
                Balloon,
                {
                  trigger: InterfaceIcon("#3c99d8"),
                  closable: false,
                  align: "t",
                  children: "一键创建数据源(有数据)"
                }
              ) })
            ] }),
            /* @__PURE__ */ jsxRuntimeExports.jsxs(Table$1, { dataSource: content.params, children: [
              /* @__PURE__ */ jsxRuntimeExports.jsx(Table$1.Column, { title: "参数名", dataIndex: "parameterName" }),
              /* @__PURE__ */ jsxRuntimeExports.jsx(Table$1.Column, { title: "描述", dataIndex: "description" }),
              /* @__PURE__ */ jsxRuntimeExports.jsx(Table$1.Column, { title: "必填", dataIndex: "requiredFields" }),
              /* @__PURE__ */ jsxRuntimeExports.jsx(Table$1.Column, { title: "操作", cell: (record) => {
                return /* @__PURE__ */ jsxRuntimeExports.jsx(Button, { type: "primary", text: true, onClick: () => {
                  _GM_setClipboard(record.parameterName);
                  Message.success("复制成功!");
                }, children: "复制" });
              } })
            ] })
          ] }) }, `content_${index_content}`);
        }) }, index2);
      }) })
    ] });
  };
  const CommonCodeBox = () => {
    const CommonCodeData = [
      {
        title: "this.utils.formatter(when, value, type)",
        description: "日期格式化",
        code: `// 格式化日期,输出值为:2022-01-29
  const formatDate = this.utils.formatter('date', new Date(), 'YYYY-MM-DD');`
      },
      {
        title: "setTimeout()",
        description: "定时器(单次)",
        code: `setTimeout(()=>{

},number)`
      },
      {
        title: "setTimeout()",
        description: "定时器(循环)",
        code: `// 设置一个计数器
  let count = 0;
  const interval = setInterval(() => {
    ++count;
    if (count === 5) {
      //停止
      clearInterval(interval);
    }
  }, number);`
      },
      {
        title: "validateRule(idCardNumber)",
        description: "身份证号校验",
        code: `function validateRule(idCardNumber) {
  if (idCardNumber && idCardNumber.length === 18) {
    const coeff = [7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2];
    const laststr = ['1', '0', 'X', '9', '8', '7', '6', '5', '4', '3', '2'];
    let total = 0;
    for(let i = 0; i < 17; ++ i) {
      total+= parseInt(idCardNumber[i], 10) * coeff[i];
    }
    return idCardNumber[17] === laststr[total % 11];
  }
  return false;
}`
      },
      {
        title: "validateRule(bankCardNumber)",
        description: "卡号校验「Luhn 算法」",
        code: `function validateRule(bankCardNumber) {
  if (bankCardNumber && /^([0-9]{16}|[0-9]{19})$/.test(bankCardNumber)) {
    let total = 0;
    bankCardNumber.split('').reverse().forEach((item, idx) => {
      const num = parseInt(item, 10);
      total += idx % 2 ? 2 * num - (num > 4 ? 9 : 0) : num;
    });
    if (total === 0) {
      return false;
    }
    return total % 10 === 0;
  }
  return false;
}`
      },
      {
        title: "validateRule(phoneNumber)",
        description: "手机号校验",
        code: `function validateRule(phoneNumber) {
  var reg = /^1d{10}$/;
  return reg.test(phoneNumber);
}`
      },
      {
        title: "maskPhoneNumber()",
        description: "手机号加密",
        code: `export function maskPhoneNumber(phoneNumber) {
  return phoneNumber.replace(/(d{3})d{4}(d{4})/, '$1****$2');
}`
      },
      {
        title: "fieldsValidate()",
        description: "表单必填校验「JS触发事件」",
        code: `/**
* 表单必填校验js事件
*/
export async function onClick() {
  //组件id集合,子表视作一个元素
  const fieldList = [];

  // 调用表单校验函数 
  this.fieldsValidate(fieldList).then(errorList => {
    setTimeout(() => {
      if (errorList.length > 0) {
        // 表单校验未通过,你可以做一些数据错误提示
        return;
      };
      // 表单校验通过,你的后续业务逻辑由此往下写
      this.utils.toast({
        title: '表单校验通过',
        type: 'success',
      });
    });
  }, 0);
}

// fieldList:Array,需要校验组件的唯一标识集合
export async function fieldsValidate(fieldList = []) {
  const result = [];
  for (let i = 0; i < fieldList.length; i++) {
    await this.$(fieldList[i]).validate((errors, values) => {
      if (!errors) { return };
      result.push({
        fieldId: fieldList[i], // 组件标识
        errors: this.utils.isMobile() ? errors.errors[fieldList[i]].errors : errors[fieldList[i]].errors // 校验错误信息
      });
    });
  };
  return result;
}`
      },
      {
        title: "vConsole",
        description: "打开需要调试页面的动作面板,在最上方直接输入下面代码。访问进行调试。 注意调试完成后删除该代码。",
        code: `const vConsole = 'https://g.alicdn.com/code/lib/vConsole/3.11.2/vconsole.min.js';const js = document.createElement('script');js.src = vConsole;document.body.append(js);js.onload = function() {
  window.vConsole = new window.VConsole();};`
      },
      {
        title: "获取子表单指定行数据",
        description: "--",
        code: `// 获取子表单组件
const tableField = this.$('tableField_l0q1sf8l');
// 获取子表单所有行标识
let items = tableField.getItems();
// 传入指定的行标识
let rowData = tableField.getItemValue(items[0]);`
      },
      {
        title: "获取子表单指定行指定组件数据",
        description: "--",
        code: `// 获取子表单组件
const tableField = this.$('tableField_l0q1sf8l');

// 获取子表单所有行标识
let items = tableField.getItems();

// 传入指定的行标识
let rowData = tableField.getItemValue(items[0]);

// 传入指定的组件唯一标识
let fieldValue = rowData["textField_l0q1sf8m"];`
      },
      {
        title: "更新子表单指定行的数据",
        description: "--",
        code: `const { formGroupId, from, changes = {}, tableFieldId } = extra || {};
// 必须,避免使用 updateItemValue 更新子表数据后,再次触发 onChange 陷入死循环
if (from === 'setItemValue') { return };
// 获取子表单组件
const tableField = this.$('tableField_l0q1sf8l');
// 更新指定行对应字段,需传入指定的行标识 (formGroupId),以及更新后的数据 Object
tableField.updateItemValue(formGroupId, {
  textField_l0q1sf8m: "4",
  selectField_l0q1sf8n: "选项二",
});`
      },
      {
        title: "tableToTable()",
        description: "子表单填充子表单",
        code: `//函数示例
// 子表单填充子表单,快速生成子表单数据
// tableData:目标子表单组件数据
// relation:字段映射关系 target:目标子表单字段唯一标识,current:当前子表单字段唯一标识
export function tableToTable(tableData = [], relation = []) {
  const result = []; // 数据处理结果
  if (!tableData.length || !relation.length) { return result };
  for (let i = 0; i < tableData.length; i++) {
    let itemObj = {};
    for (let j = 0; j < relation.length; j++) {
      itemObj[relation[j].current] = tableData[i][relation[j].target]
    };
    result.push(itemObj);
  };
  return result;
}
//使用方法
// tableData 通常由数据源获取得到
const tableData = [{
  textField_lbafn35q: '砂锅黄焖鸡',
  numberField_lbafn35r: 24
}, {
  textField_lbafn35q: '砂锅土豆',
  numberField_lbafn35r: 28
}];

// relation 需按照实际情况手动配置
const relation = [{
  target: 'textField_lbafn35q', // 目标子表单字段唯一标识
  current: 'textField_lbaft5ob' // 当前子表单字段唯一标识
}, {
  target: 'numberField_lbafn35r',
  current: 'numberField_lbaft5oc'
}];

this.$('tableField_lbaft5oa').setValue(this.tableToTable(tableData, relation));`
      },
      {
        title: "子表单类数据联动",
        description: "--",
        code: `export function onChange({ value, extra }) {
  // 需将此方法绑定到子表单的onChange上
  // 子表单数据变更时,除单元格变化引起的数据变更外,公式计算、数据联动或者外部赋值都会触发子表单的 onChange 事件
  // 解构相关属性
  const { formGroupId, from, changes = {}, tableFieldId } = extra || {};
  // 必须,避免使用 updateItemValue 更新子表数据后,再次触发 onChange 陷入死循环
  if (from === 'setItemValue') { return };
  // 获取子表单组件
  const tableField = this.$(tableFieldId);
  // 判断是否是子表单内某字段变化
  /* if (changes.fieldId === 'textField_l0q1sf8m' || (changes.name ? changes.name.split(".")[1] === 'textField_l0q1sf8m' : false)) {

    }; */
  // 更新子表单指定列数据,可与上述结合使用
  /* tableField.updateItemValue(formGroupId, {
      'selectField_l0q1sf8n': "选项二", // 更新对应字段
    }); */
  // 结合使用,实现类数据联动效果,支持数据源写法
  if (changes.fieldId === 'textField_l0q1sf8m') {
    tableField.updateItemValue(formGroupId, {
      'selectField_l0q1sf8n': "选项二", // 更新对应字段
    });
  };
}`
      },
      {
        title: "控制行内其他组件是否必填",
        description: "--",
        code: `const tableField = this.$('tableField_lhu7ixu8');
const validation = value === 'true' ? [{ type: 'required' }] : [];
tableField.getComponent(formGroupId, 'textField_lhu7ixu7').setValidation(validation); `
      },
      {
        title: "异步请求全量数据",
        description: "--",
        code: `//示例为onChange事件触发
export function onChange({ value }) {
  var formUuid = "FORM-QQ866JB1Q4R6U2BLALBVN7K8PUZU36TWX9ACL6"
  //  参数 formUuid  表单id
  // data  请求获得的大批量数据
  this.searchFormData(formUuid, data => {
    console.log("data", data)
  })
}
export function searchFormData(formUuid, callback) {
  var res = this.state.searchFormDatas
  var number = Math.ceil(res.totalCount / 100)
  var numberData = []
  for (let i = 0; i < number; i++) {
    numberData.push(i)
  }
  var data = []
  var params = numberData.map(item => {
    return new Promise((reslove, reject) => {
      var params = {
        "formUuid": formUuid,
        "pageSize": 100,
        "currentPage": item + 1
      }
      this.dataSourceMap.searchFormDatas.load(params).then(res => {
        data.push(...res.data)
        reslove(item)
      })
    })
  })

  Promise.all(params).then(() => {
    callback(data)
  })
}`
      },
      {
        title: "判断是否为空Object或空Array",
        description: "--",
        code: `// data:Array、Object 待检验的数据   1、判断当前参数是否为空Object或者空Array,是则返回true。反之,返回false。2、常用于判断数据是否为空数据,避免传入错误参数。
export function isEmptyObject(data) {
  let i;
  for (i in data) {
    if (Object.prototype.hasOwnProperty.call(data, i)) {
      return !1;
    }
  }
  return !0;
}`
      }
    ];
    return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "box-grid-1", children: CommonCodeData.map((item, index2) => {
      return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "jsApiItem_Box", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "jsApiItemTitle_Box", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "jsApiItemTitle", children: item.title }),
          /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "jsApiIcon_Box", onClick: () => {
            if (item.code) {
              _GM_setClipboard(item.code);
              Message.success("复制成功!");
            } else {
              Message.error("复制失败,请联系开发者!");
            }
          }, children: CopyIcon("#3c99d8") })
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "jsApiItemDescription", children: item.description })
      ] }) }, index2);
    }) });
  };
  const DingTalkIcon = (hexColor) => {
    return /* @__PURE__ */ jsxRuntimeExports.jsx(
      "svg",
      {
        t: "1699234585631",
        className: "icon",
        viewBox: "0 0 1024 1024",
        version: "1.1",
        xmlns: "http://www.w3.org/2000/svg",
        "p-id": "10452",
        width: "15",
        height: "15",
        children: /* @__PURE__ */ jsxRuntimeExports.jsx(
          "path",
          {
            d: "M511.957333 42.666667a469.333333 469.333333 0 1 0 469.333334 469.333333 467.968 467.968 0 0 0-469.333334-469.333333z m217.6 401.066666a32.341333 32.341333 0 0 1-8.533333 17.066667c-21.333333 42.666667-68.266667 123.733333-68.266667 123.733333l-12.8 25.6h72.533334l-136.533334 183.466667 29.866667-123.733333h-55.466667l21.333334-81.066667a396.202667 396.202667 0 0 0-55.466667 17.066667c-4.266667 0-8.533333 4.266667-12.8 4.266666a134.442667 134.442667 0 0 1-72.533333-38.4s-25.6-21.333333-21.333334-34.133333c0-4.266667 4.266667-4.266667 8.533334-8.533333a329.344 329.344 0 0 1 64-8.533334h12.8c38.4-4.266667 59.733333-8.533333 59.733333-8.533333h-51.2a691.2 691.2 0 0 1-93.866667-4.266667 131.968 131.968 0 0 1-72.533333-93.866666v-12.8c4.266667-4.266667 4.266667-4.266667 8.533333-4.266667a25.6 25.6 0 0 1 17.066667 4.266667c21.333333 4.266667 81.066667 21.333333 183.466667 38.4h8.533333s-200.533333-59.733333-213.333333-76.8a244.736 244.736 0 0 1-34.133334-123.733334 9.173333 9.173333 0 0 1 8.533334-8.533333h4.266666s149.333333 68.266667 247.466667 102.4a240.597333 240.597333 0 0 0 51.2 17.066667c64 34.133333 119.466667 55.466667 110.933333 93.866666z",
            "p-id": "10453",
            fill: hexColor
          }
        )
      }
    );
  };
  const GithubIcon = () => {
    return /* @__PURE__ */ jsxRuntimeExports.jsx(
      "svg",
      {
        t: "1699245509391",
        className: "icon",
        viewBox: "0 0 1024 1024",
        version: "1.1",
        xmlns: "http://www.w3.org/2000/svg",
        "p-id": "4018",
        width: "15",
        height: "15",
        children: /* @__PURE__ */ jsxRuntimeExports.jsx(
          "path",
          {
            d: "M511.968 73.152q119.424 0 220.288 58.848t159.712 159.712 58.848 220.288q0 143.424-83.712 258.016t-216.288 158.56q-15.424 2.848-22.848-4t-7.424-17.152q0-1.728 0.288-43.712t0.288-76.864q0-55.424-29.728-81.152 32.576-3.424 58.56-10.272t53.728-22.272 46.272-38.016 30.272-60 11.712-86.016q0-68-45.152-117.728 21.152-52-4.576-116.576-16-5.152-46.272 6.272t-52.576 25.152l-21.728 13.728q-53.152-14.848-109.728-14.848t-109.728 14.848q-9.152-6.272-24.288-15.424t-47.712-22.016-48.576-7.712q-25.728 64.576-4.576 116.576-45.152 49.728-45.152 117.728 0 48.576 11.712 85.728t30.016 60 46.016 38.272 53.728 22.272 58.56 10.272q-22.272 20.576-28 58.848-12 5.728-25.728 8.576t-32.576 2.848-37.44-12.288-31.712-35.712q-10.848-18.272-27.712-29.728t-28.288-13.728l-11.424-1.728q-12 0-16.576 2.56t-2.848 6.56 5.152 8 7.424 6.848l4 2.848q12.576 5.728 24.864 21.728t18.016 29.152l5.728 13.152q7.424 21.728 25.152 35.136t38.272 17.152 39.712 4 31.712-2.016l13.152-2.272q0 21.728 0.288 50.56t0.288 31.136q0 10.272-7.424 17.152t-22.848 4q-132.576-44-216.288-158.56t-83.712-258.016q0-119.424 58.848-220.288t159.712-159.712 220.288-58.848zM239.392 703.424q1.728-4-4-6.848-5.728-1.728-7.424 1.152-1.728 4 4 6.848 5.152 3.424 7.424-1.152zM257.12 722.848q4-2.848-1.152-9.152-5.728-5.152-9.152-1.728-4 2.848 1.152 9.152 5.728 5.728 9.152 1.728zM274.272 748.576q5.152-4 0-10.848-4.576-7.424-9.728-3.424-5.152 2.848 0 10.272t9.728 4zM298.272 772.576q4.576-4.576-2.272-10.848-6.848-6.848-11.424-1.728-5.152 4.576 2.272 10.848 6.848 6.848 11.424 1.728zM330.848 786.848q1.728-6.272-7.424-9.152-8.576-2.272-10.848 4t7.424 8.576q8.576 3.424 10.848-3.424zM366.848 789.728q0-7.424-9.728-6.272-9.152 0-9.152 6.272 0 7.424 9.728 6.272 9.152 0 9.152-6.272zM399.968 784q-1.152-6.272-10.272-5.152-9.152 1.728-8 8.576t10.272 4.576 8-8z",
            "p-id": "4019"
          }
        )
      }
    );
  };
  const GreasyForkIcon = () => {
    return /* @__PURE__ */ jsxRuntimeExports.jsxs(
      "svg",
      {
        t: "1699245675256",
        className: "icon",
        viewBox: "0 0 1024 1024",
        version: "1.1",
        xmlns: "http://www.w3.org/2000/svg",
        "p-id": "6894",
        width: "15",
        height: "15",
        children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            "path",
            {
              d: "M28.16 514.56c0 268.8 217.6 486.4 486.4 486.4s486.4-217.6 486.4-486.4-217.6-486.4-486.4-486.4-486.4 217.6-486.4 486.4z",
              "p-id": "6895"
            }
          ),
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            "path",
            {
              d: "M440.32 258.048c139.264 140.288 142.336 144.384 135.68 193.024-2.048 16.384 0 28.672 0 29.696 0 40.96 138.752 164.352 218.624 253.952 39.424 44.032 64 78.848 53.248 109.056-5.12 14.336-17.92 27.648-34.304 31.744-32.768 8.192-67.072-26.112-117.76-78.336-145.408-150.016-197.632-204.8-251.392-194.56-13.824 2.56-11.264 7.68-25.6 8.704-35.84 2.56-80.896-34.304-193.024-146.432C121.856 360.448 91.648 322.56 98.304 304.128c7.68-19.456 26.112-5.12 113.152 79.872l105.472 103.424 29.184-28.672 29.184-28.672-103.424-103.424c-68.608-69.632-97.28-106.496-87.04-112.64 10.752-6.656 52.736 27.648 117.248 90.624L401.92 404.48l30.208-28.672 29.184-30.208-99.84-100.352C274.432 157.184 250.88 115.2 287.744 115.2c5.12 0 73.728 64.512 152.576 142.848z",
              fill: "#FFFFFF",
              "p-id": "6896"
            }
          )
        ]
      }
    );
  };
  const About = () => {
    const { Text: Text2 } = Typography$1;
    return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "about_box", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "当前版本:" }),
      /* @__PURE__ */ jsxRuntimeExports.jsx(Text2, { code: true, children: "Version 2.2.2" }),
      /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "作者:" }),
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { style: { display: "flex", alignItems: "center", gap: 8 }, children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx(Text2, { code: true, children: "Navcoo.Li" }),
        /* @__PURE__ */ jsxRuntimeExports.jsx(
          "a",
          {
            style: { cursor: "pointer" },
            target: "_blank",
            href: "https://applink.dingtalk.com/page/profile?phone=li78080114",
            children: DingTalkIcon("#1296db")
          }
        )
      ] }),
      /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "项目地址:" }),
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { style: { display: "flex", alignItems: "center", gap: 8 }, children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx(
          "a",
          {
            style: { cursor: "pointer" },
            target: "_blank",
            href: "https://github.com/4095/yida-add-tampermonkey",
            children: GithubIcon()
          }
        ),
        /* @__PURE__ */ jsxRuntimeExports.jsx(
          "a",
          {
            style: { cursor: "pointer" },
            target: "_blank",
            href: "https://greasyfork.org/zh-CN/scripts/474556-%E5%AE%9C%E6%90%AD",
            children: GreasyForkIcon()
          }
        )
      ] })
    ] });
  };
  /*! xlsx.js (C) 2013-present SheetJS -- http://sheetjs.com */
  var XLSX = {};
  XLSX.version = "0.18.5";
  var current_ansi = 1252;
  var VALID_ANSI = [874, 932, 936, 949, 950, 1250, 1251, 1252, 1253, 1254, 1255, 1256, 1257, 1258, 1e4];
  var set_ansi = function(cp) {
    if (VALID_ANSI.indexOf(cp) == -1)
      return;
    current_ansi = cp;
  };
  function reset_ansi() {
    set_ansi(1252);
  }
  var set_cp = function(cp) {
    set_ansi(cp);
  };
  function reset_cp() {
    set_cp(1200);
    reset_ansi();
  }
  function utf16beread(data) {
    var o = [];
    for (var i = 0; i < data.length >> 1; ++i)
      o[i] = String.fromCharCode(data.charCodeAt(2 * i + 1) + (data.charCodeAt(2 * i) << 8));
    return o.join("");
  }
  var _getchar = function _gc1(x2) {
    return String.fromCharCode(x2);
  };
  var _getansi = function _ga1(x2) {
    return String.fromCharCode(x2);
  };
  var $cptable;
  var Base64_map = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
  function Base64_encode(input) {
    var o = "";
    var c1 = 0, c2 = 0, c3 = 0, e1 = 0, e2 = 0, e3 = 0, e4 = 0;
    for (var i = 0; i < input.length; ) {
      c1 = input.charCodeAt(i++);
      e1 = c1 >> 2;
      c2 = input.charCodeAt(i++);
      e2 = (c1 & 3) << 4 | c2 >> 4;
      c3 = input.charCodeAt(i++);
      e3 = (c2 & 15) << 2 | c3 >> 6;
      e4 = c3 & 63;
      if (isNaN(c2)) {
        e3 = e4 = 64;
      } else if (isNaN(c3)) {
        e4 = 64;
      }
      o += Base64_map.charAt(e1) + Base64_map.charAt(e2) + Base64_map.charAt(e3) + Base64_map.charAt(e4);
    }
    return o;
  }
  function Base64_decode(input) {
    var o = "";
    var c1 = 0, c2 = 0, c3 = 0, e1 = 0, e2 = 0, e3 = 0, e4 = 0;
    input = input.replace(/[^\w\+\/\=]/g, "");
    for (var i = 0; i < input.length; ) {
      e1 = Base64_map.indexOf(input.charAt(i++));
      e2 = Base64_map.indexOf(input.charAt(i++));
      c1 = e1 << 2 | e2 >> 4;
      o += String.fromCharCode(c1);
      e3 = Base64_map.indexOf(input.charAt(i++));
      c2 = (e2 & 15) << 4 | e3 >> 2;
      if (e3 !== 64) {
        o += String.fromCharCode(c2);
      }
      e4 = Base64_map.indexOf(input.charAt(i++));
      c3 = (e3 & 3) << 6 | e4;
      if (e4 !== 64) {
        o += String.fromCharCode(c3);
      }
    }
    return o;
  }
  var has_buf = /* @__PURE__ */ function() {
    return typeof Buffer !== "undefined" && typeof process !== "undefined" && typeof process.versions !== "undefined" && !!process.versions.node;
  }();
  var Buffer_from = /* @__PURE__ */ function() {
    if (typeof Buffer !== "undefined") {
      var nbfs = !Buffer.from;
      if (!nbfs)
        try {
          Buffer.from("foo", "utf8");
        } catch (e2) {
          nbfs = true;
        }
      return nbfs ? function(buf, enc) {
        return enc ? new Buffer(buf, enc) : new Buffer(buf);
      } : Buffer.from.bind(Buffer);
    }
    return function() {
    };
  }();
  function new_raw_buf(len) {
    if (has_buf)
      return Buffer.alloc ? Buffer.alloc(len) : new Buffer(len);
    return typeof Uint8Array != "undefined" ? new Uint8Array(len) : new Array(len);
  }
  function new_unsafe_buf(len) {
    if (has_buf)
      return Buffer.allocUnsafe ? Buffer.allocUnsafe(len) : new Buffer(len);
    return typeof Uint8Array != "undefined" ? new Uint8Array(len) : new Array(len);
  }
  var s2a = function s2a2(s) {
    if (has_buf)
      return Buffer_from(s, "binary");
    return s.split("").map(function(x2) {
      return x2.charCodeAt(0) & 255;
    });
  };
  function s2ab(s) {
    if (typeof ArrayBuffer === "undefined")
      return s2a(s);
    var buf = new ArrayBuffer(s.length), view = new Uint8Array(buf);
    for (var i = 0; i != s.length; ++i)
      view[i] = s.charCodeAt(i) & 255;
    return buf;
  }
  function a2s(data) {
    if (Array.isArray(data))
      return data.map(function(c2) {
        return String.fromCharCode(c2);
      }).join("");
    var o = [];
    for (var i = 0; i < data.length; ++i)
      o[i] = String.fromCharCode(data[i]);
    return o.join("");
  }
  function a2u(data) {
    if (typeof Uint8Array === "undefined")
      throw new Error("Unsupported");
    return new Uint8Array(data);
  }
  var bconcat = has_buf ? function(bufs) {
    return Buffer.concat(bufs.map(function(buf) {
      return Buffer.isBuffer(buf) ? buf : Buffer_from(buf);
    }));
  } : function(bufs) {
    if (typeof Uint8Array !== "undefined") {
      var i = 0, maxlen = 0;
      for (i = 0; i < bufs.length; ++i)
        maxlen += bufs[i].length;
      var o = new Uint8Array(maxlen);
      var len = 0;
      for (i = 0, maxlen = 0; i < bufs.length; maxlen += len, ++i) {
        len = bufs[i].length;
        if (bufs[i] instanceof Uint8Array)
          o.set(bufs[i], maxlen);
        else if (typeof bufs[i] == "string") {
          throw "wtf";
        } else
          o.set(new Uint8Array(bufs[i]), maxlen);
      }
      return o;
    }
    return [].concat.apply([], bufs.map(function(buf) {
      return Array.isArray(buf) ? buf : [].slice.call(buf);
    }));
  };
  function utf8decode(content) {
    var out = [], widx = 0, L = content.length + 250;
    var o = new_raw_buf(content.length + 255);
    for (var ridx = 0; ridx < content.length; ++ridx) {
      var c2 = content.charCodeAt(ridx);
      if (c2 < 128)
        o[widx++] = c2;
      else if (c2 < 2048) {
        o[widx++] = 192 | c2 >> 6 & 31;
        o[widx++] = 128 | c2 & 63;
      } else if (c2 >= 55296 && c2 < 57344) {
        c2 = (c2 & 1023) + 64;
        var d2 = content.charCodeAt(++ridx) & 1023;
        o[widx++] = 240 | c2 >> 8 & 7;
        o[widx++] = 128 | c2 >> 2 & 63;
        o[widx++] = 128 | d2 >> 6 & 15 | (c2 & 3) << 4;
        o[widx++] = 128 | d2 & 63;
      } else {
        o[widx++] = 224 | c2 >> 12 & 15;
        o[widx++] = 128 | c2 >> 6 & 63;
        o[widx++] = 128 | c2 & 63;
      }
      if (widx > L) {
        out.push(o.slice(0, widx));
        widx = 0;
        o = new_raw_buf(65535);
        L = 65530;
      }
    }
    out.push(o.slice(0, widx));
    return bconcat(out);
  }
  var chr0 = /\u0000/g, chr1 = /[\u0001-\u0006]/g;
  function _strrev(x2) {
    var o = "", i = x2.length - 1;
    while (i >= 0)
      o += x2.charAt(i--);
    return o;
  }
  function pad0(v2, d2) {
    var t2 = "" + v2;
    return t2.length >= d2 ? t2 : fill("0", d2 - t2.length) + t2;
  }
  function pad_(v2, d2) {
    var t2 = "" + v2;
    return t2.length >= d2 ? t2 : fill(" ", d2 - t2.length) + t2;
  }
  function rpad_(v2, d2) {
    var t2 = "" + v2;
    return t2.length >= d2 ? t2 : t2 + fill(" ", d2 - t2.length);
  }
  function pad0r1(v2, d2) {
    var t2 = "" + Math.round(v2);
    return t2.length >= d2 ? t2 : fill("0", d2 - t2.length) + t2;
  }
  function pad0r2(v2, d2) {
    var t2 = "" + v2;
    return t2.length >= d2 ? t2 : fill("0", d2 - t2.length) + t2;
  }
  var p2_32 = /* @__PURE__ */ Math.pow(2, 32);
  function pad0r(v2, d2) {
    if (v2 > p2_32 || v2 < -p2_32)
      return pad0r1(v2, d2);
    var i = Math.round(v2);
    return pad0r2(i, d2);
  }
  function SSF_isgeneral(s, i) {
    i = i || 0;
    return s.length >= 7 + i && (s.charCodeAt(i) | 32) === 103 && (s.charCodeAt(i + 1) | 32) === 101 && (s.charCodeAt(i + 2) | 32) === 110 && (s.charCodeAt(i + 3) | 32) === 101 && (s.charCodeAt(i + 4) | 32) === 114 && (s.charCodeAt(i + 5) | 32) === 97 && (s.charCodeAt(i + 6) | 32) === 108;
  }
  var days = [
    ["Sun", "Sunday"],
    ["Mon", "Monday"],
    ["Tue", "Tuesday"],
    ["Wed", "Wednesday"],
    ["Thu", "Thursday"],
    ["Fri", "Friday"],
    ["Sat", "Saturday"]
  ];
  var months = [
    ["J", "Jan", "January"],
    ["F", "Feb", "February"],
    ["M", "Mar", "March"],
    ["A", "Apr", "April"],
    ["M", "May", "May"],
    ["J", "Jun", "June"],
    ["J", "Jul", "July"],
    ["A", "Aug", "August"],
    ["S", "Sep", "September"],
    ["O", "Oct", "October"],
    ["N", "Nov", "November"],
    ["D", "Dec", "December"]
  ];
  function SSF_init_table(t2) {
    if (!t2)
      t2 = {};
    t2[0] = "General";
    t2[1] = "0";
    t2[2] = "0.00";
    t2[3] = "#,##0";
    t2[4] = "#,##0.00";
    t2[9] = "0%";
    t2[10] = "0.00%";
    t2[11] = "0.00E+00";
    t2[12] = "# ?/?";
    t2[13] = "# ??/??";
    t2[14] = "m/d/yy";
    t2[15] = "d-mmm-yy";
    t2[16] = "d-mmm";
    t2[17] = "mmm-yy";
    t2[18] = "h:mm AM/PM";
    t2[19] = "h:mm:ss AM/PM";
    t2[20] = "h:mm";
    t2[21] = "h:mm:ss";
    t2[22] = "m/d/yy h:mm";
    t2[37] = "#,##0 ;(#,##0)";
    t2[38] = "#,##0 ;[Red](#,##0)";
    t2[39] = "#,##0.00;(#,##0.00)";
    t2[40] = "#,##0.00;[Red](#,##0.00)";
    t2[45] = "mm:ss";
    t2[46] = "[h]:mm:ss";
    t2[47] = "mmss.0";
    t2[48] = "##0.0E+0";
    t2[49] = "@";
    t2[56] = '"上午/下午 "hh"時"mm"分"ss"秒 "';
    return t2;
  }
  var table_fmt = {
    0: "General",
    1: "0",
    2: "0.00",
    3: "#,##0",
    4: "#,##0.00",
    9: "0%",
    10: "0.00%",
    11: "0.00E+00",
    12: "# ?/?",
    13: "# ??/??",
    14: "m/d/yy",
    15: "d-mmm-yy",
    16: "d-mmm",
    17: "mmm-yy",
    18: "h:mm AM/PM",
    19: "h:mm:ss AM/PM",
    20: "h:mm",
    21: "h:mm:ss",
    22: "m/d/yy h:mm",
    37: "#,##0 ;(#,##0)",
    38: "#,##0 ;[Red](#,##0)",
    39: "#,##0.00;(#,##0.00)",
    40: "#,##0.00;[Red](#,##0.00)",
    45: "mm:ss",
    46: "[h]:mm:ss",
    47: "mmss.0",
    48: "##0.0E+0",
    49: "@",
    56: '"上午/下午 "hh"時"mm"分"ss"秒 "'
  };
  var SSF_default_map = {
    5: 37,
    6: 38,
    7: 39,
    8: 40,
    //  5 -> 37 ...  8 -> 40
    23: 0,
    24: 0,
    25: 0,
    26: 0,
    // 23 ->  0 ... 26 ->  0
    27: 14,
    28: 14,
    29: 14,
    30: 14,
    31: 14,
    // 27 -> 14 ... 31 -> 14
    50: 14,
    51: 14,
    52: 14,
    53: 14,
    54: 14,
    // 50 -> 14 ... 58 -> 14
    55: 14,
    56: 14,
    57: 14,
    58: 14,
    59: 1,
    60: 2,
    61: 3,
    62: 4,
    // 59 ->  1 ... 62 ->  4
    67: 9,
    68: 10,
    // 67 ->  9 ... 68 -> 10
    69: 12,
    70: 13,
    71: 14,
    // 69 -> 12 ... 71 -> 14
    72: 14,
    73: 15,
    74: 16,
    75: 17,
    // 72 -> 14 ... 75 -> 17
    76: 20,
    77: 21,
    78: 22,
    // 76 -> 20 ... 78 -> 22
    79: 45,
    80: 46,
    81: 47,
    // 79 -> 45 ... 81 -> 47
    82: 0
    // 82 ->  0 ... 65536 -> 0 (omitted)
  };
  var SSF_default_str = {
    //  5 -- Currency,   0 decimal, black negative
    5: '"$"#,##0_);\\("$"#,##0\\)',
    63: '"$"#,##0_);\\("$"#,##0\\)',
    //  6 -- Currency,   0 decimal, red   negative
    6: '"$"#,##0_);[Red]\\("$"#,##0\\)',
    64: '"$"#,##0_);[Red]\\("$"#,##0\\)',
    //  7 -- Currency,   2 decimal, black negative
    7: '"$"#,##0.00_);\\("$"#,##0.00\\)',
    65: '"$"#,##0.00_);\\("$"#,##0.00\\)',
    //  8 -- Currency,   2 decimal, red   negative
    8: '"$"#,##0.00_);[Red]\\("$"#,##0.00\\)',
    66: '"$"#,##0.00_);[Red]\\("$"#,##0.00\\)',
    // 41 -- Accounting, 0 decimal, No Symbol
    41: '_(* #,##0_);_(* \\(#,##0\\);_(* "-"_);_(@_)',
    // 42 -- Accounting, 0 decimal, $  Symbol
    42: '_("$"* #,##0_);_("$"* \\(#,##0\\);_("$"* "-"_);_(@_)',
    // 43 -- Accounting, 2 decimal, No Symbol
    43: '_(* #,##0.00_);_(* \\(#,##0.00\\);_(* "-"??_);_(@_)',
    // 44 -- Accounting, 2 decimal, $  Symbol
    44: '_("$"* #,##0.00_);_("$"* \\(#,##0.00\\);_("$"* "-"??_);_(@_)'
  };
  function SSF_frac(x2, D, mixed) {
    var sgn = x2 < 0 ? -1 : 1;
    var B = x2 * sgn;
    var P_2 = 0, P_1 = 1, P = 0;
    var Q_2 = 1, Q_1 = 0, Q = 0;
    var A2 = Math.floor(B);
    while (Q_1 < D) {
      A2 = Math.floor(B);
      P = A2 * P_1 + P_2;
      Q = A2 * Q_1 + Q_2;
      if (B - A2 < 5e-8)
        break;
      B = 1 / (B - A2);
      P_2 = P_1;
      P_1 = P;
      Q_2 = Q_1;
      Q_1 = Q;
    }
    if (Q > D) {
      if (Q_1 > D) {
        Q = Q_2;
        P = P_2;
      } else {
        Q = Q_1;
        P = P_1;
      }
    }
    if (!mixed)
      return [0, sgn * P, Q];
    var q2 = Math.floor(sgn * P / Q);
    return [q2, sgn * P - q2 * Q, Q];
  }
  function SSF_parse_date_code(v2, opts, b2) {
    if (v2 > 2958465 || v2 < 0)
      return null;
    var date = v2 | 0, time = Math.floor(86400 * (v2 - date)), dow = 0;
    var dout = [];
    var out = { D: date, T: time, u: 86400 * (v2 - date) - time, y: 0, m: 0, d: 0, H: 0, M: 0, S: 0, q: 0 };
    if (Math.abs(out.u) < 1e-6)
      out.u = 0;
    if (opts && opts.date1904)
      date += 1462;
    if (out.u > 0.9999) {
      out.u = 0;
      if (++time == 86400) {
        out.T = time = 0;
        ++date;
        ++out.D;
      }
    }
    if (date === 60) {
      dout = b2 ? [1317, 10, 29] : [1900, 2, 29];
      dow = 3;
    } else if (date === 0) {
      dout = b2 ? [1317, 8, 29] : [1900, 1, 0];
      dow = 6;
    } else {
      if (date > 60)
        --date;
      var d2 = new Date(1900, 0, 1);
      d2.setDate(d2.getDate() + date - 1);
      dout = [d2.getFullYear(), d2.getMonth() + 1, d2.getDate()];
      dow = d2.getDay();
      if (date < 60)
        dow = (dow + 6) % 7;
      if (b2)
        dow = SSF_fix_hijri(d2, dout);
    }
    out.y = dout[0];
    out.m = dout[1];
    out.d = dout[2];
    out.S = time % 60;
    time = Math.floor(time / 60);
    out.M = time % 60;
    time = Math.floor(time / 60);
    out.H = time;
    out.q = dow;
    return out;
  }
  var SSFbasedate = /* @__PURE__ */ new Date(1899, 11, 31, 0, 0, 0);
  var SSFdnthresh = /* @__PURE__ */ SSFbasedate.getTime();
  var SSFbase1904 = /* @__PURE__ */ new Date(1900, 2, 1, 0, 0, 0);
  function datenum_local(v2, date1904) {
    var epoch = /* @__PURE__ */ v2.getTime();
    if (date1904)
      epoch -= 1461 * 24 * 60 * 60 * 1e3;
    else if (v2 >= SSFbase1904)
      epoch += 24 * 60 * 60 * 1e3;
    return (epoch - (SSFdnthresh + (/* @__PURE__ */ v2.getTimezoneOffset() - /* @__PURE__ */ SSFbasedate.getTimezoneOffset()) * 6e4)) / (24 * 60 * 60 * 1e3);
  }
  function SSF_strip_decimal(o) {
    return o.indexOf(".") == -1 ? o : o.replace(/(?:\.0*|(\.\d*[1-9])0+)$/, "$1");
  }
  function SSF_normalize_exp(o) {
    if (o.indexOf("E") == -1)
      return o;
    return o.replace(/(?:\.0*|(\.\d*[1-9])0+)[Ee]/, "$1E").replace(/(E[+-])(\d)$/, "$10$2");
  }
  function SSF_small_exp(v2) {
    var w2 = v2 < 0 ? 12 : 11;
    var o = SSF_strip_decimal(v2.toFixed(12));
    if (o.length <= w2)
      return o;
    o = v2.toPrecision(10);
    if (o.length <= w2)
      return o;
    return v2.toExponential(5);
  }
  function SSF_large_exp(v2) {
    var o = SSF_strip_decimal(v2.toFixed(11));
    return o.length > (v2 < 0 ? 12 : 11) || o === "0" || o === "-0" ? v2.toPrecision(6) : o;
  }
  function SSF_general_num(v2) {
    var V = Math.floor(Math.log(Math.abs(v2)) * Math.LOG10E), o;
    if (V >= -4 && V <= -1)
      o = v2.toPrecision(10 + V);
    else if (Math.abs(V) <= 9)
      o = SSF_small_exp(v2);
    else if (V === 10)
      o = v2.toFixed(10).substr(0, 12);
    else
      o = SSF_large_exp(v2);
    return SSF_strip_decimal(SSF_normalize_exp(o.toUpperCase()));
  }
  function SSF_general(v2, opts) {
    switch (typeof v2) {
      case "string":
        return v2;
      case "boolean":
        return v2 ? "TRUE" : "FALSE";
      case "number":
        return (v2 | 0) === v2 ? v2.toString(10) : SSF_general_num(v2);
      case "undefined":
        return "";
      case "object":
        if (v2 == null)
          return "";
        if (v2 instanceof Date)
          return SSF_format(14, datenum_local(v2, opts && opts.date1904), opts);
    }
    throw new Error("unsupported value in General format: " + v2);
  }
  function SSF_fix_hijri(date, o) {
    o[0] -= 581;
    var dow = date.getDay();
    if (date < 60)
      dow = (dow + 6) % 7;
    return dow;
  }
  function SSF_write_date(type2, fmt, val, ss0) {
    var o = "", ss = 0, tt = 0, y2 = val.y, out, outl = 0;
    switch (type2) {
      case 98:
        y2 = val.y + 543;
      case 121:
        switch (fmt.length) {
          case 1:
          case 2:
            out = y2 % 100;
            outl = 2;
            break;
          default:
            out = y2 % 1e4;
            outl = 4;
            break;
        }
        break;
      case 109:
        switch (fmt.length) {
          case 1:
          case 2:
            out = val.m;
            outl = fmt.length;
            break;
          case 3:
            return months[val.m - 1][1];
          case 5:
            return months[val.m - 1][0];
          default:
            return months[val.m - 1][2];
        }
        break;
      case 100:
        switch (fmt.length) {
          case 1:
          case 2:
            out = val.d;
            outl = fmt.length;
            break;
          case 3:
            return days[val.q][0];
          default:
            return days[val.q][1];
        }
        break;
      case 104:
        switch (fmt.length) {
          case 1:
          case 2:
            out = 1 + (val.H + 11) % 12;
            outl = fmt.length;
            break;
          default:
            throw "bad hour format: " + fmt;
        }
        break;
      case 72:
        switch (fmt.length) {
          case 1:
          case 2:
            out = val.H;
            outl = fmt.length;
            break;
          default:
            throw "bad hour format: " + fmt;
        }
        break;
      case 77:
        switch (fmt.length) {
          case 1:
          case 2:
            out = val.M;
            outl = fmt.length;
            break;
          default:
            throw "bad minute format: " + fmt;
        }
        break;
      case 115:
        if (fmt != "s" && fmt != "ss" && fmt != ".0" && fmt != ".00" && fmt != ".000")
          throw "bad second format: " + fmt;
        if (val.u === 0 && (fmt == "s" || fmt == "ss"))
          return pad0(val.S, fmt.length);
        if (ss0 >= 2)
          tt = ss0 === 3 ? 1e3 : 100;
        else
          tt = ss0 === 1 ? 10 : 1;
        ss = Math.round(tt * (val.S + val.u));
        if (ss >= 60 * tt)
          ss = 0;
        if (fmt === "s")
          return ss === 0 ? "0" : "" + ss / tt;
        o = pad0(ss, 2 + ss0);
        if (fmt === "ss")
          return o.substr(0, 2);
        return "." + o.substr(2, fmt.length - 1);
      case 90:
        switch (fmt) {
          case "[h]":
          case "[hh]":
            out = val.D * 24 + val.H;
            break;
          case "[m]":
          case "[mm]":
            out = (val.D * 24 + val.H) * 60 + val.M;
            break;
          case "[s]":
          case "[ss]":
            out = ((val.D * 24 + val.H) * 60 + val.M) * 60 + Math.round(val.S + val.u);
            break;
          default:
            throw "bad abstime format: " + fmt;
        }
        outl = fmt.length === 3 ? 1 : 2;
        break;
      case 101:
        out = y2;
        outl = 1;
        break;
    }
    var outstr = outl > 0 ? pad0(out, outl) : "";
    return outstr;
  }
  function commaify(s) {
    var w2 = 3;
    if (s.length <= w2)
      return s;
    var j = s.length % w2, o = s.substr(0, j);
    for (; j != s.length; j += w2)
      o += (o.length > 0 ? "," : "") + s.substr(j, w2);
    return o;
  }
  var pct1 = /%/g;
  function write_num_pct(type2, fmt, val) {
    var sfmt = fmt.replace(pct1, ""), mul = fmt.length - sfmt.length;
    return write_num(type2, sfmt, val * Math.pow(10, 2 * mul)) + fill("%", mul);
  }
  function write_num_cm(type2, fmt, val) {
    var idx = fmt.length - 1;
    while (fmt.charCodeAt(idx - 1) === 44)
      --idx;
    return write_num(type2, fmt.substr(0, idx), val / Math.pow(10, 3 * (fmt.length - idx)));
  }
  function write_num_exp(fmt, val) {
    var o;
    var idx = fmt.indexOf("E") - fmt.indexOf(".") - 1;
    if (fmt.match(/^#+0.0E\+0$/)) {
      if (val == 0)
        return "0.0E+0";
      else if (val < 0)
        return "-" + write_num_exp(fmt, -val);
      var period = fmt.indexOf(".");
      if (period === -1)
        period = fmt.indexOf("E");
      var ee = Math.floor(Math.log(val) * Math.LOG10E) % period;
      if (ee < 0)
        ee += period;
      o = (val / Math.pow(10, ee)).toPrecision(idx + 1 + (period + ee) % period);
      if (o.indexOf("e") === -1) {
        var fakee = Math.floor(Math.log(val) * Math.LOG10E);
        if (o.indexOf(".") === -1)
          o = o.charAt(0) + "." + o.substr(1) + "E+" + (fakee - o.length + ee);
        else
          o += "E+" + (fakee - ee);
        while (o.substr(0, 2) === "0.") {
          o = o.charAt(0) + o.substr(2, period) + "." + o.substr(2 + period);
          o = o.replace(/^0+([1-9])/, "$1").replace(/^0+\./, "0.");
        }
        o = o.replace(/\+-/, "-");
      }
      o = o.replace(/^([+-]?)(\d*)\.(\d*)[Ee]/, function($$, $1, $2, $3) {
        return $1 + $2 + $3.substr(0, (period + ee) % period) + "." + $3.substr(ee) + "E";
      });
    } else
      o = val.toExponential(idx);
    if (fmt.match(/E\+00$/) && o.match(/e[+-]\d$/))
      o = o.substr(0, o.length - 1) + "0" + o.charAt(o.length - 1);
    if (fmt.match(/E\-/) && o.match(/e\+/))
      o = o.replace(/e\+/, "e");
    return o.replace("e", "E");
  }
  var frac1 = /# (\?+)( ?)\/( ?)(\d+)/;
  function write_num_f1(r2, aval, sign) {
    var den = parseInt(r2[4], 10), rr = Math.round(aval * den), base = Math.floor(rr / den);
    var myn = rr - base * den, myd = den;
    return sign + (base === 0 ? "" : "" + base) + " " + (myn === 0 ? fill(" ", r2[1].length + 1 + r2[4].length) : pad_(myn, r2[1].length) + r2[2] + "/" + r2[3] + pad0(myd, r2[4].length));
  }
  function write_num_f2(r2, aval, sign) {
    return sign + (aval === 0 ? "" : "" + aval) + fill(" ", r2[1].length + 2 + r2[4].length);
  }
  var dec1 = /^#*0*\.([0#]+)/;
  var closeparen = /\).*[0#]/;
  var phone = /\(###\) ###\\?-####/;
  function hashq(str) {
    var o = "", cc;
    for (var i = 0; i != str.length; ++i)
      switch (cc = str.charCodeAt(i)) {
        case 35:
          break;
        case 63:
          o += " ";
          break;
        case 48:
          o += "0";
          break;
        default:
          o += String.fromCharCode(cc);
      }
    return o;
  }
  function rnd(val, d2) {
    var dd = Math.pow(10, d2);
    return "" + Math.round(val * dd) / dd;
  }
  function dec(val, d2) {
    var _frac = val - Math.floor(val), dd = Math.pow(10, d2);
    if (d2 < ("" + Math.round(_frac * dd)).length)
      return 0;
    return Math.round(_frac * dd);
  }
  function carry(val, d2) {
    if (d2 < ("" + Math.round((val - Math.floor(val)) * Math.pow(10, d2))).length) {
      return 1;
    }
    return 0;
  }
  function flr(val) {
    if (val < 2147483647 && val > -2147483648)
      return "" + (val >= 0 ? val | 0 : val - 1 | 0);
    return "" + Math.floor(val);
  }
  function write_num_flt(type2, fmt, val) {
    if (type2.charCodeAt(0) === 40 && !fmt.match(closeparen)) {
      var ffmt = fmt.replace(/\( */, "").replace(/ \)/, "").replace(/\)/, "");
      if (val >= 0)
        return write_num_flt("n", ffmt, val);
      return "(" + write_num_flt("n", ffmt, -val) + ")";
    }
    if (fmt.charCodeAt(fmt.length - 1) === 44)
      return write_num_cm(type2, fmt, val);
    if (fmt.indexOf("%") !== -1)
      return write_num_pct(type2, fmt, val);
    if (fmt.indexOf("E") !== -1)
      return write_num_exp(fmt, val);
    if (fmt.charCodeAt(0) === 36)
      return "$" + write_num_flt(type2, fmt.substr(fmt.charAt(1) == " " ? 2 : 1), val);
    var o;
    var r2, ri, ff, aval = Math.abs(val), sign = val < 0 ? "-" : "";
    if (fmt.match(/^00+$/))
      return sign + pad0r(aval, fmt.length);
    if (fmt.match(/^[#?]+$/)) {
      o = pad0r(val, 0);
      if (o === "0")
        o = "";
      return o.length > fmt.length ? o : hashq(fmt.substr(0, fmt.length - o.length)) + o;
    }
    if (r2 = fmt.match(frac1))
      return write_num_f1(r2, aval, sign);
    if (fmt.match(/^#+0+$/))
      return sign + pad0r(aval, fmt.length - fmt.indexOf("0"));
    if (r2 = fmt.match(dec1)) {
      o = rnd(val, r2[1].length).replace(/^([^\.]+)$/, "$1." + hashq(r2[1])).replace(/\.$/, "." + hashq(r2[1])).replace(/\.(\d*)$/, function($$, $1) {
        return "." + $1 + fill("0", hashq(
          /*::(*/
          r2[1]
        ).length - $1.length);
      });
      return fmt.indexOf("0.") !== -1 ? o : o.replace(/^0\./, ".");
    }
    fmt = fmt.replace(/^#+([0.])/, "$1");
    if (r2 = fmt.match(/^(0*)\.(#*)$/)) {
      return sign + rnd(aval, r2[2].length).replace(/\.(\d*[1-9])0*$/, ".$1").replace(/^(-?\d*)$/, "$1.").replace(/^0\./, r2[1].length ? "0." : ".");
    }
    if (r2 = fmt.match(/^#{1,3},##0(\.?)$/))
      return sign + commaify(pad0r(aval, 0));
    if (r2 = fmt.match(/^#,##0\.([#0]*0)$/)) {
      return val < 0 ? "-" + write_num_flt(type2, fmt, -val) : commaify("" + (Math.floor(val) + carry(val, r2[1].length))) + "." + pad0(dec(val, r2[1].length), r2[1].length);
    }
    if (r2 = fmt.match(/^#,#*,#0/))
      return write_num_flt(type2, fmt.replace(/^#,#*,/, ""), val);
    if (r2 = fmt.match(/^([0#]+)(\\?-([0#]+))+$/)) {
      o = _strrev(write_num_flt(type2, fmt.replace(/[\\-]/g, ""), val));
      ri = 0;
      return _strrev(_strrev(fmt.replace(/\\/g, "")).replace(/[0#]/g, function(x3) {
        return ri < o.length ? o.charAt(ri++) : x3 === "0" ? "0" : "";
      }));
    }
    if (fmt.match(phone)) {
      o = write_num_flt(type2, "##########", val);
      return "(" + o.substr(0, 3) + ") " + o.substr(3, 3) + "-" + o.substr(6);
    }
    var oa = "";
    if (r2 = fmt.match(/^([#0?]+)( ?)\/( ?)([#0?]+)/)) {
      ri = Math.min(
        /*::String(*/
        r2[4].length,
        7
      );
      ff = SSF_frac(aval, Math.pow(10, ri) - 1, false);
      o = "" + sign;
      oa = write_num(
        "n",
        /*::String(*/
        r2[1],
        ff[1]
      );
      if (oa.charAt(oa.length - 1) == " ")
        oa = oa.substr(0, oa.length - 1) + "0";
      o += oa + /*::String(*/
      r2[2] + "/" + /*::String(*/
      r2[3];
      oa = rpad_(ff[2], ri);
      if (oa.length < r2[4].length)
        oa = hashq(r2[4].substr(r2[4].length - oa.length)) + oa;
      o += oa;
      return o;
    }
    if (r2 = fmt.match(/^# ([#0?]+)( ?)\/( ?)([#0?]+)/)) {
      ri = Math.min(Math.max(r2[1].length, r2[4].length), 7);
      ff = SSF_frac(aval, Math.pow(10, ri) - 1, true);
      return sign + (ff[0] || (ff[1] ? "" : "0")) + " " + (ff[1] ? pad_(ff[1], ri) + r2[2] + "/" + r2[3] + rpad_(ff[2], ri) : fill(" ", 2 * ri + 1 + r2[2].length + r2[3].length));
    }
    if (r2 = fmt.match(/^[#0?]+$/)) {
      o = pad0r(val, 0);
      if (fmt.length <= o.length)
        return o;
      return hashq(fmt.substr(0, fmt.length - o.length)) + o;
    }
    if (r2 = fmt.match(/^([#0?]+)\.([#0]+)$/)) {
      o = "" + val.toFixed(Math.min(r2[2].length, 10)).replace(/([^0])0+$/, "$1");
      ri = o.indexOf(".");
      var lres = fmt.indexOf(".") - ri, rres = fmt.length - o.length - lres;
      return hashq(fmt.substr(0, lres) + o + fmt.substr(fmt.length - rres));
    }
    if (r2 = fmt.match(/^00,000\.([#0]*0)$/)) {
      ri = dec(val, r2[1].length);
      return val < 0 ? "-" + write_num_flt(type2, fmt, -val) : commaify(flr(val)).replace(/^\d,\d{3}$/, "0$&").replace(/^\d*$/, function($$) {
        return "00," + ($$.length < 3 ? pad0(0, 3 - $$.length) : "") + $$;
      }) + "." + pad0(ri, r2[1].length);
    }
    switch (fmt) {
      case "###,##0.00":
        return write_num_flt(type2, "#,##0.00", val);
      case "###,###":
      case "##,###":
      case "#,###":
        var x2 = commaify(pad0r(aval, 0));
        return x2 !== "0" ? sign + x2 : "";
      case "###,###.00":
        return write_num_flt(type2, "###,##0.00", val).replace(/^0\./, ".");
      case "#,###.00":
        return write_num_flt(type2, "#,##0.00", val).replace(/^0\./, ".");
    }
    throw new Error("unsupported format |" + fmt + "|");
  }
  function write_num_cm2(type2, fmt, val) {
    var idx = fmt.length - 1;
    while (fmt.charCodeAt(idx - 1) === 44)
      --idx;
    return write_num(type2, fmt.substr(0, idx), val / Math.pow(10, 3 * (fmt.length - idx)));
  }
  function write_num_pct2(type2, fmt, val) {
    var sfmt = fmt.replace(pct1, ""), mul = fmt.length - sfmt.length;
    return write_num(type2, sfmt, val * Math.pow(10, 2 * mul)) + fill("%", mul);
  }
  function write_num_exp2(fmt, val) {
    var o;
    var idx = fmt.indexOf("E") - fmt.indexOf(".") - 1;
    if (fmt.match(/^#+0.0E\+0$/)) {
      if (val == 0)
        return "0.0E+0";
      else if (val < 0)
        return "-" + write_num_exp2(fmt, -val);
      var period = fmt.indexOf(".");
      if (period === -1)
        period = fmt.indexOf("E");
      var ee = Math.floor(Math.log(val) * Math.LOG10E) % period;
      if (ee < 0)
        ee += period;
      o = (val / Math.pow(10, ee)).toPrecision(idx + 1 + (period + ee) % period);
      if (!o.match(/[Ee]/)) {
        var fakee = Math.floor(Math.log(val) * Math.LOG10E);
        if (o.indexOf(".") === -1)
          o = o.charAt(0) + "." + o.substr(1) + "E+" + (fakee - o.length + ee);
        else
          o += "E+" + (fakee - ee);
        o = o.replace(/\+-/, "-");
      }
      o = o.replace(/^([+-]?)(\d*)\.(\d*)[Ee]/, function($$, $1, $2, $3) {
        return $1 + $2 + $3.substr(0, (period + ee) % period) + "." + $3.substr(ee) + "E";
      });
    } else
      o = val.toExponential(idx);
    if (fmt.match(/E\+00$/) && o.match(/e[+-]\d$/))
      o = o.substr(0, o.length - 1) + "0" + o.charAt(o.length - 1);
    if (fmt.match(/E\-/) && o.match(/e\+/))
      o = o.replace(/e\+/, "e");
    return o.replace("e", "E");
  }
  function write_num_int(type2, fmt, val) {
    if (type2.charCodeAt(0) === 40 && !fmt.match(closeparen)) {
      var ffmt = fmt.replace(/\( */, "").replace(/ \)/, "").replace(/\)/, "");
      if (val >= 0)
        return write_num_int("n", ffmt, val);
      return "(" + write_num_int("n", ffmt, -val) + ")";
    }
    if (fmt.charCodeAt(fmt.length - 1) === 44)
      return write_num_cm2(type2, fmt, val);
    if (fmt.indexOf("%") !== -1)
      return write_num_pct2(type2, fmt, val);
    if (fmt.indexOf("E") !== -1)
      return write_num_exp2(fmt, val);
    if (fmt.charCodeAt(0) === 36)
      return "$" + write_num_int(type2, fmt.substr(fmt.charAt(1) == " " ? 2 : 1), val);
    var o;
    var r2, ri, ff, aval = Math.abs(val), sign = val < 0 ? "-" : "";
    if (fmt.match(/^00+$/))
      return sign + pad0(aval, fmt.length);
    if (fmt.match(/^[#?]+$/)) {
      o = "" + val;
      if (val === 0)
        o = "";
      return o.length > fmt.length ? o : hashq(fmt.substr(0, fmt.length - o.length)) + o;
    }
    if (r2 = fmt.match(frac1))
      return write_num_f2(r2, aval, sign);
    if (fmt.match(/^#+0+$/))
      return sign + pad0(aval, fmt.length - fmt.indexOf("0"));
    if (r2 = fmt.match(dec1)) {
      o = ("" + val).replace(/^([^\.]+)$/, "$1." + hashq(r2[1])).replace(/\.$/, "." + hashq(r2[1]));
      o = o.replace(/\.(\d*)$/, function($$, $1) {
        return "." + $1 + fill("0", hashq(r2[1]).length - $1.length);
      });
      return fmt.indexOf("0.") !== -1 ? o : o.replace(/^0\./, ".");
    }
    fmt = fmt.replace(/^#+([0.])/, "$1");
    if (r2 = fmt.match(/^(0*)\.(#*)$/)) {
      return sign + ("" + aval).replace(/\.(\d*[1-9])0*$/, ".$1").replace(/^(-?\d*)$/, "$1.").replace(/^0\./, r2[1].length ? "0." : ".");
    }
    if (r2 = fmt.match(/^#{1,3},##0(\.?)$/))
      return sign + commaify("" + aval);
    if (r2 = fmt.match(/^#,##0\.([#0]*0)$/)) {
      return val < 0 ? "-" + write_num_int(type2, fmt, -val) : commaify("" + val) + "." + fill("0", r2[1].length);
    }
    if (r2 = fmt.match(/^#,#*,#0/))
      return write_num_int(type2, fmt.replace(/^#,#*,/, ""), val);
    if (r2 = fmt.match(/^([0#]+)(\\?-([0#]+))+$/)) {
      o = _strrev(write_num_int(type2, fmt.replace(/[\\-]/g, ""), val));
      ri = 0;
      return _strrev(_strrev(fmt.replace(/\\/g, "")).replace(/[0#]/g, function(x3) {
        return ri < o.length ? o.charAt(ri++) : x3 === "0" ? "0" : "";
      }));
    }
    if (fmt.match(phone)) {
      o = write_num_int(type2, "##########", val);
      return "(" + o.substr(0, 3) + ") " + o.substr(3, 3) + "-" + o.substr(6);
    }
    var oa = "";
    if (r2 = fmt.match(/^([#0?]+)( ?)\/( ?)([#0?]+)/)) {
      ri = Math.min(
        /*::String(*/
        r2[4].length,
        7
      );
      ff = SSF_frac(aval, Math.pow(10, ri) - 1, false);
      o = "" + sign;
      oa = write_num(
        "n",
        /*::String(*/
        r2[1],
        ff[1]
      );
      if (oa.charAt(oa.length - 1) == " ")
        oa = oa.substr(0, oa.length - 1) + "0";
      o += oa + /*::String(*/
      r2[2] + "/" + /*::String(*/
      r2[3];
      oa = rpad_(ff[2], ri);
      if (oa.length < r2[4].length)
        oa = hashq(r2[4].substr(r2[4].length - oa.length)) + oa;
      o += oa;
      return o;
    }
    if (r2 = fmt.match(/^# ([#0?]+)( ?)\/( ?)([#0?]+)/)) {
      ri = Math.min(Math.max(r2[1].length, r2[4].length), 7);
      ff = SSF_frac(aval, Math.pow(10, ri) - 1, true);
      return sign + (ff[0] || (ff[1] ? "" : "0")) + " " + (ff[1] ? pad_(ff[1], ri) + r2[2] + "/" + r2[3] + rpad_(ff[2], ri) : fill(" ", 2 * ri + 1 + r2[2].length + r2[3].length));
    }
    if (r2 = fmt.match(/^[#0?]+$/)) {
      o = "" + val;
      if (fmt.length <= o.length)
        return o;
      return hashq(fmt.substr(0, fmt.length - o.length)) + o;
    }
    if (r2 = fmt.match(/^([#0]+)\.([#0]+)$/)) {
      o = "" + val.toFixed(Math.min(r2[2].length, 10)).replace(/([^0])0+$/, "$1");
      ri = o.indexOf(".");
      var lres = fmt.indexOf(".") - ri, rres = fmt.length - o.length - lres;
      return hashq(fmt.substr(0, lres) + o + fmt.substr(fmt.length - rres));
    }
    if (r2 = fmt.match(/^00,000\.([#0]*0)$/)) {
      return val < 0 ? "-" + write_num_int(type2, fmt, -val) : commaify("" + val).replace(/^\d,\d{3}$/, "0$&").replace(/^\d*$/, function($$) {
        return "00," + ($$.length < 3 ? pad0(0, 3 - $$.length) : "") + $$;
      }) + "." + pad0(0, r2[1].length);
    }
    switch (fmt) {
      case "###,###":
      case "##,###":
      case "#,###":
        var x2 = commaify("" + aval);
        return x2 !== "0" ? sign + x2 : "";
      default:
        if (fmt.match(/\.[0#?]*$/))
          return write_num_int(type2, fmt.slice(0, fmt.lastIndexOf(".")), val) + hashq(fmt.slice(fmt.lastIndexOf(".")));
    }
    throw new Error("unsupported format |" + fmt + "|");
  }
  function write_num(type2, fmt, val) {
    return (val | 0) === val ? write_num_int(type2, fmt, val) : write_num_flt(type2, fmt, val);
  }
  function SSF_split_fmt(fmt) {
    var out = [];
    var in_str = false;
    for (var i = 0, j = 0; i < fmt.length; ++i)
      switch (
        /*cc=*/
        fmt.charCodeAt(i)
      ) {
        case 34:
          in_str = !in_str;
          break;
        case 95:
        case 42:
        case 92:
          ++i;
          break;
        case 59:
          out[out.length] = fmt.substr(j, i - j);
          j = i + 1;
      }
    out[out.length] = fmt.substr(j);
    if (in_str === true)
      throw new Error("Format |" + fmt + "| unterminated string ");
    return out;
  }
  var SSF_abstime = /\[[HhMmSs\u0E0A\u0E19\u0E17]*\]/;
  function fmt_is_date(fmt) {
    var i = 0, c2 = "", o = "";
    while (i < fmt.length) {
      switch (c2 = fmt.charAt(i)) {
        case "G":
          if (SSF_isgeneral(fmt, i))
            i += 6;
          i++;
          break;
        case '"':
          for (
            ;
            /*cc=*/
            fmt.charCodeAt(++i) !== 34 && i < fmt.length;
          ) {
          }
          ++i;
          break;
        case "\\":
          i += 2;
          break;
        case "_":
          i += 2;
          break;
        case "@":
          ++i;
          break;
        case "B":
        case "b":
          if (fmt.charAt(i + 1) === "1" || fmt.charAt(i + 1) === "2")
            return true;
        case "M":
        case "D":
        case "Y":
        case "H":
        case "S":
        case "E":
        case "m":
        case "d":
        case "y":
        case "h":
        case "s":
        case "e":
        case "g":
          return true;
        case "A":
        case "a":
        case "上":
          if (fmt.substr(i, 3).toUpperCase() === "A/P")
            return true;
          if (fmt.substr(i, 5).toUpperCase() === "AM/PM")
            return true;
          if (fmt.substr(i, 5).toUpperCase() === "上午/下午")
            return true;
          ++i;
          break;
        case "[":
          o = c2;
          while (fmt.charAt(i++) !== "]" && i < fmt.length)
            o += fmt.charAt(i);
          if (o.match(SSF_abstime))
            return true;
          break;
        case ".":
        case "0":
        case "#":
          while (i < fmt.length && ("0#?.,E+-%".indexOf(c2 = fmt.charAt(++i)) > -1 || c2 == "\\" && fmt.charAt(i + 1) == "-" && "0#".indexOf(fmt.charAt(i + 2)) > -1)) {
          }
          break;
        case "?":
          while (fmt.charAt(++i) === c2) {
          }
          break;
        case "*":
          ++i;
          if (fmt.charAt(i) == " " || fmt.charAt(i) == "*")
            ++i;
          break;
        case "(":
        case ")":
          ++i;
          break;
        case "1":
        case "2":
        case "3":
        case "4":
        case "5":
        case "6":
        case "7":
        case "8":
        case "9":
          while (i < fmt.length && "0123456789".indexOf(fmt.charAt(++i)) > -1) {
          }
          break;
        case " ":
          ++i;
          break;
        default:
          ++i;
          break;
      }
    }
    return false;
  }
  function eval_fmt(fmt, v2, opts, flen) {
    var out = [], o = "", i = 0, c2 = "", lst = "t", dt, j, cc;
    var hr = "H";
    while (i < fmt.length) {
      switch (c2 = fmt.charAt(i)) {
        case "G":
          if (!SSF_isgeneral(fmt, i))
            throw new Error("unrecognized character " + c2 + " in " + fmt);
          out[out.length] = { t: "G", v: "General" };
          i += 7;
          break;
        case '"':
          for (o = ""; (cc = fmt.charCodeAt(++i)) !== 34 && i < fmt.length; )
            o += String.fromCharCode(cc);
          out[out.length] = { t: "t", v: o };
          ++i;
          break;
        case "\\":
          var w2 = fmt.charAt(++i), t2 = w2 === "(" || w2 === ")" ? w2 : "t";
          out[out.length] = { t: t2, v: w2 };
          ++i;
          break;
        case "_":
          out[out.length] = { t: "t", v: " " };
          i += 2;
          break;
        case "@":
          out[out.length] = { t: "T", v: v2 };
          ++i;
          break;
        case "B":
        case "b":
          if (fmt.charAt(i + 1) === "1" || fmt.charAt(i + 1) === "2") {
            if (dt == null) {
              dt = SSF_parse_date_code(v2, opts, fmt.charAt(i + 1) === "2");
              if (dt == null)
                return "";
            }
            out[out.length] = { t: "X", v: fmt.substr(i, 2) };
            lst = c2;
            i += 2;
            break;
          }
        case "M":
        case "D":
        case "Y":
        case "H":
        case "S":
        case "E":
          c2 = c2.toLowerCase();
        case "m":
        case "d":
        case "y":
        case "h":
        case "s":
        case "e":
        case "g":
          if (v2 < 0)
            return "";
          if (dt == null) {
            dt = SSF_parse_date_code(v2, opts);
            if (dt == null)
              return "";
          }
          o = c2;
          while (++i < fmt.length && fmt.charAt(i).toLowerCase() === c2)
            o += c2;
          if (c2 === "m" && lst.toLowerCase() === "h")
            c2 = "M";
          if (c2 === "h")
            c2 = hr;
          out[out.length] = { t: c2, v: o };
          lst = c2;
          break;
        case "A":
        case "a":
        case "上":
          var q2 = { t: c2, v: c2 };
          if (dt == null)
            dt = SSF_parse_date_code(v2, opts);
          if (fmt.substr(i, 3).toUpperCase() === "A/P") {
            if (dt != null)
              q2.v = dt.H >= 12 ? "P" : "A";
            q2.t = "T";
            hr = "h";
            i += 3;
          } else if (fmt.substr(i, 5).toUpperCase() === "AM/PM") {
            if (dt != null)
              q2.v = dt.H >= 12 ? "PM" : "AM";
            q2.t = "T";
            i += 5;
            hr = "h";
          } else if (fmt.substr(i, 5).toUpperCase() === "上午/下午") {
            if (dt != null)
              q2.v = dt.H >= 12 ? "下午" : "上午";
            q2.t = "T";
            i += 5;
            hr = "h";
          } else {
            q2.t = "t";
            ++i;
          }
          if (dt == null && q2.t === "T")
            return "";
          out[out.length] = q2;
          lst = c2;
          break;
        case "[":
          o = c2;
          while (fmt.charAt(i++) !== "]" && i < fmt.length)
            o += fmt.charAt(i);
          if (o.slice(-1) !== "]")
            throw 'unterminated "[" block: |' + o + "|";
          if (o.match(SSF_abstime)) {
            if (dt == null) {
              dt = SSF_parse_date_code(v2, opts);
              if (dt == null)
                return "";
            }
            out[out.length] = { t: "Z", v: o.toLowerCase() };
            lst = o.charAt(1);
          } else if (o.indexOf("$") > -1) {
            o = (o.match(/\$([^-\[\]]*)/) || [])[1] || "$";
            if (!fmt_is_date(fmt))
              out[out.length] = { t: "t", v: o };
          }
          break;
        case ".":
          if (dt != null) {
            o = c2;
            while (++i < fmt.length && (c2 = fmt.charAt(i)) === "0")
              o += c2;
            out[out.length] = { t: "s", v: o };
            break;
          }
        case "0":
        case "#":
          o = c2;
          while (++i < fmt.length && "0#?.,E+-%".indexOf(c2 = fmt.charAt(i)) > -1)
            o += c2;
          out[out.length] = { t: "n", v: o };
          break;
        case "?":
          o = c2;
          while (fmt.charAt(++i) === c2)
            o += c2;
          out[out.length] = { t: c2, v: o };
          lst = c2;
          break;
        case "*":
          ++i;
          if (fmt.charAt(i) == " " || fmt.charAt(i) == "*")
            ++i;
          break;
        case "(":
        case ")":
          out[out.length] = { t: flen === 1 ? "t" : c2, v: c2 };
          ++i;
          break;
        case "1":
        case "2":
        case "3":
        case "4":
        case "5":
        case "6":
        case "7":
        case "8":
        case "9":
          o = c2;
          while (i < fmt.length && "0123456789".indexOf(fmt.charAt(++i)) > -1)
            o += fmt.charAt(i);
          out[out.length] = { t: "D", v: o };
          break;
        case " ":
          out[out.length] = { t: c2, v: c2 };
          ++i;
          break;
        case "$":
          out[out.length] = { t: "t", v: "$" };
          ++i;
          break;
        default:
          if (",$-+/():!^&'~{}<>=€acfijklopqrtuvwxzP".indexOf(c2) === -1)
            throw new Error("unrecognized character " + c2 + " in " + fmt);
          out[out.length] = { t: "t", v: c2 };
          ++i;
          break;
      }
    }
    var bt = 0, ss0 = 0, ssm;
    for (i = out.length - 1, lst = "t"; i >= 0; --i) {
      switch (out[i].t) {
        case "h":
        case "H":
          out[i].t = hr;
          lst = "h";
          if (bt < 1)
            bt = 1;
          break;
        case "s":
          if (ssm = out[i].v.match(/\.0+$/))
            ss0 = Math.max(ss0, ssm[0].length - 1);
          if (bt < 3)
            bt = 3;
        case "d":
        case "y":
        case "M":
        case "e":
          lst = out[i].t;
          break;
        case "m":
          if (lst === "s") {
            out[i].t = "M";
            if (bt < 2)
              bt = 2;
          }
          break;
        case "X":
          break;
        case "Z":
          if (bt < 1 && out[i].v.match(/[Hh]/))
            bt = 1;
          if (bt < 2 && out[i].v.match(/[Mm]/))
            bt = 2;
          if (bt < 3 && out[i].v.match(/[Ss]/))
            bt = 3;
      }
    }
    switch (bt) {
      case 0:
        break;
      case 1:
        if (dt.u >= 0.5) {
          dt.u = 0;
          ++dt.S;
        }
        if (dt.S >= 60) {
          dt.S = 0;
          ++dt.M;
        }
        if (dt.M >= 60) {
          dt.M = 0;
          ++dt.H;
        }
        break;
      case 2:
        if (dt.u >= 0.5) {
          dt.u = 0;
          ++dt.S;
        }
        if (dt.S >= 60) {
          dt.S = 0;
          ++dt.M;
        }
        break;
    }
    var nstr = "", jj;
    for (i = 0; i < out.length; ++i) {
      switch (out[i].t) {
        case "t":
        case "T":
        case " ":
        case "D":
          break;
        case "X":
          out[i].v = "";
          out[i].t = ";";
          break;
        case "d":
        case "m":
        case "y":
        case "h":
        case "H":
        case "M":
        case "s":
        case "e":
        case "b":
        case "Z":
          out[i].v = SSF_write_date(out[i].t.charCodeAt(0), out[i].v, dt, ss0);
          out[i].t = "t";
          break;
        case "n":
        case "?":
          jj = i + 1;
          while (out[jj] != null && ((c2 = out[jj].t) === "?" || c2 === "D" || (c2 === " " || c2 === "t") && out[jj + 1] != null && (out[jj + 1].t === "?" || out[jj + 1].t === "t" && out[jj + 1].v === "/") || out[i].t === "(" && (c2 === " " || c2 === "n" || c2 === ")") || c2 === "t" && (out[jj].v === "/" || out[jj].v === " " && out[jj + 1] != null && out[jj + 1].t == "?"))) {
            out[i].v += out[jj].v;
            out[jj] = { v: "", t: ";" };
            ++jj;
          }
          nstr += out[i].v;
          i = jj - 1;
          break;
        case "G":
          out[i].t = "t";
          out[i].v = SSF_general(v2, opts);
          break;
      }
    }
    var vv = "", myv, ostr;
    if (nstr.length > 0) {
      if (nstr.charCodeAt(0) == 40) {
        myv = v2 < 0 && nstr.charCodeAt(0) === 45 ? -v2 : v2;
        ostr = write_num("n", nstr, myv);
      } else {
        myv = v2 < 0 && flen > 1 ? -v2 : v2;
        ostr = write_num("n", nstr, myv);
        if (myv < 0 && out[0] && out[0].t == "t") {
          ostr = ostr.substr(1);
          out[0].v = "-" + out[0].v;
        }
      }
      jj = ostr.length - 1;
      var decpt = out.length;
      for (i = 0; i < out.length; ++i)
        if (out[i] != null && out[i].t != "t" && out[i].v.indexOf(".") > -1) {
          decpt = i;
          break;
        }
      var lasti = out.length;
      if (decpt === out.length && ostr.indexOf("E") === -1) {
        for (i = out.length - 1; i >= 0; --i) {
          if (out[i] == null || "n?".indexOf(out[i].t) === -1)
            continue;
          if (jj >= out[i].v.length - 1) {
            jj -= out[i].v.length;
            out[i].v = ostr.substr(jj + 1, out[i].v.length);
          } else if (jj < 0)
            out[i].v = "";
          else {
            out[i].v = ostr.substr(0, jj + 1);
            jj = -1;
          }
          out[i].t = "t";
          lasti = i;
        }
        if (jj >= 0 && lasti < out.length)
          out[lasti].v = ostr.substr(0, jj + 1) + out[lasti].v;
      } else if (decpt !== out.length && ostr.indexOf("E") === -1) {
        jj = ostr.indexOf(".") - 1;
        for (i = decpt; i >= 0; --i) {
          if (out[i] == null || "n?".indexOf(out[i].t) === -1)
            continue;
          j = out[i].v.indexOf(".") > -1 && i === decpt ? out[i].v.indexOf(".") - 1 : out[i].v.length - 1;
          vv = out[i].v.substr(j + 1);
          for (; j >= 0; --j) {
            if (jj >= 0 && (out[i].v.charAt(j) === "0" || out[i].v.charAt(j) === "#"))
              vv = ostr.charAt(jj--) + vv;
          }
          out[i].v = vv;
          out[i].t = "t";
          lasti = i;
        }
        if (jj >= 0 && lasti < out.length)
          out[lasti].v = ostr.substr(0, jj + 1) + out[lasti].v;
        jj = ostr.indexOf(".") + 1;
        for (i = decpt; i < out.length; ++i) {
          if (out[i] == null || "n?(".indexOf(out[i].t) === -1 && i !== decpt)
            continue;
          j = out[i].v.indexOf(".") > -1 && i === decpt ? out[i].v.indexOf(".") + 1 : 0;
          vv = out[i].v.substr(0, j);
          for (; j < out[i].v.length; ++j) {
            if (jj < ostr.length)
              vv += ostr.charAt(jj++);
          }
          out[i].v = vv;
          out[i].t = "t";
          lasti = i;
        }
      }
    }
    for (i = 0; i < out.length; ++i)
      if (out[i] != null && "n?".indexOf(out[i].t) > -1) {
        myv = flen > 1 && v2 < 0 && i > 0 && out[i - 1].v === "-" ? -v2 : v2;
        out[i].v = write_num(out[i].t, out[i].v, myv);
        out[i].t = "t";
      }
    var retval = "";
    for (i = 0; i !== out.length; ++i)
      if (out[i] != null)
        retval += out[i].v;
    return retval;
  }
  var cfregex2 = /\[(=|>[=]?|<[>=]?)(-?\d+(?:\.\d*)?)\]/;
  function chkcond(v2, rr) {
    if (rr == null)
      return false;
    var thresh = parseFloat(rr[2]);
    switch (rr[1]) {
      case "=":
        if (v2 == thresh)
          return true;
        break;
      case ">":
        if (v2 > thresh)
          return true;
        break;
      case "<":
        if (v2 < thresh)
          return true;
        break;
      case "<>":
        if (v2 != thresh)
          return true;
        break;
      case ">=":
        if (v2 >= thresh)
          return true;
        break;
      case "<=":
        if (v2 <= thresh)
          return true;
        break;
    }
    return false;
  }
  function choose_fmt(f2, v2) {
    var fmt = SSF_split_fmt(f2);
    var l2 = fmt.length, lat = fmt[l2 - 1].indexOf("@");
    if (l2 < 4 && lat > -1)
      --l2;
    if (fmt.length > 4)
      throw new Error("cannot find right format for |" + fmt.join("|") + "|");
    if (typeof v2 !== "number")
      return [4, fmt.length === 4 || lat > -1 ? fmt[fmt.length - 1] : "@"];
    switch (fmt.length) {
      case 1:
        fmt = lat > -1 ? ["General", "General", "General", fmt[0]] : [fmt[0], fmt[0], fmt[0], "@"];
        break;
      case 2:
        fmt = lat > -1 ? [fmt[0], fmt[0], fmt[0], fmt[1]] : [fmt[0], fmt[1], fmt[0], "@"];
        break;
      case 3:
        fmt = lat > -1 ? [fmt[0], fmt[1], fmt[0], fmt[2]] : [fmt[0], fmt[1], fmt[2], "@"];
        break;
    }
    var ff = v2 > 0 ? fmt[0] : v2 < 0 ? fmt[1] : fmt[2];
    if (fmt[0].indexOf("[") === -1 && fmt[1].indexOf("[") === -1)
      return [l2, ff];
    if (fmt[0].match(/\[[=<>]/) != null || fmt[1].match(/\[[=<>]/) != null) {
      var m1 = fmt[0].match(cfregex2);
      var m2 = fmt[1].match(cfregex2);
      return chkcond(v2, m1) ? [l2, fmt[0]] : chkcond(v2, m2) ? [l2, fmt[1]] : [l2, fmt[m1 != null && m2 != null ? 2 : 1]];
    }
    return [l2, ff];
  }
  function SSF_format(fmt, v2, o) {
    if (o == null)
      o = {};
    var sfmt = "";
    switch (typeof fmt) {
      case "string":
        if (fmt == "m/d/yy" && o.dateNF)
          sfmt = o.dateNF;
        else
          sfmt = fmt;
        break;
      case "number":
        if (fmt == 14 && o.dateNF)
          sfmt = o.dateNF;
        else
          sfmt = (o.table != null ? o.table : table_fmt)[fmt];
        if (sfmt == null)
          sfmt = o.table && o.table[SSF_default_map[fmt]] || table_fmt[SSF_default_map[fmt]];
        if (sfmt == null)
          sfmt = SSF_default_str[fmt] || "General";
        break;
    }
    if (SSF_isgeneral(sfmt, 0))
      return SSF_general(v2, o);
    if (v2 instanceof Date)
      v2 = datenum_local(v2, o.date1904);
    var f2 = choose_fmt(sfmt, v2);
    if (SSF_isgeneral(f2[1]))
      return SSF_general(v2, o);
    if (v2 === true)
      v2 = "TRUE";
    else if (v2 === false)
      v2 = "FALSE";
    else if (v2 === "" || v2 == null)
      return "";
    return eval_fmt(f2[1], v2, o, f2[0]);
  }
  function SSF_load(fmt, idx) {
    if (typeof idx != "number") {
      idx = +idx || -1;
      for (var i = 0; i < 392; ++i) {
        if (table_fmt[i] == void 0) {
          if (idx < 0)
            idx = i;
          continue;
        }
        if (table_fmt[i] == fmt) {
          idx = i;
          break;
        }
      }
      if (idx < 0)
        idx = 391;
    }
    table_fmt[idx] = fmt;
    return idx;
  }
  function SSF_load_table(tbl) {
    for (var i = 0; i != 392; ++i)
      if (tbl[i] !== void 0)
        SSF_load(tbl[i], i);
  }
  function make_ssf() {
    table_fmt = SSF_init_table();
  }
  var dateNFregex = /[dD]+|[mM]+|[yYeE]+|[Hh]+|[Ss]+/g;
  function dateNF_regex(dateNF) {
    var fmt = typeof dateNF == "number" ? table_fmt[dateNF] : dateNF;
    fmt = fmt.replace(dateNFregex, "(\\d+)");
    return new RegExp("^" + fmt + "$");
  }
  function dateNF_fix(str, dateNF, match) {
    var Y = -1, m2 = -1, d2 = -1, H = -1, M = -1, S = -1;
    (dateNF.match(dateNFregex) || []).forEach(function(n2, i) {
      var v2 = parseInt(match[i + 1], 10);
      switch (n2.toLowerCase().charAt(0)) {
        case "y":
          Y = v2;
          break;
        case "d":
          d2 = v2;
          break;
        case "h":
          H = v2;
          break;
        case "s":
          S = v2;
          break;
        case "m":
          if (H >= 0)
            M = v2;
          else
            m2 = v2;
          break;
      }
    });
    if (S >= 0 && M == -1 && m2 >= 0) {
      M = m2;
      m2 = -1;
    }
    var datestr = ("" + (Y >= 0 ? Y : (/* @__PURE__ */ new Date()).getFullYear())).slice(-4) + "-" + ("00" + (m2 >= 1 ? m2 : 1)).slice(-2) + "-" + ("00" + (d2 >= 1 ? d2 : 1)).slice(-2);
    if (datestr.length == 7)
      datestr = "0" + datestr;
    if (datestr.length == 8)
      datestr = "20" + datestr;
    var timestr = ("00" + (H >= 0 ? H : 0)).slice(-2) + ":" + ("00" + (M >= 0 ? M : 0)).slice(-2) + ":" + ("00" + (S >= 0 ? S : 0)).slice(-2);
    if (H == -1 && M == -1 && S == -1)
      return datestr;
    if (Y == -1 && m2 == -1 && d2 == -1)
      return timestr;
    return datestr + "T" + timestr;
  }
  var CRC32 = /* @__PURE__ */ function() {
    var CRC322 = {};
    CRC322.version = "1.2.0";
    function signed_crc_table() {
      var c2 = 0, table = new Array(256);
      for (var n2 = 0; n2 != 256; ++n2) {
        c2 = n2;
        c2 = c2 & 1 ? -306674912 ^ c2 >>> 1 : c2 >>> 1;
        c2 = c2 & 1 ? -306674912 ^ c2 >>> 1 : c2 >>> 1;
        c2 = c2 & 1 ? -306674912 ^ c2 >>> 1 : c2 >>> 1;
        c2 = c2 & 1 ? -306674912 ^ c2 >>> 1 : c2 >>> 1;
        c2 = c2 & 1 ? -306674912 ^ c2 >>> 1 : c2 >>> 1;
        c2 = c2 & 1 ? -306674912 ^ c2 >>> 1 : c2 >>> 1;
        c2 = c2 & 1 ? -306674912 ^ c2 >>> 1 : c2 >>> 1;
        c2 = c2 & 1 ? -306674912 ^ c2 >>> 1 : c2 >>> 1;
        table[n2] = c2;
      }
      return typeof Int32Array !== "undefined" ? new Int32Array(table) : table;
    }
    var T0 = signed_crc_table();
    function slice_by_16_tables(T) {
      var c2 = 0, v2 = 0, n2 = 0, table = typeof Int32Array !== "undefined" ? new Int32Array(4096) : new Array(4096);
      for (n2 = 0; n2 != 256; ++n2)
        table[n2] = T[n2];
      for (n2 = 0; n2 != 256; ++n2) {
        v2 = T[n2];
        for (c2 = 256 + n2; c2 < 4096; c2 += 256)
          v2 = table[c2] = v2 >>> 8 ^ T[v2 & 255];
      }
      var out = [];
      for (n2 = 1; n2 != 16; ++n2)
        out[n2 - 1] = typeof Int32Array !== "undefined" ? table.subarray(n2 * 256, n2 * 256 + 256) : table.slice(n2 * 256, n2 * 256 + 256);
      return out;
    }
    var TT = slice_by_16_tables(T0);
    var T1 = TT[0], T2 = TT[1], T3 = TT[2], T4 = TT[3], T5 = TT[4];
    var T6 = TT[5], T7 = TT[6], T8 = TT[7], T9 = TT[8], Ta = TT[9];
    var Tb = TT[10], Tc = TT[11], Td = TT[12], Te = TT[13], Tf = TT[14];
    function crc32_bstr(bstr, seed) {
      var C = seed ^ -1;
      for (var i = 0, L = bstr.length; i < L; )
        C = C >>> 8 ^ T0[(C ^ bstr.charCodeAt(i++)) & 255];
      return ~C;
    }
    function crc32_buf(B, seed) {
      var C = seed ^ -1, L = B.length - 15, i = 0;
      for (; i < L; )
        C = Tf[B[i++] ^ C & 255] ^ Te[B[i++] ^ C >> 8 & 255] ^ Td[B[i++] ^ C >> 16 & 255] ^ Tc[B[i++] ^ C >>> 24] ^ Tb[B[i++]] ^ Ta[B[i++]] ^ T9[B[i++]] ^ T8[B[i++]] ^ T7[B[i++]] ^ T6[B[i++]] ^ T5[B[i++]] ^ T4[B[i++]] ^ T3[B[i++]] ^ T2[B[i++]] ^ T1[B[i++]] ^ T0[B[i++]];
      L += 15;
      while (i < L)
        C = C >>> 8 ^ T0[(C ^ B[i++]) & 255];
      return ~C;
    }
    function crc32_str(str, seed) {
      var C = seed ^ -1;
      for (var i = 0, L = str.length, c2 = 0, d2 = 0; i < L; ) {
        c2 = str.charCodeAt(i++);
        if (c2 < 128) {
          C = C >>> 8 ^ T0[(C ^ c2) & 255];
        } else if (c2 < 2048) {
          C = C >>> 8 ^ T0[(C ^ (192 | c2 >> 6 & 31)) & 255];
          C = C >>> 8 ^ T0[(C ^ (128 | c2 & 63)) & 255];
        } else if (c2 >= 55296 && c2 < 57344) {
          c2 = (c2 & 1023) + 64;
          d2 = str.charCodeAt(i++) & 1023;
          C = C >>> 8 ^ T0[(C ^ (240 | c2 >> 8 & 7)) & 255];
          C = C >>> 8 ^ T0[(C ^ (128 | c2 >> 2 & 63)) & 255];
          C = C >>> 8 ^ T0[(C ^ (128 | d2 >> 6 & 15 | (c2 & 3) << 4)) & 255];
          C = C >>> 8 ^ T0[(C ^ (128 | d2 & 63)) & 255];
        } else {
          C = C >>> 8 ^ T0[(C ^ (224 | c2 >> 12 & 15)) & 255];
          C = C >>> 8 ^ T0[(C ^ (128 | c2 >> 6 & 63)) & 255];
          C = C >>> 8 ^ T0[(C ^ (128 | c2 & 63)) & 255];
        }
      }
      return ~C;
    }
    CRC322.table = T0;
    CRC322.bstr = crc32_bstr;
    CRC322.buf = crc32_buf;
    CRC322.str = crc32_str;
    return CRC322;
  }();
  var CFB = /* @__PURE__ */ function _CFB() {
    var exports = {};
    exports.version = "1.2.1";
    function namecmp(l2, r2) {
      var L = l2.split("/"), R = r2.split("/");
      for (var i2 = 0, c2 = 0, Z = Math.min(L.length, R.length); i2 < Z; ++i2) {
        if (c2 = L[i2].length - R[i2].length)
          return c2;
        if (L[i2] != R[i2])
          return L[i2] < R[i2] ? -1 : 1;
      }
      return L.length - R.length;
    }
    function dirname(p2) {
      if (p2.charAt(p2.length - 1) == "/")
        return p2.slice(0, -1).indexOf("/") === -1 ? p2 : dirname(p2.slice(0, -1));
      var c2 = p2.lastIndexOf("/");
      return c2 === -1 ? p2 : p2.slice(0, c2 + 1);
    }
    function filename(p2) {
      if (p2.charAt(p2.length - 1) == "/")
        return filename(p2.slice(0, -1));
      var c2 = p2.lastIndexOf("/");
      return c2 === -1 ? p2 : p2.slice(c2 + 1);
    }
    function write_dos_date(buf, date) {
      if (typeof date === "string")
        date = new Date(date);
      var hms = date.getHours();
      hms = hms << 6 | date.getMinutes();
      hms = hms << 5 | date.getSeconds() >>> 1;
      buf.write_shift(2, hms);
      var ymd = date.getFullYear() - 1980;
      ymd = ymd << 4 | date.getMonth() + 1;
      ymd = ymd << 5 | date.getDate();
      buf.write_shift(2, ymd);
    }
    function parse_dos_date(buf) {
      var hms = buf.read_shift(2) & 65535;
      var ymd = buf.read_shift(2) & 65535;
      var val = /* @__PURE__ */ new Date();
      var d2 = ymd & 31;
      ymd >>>= 5;
      var m2 = ymd & 15;
      ymd >>>= 4;
      val.setMilliseconds(0);
      val.setFullYear(ymd + 1980);
      val.setMonth(m2 - 1);
      val.setDate(d2);
      var S = hms & 31;
      hms >>>= 5;
      var M = hms & 63;
      hms >>>= 6;
      val.setHours(hms);
      val.setMinutes(M);
      val.setSeconds(S << 1);
      return val;
    }
    function parse_extra_field(blob) {
      prep_blob(blob, 0);
      var o = (
        /*::(*/
        {}
      );
      var flags = 0;
      while (blob.l <= blob.length - 4) {
        var type2 = blob.read_shift(2);
        var sz = blob.read_shift(2), tgt = blob.l + sz;
        var p2 = {};
        switch (type2) {
          case 21589:
            {
              flags = blob.read_shift(1);
              if (flags & 1)
                p2.mtime = blob.read_shift(4);
              if (sz > 5) {
                if (flags & 2)
                  p2.atime = blob.read_shift(4);
                if (flags & 4)
                  p2.ctime = blob.read_shift(4);
              }
              if (p2.mtime)
                p2.mt = new Date(p2.mtime * 1e3);
            }
            break;
        }
        blob.l = tgt;
        o[type2] = p2;
      }
      return o;
    }
    var fs;
    function get_fs() {
      return fs || (fs = {});
    }
    function parse(file, options) {
      if (file[0] == 80 && file[1] == 75)
        return parse_zip(file, options);
      if ((file[0] | 32) == 109 && (file[1] | 32) == 105)
        return parse_mad(file, options);
      if (file.length < 512)
        throw new Error("CFB file size " + file.length + " < 512");
      var mver = 3;
      var ssz = 512;
      var nmfs = 0;
      var difat_sec_cnt = 0;
      var dir_start = 0;
      var minifat_start = 0;
      var difat_start = 0;
      var fat_addrs = [];
      var blob = (
        /*::(*/
        file.slice(0, 512)
      );
      prep_blob(blob, 0);
      var mv = check_get_mver(blob);
      mver = mv[0];
      switch (mver) {
        case 3:
          ssz = 512;
          break;
        case 4:
          ssz = 4096;
          break;
        case 0:
          if (mv[1] == 0)
            return parse_zip(file, options);
        default:
          throw new Error("Major Version: Expected 3 or 4 saw " + mver);
      }
      if (ssz !== 512) {
        blob = /*::(*/
        file.slice(0, ssz);
        prep_blob(
          blob,
          28
          /* blob.l */
        );
      }
      var header = file.slice(0, ssz);
      check_shifts(blob, mver);
      var dir_cnt = blob.read_shift(4, "i");
      if (mver === 3 && dir_cnt !== 0)
        throw new Error("# Directory Sectors: Expected 0 saw " + dir_cnt);
      blob.l += 4;
      dir_start = blob.read_shift(4, "i");
      blob.l += 4;
      blob.chk("00100000", "Mini Stream Cutoff Size: ");
      minifat_start = blob.read_shift(4, "i");
      nmfs = blob.read_shift(4, "i");
      difat_start = blob.read_shift(4, "i");
      difat_sec_cnt = blob.read_shift(4, "i");
      for (var q3 = -1, j = 0; j < 109; ++j) {
        q3 = blob.read_shift(4, "i");
        if (q3 < 0)
          break;
        fat_addrs[j] = q3;
      }
      var sectors = sectorify(file, ssz);
      sleuth_fat(difat_start, difat_sec_cnt, sectors, ssz, fat_addrs);
      var sector_list = make_sector_list(sectors, dir_start, fat_addrs, ssz);
      sector_list[dir_start].name = "!Directory";
      if (nmfs > 0 && minifat_start !== ENDOFCHAIN)
        sector_list[minifat_start].name = "!MiniFAT";
      sector_list[fat_addrs[0]].name = "!FAT";
      sector_list.fat_addrs = fat_addrs;
      sector_list.ssz = ssz;
      var files = {}, Paths = [], FileIndex = [], FullPaths = [];
      read_directory(dir_start, sector_list, sectors, Paths, nmfs, files, FileIndex, minifat_start);
      build_full_paths(FileIndex, FullPaths, Paths);
      Paths.shift();
      var o = {
        FileIndex,
        FullPaths
      };
      if (options && options.raw)
        o.raw = { header, sectors };
      return o;
    }
    function check_get_mver(blob) {
      if (blob[blob.l] == 80 && blob[blob.l + 1] == 75)
        return [0, 0];
      blob.chk(HEADER_SIGNATURE, "Header Signature: ");
      blob.l += 16;
      var mver = blob.read_shift(2, "u");
      return [blob.read_shift(2, "u"), mver];
    }
    function check_shifts(blob, mver) {
      var shift = 9;
      blob.l += 2;
      switch (shift = blob.read_shift(2)) {
        case 9:
          if (mver != 3)
            throw new Error("Sector Shift: Expected 9 saw " + shift);
          break;
        case 12:
          if (mver != 4)
            throw new Error("Sector Shift: Expected 12 saw " + shift);
          break;
        default:
          throw new Error("Sector Shift: Expected 9 or 12 saw " + shift);
      }
      blob.chk("0600", "Mini Sector Shift: ");
      blob.chk("000000000000", "Reserved: ");
    }
    function sectorify(file, ssz) {
      var nsectors = Math.ceil(file.length / ssz) - 1;
      var sectors = [];
      for (var i2 = 1; i2 < nsectors; ++i2)
        sectors[i2 - 1] = file.slice(i2 * ssz, (i2 + 1) * ssz);
      sectors[nsectors - 1] = file.slice(nsectors * ssz);
      return sectors;
    }
    function build_full_paths(FI, FP, Paths) {
      var i2 = 0, L = 0, R = 0, C = 0, j = 0, pl = Paths.length;
      var dad = [], q3 = [];
      for (; i2 < pl; ++i2) {
        dad[i2] = q3[i2] = i2;
        FP[i2] = Paths[i2];
      }
      for (; j < q3.length; ++j) {
        i2 = q3[j];
        L = FI[i2].L;
        R = FI[i2].R;
        C = FI[i2].C;
        if (dad[i2] === i2) {
          if (L !== -1 && dad[L] !== L)
            dad[i2] = dad[L];
          if (R !== -1 && dad[R] !== R)
            dad[i2] = dad[R];
        }
        if (C !== -1)
          dad[C] = i2;
        if (L !== -1 && i2 != dad[i2]) {
          dad[L] = dad[i2];
          if (q3.lastIndexOf(L) < j)
            q3.push(L);
        }
        if (R !== -1 && i2 != dad[i2]) {
          dad[R] = dad[i2];
          if (q3.lastIndexOf(R) < j)
            q3.push(R);
        }
      }
      for (i2 = 1; i2 < pl; ++i2)
        if (dad[i2] === i2) {
          if (R !== -1 && dad[R] !== R)
            dad[i2] = dad[R];
          else if (L !== -1 && dad[L] !== L)
            dad[i2] = dad[L];
        }
      for (i2 = 1; i2 < pl; ++i2) {
        if (FI[i2].type === 0)
          continue;
        j = i2;
        if (j != dad[j])
          do {
            j = dad[j];
            FP[i2] = FP[j] + "/" + FP[i2];
          } while (j !== 0 && -1 !== dad[j] && j != dad[j]);
        dad[i2] = -1;
      }
      FP[0] += "/";
      for (i2 = 1; i2 < pl; ++i2) {
        if (FI[i2].type !== 2)
          FP[i2] += "/";
      }
    }
    function get_mfat_entry(entry, payload, mini) {
      var start = entry.start, size2 = entry.size;
      var o = [];
      var idx = start;
      while (mini && size2 > 0 && idx >= 0) {
        o.push(payload.slice(idx * MSSZ, idx * MSSZ + MSSZ));
        size2 -= MSSZ;
        idx = __readInt32LE(mini, idx * 4);
      }
      if (o.length === 0)
        return new_buf(0);
      return bconcat(o).slice(0, entry.size);
    }
    function sleuth_fat(idx, cnt, sectors, ssz, fat_addrs) {
      var q3 = ENDOFCHAIN;
      if (idx === ENDOFCHAIN) {
        if (cnt !== 0)
          throw new Error("DIFAT chain shorter than expected");
      } else if (idx !== -1) {
        var sector = sectors[idx], m2 = (ssz >>> 2) - 1;
        if (!sector)
          return;
        for (var i2 = 0; i2 < m2; ++i2) {
          if ((q3 = __readInt32LE(sector, i2 * 4)) === ENDOFCHAIN)
            break;
          fat_addrs.push(q3);
        }
        sleuth_fat(__readInt32LE(sector, ssz - 4), cnt - 1, sectors, ssz, fat_addrs);
      }
    }
    function get_sector_list(sectors, start, fat_addrs, ssz, chkd) {
      var buf = [], buf_chain = [];
      if (!chkd)
        chkd = [];
      var modulus = ssz - 1, j = 0, jj = 0;
      for (j = start; j >= 0; ) {
        chkd[j] = true;
        buf[buf.length] = j;
        buf_chain.push(sectors[j]);
        var addr = fat_addrs[Math.floor(j * 4 / ssz)];
        jj = j * 4 & modulus;
        if (ssz < 4 + jj)
          throw new Error("FAT boundary crossed: " + j + " 4 " + ssz);
        if (!sectors[addr])
          break;
        j = __readInt32LE(sectors[addr], jj);
      }
      return { nodes: buf, data: __toBuffer([buf_chain]) };
    }
    function make_sector_list(sectors, dir_start, fat_addrs, ssz) {
      var sl = sectors.length, sector_list = [];
      var chkd = [], buf = [], buf_chain = [];
      var modulus = ssz - 1, i2 = 0, j = 0, k2 = 0, jj = 0;
      for (i2 = 0; i2 < sl; ++i2) {
        buf = [];
        k2 = i2 + dir_start;
        if (k2 >= sl)
          k2 -= sl;
        if (chkd[k2])
          continue;
        buf_chain = [];
        var seen = [];
        for (j = k2; j >= 0; ) {
          seen[j] = true;
          chkd[j] = true;
          buf[buf.length] = j;
          buf_chain.push(sectors[j]);
          var addr = fat_addrs[Math.floor(j * 4 / ssz)];
          jj = j * 4 & modulus;
          if (ssz < 4 + jj)
            throw new Error("FAT boundary crossed: " + j + " 4 " + ssz);
          if (!sectors[addr])
            break;
          j = __readInt32LE(sectors[addr], jj);
          if (seen[j])
            break;
        }
        sector_list[k2] = { nodes: buf, data: __toBuffer([buf_chain]) };
      }
      return sector_list;
    }
    function read_directory(dir_start, sector_list, sectors, Paths, nmfs, files, FileIndex, mini) {
      var minifat_store = 0, pl = Paths.length ? 2 : 0;
      var sector = sector_list[dir_start].data;
      var i2 = 0, namelen = 0, name;
      for (; i2 < sector.length; i2 += 128) {
        var blob = (
          /*::(*/
          sector.slice(i2, i2 + 128)
        );
        prep_blob(blob, 64);
        namelen = blob.read_shift(2);
        name = __utf16le(blob, 0, namelen - pl);
        Paths.push(name);
        var o = {
          name,
          type: blob.read_shift(1),
          color: blob.read_shift(1),
          L: blob.read_shift(4, "i"),
          R: blob.read_shift(4, "i"),
          C: blob.read_shift(4, "i"),
          clsid: blob.read_shift(16),
          state: blob.read_shift(4, "i"),
          start: 0,
          size: 0
        };
        var ctime = blob.read_shift(2) + blob.read_shift(2) + blob.read_shift(2) + blob.read_shift(2);
        if (ctime !== 0)
          o.ct = read_date(blob, blob.l - 8);
        var mtime = blob.read_shift(2) + blob.read_shift(2) + blob.read_shift(2) + blob.read_shift(2);
        if (mtime !== 0)
          o.mt = read_date(blob, blob.l - 8);
        o.start = blob.read_shift(4, "i");
        o.size = blob.read_shift(4, "i");
        if (o.size < 0 && o.start < 0) {
          o.size = o.type = 0;
          o.start = ENDOFCHAIN;
          o.name = "";
        }
        if (o.type === 5) {
          minifat_store = o.start;
          if (nmfs > 0 && minifat_store !== ENDOFCHAIN)
            sector_list[minifat_store].name = "!StreamData";
        } else if (o.size >= 4096) {
          o.storage = "fat";
          if (sector_list[o.start] === void 0)
            sector_list[o.start] = get_sector_list(sectors, o.start, sector_list.fat_addrs, sector_list.ssz);
          sector_list[o.start].name = o.name;
          o.content = sector_list[o.start].data.slice(0, o.size);
        } else {
          o.storage = "minifat";
          if (o.size < 0)
            o.size = 0;
          else if (minifat_store !== ENDOFCHAIN && o.start !== ENDOFCHAIN && sector_list[minifat_store]) {
            o.content = get_mfat_entry(o, sector_list[minifat_store].data, (sector_list[mini] || {}).data);
          }
        }
        if (o.content)
          prep_blob(o.content, 0);
        files[name] = o;
        FileIndex.push(o);
      }
    }
    function read_date(blob, offset) {
      return new Date((__readUInt32LE(blob, offset + 4) / 1e7 * Math.pow(2, 32) + __readUInt32LE(blob, offset) / 1e7 - 11644473600) * 1e3);
    }
    function read_file(filename2, options) {
      get_fs();
      return parse(fs.readFileSync(filename2), options);
    }
    function read(blob, options) {
      var type2 = options && options.type;
      if (!type2) {
        if (has_buf && Buffer.isBuffer(blob))
          type2 = "buffer";
      }
      switch (type2 || "base64") {
        case "file":
          return read_file(blob, options);
        case "base64":
          return parse(s2a(Base64_decode(blob)), options);
        case "binary":
          return parse(s2a(blob), options);
      }
      return parse(
        /*::typeof blob == 'string' ? new Buffer(blob, 'utf-8') : */
        blob,
        options
      );
    }
    function init_cfb(cfb, opts) {
      var o = opts || {}, root = o.root || "Root Entry";
      if (!cfb.FullPaths)
        cfb.FullPaths = [];
      if (!cfb.FileIndex)
        cfb.FileIndex = [];
      if (cfb.FullPaths.length !== cfb.FileIndex.length)
        throw new Error("inconsistent CFB structure");
      if (cfb.FullPaths.length === 0) {
        cfb.FullPaths[0] = root + "/";
        cfb.FileIndex[0] = { name: root, type: 5 };
      }
      if (o.CLSID)
        cfb.FileIndex[0].clsid = o.CLSID;
      seed_cfb(cfb);
    }
    function seed_cfb(cfb) {
      var nm = "Sh33tJ5";
      if (CFB.find(cfb, "/" + nm))
        return;
      var p2 = new_buf(4);
      p2[0] = 55;
      p2[1] = p2[3] = 50;
      p2[2] = 54;
      cfb.FileIndex.push({ name: nm, type: 2, content: p2, size: 4, L: 69, R: 69, C: 69 });
      cfb.FullPaths.push(cfb.FullPaths[0] + nm);
      rebuild_cfb(cfb);
    }
    function rebuild_cfb(cfb, f2) {
      init_cfb(cfb);
      var gc = false, s = false;
      for (var i2 = cfb.FullPaths.length - 1; i2 >= 0; --i2) {
        var _file = cfb.FileIndex[i2];
        switch (_file.type) {
          case 0:
            if (s)
              gc = true;
            else {
              cfb.FileIndex.pop();
              cfb.FullPaths.pop();
            }
            break;
          case 1:
          case 2:
          case 5:
            s = true;
            if (isNaN(_file.R * _file.L * _file.C))
              gc = true;
            if (_file.R > -1 && _file.L > -1 && _file.R == _file.L)
              gc = true;
            break;
          default:
            gc = true;
            break;
        }
      }
      if (!gc && !f2)
        return;
      var now = new Date(1987, 1, 19), j = 0;
      var fullPaths = Object.create ? /* @__PURE__ */ Object.create(null) : {};
      var data = [];
      for (i2 = 0; i2 < cfb.FullPaths.length; ++i2) {
        fullPaths[cfb.FullPaths[i2]] = true;
        if (cfb.FileIndex[i2].type === 0)
          continue;
        data.push([cfb.FullPaths[i2], cfb.FileIndex[i2]]);
      }
      for (i2 = 0; i2 < data.length; ++i2) {
        var dad = dirname(data[i2][0]);
        s = fullPaths[dad];
        if (!s) {
          data.push([dad, {
            name: filename(dad).replace("/", ""),
            type: 1,
            clsid: HEADER_CLSID,
            ct: now,
            mt: now,
            content: null
          }]);
          fullPaths[dad] = true;
        }
      }
      data.sort(function(x2, y2) {
        return namecmp(x2[0], y2[0]);
      });
      cfb.FullPaths = [];
      cfb.FileIndex = [];
      for (i2 = 0; i2 < data.length; ++i2) {
        cfb.FullPaths[i2] = data[i2][0];
        cfb.FileIndex[i2] = data[i2][1];
      }
      for (i2 = 0; i2 < data.length; ++i2) {
        var elt = cfb.FileIndex[i2];
        var nm = cfb.FullPaths[i2];
        elt.name = filename(nm).replace("/", "");
        elt.L = elt.R = elt.C = -(elt.color = 1);
        elt.size = elt.content ? elt.content.length : 0;
        elt.start = 0;
        elt.clsid = elt.clsid || HEADER_CLSID;
        if (i2 === 0) {
          elt.C = data.length > 1 ? 1 : -1;
          elt.size = 0;
          elt.type = 5;
        } else if (nm.slice(-1) == "/") {
          for (j = i2 + 1; j < data.length; ++j)
            if (dirname(cfb.FullPaths[j]) == nm)
              break;
          elt.C = j >= data.length ? -1 : j;
          for (j = i2 + 1; j < data.length; ++j)
            if (dirname(cfb.FullPaths[j]) == dirname(nm))
              break;
          elt.R = j >= data.length ? -1 : j;
          elt.type = 1;
        } else {
          if (dirname(cfb.FullPaths[i2 + 1] || "") == dirname(nm))
            elt.R = i2 + 1;
          elt.type = 2;
        }
      }
    }
    function _write(cfb, options) {
      var _opts = options || {};
      if (_opts.fileType == "mad")
        return write_mad(cfb, _opts);
      rebuild_cfb(cfb);
      switch (_opts.fileType) {
        case "zip":
          return write_zip2(cfb, _opts);
      }
      var L = function(cfb2) {
        var mini_size = 0, fat_size = 0;
        for (var i3 = 0; i3 < cfb2.FileIndex.length; ++i3) {
          var file2 = cfb2.FileIndex[i3];
          if (!file2.content)
            continue;
          var flen2 = file2.content.length;
          if (flen2 > 0) {
            if (flen2 < 4096)
              mini_size += flen2 + 63 >> 6;
            else
              fat_size += flen2 + 511 >> 9;
          }
        }
        var dir_cnt = cfb2.FullPaths.length + 3 >> 2;
        var mini_cnt = mini_size + 7 >> 3;
        var mfat_cnt = mini_size + 127 >> 7;
        var fat_base = mini_cnt + fat_size + dir_cnt + mfat_cnt;
        var fat_cnt = fat_base + 127 >> 7;
        var difat_cnt = fat_cnt <= 109 ? 0 : Math.ceil((fat_cnt - 109) / 127);
        while (fat_base + fat_cnt + difat_cnt + 127 >> 7 > fat_cnt)
          difat_cnt = ++fat_cnt <= 109 ? 0 : Math.ceil((fat_cnt - 109) / 127);
        var L2 = [1, difat_cnt, fat_cnt, mfat_cnt, dir_cnt, fat_size, mini_size, 0];
        cfb2.FileIndex[0].size = mini_size << 6;
        L2[7] = (cfb2.FileIndex[0].start = L2[0] + L2[1] + L2[2] + L2[3] + L2[4] + L2[5]) + (L2[6] + 7 >> 3);
        return L2;
      }(cfb);
      var o = new_buf(L[7] << 9);
      var i2 = 0, T = 0;
      {
        for (i2 = 0; i2 < 8; ++i2)
          o.write_shift(1, HEADER_SIG[i2]);
        for (i2 = 0; i2 < 8; ++i2)
          o.write_shift(2, 0);
        o.write_shift(2, 62);
        o.write_shift(2, 3);
        o.write_shift(2, 65534);
        o.write_shift(2, 9);
        o.write_shift(2, 6);
        for (i2 = 0; i2 < 3; ++i2)
          o.write_shift(2, 0);
        o.write_shift(4, 0);
        o.write_shift(4, L[2]);
        o.write_shift(4, L[0] + L[1] + L[2] + L[3] - 1);
        o.write_shift(4, 0);
        o.write_shift(4, 1 << 12);
        o.write_shift(4, L[3] ? L[0] + L[1] + L[2] - 1 : ENDOFCHAIN);
        o.write_shift(4, L[3]);
        o.write_shift(-4, L[1] ? L[0] - 1 : ENDOFCHAIN);
        o.write_shift(4, L[1]);
        for (i2 = 0; i2 < 109; ++i2)
          o.write_shift(-4, i2 < L[2] ? L[1] + i2 : -1);
      }
      if (L[1]) {
        for (T = 0; T < L[1]; ++T) {
          for (; i2 < 236 + T * 127; ++i2)
            o.write_shift(-4, i2 < L[2] ? L[1] + i2 : -1);
          o.write_shift(-4, T === L[1] - 1 ? ENDOFCHAIN : T + 1);
        }
      }
      var chainit = function(w2) {
        for (T += w2; i2 < T - 1; ++i2)
          o.write_shift(-4, i2 + 1);
        if (w2) {
          ++i2;
          o.write_shift(-4, ENDOFCHAIN);
        }
      };
      T = i2 = 0;
      for (T += L[1]; i2 < T; ++i2)
        o.write_shift(-4, consts.DIFSECT);
      for (T += L[2]; i2 < T; ++i2)
        o.write_shift(-4, consts.FATSECT);
      chainit(L[3]);
      chainit(L[4]);
      var j = 0, flen = 0;
      var file = cfb.FileIndex[0];
      for (; j < cfb.FileIndex.length; ++j) {
        file = cfb.FileIndex[j];
        if (!file.content)
          continue;
        flen = file.content.length;
        if (flen < 4096)
          continue;
        file.start = T;
        chainit(flen + 511 >> 9);
      }
      chainit(L[6] + 7 >> 3);
      while (o.l & 511)
        o.write_shift(-4, consts.ENDOFCHAIN);
      T = i2 = 0;
      for (j = 0; j < cfb.FileIndex.length; ++j) {
        file = cfb.FileIndex[j];
        if (!file.content)
          continue;
        flen = file.content.length;
        if (!flen || flen >= 4096)
          continue;
        file.start = T;
        chainit(flen + 63 >> 6);
      }
      while (o.l & 511)
        o.write_shift(-4, consts.ENDOFCHAIN);
      for (i2 = 0; i2 < L[4] << 2; ++i2) {
        var nm = cfb.FullPaths[i2];
        if (!nm || nm.length === 0) {
          for (j = 0; j < 17; ++j)
            o.write_shift(4, 0);
          for (j = 0; j < 3; ++j)
            o.write_shift(4, -1);
          for (j = 0; j < 12; ++j)
            o.write_shift(4, 0);
          continue;
        }
        file = cfb.FileIndex[i2];
        if (i2 === 0)
          file.start = file.size ? file.start - 1 : ENDOFCHAIN;
        var _nm = i2 === 0 && _opts.root || file.name;
        flen = 2 * (_nm.length + 1);
        o.write_shift(64, _nm, "utf16le");
        o.write_shift(2, flen);
        o.write_shift(1, file.type);
        o.write_shift(1, file.color);
        o.write_shift(-4, file.L);
        o.write_shift(-4, file.R);
        o.write_shift(-4, file.C);
        if (!file.clsid)
          for (j = 0; j < 4; ++j)
            o.write_shift(4, 0);
        else
          o.write_shift(16, file.clsid, "hex");
        o.write_shift(4, file.state || 0);
        o.write_shift(4, 0);
        o.write_shift(4, 0);
        o.write_shift(4, 0);
        o.write_shift(4, 0);
        o.write_shift(4, file.start);
        o.write_shift(4, file.size);
        o.write_shift(4, 0);
      }
      for (i2 = 1; i2 < cfb.FileIndex.length; ++i2) {
        file = cfb.FileIndex[i2];
        if (file.size >= 4096) {
          o.l = file.start + 1 << 9;
          if (has_buf && Buffer.isBuffer(file.content)) {
            file.content.copy(o, o.l, 0, file.size);
            o.l += file.size + 511 & -512;
          } else {
            for (j = 0; j < file.size; ++j)
              o.write_shift(1, file.content[j]);
            for (; j & 511; ++j)
              o.write_shift(1, 0);
          }
        }
      }
      for (i2 = 1; i2 < cfb.FileIndex.length; ++i2) {
        file = cfb.FileIndex[i2];
        if (file.size > 0 && file.size < 4096) {
          if (has_buf && Buffer.isBuffer(file.content)) {
            file.content.copy(o, o.l, 0, file.size);
            o.l += file.size + 63 & -64;
          } else {
            for (j = 0; j < file.size; ++j)
              o.write_shift(1, file.content[j]);
            for (; j & 63; ++j)
              o.write_shift(1, 0);
          }
        }
      }
      if (has_buf) {
        o.l = o.length;
      } else {
        while (o.l < o.length)
          o.write_shift(1, 0);
      }
      return o;
    }
    function find(cfb, path) {
      var UCFullPaths = cfb.FullPaths.map(function(x2) {
        return x2.toUpperCase();
      });
      var UCPaths = UCFullPaths.map(function(x2) {
        var y2 = x2.split("/");
        return y2[y2.length - (x2.slice(-1) == "/" ? 2 : 1)];
      });
      var k2 = false;
      if (path.charCodeAt(0) === 47) {
        k2 = true;
        path = UCFullPaths[0].slice(0, -1) + path;
      } else
        k2 = path.indexOf("/") !== -1;
      var UCPath = path.toUpperCase();
      var w2 = k2 === true ? UCFullPaths.indexOf(UCPath) : UCPaths.indexOf(UCPath);
      if (w2 !== -1)
        return cfb.FileIndex[w2];
      var m2 = !UCPath.match(chr1);
      UCPath = UCPath.replace(chr0, "");
      if (m2)
        UCPath = UCPath.replace(chr1, "!");
      for (w2 = 0; w2 < UCFullPaths.length; ++w2) {
        if ((m2 ? UCFullPaths[w2].replace(chr1, "!") : UCFullPaths[w2]).replace(chr0, "") == UCPath)
          return cfb.FileIndex[w2];
        if ((m2 ? UCPaths[w2].replace(chr1, "!") : UCPaths[w2]).replace(chr0, "") == UCPath)
          return cfb.FileIndex[w2];
      }
      return null;
    }
    var MSSZ = 64;
    var ENDOFCHAIN = -2;
    var HEADER_SIGNATURE = "d0cf11e0a1b11ae1";
    var HEADER_SIG = [208, 207, 17, 224, 161, 177, 26, 225];
    var HEADER_CLSID = "00000000000000000000000000000000";
    var consts = {
      /* 2.1 Compund File Sector Numbers and Types */
      MAXREGSECT: -6,
      DIFSECT: -4,
      FATSECT: -3,
      ENDOFCHAIN,
      FREESECT: -1,
      /* 2.2 Compound File Header */
      HEADER_SIGNATURE,
      HEADER_MINOR_VERSION: "3e00",
      MAXREGSID: -6,
      NOSTREAM: -1,
      HEADER_CLSID,
      /* 2.6.1 Compound File Directory Entry */
      EntryTypes: ["unknown", "storage", "stream", "lockbytes", "property", "root"]
    };
    function write_file(cfb, filename2, options) {
      get_fs();
      var o = _write(cfb, options);
      fs.writeFileSync(filename2, o);
    }
    function a2s2(o) {
      var out = new Array(o.length);
      for (var i2 = 0; i2 < o.length; ++i2)
        out[i2] = String.fromCharCode(o[i2]);
      return out.join("");
    }
    function write(cfb, options) {
      var o = _write(cfb, options);
      switch (options && options.type || "buffer") {
        case "file":
          get_fs();
          fs.writeFileSync(options.filename, o);
          return o;
        case "binary":
          return typeof o == "string" ? o : a2s2(o);
        case "base64":
          return Base64_encode(typeof o == "string" ? o : a2s2(o));
        case "buffer":
          if (has_buf)
            return Buffer.isBuffer(o) ? o : Buffer_from(o);
        case "array":
          return typeof o == "string" ? s2a(o) : o;
      }
      return o;
    }
    var _zlib;
    function use_zlib(zlib) {
      try {
        var InflateRaw = zlib.InflateRaw;
        var InflRaw = new InflateRaw();
        InflRaw._processChunk(new Uint8Array([3, 0]), InflRaw._finishFlushFlag);
        if (InflRaw.bytesRead)
          _zlib = zlib;
        else
          throw new Error("zlib does not expose bytesRead");
      } catch (e2) {
        console.error("cannot use native zlib: " + (e2.message || e2));
      }
    }
    function _inflateRawSync(payload, usz) {
      if (!_zlib)
        return _inflate(payload, usz);
      var InflateRaw = _zlib.InflateRaw;
      var InflRaw = new InflateRaw();
      var out = InflRaw._processChunk(payload.slice(payload.l), InflRaw._finishFlushFlag);
      payload.l += InflRaw.bytesRead;
      return out;
    }
    function _deflateRawSync(payload) {
      return _zlib ? _zlib.deflateRawSync(payload) : _deflate(payload);
    }
    var CLEN_ORDER = [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15];
    var LEN_LN = [3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258];
    var DST_LN = [1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, 8193, 12289, 16385, 24577];
    function bit_swap_8(n2) {
      var t2 = (n2 << 1 | n2 << 11) & 139536 | (n2 << 5 | n2 << 15) & 558144;
      return (t2 >> 16 | t2 >> 8 | t2) & 255;
    }
    var use_typed_arrays = typeof Uint8Array !== "undefined";
    var bitswap8 = use_typed_arrays ? new Uint8Array(1 << 8) : [];
    for (var q2 = 0; q2 < 1 << 8; ++q2)
      bitswap8[q2] = bit_swap_8(q2);
    function bit_swap_n(n2, b2) {
      var rev = bitswap8[n2 & 255];
      if (b2 <= 8)
        return rev >>> 8 - b2;
      rev = rev << 8 | bitswap8[n2 >> 8 & 255];
      if (b2 <= 16)
        return rev >>> 16 - b2;
      rev = rev << 8 | bitswap8[n2 >> 16 & 255];
      return rev >>> 24 - b2;
    }
    function read_bits_2(buf, bl) {
      var w2 = bl & 7, h2 = bl >>> 3;
      return (buf[h2] | (w2 <= 6 ? 0 : buf[h2 + 1] << 8)) >>> w2 & 3;
    }
    function read_bits_3(buf, bl) {
      var w2 = bl & 7, h2 = bl >>> 3;
      return (buf[h2] | (w2 <= 5 ? 0 : buf[h2 + 1] << 8)) >>> w2 & 7;
    }
    function read_bits_4(buf, bl) {
      var w2 = bl & 7, h2 = bl >>> 3;
      return (buf[h2] | (w2 <= 4 ? 0 : buf[h2 + 1] << 8)) >>> w2 & 15;
    }
    function read_bits_5(buf, bl) {
      var w2 = bl & 7, h2 = bl >>> 3;
      return (buf[h2] | (w2 <= 3 ? 0 : buf[h2 + 1] << 8)) >>> w2 & 31;
    }
    function read_bits_7(buf, bl) {
      var w2 = bl & 7, h2 = bl >>> 3;
      return (buf[h2] | (w2 <= 1 ? 0 : buf[h2 + 1] << 8)) >>> w2 & 127;
    }
    function read_bits_n(buf, bl, n2) {
      var w2 = bl & 7, h2 = bl >>> 3, f2 = (1 << n2) - 1;
      var v2 = buf[h2] >>> w2;
      if (n2 < 8 - w2)
        return v2 & f2;
      v2 |= buf[h2 + 1] << 8 - w2;
      if (n2 < 16 - w2)
        return v2 & f2;
      v2 |= buf[h2 + 2] << 16 - w2;
      if (n2 < 24 - w2)
        return v2 & f2;
      v2 |= buf[h2 + 3] << 24 - w2;
      return v2 & f2;
    }
    function write_bits_3(buf, bl, v2) {
      var w2 = bl & 7, h2 = bl >>> 3;
      if (w2 <= 5)
        buf[h2] |= (v2 & 7) << w2;
      else {
        buf[h2] |= v2 << w2 & 255;
        buf[h2 + 1] = (v2 & 7) >> 8 - w2;
      }
      return bl + 3;
    }
    function write_bits_1(buf, bl, v2) {
      var w2 = bl & 7, h2 = bl >>> 3;
      v2 = (v2 & 1) << w2;
      buf[h2] |= v2;
      return bl + 1;
    }
    function write_bits_8(buf, bl, v2) {
      var w2 = bl & 7, h2 = bl >>> 3;
      v2 <<= w2;
      buf[h2] |= v2 & 255;
      v2 >>>= 8;
      buf[h2 + 1] = v2;
      return bl + 8;
    }
    function write_bits_16(buf, bl, v2) {
      var w2 = bl & 7, h2 = bl >>> 3;
      v2 <<= w2;
      buf[h2] |= v2 & 255;
      v2 >>>= 8;
      buf[h2 + 1] = v2 & 255;
      buf[h2 + 2] = v2 >>> 8;
      return bl + 16;
    }
    function realloc(b2, sz) {
      var L = b2.length, M = 2 * L > sz ? 2 * L : sz + 5, i2 = 0;
      if (L >= sz)
        return b2;
      if (has_buf) {
        var o = new_unsafe_buf(M);
        if (b2.copy)
          b2.copy(o);
        else
          for (; i2 < b2.length; ++i2)
            o[i2] = b2[i2];
        return o;
      } else if (use_typed_arrays) {
        var a = new Uint8Array(M);
        if (a.set)
          a.set(b2);
        else
          for (; i2 < L; ++i2)
            a[i2] = b2[i2];
        return a;
      }
      b2.length = M;
      return b2;
    }
    function zero_fill_array(n2) {
      var o = new Array(n2);
      for (var i2 = 0; i2 < n2; ++i2)
        o[i2] = 0;
      return o;
    }
    function build_tree(clens, cmap, MAX) {
      var maxlen = 1, w2 = 0, i2 = 0, j = 0, ccode = 0, L = clens.length;
      var bl_count = use_typed_arrays ? new Uint16Array(32) : zero_fill_array(32);
      for (i2 = 0; i2 < 32; ++i2)
        bl_count[i2] = 0;
      for (i2 = L; i2 < MAX; ++i2)
        clens[i2] = 0;
      L = clens.length;
      var ctree = use_typed_arrays ? new Uint16Array(L) : zero_fill_array(L);
      for (i2 = 0; i2 < L; ++i2) {
        bl_count[w2 = clens[i2]]++;
        if (maxlen < w2)
          maxlen = w2;
        ctree[i2] = 0;
      }
      bl_count[0] = 0;
      for (i2 = 1; i2 <= maxlen; ++i2)
        bl_count[i2 + 16] = ccode = ccode + bl_count[i2 - 1] << 1;
      for (i2 = 0; i2 < L; ++i2) {
        ccode = clens[i2];
        if (ccode != 0)
          ctree[i2] = bl_count[ccode + 16]++;
      }
      var cleni = 0;
      for (i2 = 0; i2 < L; ++i2) {
        cleni = clens[i2];
        if (cleni != 0) {
          ccode = bit_swap_n(ctree[i2], maxlen) >> maxlen - cleni;
          for (j = (1 << maxlen + 4 - cleni) - 1; j >= 0; --j)
            cmap[ccode | j << cleni] = cleni & 15 | i2 << 4;
        }
      }
      return maxlen;
    }
    var fix_lmap = use_typed_arrays ? new Uint16Array(512) : zero_fill_array(512);
    var fix_dmap = use_typed_arrays ? new Uint16Array(32) : zero_fill_array(32);
    if (!use_typed_arrays) {
      for (var i = 0; i < 512; ++i)
        fix_lmap[i] = 0;
      for (i = 0; i < 32; ++i)
        fix_dmap[i] = 0;
    }
    (function() {
      var dlens = [];
      var i2 = 0;
      for (; i2 < 32; i2++)
        dlens.push(5);
      build_tree(dlens, fix_dmap, 32);
      var clens = [];
      i2 = 0;
      for (; i2 <= 143; i2++)
        clens.push(8);
      for (; i2 <= 255; i2++)
        clens.push(9);
      for (; i2 <= 279; i2++)
        clens.push(7);
      for (; i2 <= 287; i2++)
        clens.push(8);
      build_tree(clens, fix_lmap, 288);
    })();
    var _deflateRaw = /* @__PURE__ */ function _deflateRawIIFE() {
      var DST_LN_RE = use_typed_arrays ? new Uint8Array(32768) : [];
      var j = 0, k2 = 0;
      for (; j < DST_LN.length - 1; ++j) {
        for (; k2 < DST_LN[j + 1]; ++k2)
          DST_LN_RE[k2] = j;
      }
      for (; k2 < 32768; ++k2)
        DST_LN_RE[k2] = 29;
      var LEN_LN_RE = use_typed_arrays ? new Uint8Array(259) : [];
      for (j = 0, k2 = 0; j < LEN_LN.length - 1; ++j) {
        for (; k2 < LEN_LN[j + 1]; ++k2)
          LEN_LN_RE[k2] = j;
      }
      function write_stored(data, out) {
        var boff = 0;
        while (boff < data.length) {
          var L = Math.min(65535, data.length - boff);
          var h2 = boff + L == data.length;
          out.write_shift(1, +h2);
          out.write_shift(2, L);
          out.write_shift(2, ~L & 65535);
          while (L-- > 0)
            out[out.l++] = data[boff++];
        }
        return out.l;
      }
      function write_huff_fixed(data, out) {
        var bl = 0;
        var boff = 0;
        var addrs = use_typed_arrays ? new Uint16Array(32768) : [];
        while (boff < data.length) {
          var L = (
            /* data.length - boff; */
            Math.min(65535, data.length - boff)
          );
          if (L < 10) {
            bl = write_bits_3(out, bl, +!!(boff + L == data.length));
            if (bl & 7)
              bl += 8 - (bl & 7);
            out.l = bl / 8 | 0;
            out.write_shift(2, L);
            out.write_shift(2, ~L & 65535);
            while (L-- > 0)
              out[out.l++] = data[boff++];
            bl = out.l * 8;
            continue;
          }
          bl = write_bits_3(out, bl, +!!(boff + L == data.length) + 2);
          var hash = 0;
          while (L-- > 0) {
            var d2 = data[boff];
            hash = (hash << 5 ^ d2) & 32767;
            var match = -1, mlen = 0;
            if (match = addrs[hash]) {
              match |= boff & ~32767;
              if (match > boff)
                match -= 32768;
              if (match < boff)
                while (data[match + mlen] == data[boff + mlen] && mlen < 250)
                  ++mlen;
            }
            if (mlen > 2) {
              d2 = LEN_LN_RE[mlen];
              if (d2 <= 22)
                bl = write_bits_8(out, bl, bitswap8[d2 + 1] >> 1) - 1;
              else {
                write_bits_8(out, bl, 3);
                bl += 5;
                write_bits_8(out, bl, bitswap8[d2 - 23] >> 5);
                bl += 3;
              }
              var len_eb = d2 < 8 ? 0 : d2 - 4 >> 2;
              if (len_eb > 0) {
                write_bits_16(out, bl, mlen - LEN_LN[d2]);
                bl += len_eb;
              }
              d2 = DST_LN_RE[boff - match];
              bl = write_bits_8(out, bl, bitswap8[d2] >> 3);
              bl -= 3;
              var dst_eb = d2 < 4 ? 0 : d2 - 2 >> 1;
              if (dst_eb > 0) {
                write_bits_16(out, bl, boff - match - DST_LN[d2]);
                bl += dst_eb;
              }
              for (var q3 = 0; q3 < mlen; ++q3) {
                addrs[hash] = boff & 32767;
                hash = (hash << 5 ^ data[boff]) & 32767;
                ++boff;
              }
              L -= mlen - 1;
            } else {
              if (d2 <= 143)
                d2 = d2 + 48;
              else
                bl = write_bits_1(out, bl, 1);
              bl = write_bits_8(out, bl, bitswap8[d2]);
              addrs[hash] = boff & 32767;
              ++boff;
            }
          }
          bl = write_bits_8(out, bl, 0) - 1;
        }
        out.l = (bl + 7) / 8 | 0;
        return out.l;
      }
      return function _deflateRaw2(data, out) {
        if (data.length < 8)
          return write_stored(data, out);
        return write_huff_fixed(data, out);
      };
    }();
    function _deflate(data) {
      var buf = new_buf(50 + Math.floor(data.length * 1.1));
      var off2 = _deflateRaw(data, buf);
      return buf.slice(0, off2);
    }
    var dyn_lmap = use_typed_arrays ? new Uint16Array(32768) : zero_fill_array(32768);
    var dyn_dmap = use_typed_arrays ? new Uint16Array(32768) : zero_fill_array(32768);
    var dyn_cmap = use_typed_arrays ? new Uint16Array(128) : zero_fill_array(128);
    var dyn_len_1 = 1, dyn_len_2 = 1;
    function dyn(data, boff) {
      var _HLIT = read_bits_5(data, boff) + 257;
      boff += 5;
      var _HDIST = read_bits_5(data, boff) + 1;
      boff += 5;
      var _HCLEN = read_bits_4(data, boff) + 4;
      boff += 4;
      var w2 = 0;
      var clens = use_typed_arrays ? new Uint8Array(19) : zero_fill_array(19);
      var ctree = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
      var maxlen = 1;
      var bl_count = use_typed_arrays ? new Uint8Array(8) : zero_fill_array(8);
      var next_code = use_typed_arrays ? new Uint8Array(8) : zero_fill_array(8);
      var L = clens.length;
      for (var i2 = 0; i2 < _HCLEN; ++i2) {
        clens[CLEN_ORDER[i2]] = w2 = read_bits_3(data, boff);
        if (maxlen < w2)
          maxlen = w2;
        bl_count[w2]++;
        boff += 3;
      }
      var ccode = 0;
      bl_count[0] = 0;
      for (i2 = 1; i2 <= maxlen; ++i2)
        next_code[i2] = ccode = ccode + bl_count[i2 - 1] << 1;
      for (i2 = 0; i2 < L; ++i2)
        if ((ccode = clens[i2]) != 0)
          ctree[i2] = next_code[ccode]++;
      var cleni = 0;
      for (i2 = 0; i2 < L; ++i2) {
        cleni = clens[i2];
        if (cleni != 0) {
          ccode = bitswap8[ctree[i2]] >> 8 - cleni;
          for (var j = (1 << 7 - cleni) - 1; j >= 0; --j)
            dyn_cmap[ccode | j << cleni] = cleni & 7 | i2 << 3;
        }
      }
      var hcodes = [];
      maxlen = 1;
      for (; hcodes.length < _HLIT + _HDIST; ) {
        ccode = dyn_cmap[read_bits_7(data, boff)];
        boff += ccode & 7;
        switch (ccode >>>= 3) {
          case 16:
            w2 = 3 + read_bits_2(data, boff);
            boff += 2;
            ccode = hcodes[hcodes.length - 1];
            while (w2-- > 0)
              hcodes.push(ccode);
            break;
          case 17:
            w2 = 3 + read_bits_3(data, boff);
            boff += 3;
            while (w2-- > 0)
              hcodes.push(0);
            break;
          case 18:
            w2 = 11 + read_bits_7(data, boff);
            boff += 7;
            while (w2-- > 0)
              hcodes.push(0);
            break;
          default:
            hcodes.push(ccode);
            if (maxlen < ccode)
              maxlen = ccode;
            break;
        }
      }
      var h1 = hcodes.slice(0, _HLIT), h2 = hcodes.slice(_HLIT);
      for (i2 = _HLIT; i2 < 286; ++i2)
        h1[i2] = 0;
      for (i2 = _HDIST; i2 < 30; ++i2)
        h2[i2] = 0;
      dyn_len_1 = build_tree(h1, dyn_lmap, 286);
      dyn_len_2 = build_tree(h2, dyn_dmap, 30);
      return boff;
    }
    function inflate(data, usz) {
      if (data[0] == 3 && !(data[1] & 3)) {
        return [new_raw_buf(usz), 2];
      }
      var boff = 0;
      var header = 0;
      var outbuf = new_unsafe_buf(usz ? usz : 1 << 18);
      var woff = 0;
      var OL = outbuf.length >>> 0;
      var max_len_1 = 0, max_len_2 = 0;
      while ((header & 1) == 0) {
        header = read_bits_3(data, boff);
        boff += 3;
        if (header >>> 1 == 0) {
          if (boff & 7)
            boff += 8 - (boff & 7);
          var sz = data[boff >>> 3] | data[(boff >>> 3) + 1] << 8;
          boff += 32;
          if (sz > 0) {
            if (!usz && OL < woff + sz) {
              outbuf = realloc(outbuf, woff + sz);
              OL = outbuf.length;
            }
            while (sz-- > 0) {
              outbuf[woff++] = data[boff >>> 3];
              boff += 8;
            }
          }
          continue;
        } else if (header >> 1 == 1) {
          max_len_1 = 9;
          max_len_2 = 5;
        } else {
          boff = dyn(data, boff);
          max_len_1 = dyn_len_1;
          max_len_2 = dyn_len_2;
        }
        for (; ; ) {
          if (!usz && OL < woff + 32767) {
            outbuf = realloc(outbuf, woff + 32767);
            OL = outbuf.length;
          }
          var bits = read_bits_n(data, boff, max_len_1);
          var code = header >>> 1 == 1 ? fix_lmap[bits] : dyn_lmap[bits];
          boff += code & 15;
          code >>>= 4;
          if ((code >>> 8 & 255) === 0)
            outbuf[woff++] = code;
          else if (code == 256)
            break;
          else {
            code -= 257;
            var len_eb = code < 8 ? 0 : code - 4 >> 2;
            if (len_eb > 5)
              len_eb = 0;
            var tgt = woff + LEN_LN[code];
            if (len_eb > 0) {
              tgt += read_bits_n(data, boff, len_eb);
              boff += len_eb;
            }
            bits = read_bits_n(data, boff, max_len_2);
            code = header >>> 1 == 1 ? fix_dmap[bits] : dyn_dmap[bits];
            boff += code & 15;
            code >>>= 4;
            var dst_eb = code < 4 ? 0 : code - 2 >> 1;
            var dst = DST_LN[code];
            if (dst_eb > 0) {
              dst += read_bits_n(data, boff, dst_eb);
              boff += dst_eb;
            }
            if (!usz && OL < tgt) {
              outbuf = realloc(outbuf, tgt + 100);
              OL = outbuf.length;
            }
            while (woff < tgt) {
              outbuf[woff] = outbuf[woff - dst];
              ++woff;
            }
          }
        }
      }
      if (usz)
        return [outbuf, boff + 7 >>> 3];
      return [outbuf.slice(0, woff), boff + 7 >>> 3];
    }
    function _inflate(payload, usz) {
      var data = payload.slice(payload.l || 0);
      var out = inflate(data, usz);
      payload.l += out[1];
      return out[0];
    }
    function warn_or_throw(wrn, msg) {
      if (wrn) {
        if (typeof console !== "undefined")
          console.error(msg);
      } else
        throw new Error(msg);
    }
    function parse_zip(file, options) {
      var blob = (
        /*::(*/
        file
      );
      prep_blob(blob, 0);
      var FileIndex = [], FullPaths = [];
      var o = {
        FileIndex,
        FullPaths
      };
      init_cfb(o, { root: options.root });
      var i2 = blob.length - 4;
      while ((blob[i2] != 80 || blob[i2 + 1] != 75 || blob[i2 + 2] != 5 || blob[i2 + 3] != 6) && i2 >= 0)
        --i2;
      blob.l = i2 + 4;
      blob.l += 4;
      var fcnt = blob.read_shift(2);
      blob.l += 6;
      var start_cd = blob.read_shift(4);
      blob.l = start_cd;
      for (i2 = 0; i2 < fcnt; ++i2) {
        blob.l += 20;
        var csz = blob.read_shift(4);
        var usz = blob.read_shift(4);
        var namelen = blob.read_shift(2);
        var efsz = blob.read_shift(2);
        var fcsz = blob.read_shift(2);
        blob.l += 8;
        var offset = blob.read_shift(4);
        var EF = parse_extra_field(
          /*::(*/
          blob.slice(blob.l + namelen, blob.l + namelen + efsz)
          /*:: :any)*/
        );
        blob.l += namelen + efsz + fcsz;
        var L = blob.l;
        blob.l = offset + 4;
        parse_local_file(blob, csz, usz, o, EF);
        blob.l = L;
      }
      return o;
    }
    function parse_local_file(blob, csz, usz, o, EF) {
      blob.l += 2;
      var flags = blob.read_shift(2);
      var meth = blob.read_shift(2);
      var date = parse_dos_date(blob);
      if (flags & 8257)
        throw new Error("Unsupported ZIP encryption");
      var crc32 = blob.read_shift(4);
      var _csz = blob.read_shift(4);
      var _usz = blob.read_shift(4);
      var namelen = blob.read_shift(2);
      var efsz = blob.read_shift(2);
      var name = "";
      for (var i2 = 0; i2 < namelen; ++i2)
        name += String.fromCharCode(blob[blob.l++]);
      if (efsz) {
        var ef = parse_extra_field(
          /*::(*/
          blob.slice(blob.l, blob.l + efsz)
          /*:: :any)*/
        );
        if ((ef[21589] || {}).mt)
          date = ef[21589].mt;
        if (((EF || {})[21589] || {}).mt)
          date = EF[21589].mt;
      }
      blob.l += efsz;
      var data = blob.slice(blob.l, blob.l + _csz);
      switch (meth) {
        case 8:
          data = _inflateRawSync(blob, _usz);
          break;
        case 0:
          break;
        default:
          throw new Error("Unsupported ZIP Compression method " + meth);
      }
      var wrn = false;
      if (flags & 8) {
        crc32 = blob.read_shift(4);
        if (crc32 == 134695760) {
          crc32 = blob.read_shift(4);
          wrn = true;
        }
        _csz = blob.read_shift(4);
        _usz = blob.read_shift(4);
      }
      if (_csz != csz)
        warn_or_throw(wrn, "Bad compressed size: " + csz + " != " + _csz);
      if (_usz != usz)
        warn_or_throw(wrn, "Bad uncompressed size: " + usz + " != " + _usz);
      cfb_add(o, name, data, { unsafe: true, mt: date });
    }
    function write_zip2(cfb, options) {
      var _opts = options || {};
      var out = [], cdirs = [];
      var o = new_buf(1);
      var method = _opts.compression ? 8 : 0, flags = 0;
      var i2 = 0, j = 0;
      var start_cd = 0, fcnt = 0;
      var root = cfb.FullPaths[0], fp = root, fi = cfb.FileIndex[0];
      var crcs = [];
      var sz_cd = 0;
      for (i2 = 1; i2 < cfb.FullPaths.length; ++i2) {
        fp = cfb.FullPaths[i2].slice(root.length);
        fi = cfb.FileIndex[i2];
        if (!fi.size || !fi.content || fp == "Sh33tJ5")
          continue;
        var start = start_cd;
        var namebuf = new_buf(fp.length);
        for (j = 0; j < fp.length; ++j)
          namebuf.write_shift(1, fp.charCodeAt(j) & 127);
        namebuf = namebuf.slice(0, namebuf.l);
        crcs[fcnt] = CRC32.buf(
          /*::((*/
          fi.content,
          0
        );
        var outbuf = fi.content;
        if (method == 8)
          outbuf = _deflateRawSync(outbuf);
        o = new_buf(30);
        o.write_shift(4, 67324752);
        o.write_shift(2, 20);
        o.write_shift(2, flags);
        o.write_shift(2, method);
        if (fi.mt)
          write_dos_date(o, fi.mt);
        else
          o.write_shift(4, 0);
        o.write_shift(-4, crcs[fcnt]);
        o.write_shift(4, outbuf.length);
        o.write_shift(
          4,
          /*::(*/
          fi.content.length
        );
        o.write_shift(2, namebuf.length);
        o.write_shift(2, 0);
        start_cd += o.length;
        out.push(o);
        start_cd += namebuf.length;
        out.push(namebuf);
        start_cd += outbuf.length;
        out.push(outbuf);
        o = new_buf(46);
        o.write_shift(4, 33639248);
        o.write_shift(2, 0);
        o.write_shift(2, 20);
        o.write_shift(2, flags);
        o.write_shift(2, method);
        o.write_shift(4, 0);
        o.write_shift(-4, crcs[fcnt]);
        o.write_shift(4, outbuf.length);
        o.write_shift(
          4,
          /*::(*/
          fi.content.length
        );
        o.write_shift(2, namebuf.length);
        o.write_shift(2, 0);
        o.write_shift(2, 0);
        o.write_shift(2, 0);
        o.write_shift(2, 0);
        o.write_shift(4, 0);
        o.write_shift(4, start);
        sz_cd += o.l;
        cdirs.push(o);
        sz_cd += namebuf.length;
        cdirs.push(namebuf);
        ++fcnt;
      }
      o = new_buf(22);
      o.write_shift(4, 101010256);
      o.write_shift(2, 0);
      o.write_shift(2, 0);
      o.write_shift(2, fcnt);
      o.write_shift(2, fcnt);
      o.write_shift(4, sz_cd);
      o.write_shift(4, start_cd);
      o.write_shift(2, 0);
      return bconcat([bconcat(out), bconcat(cdirs), o]);
    }
    var ContentTypeMap = {
      "htm": "text/html",
      "xml": "text/xml",
      "gif": "image/gif",
      "jpg": "image/jpeg",
      "png": "image/png",
      "mso": "application/x-mso",
      "thmx": "application/vnd.ms-officetheme",
      "sh33tj5": "application/octet-stream"
    };
    function get_content_type(fi, fp) {
      if (fi.ctype)
        return fi.ctype;
      var ext = fi.name || "", m2 = ext.match(/\.([^\.]+)$/);
      if (m2 && ContentTypeMap[m2[1]])
        return ContentTypeMap[m2[1]];
      if (fp) {
        m2 = (ext = fp).match(/[\.\\]([^\.\\])+$/);
        if (m2 && ContentTypeMap[m2[1]])
          return ContentTypeMap[m2[1]];
      }
      return "application/octet-stream";
    }
    function write_base64_76(bstr) {
      var data = Base64_encode(bstr);
      var o = [];
      for (var i2 = 0; i2 < data.length; i2 += 76)
        o.push(data.slice(i2, i2 + 76));
      return o.join("\r\n") + "\r\n";
    }
    function write_quoted_printable(text) {
      var encoded = text.replace(/[\x00-\x08\x0B\x0C\x0E-\x1F\x7E-\xFF=]/g, function(c2) {
        var w2 = c2.charCodeAt(0).toString(16).toUpperCase();
        return "=" + (w2.length == 1 ? "0" + w2 : w2);
      });
      encoded = encoded.replace(/ $/mg, "=20").replace(/\t$/mg, "=09");
      if (encoded.charAt(0) == "\n")
        encoded = "=0D" + encoded.slice(1);
      encoded = encoded.replace(/\r(?!\n)/mg, "=0D").replace(/\n\n/mg, "\n=0A").replace(/([^\r\n])\n/mg, "$1=0A");
      var o = [], split = encoded.split("\r\n");
      for (var si = 0; si < split.length; ++si) {
        var str = split[si];
        if (str.length == 0) {
          o.push("");
          continue;
        }
        for (var i2 = 0; i2 < str.length; ) {
          var end = 76;
          var tmp = str.slice(i2, i2 + end);
          if (tmp.charAt(end - 1) == "=")
            end--;
          else if (tmp.charAt(end - 2) == "=")
            end -= 2;
          else if (tmp.charAt(end - 3) == "=")
            end -= 3;
          tmp = str.slice(i2, i2 + end);
          i2 += end;
          if (i2 < str.length)
            tmp += "=";
          o.push(tmp);
        }
      }
      return o.join("\r\n");
    }
    function parse_quoted_printable(data) {
      var o = [];
      for (var di = 0; di < data.length; ++di) {
        var line = data[di];
        while (di <= data.length && line.charAt(line.length - 1) == "=")
          line = line.slice(0, line.length - 1) + data[++di];
        o.push(line);
      }
      for (var oi = 0; oi < o.length; ++oi)
        o[oi] = o[oi].replace(/[=][0-9A-Fa-f]{2}/g, function($$) {
          return String.fromCharCode(parseInt($$.slice(1), 16));
        });
      return s2a(o.join("\r\n"));
    }
    function parse_mime(cfb, data, root) {
      var fname = "", cte = "", ctype = "", fdata;
      var di = 0;
      for (; di < 10; ++di) {
        var line = data[di];
        if (!line || line.match(/^\s*$/))
          break;
        var m2 = line.match(/^(.*?):\s*([^\s].*)$/);
        if (m2)
          switch (m2[1].toLowerCase()) {
            case "content-location":
              fname = m2[2].trim();
              break;
            case "content-type":
              ctype = m2[2].trim();
              break;
            case "content-transfer-encoding":
              cte = m2[2].trim();
              break;
          }
      }
      ++di;
      switch (cte.toLowerCase()) {
        case "base64":
          fdata = s2a(Base64_decode(data.slice(di).join("")));
          break;
        case "quoted-printable":
          fdata = parse_quoted_printable(data.slice(di));
          break;
        default:
          throw new Error("Unsupported Content-Transfer-Encoding " + cte);
      }
      var file = cfb_add(cfb, fname.slice(root.length), fdata, { unsafe: true });
      if (ctype)
        file.ctype = ctype;
    }
    function parse_mad(file, options) {
      if (a2s2(file.slice(0, 13)).toLowerCase() != "mime-version:")
        throw new Error("Unsupported MAD header");
      var root = options && options.root || "";
      var data = (has_buf && Buffer.isBuffer(file) ? file.toString("binary") : a2s2(file)).split("\r\n");
      var di = 0, row = "";
      for (di = 0; di < data.length; ++di) {
        row = data[di];
        if (!/^Content-Location:/i.test(row))
          continue;
        row = row.slice(row.indexOf("file"));
        if (!root)
          root = row.slice(0, row.lastIndexOf("/") + 1);
        if (row.slice(0, root.length) == root)
          continue;
        while (root.length > 0) {
          root = root.slice(0, root.length - 1);
          root = root.slice(0, root.lastIndexOf("/") + 1);
          if (row.slice(0, root.length) == root)
            break;
        }
      }
      var mboundary = (data[1] || "").match(/boundary="(.*?)"/);
      if (!mboundary)
        throw new Error("MAD cannot find boundary");
      var boundary = "--" + (mboundary[1] || "");
      var FileIndex = [], FullPaths = [];
      var o = {
        FileIndex,
        FullPaths
      };
      init_cfb(o);
      var start_di, fcnt = 0;
      for (di = 0; di < data.length; ++di) {
        var line = data[di];
        if (line !== boundary && line !== boundary + "--")
          continue;
        if (fcnt++)
          parse_mime(o, data.slice(start_di, di), root);
        start_di = di;
      }
      return o;
    }
    function write_mad(cfb, options) {
      var opts = options || {};
      var boundary = opts.boundary || "SheetJS";
      boundary = "------=" + boundary;
      var out = [
        "MIME-Version: 1.0",
        'Content-Type: multipart/related; boundary="' + boundary.slice(2) + '"',
        "",
        "",
        ""
      ];
      var root = cfb.FullPaths[0], fp = root, fi = cfb.FileIndex[0];
      for (var i2 = 1; i2 < cfb.FullPaths.length; ++i2) {
        fp = cfb.FullPaths[i2].slice(root.length);
        fi = cfb.FileIndex[i2];
        if (!fi.size || !fi.content || fp == "Sh33tJ5")
          continue;
        fp = fp.replace(/[\x00-\x08\x0B\x0C\x0E-\x1F\x7E-\xFF]/g, function(c2) {
          return "_x" + c2.charCodeAt(0).toString(16) + "_";
        }).replace(/[\u0080-\uFFFF]/g, function(u) {
          return "_u" + u.charCodeAt(0).toString(16) + "_";
        });
        var ca = fi.content;
        var cstr = has_buf && Buffer.isBuffer(ca) ? ca.toString("binary") : a2s2(ca);
        var dispcnt = 0, L = Math.min(1024, cstr.length), cc = 0;
        for (var csl = 0; csl <= L; ++csl)
          if ((cc = cstr.charCodeAt(csl)) >= 32 && cc < 128)
            ++dispcnt;
        var qp = dispcnt >= L * 4 / 5;
        out.push(boundary);
        out.push("Content-Location: " + (opts.root || "file:///C:/SheetJS/") + fp);
        out.push("Content-Transfer-Encoding: " + (qp ? "quoted-printable" : "base64"));
        out.push("Content-Type: " + get_content_type(fi, fp));
        out.push("");
        out.push(qp ? write_quoted_printable(cstr) : write_base64_76(cstr));
      }
      out.push(boundary + "--\r\n");
      return out.join("\r\n");
    }
    function cfb_new(opts) {
      var o = {};
      init_cfb(o, opts);
      return o;
    }
    function cfb_add(cfb, name, content, opts) {
      var unsafe = opts && opts.unsafe;
      if (!unsafe)
        init_cfb(cfb);
      var file = !unsafe && CFB.find(cfb, name);
      if (!file) {
        var fpath = cfb.FullPaths[0];
        if (name.slice(0, fpath.length) == fpath)
          fpath = name;
        else {
          if (fpath.slice(-1) != "/")
            fpath += "/";
          fpath = (fpath + name).replace("//", "/");
        }
        file = { name: filename(name), type: 2 };
        cfb.FileIndex.push(file);
        cfb.FullPaths.push(fpath);
        if (!unsafe)
          CFB.utils.cfb_gc(cfb);
      }
      file.content = content;
      file.size = content ? content.length : 0;
      if (opts) {
        if (opts.CLSID)
          file.clsid = opts.CLSID;
        if (opts.mt)
          file.mt = opts.mt;
        if (opts.ct)
          file.ct = opts.ct;
      }
      return file;
    }
    function cfb_del(cfb, name) {
      init_cfb(cfb);
      var file = CFB.find(cfb, name);
      if (file) {
        for (var j = 0; j < cfb.FileIndex.length; ++j)
          if (cfb.FileIndex[j] == file) {
            cfb.FileIndex.splice(j, 1);
            cfb.FullPaths.splice(j, 1);
            return true;
          }
      }
      return false;
    }
    function cfb_mov(cfb, old_name, new_name) {
      init_cfb(cfb);
      var file = CFB.find(cfb, old_name);
      if (file) {
        for (var j = 0; j < cfb.FileIndex.length; ++j)
          if (cfb.FileIndex[j] == file) {
            cfb.FileIndex[j].name = filename(new_name);
            cfb.FullPaths[j] = new_name;
            return true;
          }
      }
      return false;
    }
    function cfb_gc(cfb) {
      rebuild_cfb(cfb, true);
    }
    exports.find = find;
    exports.read = read;
    exports.parse = parse;
    exports.write = write;
    exports.writeFile = write_file;
    exports.utils = {
      cfb_new,
      cfb_add,
      cfb_del,
      cfb_mov,
      cfb_gc,
      ReadShift,
      CheckField,
      prep_blob,
      bconcat,
      use_zlib,
      _deflateRaw: _deflate,
      _inflateRaw: _inflate,
      consts
    };
    return exports;
  }();
  function blobify(data) {
    if (typeof data === "string")
      return s2ab(data);
    if (Array.isArray(data))
      return a2u(data);
    return data;
  }
  function write_dl(fname, payload, enc) {
    if (typeof Deno !== "undefined") {
      if (enc && typeof payload == "string")
        switch (enc) {
          case "utf8":
            payload = new TextEncoder(enc).encode(payload);
            break;
          case "binary":
            payload = s2ab(payload);
            break;
          default:
            throw new Error("Unsupported encoding " + enc);
        }
      return Deno.writeFileSync(fname, payload);
    }
    var data = enc == "utf8" ? utf8write(payload) : payload;
    if (typeof IE_SaveFile !== "undefined")
      return IE_SaveFile(data, fname);
    if (typeof Blob !== "undefined") {
      var blob = new Blob([blobify(data)], { type: "application/octet-stream" });
      if (typeof navigator !== "undefined" && navigator.msSaveBlob)
        return navigator.msSaveBlob(blob, fname);
      if (typeof saveAs !== "undefined")
        return saveAs(blob, fname);
      if (typeof URL !== "undefined" && typeof document !== "undefined" && document.createElement && URL.createObjectURL) {
        var url = URL.createObjectURL(blob);
        if (typeof chrome === "object" && typeof (chrome.downloads || {}).download == "function") {
          if (URL.revokeObjectURL && typeof setTimeout !== "undefined")
            setTimeout(function() {
              URL.revokeObjectURL(url);
            }, 6e4);
          return chrome.downloads.download({ url, filename: fname, saveAs: true });
        }
        var a = document.createElement("a");
        if (a.download != null) {
          a.download = fname;
          a.href = url;
          document.body.appendChild(a);
          a.click();
          document.body.removeChild(a);
          if (URL.revokeObjectURL && typeof setTimeout !== "undefined")
            setTimeout(function() {
              URL.revokeObjectURL(url);
            }, 6e4);
          return url;
        }
      }
    }
    if (typeof $ !== "undefined" && typeof File !== "undefined" && typeof Folder !== "undefined")
      try {
        var out = File(fname);
        out.open("w");
        out.encoding = "binary";
        if (Array.isArray(payload))
          payload = a2s(payload);
        out.write(payload);
        out.close();
        return payload;
      } catch (e2) {
        if (!e2.message || !e2.message.match(/onstruct/))
          throw e2;
      }
    throw new Error("cannot save file " + fname);
  }
  function keys2(o) {
    var ks = Object.keys(o), o2 = [];
    for (var i = 0; i < ks.length; ++i)
      if (Object.prototype.hasOwnProperty.call(o, ks[i]))
        o2.push(ks[i]);
    return o2;
  }
  function evert_key(obj2, key) {
    var o = [], K = keys2(obj2);
    for (var i = 0; i !== K.length; ++i)
      if (o[obj2[K[i]][key]] == null)
        o[obj2[K[i]][key]] = K[i];
    return o;
  }
  function evert(obj2) {
    var o = [], K = keys2(obj2);
    for (var i = 0; i !== K.length; ++i)
      o[obj2[K[i]]] = K[i];
    return o;
  }
  function evert_num(obj2) {
    var o = [], K = keys2(obj2);
    for (var i = 0; i !== K.length; ++i)
      o[obj2[K[i]]] = parseInt(K[i], 10);
    return o;
  }
  function evert_arr(obj2) {
    var o = [], K = keys2(obj2);
    for (var i = 0; i !== K.length; ++i) {
      if (o[obj2[K[i]]] == null)
        o[obj2[K[i]]] = [];
      o[obj2[K[i]]].push(K[i]);
    }
    return o;
  }
  var basedate = /* @__PURE__ */ new Date(1899, 11, 30, 0, 0, 0);
  function datenum(v2, date1904) {
    var epoch = /* @__PURE__ */ v2.getTime();
    if (date1904)
      epoch -= 1462 * 24 * 60 * 60 * 1e3;
    var dnthresh2 = /* @__PURE__ */ basedate.getTime() + (/* @__PURE__ */ v2.getTimezoneOffset() - /* @__PURE__ */ basedate.getTimezoneOffset()) * 6e4;
    return (epoch - dnthresh2) / (24 * 60 * 60 * 1e3);
  }
  var refdate = /* @__PURE__ */ new Date();
  var dnthresh = /* @__PURE__ */ basedate.getTime() + (/* @__PURE__ */ refdate.getTimezoneOffset() - /* @__PURE__ */ basedate.getTimezoneOffset()) * 6e4;
  var refoffset = /* @__PURE__ */ refdate.getTimezoneOffset();
  function numdate(v2) {
    var out = /* @__PURE__ */ new Date();
    out.setTime(v2 * 24 * 60 * 60 * 1e3 + dnthresh);
    if (out.getTimezoneOffset() !== refoffset) {
      out.setTime(out.getTime() + (out.getTimezoneOffset() - refoffset) * 6e4);
    }
    return out;
  }
  var good_pd_date_1 = /* @__PURE__ */ new Date("2017-02-19T19:06:09.000Z");
  var good_pd_date = /* @__PURE__ */ isNaN(/* @__PURE__ */ good_pd_date_1.getFullYear()) ? /* @__PURE__ */ new Date("2/19/17") : good_pd_date_1;
  var good_pd = /* @__PURE__ */ good_pd_date.getFullYear() == 2017;
  function parseDate(str, fixdate) {
    var d2 = new Date(str);
    if (good_pd) {
      if (fixdate > 0)
        d2.setTime(d2.getTime() + d2.getTimezoneOffset() * 60 * 1e3);
      else if (fixdate < 0)
        d2.setTime(d2.getTime() - d2.getTimezoneOffset() * 60 * 1e3);
      return d2;
    }
    if (str instanceof Date)
      return str;
    if (good_pd_date.getFullYear() == 1917 && !isNaN(d2.getFullYear())) {
      var s = d2.getFullYear();
      if (str.indexOf("" + s) > -1)
        return d2;
      d2.setFullYear(d2.getFullYear() + 100);
      return d2;
    }
    var n2 = str.match(/\d+/g) || ["2017", "2", "19", "0", "0", "0"];
    var out = new Date(+n2[0], +n2[1] - 1, +n2[2], +n2[3] || 0, +n2[4] || 0, +n2[5] || 0);
    if (str.indexOf("Z") > -1)
      out = new Date(out.getTime() - out.getTimezoneOffset() * 60 * 1e3);
    return out;
  }
  function cc2str(arr, debomit) {
    if (has_buf && Buffer.isBuffer(arr)) {
      if (debomit) {
        if (arr[0] == 255 && arr[1] == 254)
          return utf8write(arr.slice(2).toString("utf16le"));
        if (arr[1] == 254 && arr[2] == 255)
          return utf8write(utf16beread(arr.slice(2).toString("binary")));
      }
      return arr.toString("binary");
    }
    if (typeof TextDecoder !== "undefined")
      try {
        if (debomit) {
          if (arr[0] == 255 && arr[1] == 254)
            return utf8write(new TextDecoder("utf-16le").decode(arr.slice(2)));
          if (arr[0] == 254 && arr[1] == 255)
            return utf8write(new TextDecoder("utf-16be").decode(arr.slice(2)));
        }
        var rev = {
          "€": "€",
          "‚": "‚",
          "ƒ": "ƒ",
          "„": "„",
          "…": "…",
          "†": "†",
          "‡": "‡",
          "ˆ": "ˆ",
          "‰": "‰",
          "Š": "Š",
          "‹": "‹",
          "Œ": "Œ",
          "Ž": "Ž",
          "‘": "‘",
          "’": "’",
          "“": "“",
          "”": "”",
          "•": "•",
          "–": "–",
          "—": "—",
          "˜": "˜",
          "™": "™",
          "š": "š",
          "›": "›",
          "œ": "œ",
          "ž": "ž",
          "Ÿ": "Ÿ"
        };
        if (Array.isArray(arr))
          arr = new Uint8Array(arr);
        return new TextDecoder("latin1").decode(arr).replace(/[€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ]/g, function(c2) {
          return rev[c2] || c2;
        });
      } catch (e2) {
      }
    var o = [];
    for (var i = 0; i != arr.length; ++i)
      o.push(String.fromCharCode(arr[i]));
    return o.join("");
  }
  function dup(o) {
    if (typeof JSON != "undefined" && !Array.isArray(o))
      return JSON.parse(JSON.stringify(o));
    if (typeof o != "object" || o == null)
      return o;
    if (o instanceof Date)
      return new Date(o.getTime());
    var out = {};
    for (var k2 in o)
      if (Object.prototype.hasOwnProperty.call(o, k2))
        out[k2] = dup(o[k2]);
    return out;
  }
  function fill(c2, l2) {
    var o = "";
    while (o.length < l2)
      o += c2;
    return o;
  }
  function fuzzynum(s) {
    var v2 = Number(s);
    if (!isNaN(v2))
      return isFinite(v2) ? v2 : NaN;
    if (!/\d/.test(s))
      return v2;
    var wt = 1;
    var ss = s.replace(/([\d]),([\d])/g, "$1$2").replace(/[$]/g, "").replace(/[%]/g, function() {
      wt *= 100;
      return "";
    });
    if (!isNaN(v2 = Number(ss)))
      return v2 / wt;
    ss = ss.replace(/[(](.*)[)]/, function($$, $1) {
      wt = -wt;
      return $1;
    });
    if (!isNaN(v2 = Number(ss)))
      return v2 / wt;
    return v2;
  }
  var lower_months = ["january", "february", "march", "april", "may", "june", "july", "august", "september", "october", "november", "december"];
  function fuzzydate(s) {
    var o = new Date(s), n2 = /* @__PURE__ */ new Date(NaN);
    var y2 = o.getYear(), m2 = o.getMonth(), d2 = o.getDate();
    if (isNaN(d2))
      return n2;
    var lower = s.toLowerCase();
    if (lower.match(/jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec/)) {
      lower = lower.replace(/[^a-z]/g, "").replace(/([^a-z]|^)[ap]m?([^a-z]|$)/, "");
      if (lower.length > 3 && lower_months.indexOf(lower) == -1)
        return n2;
    } else if (lower.match(/[a-z]/))
      return n2;
    if (y2 < 0 || y2 > 8099)
      return n2;
    if ((m2 > 0 || d2 > 1) && y2 != 101)
      return o;
    if (s.match(/[^-0-9:,\/\\]/))
      return n2;
    return o;
  }
  function zip_add_file(zip, path, content) {
    if (zip.FullPaths) {
      if (typeof content == "string") {
        var res;
        if (has_buf)
          res = Buffer_from(content);
        else
          res = utf8decode(content);
        return CFB.utils.cfb_add(zip, path, res);
      }
      CFB.utils.cfb_add(zip, path, content);
    } else
      zip.file(path, content);
  }
  function zip_new() {
    return CFB.utils.cfb_new();
  }
  var XML_HEADER = '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r\n';
  var encodings = {
    "&quot;": '"',
    "&apos;": "'",
    "&gt;": ">",
    "&lt;": "<",
    "&amp;": "&"
  };
  var rencoding = /* @__PURE__ */ evert(encodings);
  var decregex = /[&<>'"]/g, charegex = /[\u0000-\u0008\u000b-\u001f]/g;
  function escapexml(text) {
    var s = text + "";
    return s.replace(decregex, function(y2) {
      return rencoding[y2];
    }).replace(charegex, function(s2) {
      return "_x" + ("000" + s2.charCodeAt(0).toString(16)).slice(-4) + "_";
    });
  }
  function escapexmltag(text) {
    return escapexml(text).replace(/ /g, "_x0020_");
  }
  var htmlcharegex = /[\u0000-\u001f]/g;
  function escapehtml(text) {
    var s = text + "";
    return s.replace(decregex, function(y2) {
      return rencoding[y2];
    }).replace(/\n/g, "<br/>").replace(htmlcharegex, function(s2) {
      return "&#x" + ("000" + s2.charCodeAt(0).toString(16)).slice(-4) + ";";
    });
  }
  function escapexlml(text) {
    var s = text + "";
    return s.replace(decregex, function(y2) {
      return rencoding[y2];
    }).replace(htmlcharegex, function(s2) {
      return "&#x" + s2.charCodeAt(0).toString(16).toUpperCase() + ";";
    });
  }
  function xlml_unfixstr(str) {
    return str.replace(/(\r\n|[\r\n])/g, "&#10;");
  }
  function parsexmlbool(value) {
    switch (value) {
      case 1:
      case true:
      case "1":
      case "true":
      case "TRUE":
        return true;
      default:
        return false;
    }
  }
  function utf8reada(orig) {
    var out = "", i = 0, c2 = 0, d2 = 0, e2 = 0, f2 = 0, w2 = 0;
    while (i < orig.length) {
      c2 = orig.charCodeAt(i++);
      if (c2 < 128) {
        out += String.fromCharCode(c2);
        continue;
      }
      d2 = orig.charCodeAt(i++);
      if (c2 > 191 && c2 < 224) {
        f2 = (c2 & 31) << 6;
        f2 |= d2 & 63;
        out += String.fromCharCode(f2);
        continue;
      }
      e2 = orig.charCodeAt(i++);
      if (c2 < 240) {
        out += String.fromCharCode((c2 & 15) << 12 | (d2 & 63) << 6 | e2 & 63);
        continue;
      }
      f2 = orig.charCodeAt(i++);
      w2 = ((c2 & 7) << 18 | (d2 & 63) << 12 | (e2 & 63) << 6 | f2 & 63) - 65536;
      out += String.fromCharCode(55296 + (w2 >>> 10 & 1023));
      out += String.fromCharCode(56320 + (w2 & 1023));
    }
    return out;
  }
  function utf8readb(data) {
    var out = new_raw_buf(2 * data.length), w2, i, j = 1, k2 = 0, ww = 0, c2;
    for (i = 0; i < data.length; i += j) {
      j = 1;
      if ((c2 = data.charCodeAt(i)) < 128)
        w2 = c2;
      else if (c2 < 224) {
        w2 = (c2 & 31) * 64 + (data.charCodeAt(i + 1) & 63);
        j = 2;
      } else if (c2 < 240) {
        w2 = (c2 & 15) * 4096 + (data.charCodeAt(i + 1) & 63) * 64 + (data.charCodeAt(i + 2) & 63);
        j = 3;
      } else {
        j = 4;
        w2 = (c2 & 7) * 262144 + (data.charCodeAt(i + 1) & 63) * 4096 + (data.charCodeAt(i + 2) & 63) * 64 + (data.charCodeAt(i + 3) & 63);
        w2 -= 65536;
        ww = 55296 + (w2 >>> 10 & 1023);
        w2 = 56320 + (w2 & 1023);
      }
      if (ww !== 0) {
        out[k2++] = ww & 255;
        out[k2++] = ww >>> 8;
        ww = 0;
      }
      out[k2++] = w2 % 256;
      out[k2++] = w2 >>> 8;
    }
    return out.slice(0, k2).toString("ucs2");
  }
  function utf8readc(data) {
    return Buffer_from(data, "binary").toString("utf8");
  }
  var utf8corpus = "foo bar baz☃🍣";
  var utf8read = has_buf && (/* @__PURE__ */ utf8readc(utf8corpus) == /* @__PURE__ */ utf8reada(utf8corpus) && utf8readc || /* @__PURE__ */ utf8readb(utf8corpus) == /* @__PURE__ */ utf8reada(utf8corpus) && utf8readb) || utf8reada;
  var utf8write = has_buf ? function(data) {
    return Buffer_from(data, "utf8").toString("binary");
  } : function(orig) {
    var out = [], i = 0, c2 = 0, d2 = 0;
    while (i < orig.length) {
      c2 = orig.charCodeAt(i++);
      switch (true) {
        case c2 < 128:
          out.push(String.fromCharCode(c2));
          break;
        case c2 < 2048:
          out.push(String.fromCharCode(192 + (c2 >> 6)));
          out.push(String.fromCharCode(128 + (c2 & 63)));
          break;
        case (c2 >= 55296 && c2 < 57344):
          c2 -= 55296;
          d2 = orig.charCodeAt(i++) - 56320 + (c2 << 10);
          out.push(String.fromCharCode(240 + (d2 >> 18 & 7)));
          out.push(String.fromCharCode(144 + (d2 >> 12 & 63)));
          out.push(String.fromCharCode(128 + (d2 >> 6 & 63)));
          out.push(String.fromCharCode(128 + (d2 & 63)));
          break;
        default:
          out.push(String.fromCharCode(224 + (c2 >> 12)));
          out.push(String.fromCharCode(128 + (c2 >> 6 & 63)));
          out.push(String.fromCharCode(128 + (c2 & 63)));
      }
    }
    return out.join("");
  };
  var htmldecode = /* @__PURE__ */ function() {
    var entities = [
      ["nbsp", " "],
      ["middot", "·"],
      ["quot", '"'],
      ["apos", "'"],
      ["gt", ">"],
      ["lt", "<"],
      ["amp", "&"]
    ].map(function(x2) {
      return [new RegExp("&" + x2[0] + ";", "ig"), x2[1]];
    });
    return function htmldecode2(str) {
      var o = str.replace(/^[\t\n\r ]+/, "").replace(/[\t\n\r ]+$/, "").replace(/>\s+/g, ">").replace(/\s+</g, "<").replace(/[\t\n\r ]+/g, " ").replace(/<\s*[bB][rR]\s*\/?>/g, "\n").replace(/<[^>]*>/g, "");
      for (var i = 0; i < entities.length; ++i)
        o = o.replace(entities[i][0], entities[i][1]);
      return o;
    };
  }();
  var wtregex = /(^\s|\s$|\n)/;
  function writetag(f2, g2) {
    return "<" + f2 + (g2.match(wtregex) ? ' xml:space="preserve"' : "") + ">" + g2 + "</" + f2 + ">";
  }
  function wxt_helper(h2) {
    return keys2(h2).map(function(k2) {
      return " " + k2 + '="' + h2[k2] + '"';
    }).join("");
  }
  function writextag(f2, g2, h2) {
    return "<" + f2 + (h2 != null ? wxt_helper(h2) : "") + (g2 != null ? (g2.match(wtregex) ? ' xml:space="preserve"' : "") + ">" + g2 + "</" + f2 : "/") + ">";
  }
  function write_w3cdtf(d2, t2) {
    try {
      return d2.toISOString().replace(/\.\d*/, "");
    } catch (e2) {
      if (t2)
        throw e2;
    }
    return "";
  }
  function write_vt(s, xlsx) {
    switch (typeof s) {
      case "string":
        var o = writextag("vt:lpwstr", escapexml(s));
        if (xlsx)
          o = o.replace(/&quot;/g, "_x0022_");
        return o;
      case "number":
        return writextag((s | 0) == s ? "vt:i4" : "vt:r8", escapexml(String(s)));
      case "boolean":
        return writextag("vt:bool", s ? "true" : "false");
    }
    if (s instanceof Date)
      return writextag("vt:filetime", write_w3cdtf(s));
    throw new Error("Unable to serialize " + s);
  }
  var XMLNS = {
    CORE_PROPS: "http://schemas.openxmlformats.org/package/2006/metadata/core-properties",
    CUST_PROPS: "http://schemas.openxmlformats.org/officeDocument/2006/custom-properties",
    EXT_PROPS: "http://schemas.openxmlformats.org/officeDocument/2006/extended-properties",
    CT: "http://schemas.openxmlformats.org/package/2006/content-types",
    RELS: "http://schemas.openxmlformats.org/package/2006/relationships",
    TCMNT: "http://schemas.microsoft.com/office/spreadsheetml/2018/threadedcomments",
    "dc": "http://purl.org/dc/elements/1.1/",
    "dcterms": "http://purl.org/dc/terms/",
    "dcmitype": "http://purl.org/dc/dcmitype/",
    "mx": "http://schemas.microsoft.com/office/mac/excel/2008/main",
    "r": "http://schemas.openxmlformats.org/officeDocument/2006/relationships",
    "sjs": "http://schemas.openxmlformats.org/package/2006/sheetjs/core-properties",
    "vt": "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes",
    "xsi": "http://www.w3.org/2001/XMLSchema-instance",
    "xsd": "http://www.w3.org/2001/XMLSchema"
  };
  var XMLNS_main = [
    "http://schemas.openxmlformats.org/spreadsheetml/2006/main",
    "http://purl.oclc.org/ooxml/spreadsheetml/main",
    "http://schemas.microsoft.com/office/excel/2006/main",
    "http://schemas.microsoft.com/office/excel/2006/2"
  ];
  var XLMLNS = {
    "o": "urn:schemas-microsoft-com:office:office",
    "x": "urn:schemas-microsoft-com:office:excel",
    "ss": "urn:schemas-microsoft-com:office:spreadsheet",
    "dt": "uuid:C2F41010-65B3-11d1-A29F-00AA00C14882",
    "mv": "http://macVmlSchemaUri",
    "v": "urn:schemas-microsoft-com:vml",
    "html": "http://www.w3.org/TR/REC-html40"
  };
  function read_double_le(b2, idx) {
    var s = 1 - 2 * (b2[idx + 7] >>> 7);
    var e2 = ((b2[idx + 7] & 127) << 4) + (b2[idx + 6] >>> 4 & 15);
    var m2 = b2[idx + 6] & 15;
    for (var i = 5; i >= 0; --i)
      m2 = m2 * 256 + b2[idx + i];
    if (e2 == 2047)
      return m2 == 0 ? s * Infinity : NaN;
    if (e2 == 0)
      e2 = -1022;
    else {
      e2 -= 1023;
      m2 += Math.pow(2, 52);
    }
    return s * Math.pow(2, e2 - 52) * m2;
  }
  function write_double_le(b2, v2, idx) {
    var bs = (v2 < 0 || 1 / v2 == -Infinity ? 1 : 0) << 7, e2 = 0, m2 = 0;
    var av = bs ? -v2 : v2;
    if (!isFinite(av)) {
      e2 = 2047;
      m2 = isNaN(v2) ? 26985 : 0;
    } else if (av == 0)
      e2 = m2 = 0;
    else {
      e2 = Math.floor(Math.log(av) / Math.LN2);
      m2 = av * Math.pow(2, 52 - e2);
      if (e2 <= -1023 && (!isFinite(m2) || m2 < Math.pow(2, 52))) {
        e2 = -1022;
      } else {
        m2 -= Math.pow(2, 52);
        e2 += 1023;
      }
    }
    for (var i = 0; i <= 5; ++i, m2 /= 256)
      b2[idx + i] = m2 & 255;
    b2[idx + 6] = (e2 & 15) << 4 | m2 & 15;
    b2[idx + 7] = e2 >> 4 | bs;
  }
  var ___toBuffer = function(bufs) {
    var x2 = [], w2 = 10240;
    for (var i = 0; i < bufs[0].length; ++i)
      if (bufs[0][i])
        for (var j = 0, L = bufs[0][i].length; j < L; j += w2)
          x2.push.apply(x2, bufs[0][i].slice(j, j + w2));
    return x2;
  };
  var __toBuffer = has_buf ? function(bufs) {
    return bufs[0].length > 0 && Buffer.isBuffer(bufs[0][0]) ? Buffer.concat(bufs[0].map(function(x2) {
      return Buffer.isBuffer(x2) ? x2 : Buffer_from(x2);
    })) : ___toBuffer(bufs);
  } : ___toBuffer;
  var ___utf16le = function(b2, s, e2) {
    var ss = [];
    for (var i = s; i < e2; i += 2)
      ss.push(String.fromCharCode(__readUInt16LE(b2, i)));
    return ss.join("").replace(chr0, "");
  };
  var __utf16le = has_buf ? function(b2, s, e2) {
    if (!Buffer.isBuffer(b2))
      return ___utf16le(b2, s, e2);
    return b2.toString("utf16le", s, e2).replace(chr0, "");
  } : ___utf16le;
  var ___hexlify = function(b2, s, l2) {
    var ss = [];
    for (var i = s; i < s + l2; ++i)
      ss.push(("0" + b2[i].toString(16)).slice(-2));
    return ss.join("");
  };
  var __hexlify = has_buf ? function(b2, s, l2) {
    return Buffer.isBuffer(b2) ? b2.toString("hex", s, s + l2) : ___hexlify(b2, s, l2);
  } : ___hexlify;
  var ___utf8 = function(b2, s, e2) {
    var ss = [];
    for (var i = s; i < e2; i++)
      ss.push(String.fromCharCode(__readUInt8(b2, i)));
    return ss.join("");
  };
  var __utf8 = has_buf ? function utf8_b(b2, s, e2) {
    return Buffer.isBuffer(b2) ? b2.toString("utf8", s, e2) : ___utf8(b2, s, e2);
  } : ___utf8;
  var ___lpstr = function(b2, i) {
    var len = __readUInt32LE(b2, i);
    return len > 0 ? __utf8(b2, i + 4, i + 4 + len - 1) : "";
  };
  var __lpstr = ___lpstr;
  var ___cpstr = function(b2, i) {
    var len = __readUInt32LE(b2, i);
    return len > 0 ? __utf8(b2, i + 4, i + 4 + len - 1) : "";
  };
  var __cpstr = ___cpstr;
  var ___lpwstr = function(b2, i) {
    var len = 2 * __readUInt32LE(b2, i);
    return len > 0 ? __utf8(b2, i + 4, i + 4 + len - 1) : "";
  };
  var __lpwstr = ___lpwstr;
  var ___lpp4 = function lpp4_(b2, i) {
    var len = __readUInt32LE(b2, i);
    return len > 0 ? __utf16le(b2, i + 4, i + 4 + len) : "";
  };
  var __lpp4 = ___lpp4;
  var ___8lpp4 = function(b2, i) {
    var len = __readUInt32LE(b2, i);
    return len > 0 ? __utf8(b2, i + 4, i + 4 + len) : "";
  };
  var __8lpp4 = ___8lpp4;
  var ___double = function(b2, idx) {
    return read_double_le(b2, idx);
  };
  var __double = ___double;
  var is_buf = function is_buf_a(a) {
    return Array.isArray(a) || typeof Uint8Array !== "undefined" && a instanceof Uint8Array;
  };
  if (has_buf) {
    __lpstr = function lpstr_b(b2, i) {
      if (!Buffer.isBuffer(b2))
        return ___lpstr(b2, i);
      var len = b2.readUInt32LE(i);
      return len > 0 ? b2.toString("utf8", i + 4, i + 4 + len - 1) : "";
    };
    __cpstr = function cpstr_b(b2, i) {
      if (!Buffer.isBuffer(b2))
        return ___cpstr(b2, i);
      var len = b2.readUInt32LE(i);
      return len > 0 ? b2.toString("utf8", i + 4, i + 4 + len - 1) : "";
    };
    __lpwstr = function lpwstr_b(b2, i) {
      if (!Buffer.isBuffer(b2))
        return ___lpwstr(b2, i);
      var len = 2 * b2.readUInt32LE(i);
      return b2.toString("utf16le", i + 4, i + 4 + len - 1);
    };
    __lpp4 = function lpp4_b(b2, i) {
      if (!Buffer.isBuffer(b2))
        return ___lpp4(b2, i);
      var len = b2.readUInt32LE(i);
      return b2.toString("utf16le", i + 4, i + 4 + len);
    };
    __8lpp4 = function lpp4_8b(b2, i) {
      if (!Buffer.isBuffer(b2))
        return ___8lpp4(b2, i);
      var len = b2.readUInt32LE(i);
      return b2.toString("utf8", i + 4, i + 4 + len);
    };
    __double = function double_(b2, i) {
      if (Buffer.isBuffer(b2))
        return b2.readDoubleLE(i);
      return ___double(b2, i);
    };
    is_buf = function is_buf_b(a) {
      return Buffer.isBuffer(a) || Array.isArray(a) || typeof Uint8Array !== "undefined" && a instanceof Uint8Array;
    };
  }
  var __readUInt8 = function(b2, idx) {
    return b2[idx];
  };
  var __readUInt16LE = function(b2, idx) {
    return b2[idx + 1] * (1 << 8) + b2[idx];
  };
  var __readInt16LE = function(b2, idx) {
    var u = b2[idx + 1] * (1 << 8) + b2[idx];
    return u < 32768 ? u : (65535 - u + 1) * -1;
  };
  var __readUInt32LE = function(b2, idx) {
    return b2[idx + 3] * (1 << 24) + (b2[idx + 2] << 16) + (b2[idx + 1] << 8) + b2[idx];
  };
  var __readInt32LE = function(b2, idx) {
    return b2[idx + 3] << 24 | b2[idx + 2] << 16 | b2[idx + 1] << 8 | b2[idx];
  };
  var __readInt32BE = function(b2, idx) {
    return b2[idx] << 24 | b2[idx + 1] << 16 | b2[idx + 2] << 8 | b2[idx + 3];
  };
  function ReadShift(size2, t2) {
    var o = "", oI, oR, oo = [], w2, vv, i, loc;
    switch (t2) {
      case "dbcs":
        loc = this.l;
        if (has_buf && Buffer.isBuffer(this))
          o = this.slice(this.l, this.l + 2 * size2).toString("utf16le");
        else
          for (i = 0; i < size2; ++i) {
            o += String.fromCharCode(__readUInt16LE(this, loc));
            loc += 2;
          }
        size2 *= 2;
        break;
      case "utf8":
        o = __utf8(this, this.l, this.l + size2);
        break;
      case "utf16le":
        size2 *= 2;
        o = __utf16le(this, this.l, this.l + size2);
        break;
      case "wstr":
        return ReadShift.call(this, size2, "dbcs");
      case "lpstr-ansi":
        o = __lpstr(this, this.l);
        size2 = 4 + __readUInt32LE(this, this.l);
        break;
      case "lpstr-cp":
        o = __cpstr(this, this.l);
        size2 = 4 + __readUInt32LE(this, this.l);
        break;
      case "lpwstr":
        o = __lpwstr(this, this.l);
        size2 = 4 + 2 * __readUInt32LE(this, this.l);
        break;
      case "lpp4":
        size2 = 4 + __readUInt32LE(this, this.l);
        o = __lpp4(this, this.l);
        if (size2 & 2)
          size2 += 2;
        break;
      case "8lpp4":
        size2 = 4 + __readUInt32LE(this, this.l);
        o = __8lpp4(this, this.l);
        if (size2 & 3)
          size2 += 4 - (size2 & 3);
        break;
      case "cstr":
        size2 = 0;
        o = "";
        while ((w2 = __readUInt8(this, this.l + size2++)) !== 0)
          oo.push(_getchar(w2));
        o = oo.join("");
        break;
      case "_wstr":
        size2 = 0;
        o = "";
        while ((w2 = __readUInt16LE(this, this.l + size2)) !== 0) {
          oo.push(_getchar(w2));
          size2 += 2;
        }
        size2 += 2;
        o = oo.join("");
        break;
      case "dbcs-cont":
        o = "";
        loc = this.l;
        for (i = 0; i < size2; ++i) {
          if (this.lens && this.lens.indexOf(loc) !== -1) {
            w2 = __readUInt8(this, loc);
            this.l = loc + 1;
            vv = ReadShift.call(this, size2 - i, w2 ? "dbcs-cont" : "sbcs-cont");
            return oo.join("") + vv;
          }
          oo.push(_getchar(__readUInt16LE(this, loc)));
          loc += 2;
        }
        o = oo.join("");
        size2 *= 2;
        break;
      case "cpstr":
      case "sbcs-cont":
        o = "";
        loc = this.l;
        for (i = 0; i != size2; ++i) {
          if (this.lens && this.lens.indexOf(loc) !== -1) {
            w2 = __readUInt8(this, loc);
            this.l = loc + 1;
            vv = ReadShift.call(this, size2 - i, w2 ? "dbcs-cont" : "sbcs-cont");
            return oo.join("") + vv;
          }
          oo.push(_getchar(__readUInt8(this, loc)));
          loc += 1;
        }
        o = oo.join("");
        break;
      default:
        switch (size2) {
          case 1:
            oI = __readUInt8(this, this.l);
            this.l++;
            return oI;
          case 2:
            oI = (t2 === "i" ? __readInt16LE : __readUInt16LE)(this, this.l);
            this.l += 2;
            return oI;
          case 4:
          case -4:
            if (t2 === "i" || (this[this.l + 3] & 128) === 0) {
              oI = (size2 > 0 ? __readInt32LE : __readInt32BE)(this, this.l);
              this.l += 4;
              return oI;
            } else {
              oR = __readUInt32LE(this, this.l);
              this.l += 4;
            }
            return oR;
          case 8:
          case -8:
            if (t2 === "f") {
              if (size2 == 8)
                oR = __double(this, this.l);
              else
                oR = __double([this[this.l + 7], this[this.l + 6], this[this.l + 5], this[this.l + 4], this[this.l + 3], this[this.l + 2], this[this.l + 1], this[this.l + 0]], 0);
              this.l += 8;
              return oR;
            } else
              size2 = 8;
          case 16:
            o = __hexlify(this, this.l, size2);
            break;
        }
    }
    this.l += size2;
    return o;
  }
  var __writeUInt32LE = function(b2, val, idx) {
    b2[idx] = val & 255;
    b2[idx + 1] = val >>> 8 & 255;
    b2[idx + 2] = val >>> 16 & 255;
    b2[idx + 3] = val >>> 24 & 255;
  };
  var __writeInt32LE = function(b2, val, idx) {
    b2[idx] = val & 255;
    b2[idx + 1] = val >> 8 & 255;
    b2[idx + 2] = val >> 16 & 255;
    b2[idx + 3] = val >> 24 & 255;
  };
  var __writeUInt16LE = function(b2, val, idx) {
    b2[idx] = val & 255;
    b2[idx + 1] = val >>> 8 & 255;
  };
  function WriteShift(t2, val, f2) {
    var size2 = 0, i = 0;
    if (f2 === "dbcs") {
      for (i = 0; i != val.length; ++i)
        __writeUInt16LE(this, val.charCodeAt(i), this.l + 2 * i);
      size2 = 2 * val.length;
    } else if (f2 === "sbcs") {
      {
        val = val.replace(/[^\x00-\x7F]/g, "_");
        for (i = 0; i != val.length; ++i)
          this[this.l + i] = val.charCodeAt(i) & 255;
      }
      size2 = val.length;
    } else if (f2 === "hex") {
      for (; i < t2; ++i) {
        this[this.l++] = parseInt(val.slice(2 * i, 2 * i + 2), 16) || 0;
      }
      return this;
    } else if (f2 === "utf16le") {
      var end = Math.min(this.l + t2, this.length);
      for (i = 0; i < Math.min(val.length, t2); ++i) {
        var cc = val.charCodeAt(i);
        this[this.l++] = cc & 255;
        this[this.l++] = cc >> 8;
      }
      while (this.l < end)
        this[this.l++] = 0;
      return this;
    } else
      switch (t2) {
        case 1:
          size2 = 1;
          this[this.l] = val & 255;
          break;
        case 2:
          size2 = 2;
          this[this.l] = val & 255;
          val >>>= 8;
          this[this.l + 1] = val & 255;
          break;
        case 3:
          size2 = 3;
          this[this.l] = val & 255;
          val >>>= 8;
          this[this.l + 1] = val & 255;
          val >>>= 8;
          this[this.l + 2] = val & 255;
          break;
        case 4:
          size2 = 4;
          __writeUInt32LE(this, val, this.l);
          break;
        case 8:
          size2 = 8;
          if (f2 === "f") {
            write_double_le(this, val, this.l);
            break;
          }
        case 16:
          break;
        case -4:
          size2 = 4;
          __writeInt32LE(this, val, this.l);
          break;
      }
    this.l += size2;
    return this;
  }
  function CheckField(hexstr, fld) {
    var m2 = __hexlify(this, this.l, hexstr.length >> 1);
    if (m2 !== hexstr)
      throw new Error(fld + "Expected " + hexstr + " saw " + m2);
    this.l += hexstr.length >> 1;
  }
  function prep_blob(blob, pos) {
    blob.l = pos;
    blob.read_shift = /*::(*/
    ReadShift;
    blob.chk = CheckField;
    blob.write_shift = WriteShift;
  }
  function parsenoop(blob, length2) {
    blob.l += length2;
  }
  function new_buf(sz) {
    var o = new_raw_buf(sz);
    prep_blob(o, 0);
    return o;
  }
  function buf_array() {
    var bufs = [], blksz = has_buf ? 256 : 2048;
    var newblk = function ba_newblk(sz) {
      var o = new_buf(sz);
      prep_blob(o, 0);
      return o;
    };
    var curbuf = newblk(blksz);
    var endbuf = function ba_endbuf() {
      if (!curbuf)
        return;
      if (curbuf.length > curbuf.l) {
        curbuf = curbuf.slice(0, curbuf.l);
        curbuf.l = curbuf.length;
      }
      if (curbuf.length > 0)
        bufs.push(curbuf);
      curbuf = null;
    };
    var next = function ba_next(sz) {
      if (curbuf && sz < curbuf.length - curbuf.l)
        return curbuf;
      endbuf();
      return curbuf = newblk(Math.max(sz + 1, blksz));
    };
    var end = function ba_end() {
      endbuf();
      return bconcat(bufs);
    };
    var push = function ba_push(buf) {
      endbuf();
      curbuf = buf;
      if (curbuf.l == null)
        curbuf.l = curbuf.length;
      next(blksz);
    };
    return { next, push, end, _bufs: bufs };
  }
  function write_record(ba, type2, payload, length2) {
    var t2 = +type2, l2;
    if (isNaN(t2))
      return;
    if (!length2)
      length2 = XLSBRecordEnum[t2].p || (payload || []).length || 0;
    l2 = 1 + (t2 >= 128 ? 1 : 0) + 1;
    if (length2 >= 128)
      ++l2;
    if (length2 >= 16384)
      ++l2;
    if (length2 >= 2097152)
      ++l2;
    var o = ba.next(l2);
    if (t2 <= 127)
      o.write_shift(1, t2);
    else {
      o.write_shift(1, (t2 & 127) + 128);
      o.write_shift(1, t2 >> 7);
    }
    for (var i = 0; i != 4; ++i) {
      if (length2 >= 128) {
        o.write_shift(1, (length2 & 127) + 128);
        length2 >>= 7;
      } else {
        o.write_shift(1, length2);
        break;
      }
    }
    if (
      /*:: length != null &&*/
      length2 > 0 && is_buf(payload)
    )
      ba.push(payload);
  }
  function shift_cell_xls(cell5, tgt, opts) {
    var out = dup(cell5);
    if (tgt.s) {
      if (out.cRel)
        out.c += tgt.s.c;
      if (out.rRel)
        out.r += tgt.s.r;
    } else {
      if (out.cRel)
        out.c += tgt.c;
      if (out.rRel)
        out.r += tgt.r;
    }
    if (!opts || opts.biff < 12) {
      while (out.c >= 256)
        out.c -= 256;
      while (out.r >= 65536)
        out.r -= 65536;
    }
    return out;
  }
  function shift_range_xls(cell5, range, opts) {
    var out = dup(cell5);
    out.s = shift_cell_xls(out.s, range.s, opts);
    out.e = shift_cell_xls(out.e, range.s, opts);
    return out;
  }
  function encode_cell_xls(c2, biff) {
    if (c2.cRel && c2.c < 0) {
      c2 = dup(c2);
      while (c2.c < 0)
        c2.c += biff > 8 ? 16384 : 256;
    }
    if (c2.rRel && c2.r < 0) {
      c2 = dup(c2);
      while (c2.r < 0)
        c2.r += biff > 8 ? 1048576 : biff > 5 ? 65536 : 16384;
    }
    var s = encode_cell(c2);
    if (!c2.cRel && c2.cRel != null)
      s = fix_col(s);
    if (!c2.rRel && c2.rRel != null)
      s = fix_row(s);
    return s;
  }
  function encode_range_xls(r2, opts) {
    if (r2.s.r == 0 && !r2.s.rRel) {
      if (r2.e.r == (opts.biff >= 12 ? 1048575 : opts.biff >= 8 ? 65536 : 16384) && !r2.e.rRel) {
        return (r2.s.cRel ? "" : "$") + encode_col(r2.s.c) + ":" + (r2.e.cRel ? "" : "$") + encode_col(r2.e.c);
      }
    }
    if (r2.s.c == 0 && !r2.s.cRel) {
      if (r2.e.c == (opts.biff >= 12 ? 16383 : 255) && !r2.e.cRel) {
        return (r2.s.rRel ? "" : "$") + encode_row(r2.s.r) + ":" + (r2.e.rRel ? "" : "$") + encode_row(r2.e.r);
      }
    }
    return encode_cell_xls(r2.s, opts.biff) + ":" + encode_cell_xls(r2.e, opts.biff);
  }
  function decode_row(rowstr) {
    return parseInt(unfix_row(rowstr), 10) - 1;
  }
  function encode_row(row) {
    return "" + (row + 1);
  }
  function fix_row(cstr) {
    return cstr.replace(/([A-Z]|^)(\d+)$/, "$1$$$2");
  }
  function unfix_row(cstr) {
    return cstr.replace(/\$(\d+)$/, "$1");
  }
  function decode_col(colstr) {
    var c2 = unfix_col(colstr), d2 = 0, i = 0;
    for (; i !== c2.length; ++i)
      d2 = 26 * d2 + c2.charCodeAt(i) - 64;
    return d2 - 1;
  }
  function encode_col(col) {
    if (col < 0)
      throw new Error("invalid column " + col);
    var s = "";
    for (++col; col; col = Math.floor((col - 1) / 26))
      s = String.fromCharCode((col - 1) % 26 + 65) + s;
    return s;
  }
  function fix_col(cstr) {
    return cstr.replace(/^([A-Z])/, "$$$1");
  }
  function unfix_col(cstr) {
    return cstr.replace(/^\$([A-Z])/, "$1");
  }
  function split_cell(cstr) {
    return cstr.replace(/(\$?[A-Z]*)(\$?\d*)/, "$1,$2").split(",");
  }
  function decode_cell(cstr) {
    var R = 0, C = 0;
    for (var i = 0; i < cstr.length; ++i) {
      var cc = cstr.charCodeAt(i);
      if (cc >= 48 && cc <= 57)
        R = 10 * R + (cc - 48);
      else if (cc >= 65 && cc <= 90)
        C = 26 * C + (cc - 64);
    }
    return { c: C - 1, r: R - 1 };
  }
  function encode_cell(cell5) {
    var col = cell5.c + 1;
    var s = "";
    for (; col; col = (col - 1) / 26 | 0)
      s = String.fromCharCode((col - 1) % 26 + 65) + s;
    return s + (cell5.r + 1);
  }
  function decode_range(range) {
    var idx = range.indexOf(":");
    if (idx == -1)
      return { s: decode_cell(range), e: decode_cell(range) };
    return { s: decode_cell(range.slice(0, idx)), e: decode_cell(range.slice(idx + 1)) };
  }
  function encode_range(cs, ce) {
    if (typeof ce === "undefined" || typeof ce === "number") {
      return encode_range(cs.s, cs.e);
    }
    if (typeof cs !== "string")
      cs = encode_cell(cs);
    if (typeof ce !== "string")
      ce = encode_cell(ce);
    return cs == ce ? cs : cs + ":" + ce;
  }
  function safe_decode_range(range) {
    var o = { s: { c: 0, r: 0 }, e: { c: 0, r: 0 } };
    var idx = 0, i = 0, cc = 0;
    var len = range.length;
    for (idx = 0; i < len; ++i) {
      if ((cc = range.charCodeAt(i) - 64) < 1 || cc > 26)
        break;
      idx = 26 * idx + cc;
    }
    o.s.c = --idx;
    for (idx = 0; i < len; ++i) {
      if ((cc = range.charCodeAt(i) - 48) < 0 || cc > 9)
        break;
      idx = 10 * idx + cc;
    }
    o.s.r = --idx;
    if (i === len || cc != 10) {
      o.e.c = o.s.c;
      o.e.r = o.s.r;
      return o;
    }
    ++i;
    for (idx = 0; i != len; ++i) {
      if ((cc = range.charCodeAt(i) - 64) < 1 || cc > 26)
        break;
      idx = 26 * idx + cc;
    }
    o.e.c = --idx;
    for (idx = 0; i != len; ++i) {
      if ((cc = range.charCodeAt(i) - 48) < 0 || cc > 9)
        break;
      idx = 10 * idx + cc;
    }
    o.e.r = --idx;
    return o;
  }
  function safe_format_cell(cell5, v2) {
    var q2 = cell5.t == "d" && v2 instanceof Date;
    if (cell5.z != null)
      try {
        return cell5.w = SSF_format(cell5.z, q2 ? datenum(v2) : v2);
      } catch (e2) {
      }
    try {
      return cell5.w = SSF_format((cell5.XF || {}).numFmtId || (q2 ? 14 : 0), q2 ? datenum(v2) : v2);
    } catch (e2) {
      return "" + v2;
    }
  }
  function format_cell(cell5, v2, o) {
    if (cell5 == null || cell5.t == null || cell5.t == "z")
      return "";
    if (cell5.w !== void 0)
      return cell5.w;
    if (cell5.t == "d" && !cell5.z && o && o.dateNF)
      cell5.z = o.dateNF;
    if (cell5.t == "e")
      return BErr[cell5.v] || cell5.v;
    if (v2 == void 0)
      return safe_format_cell(cell5, cell5.v);
    return safe_format_cell(cell5, v2);
  }
  function sheet_to_workbook(sheet, opts) {
    var n2 = opts && opts.sheet ? opts.sheet : "Sheet1";
    var sheets = {};
    sheets[n2] = sheet;
    return { SheetNames: [n2], Sheets: sheets };
  }
  function sheet_add_aoa(_ws, data, opts) {
    var o = opts || {};
    var dense = _ws ? Array.isArray(_ws) : o.dense;
    var ws = _ws || (dense ? [] : {});
    var _R = 0, _C = 0;
    if (ws && o.origin != null) {
      if (typeof o.origin == "number")
        _R = o.origin;
      else {
        var _origin = typeof o.origin == "string" ? decode_cell(o.origin) : o.origin;
        _R = _origin.r;
        _C = _origin.c;
      }
      if (!ws["!ref"])
        ws["!ref"] = "A1:A1";
    }
    var range = { s: { c: 1e7, r: 1e7 }, e: { c: 0, r: 0 } };
    if (ws["!ref"]) {
      var _range = safe_decode_range(ws["!ref"]);
      range.s.c = _range.s.c;
      range.s.r = _range.s.r;
      range.e.c = Math.max(range.e.c, _range.e.c);
      range.e.r = Math.max(range.e.r, _range.e.r);
      if (_R == -1)
        range.e.r = _R = _range.e.r + 1;
    }
    for (var R = 0; R != data.length; ++R) {
      if (!data[R])
        continue;
      if (!Array.isArray(data[R]))
        throw new Error("aoa_to_sheet expects an array of arrays");
      for (var C = 0; C != data[R].length; ++C) {
        if (typeof data[R][C] === "undefined")
          continue;
        var cell5 = { v: data[R][C] };
        var __R = _R + R, __C = _C + C;
        if (range.s.r > __R)
          range.s.r = __R;
        if (range.s.c > __C)
          range.s.c = __C;
        if (range.e.r < __R)
          range.e.r = __R;
        if (range.e.c < __C)
          range.e.c = __C;
        if (data[R][C] && typeof data[R][C] === "object" && !Array.isArray(data[R][C]) && !(data[R][C] instanceof Date))
          cell5 = data[R][C];
        else {
          if (Array.isArray(cell5.v)) {
            cell5.f = data[R][C][1];
            cell5.v = cell5.v[0];
          }
          if (cell5.v === null) {
            if (cell5.f)
              cell5.t = "n";
            else if (o.nullError) {
              cell5.t = "e";
              cell5.v = 0;
            } else if (!o.sheetStubs)
              continue;
            else
              cell5.t = "z";
          } else if (typeof cell5.v === "number")
            cell5.t = "n";
          else if (typeof cell5.v === "boolean")
            cell5.t = "b";
          else if (cell5.v instanceof Date) {
            cell5.z = o.dateNF || table_fmt[14];
            if (o.cellDates) {
              cell5.t = "d";
              cell5.w = SSF_format(cell5.z, datenum(cell5.v));
            } else {
              cell5.t = "n";
              cell5.v = datenum(cell5.v);
              cell5.w = SSF_format(cell5.z, cell5.v);
            }
          } else
            cell5.t = "s";
        }
        if (dense) {
          if (!ws[__R])
            ws[__R] = [];
          if (ws[__R][__C] && ws[__R][__C].z)
            cell5.z = ws[__R][__C].z;
          ws[__R][__C] = cell5;
        } else {
          var cell_ref = encode_cell({ c: __C, r: __R });
          if (ws[cell_ref] && ws[cell_ref].z)
            cell5.z = ws[cell_ref].z;
          ws[cell_ref] = cell5;
        }
      }
    }
    if (range.s.c < 1e7)
      ws["!ref"] = encode_range(range);
    return ws;
  }
  function aoa_to_sheet(data, opts) {
    return sheet_add_aoa(null, data, opts);
  }
  function parse_Int32LE(data) {
    return data.read_shift(4, "i");
  }
  function write_UInt32LE(x2, o) {
    if (!o)
      o = new_buf(4);
    o.write_shift(4, x2);
    return o;
  }
  function parse_XLWideString(data) {
    var cchCharacters = data.read_shift(4);
    return cchCharacters === 0 ? "" : data.read_shift(cchCharacters, "dbcs");
  }
  function write_XLWideString(data, o) {
    var _null = false;
    if (o == null) {
      _null = true;
      o = new_buf(4 + 2 * data.length);
    }
    o.write_shift(4, data.length);
    if (data.length > 0)
      o.write_shift(0, data, "dbcs");
    return _null ? o.slice(0, o.l) : o;
  }
  function parse_StrRun(data) {
    return { ich: data.read_shift(2), ifnt: data.read_shift(2) };
  }
  function write_StrRun(run, o) {
    if (!o)
      o = new_buf(4);
    o.write_shift(2, run.ich || 0);
    o.write_shift(2, run.ifnt || 0);
    return o;
  }
  function parse_RichStr(data, length2) {
    var start = data.l;
    var flags = data.read_shift(1);
    var str = parse_XLWideString(data);
    var rgsStrRun = [];
    var z2 = { t: str, h: str };
    if ((flags & 1) !== 0) {
      var dwSizeStrRun = data.read_shift(4);
      for (var i = 0; i != dwSizeStrRun; ++i)
        rgsStrRun.push(parse_StrRun(data));
      z2.r = rgsStrRun;
    } else
      z2.r = [{ ich: 0, ifnt: 0 }];
    data.l = start + length2;
    return z2;
  }
  function write_RichStr(str, o) {
    var _null = false;
    if (o == null) {
      _null = true;
      o = new_buf(15 + 4 * str.t.length);
    }
    o.write_shift(1, 0);
    write_XLWideString(str.t, o);
    return _null ? o.slice(0, o.l) : o;
  }
  var parse_BrtCommentText = parse_RichStr;
  function write_BrtCommentText(str, o) {
    var _null = false;
    if (o == null) {
      _null = true;
      o = new_buf(23 + 4 * str.t.length);
    }
    o.write_shift(1, 1);
    write_XLWideString(str.t, o);
    o.write_shift(4, 1);
    write_StrRun({ ich: 0, ifnt: 0 }, o);
    return _null ? o.slice(0, o.l) : o;
  }
  function parse_XLSBCell(data) {
    var col = data.read_shift(4);
    var iStyleRef = data.read_shift(2);
    iStyleRef += data.read_shift(1) << 16;
    data.l++;
    return { c: col, iStyleRef };
  }
  function write_XLSBCell(cell5, o) {
    if (o == null)
      o = new_buf(8);
    o.write_shift(-4, cell5.c);
    o.write_shift(3, cell5.iStyleRef || cell5.s);
    o.write_shift(1, 0);
    return o;
  }
  function parse_XLSBShortCell(data) {
    var iStyleRef = data.read_shift(2);
    iStyleRef += data.read_shift(1) << 16;
    data.l++;
    return { c: -1, iStyleRef };
  }
  function write_XLSBShortCell(cell5, o) {
    if (o == null)
      o = new_buf(4);
    o.write_shift(3, cell5.iStyleRef || cell5.s);
    o.write_shift(1, 0);
    return o;
  }
  var parse_XLSBCodeName = parse_XLWideString;
  var write_XLSBCodeName = write_XLWideString;
  function parse_XLNullableWideString(data) {
    var cchCharacters = data.read_shift(4);
    return cchCharacters === 0 || cchCharacters === 4294967295 ? "" : data.read_shift(cchCharacters, "dbcs");
  }
  function write_XLNullableWideString(data, o) {
    var _null = false;
    if (o == null) {
      _null = true;
      o = new_buf(127);
    }
    o.write_shift(4, data.length > 0 ? data.length : 4294967295);
    if (data.length > 0)
      o.write_shift(0, data, "dbcs");
    return _null ? o.slice(0, o.l) : o;
  }
  var parse_XLNameWideString = parse_XLWideString;
  var parse_RelID = parse_XLNullableWideString;
  var write_RelID = write_XLNullableWideString;
  function parse_RkNumber(data) {
    var b2 = data.slice(data.l, data.l + 4);
    var fX100 = b2[0] & 1, fInt = b2[0] & 2;
    data.l += 4;
    var RK = fInt === 0 ? __double([0, 0, 0, 0, b2[0] & 252, b2[1], b2[2], b2[3]], 0) : __readInt32LE(b2, 0) >> 2;
    return fX100 ? RK / 100 : RK;
  }
  function write_RkNumber(data, o) {
    if (o == null)
      o = new_buf(4);
    var fX100 = 0, fInt = 0, d100 = data * 100;
    if (data == (data | 0) && data >= -(1 << 29) && data < 1 << 29) {
      fInt = 1;
    } else if (d100 == (d100 | 0) && d100 >= -(1 << 29) && d100 < 1 << 29) {
      fInt = 1;
      fX100 = 1;
    }
    if (fInt)
      o.write_shift(-4, ((fX100 ? d100 : data) << 2) + (fX100 + 2));
    else
      throw new Error("unsupported RkNumber " + data);
  }
  function parse_RfX(data) {
    var cell5 = { s: {}, e: {} };
    cell5.s.r = data.read_shift(4);
    cell5.e.r = data.read_shift(4);
    cell5.s.c = data.read_shift(4);
    cell5.e.c = data.read_shift(4);
    return cell5;
  }
  function write_RfX(r2, o) {
    if (!o)
      o = new_buf(16);
    o.write_shift(4, r2.s.r);
    o.write_shift(4, r2.e.r);
    o.write_shift(4, r2.s.c);
    o.write_shift(4, r2.e.c);
    return o;
  }
  var parse_UncheckedRfX = parse_RfX;
  var write_UncheckedRfX = write_RfX;
  function parse_Xnum(data) {
    if (data.length - data.l < 8)
      throw "XLS Xnum Buffer underflow";
    return data.read_shift(8, "f");
  }
  function write_Xnum(data, o) {
    return (o || new_buf(8)).write_shift(8, data, "f");
  }
  function parse_BrtColor(data) {
    var out = {};
    var d2 = data.read_shift(1);
    var xColorType = d2 >>> 1;
    var index2 = data.read_shift(1);
    var nTS = data.read_shift(2, "i");
    var bR = data.read_shift(1);
    var bG = data.read_shift(1);
    var bB = data.read_shift(1);
    data.l++;
    switch (xColorType) {
      case 0:
        out.auto = 1;
        break;
      case 1:
        out.index = index2;
        var icv = XLSIcv[index2];
        if (icv)
          out.rgb = rgb2Hex(icv);
        break;
      case 2:
        out.rgb = rgb2Hex([bR, bG, bB]);
        break;
      case 3:
        out.theme = index2;
        break;
    }
    if (nTS != 0)
      out.tint = nTS > 0 ? nTS / 32767 : nTS / 32768;
    return out;
  }
  function write_BrtColor(color, o) {
    if (!o)
      o = new_buf(8);
    if (!color || color.auto) {
      o.write_shift(4, 0);
      o.write_shift(4, 0);
      return o;
    }
    if (color.index != null) {
      o.write_shift(1, 2);
      o.write_shift(1, color.index);
    } else if (color.theme != null) {
      o.write_shift(1, 6);
      o.write_shift(1, color.theme);
    } else {
      o.write_shift(1, 5);
      o.write_shift(1, 0);
    }
    var nTS = color.tint || 0;
    if (nTS > 0)
      nTS *= 32767;
    else if (nTS < 0)
      nTS *= 32768;
    o.write_shift(2, nTS);
    if (!color.rgb || color.theme != null) {
      o.write_shift(2, 0);
      o.write_shift(1, 0);
      o.write_shift(1, 0);
    } else {
      var rgb = color.rgb || "FFFFFF";
      if (typeof rgb == "number")
        rgb = ("000000" + rgb.toString(16)).slice(-6);
      o.write_shift(1, parseInt(rgb.slice(0, 2), 16));
      o.write_shift(1, parseInt(rgb.slice(2, 4), 16));
      o.write_shift(1, parseInt(rgb.slice(4, 6), 16));
      o.write_shift(1, 255);
    }
    return o;
  }
  function parse_FontFlags(data) {
    var d2 = data.read_shift(1);
    data.l++;
    var out = {
      fBold: d2 & 1,
      fItalic: d2 & 2,
      fUnderline: d2 & 4,
      fStrikeout: d2 & 8,
      fOutline: d2 & 16,
      fShadow: d2 & 32,
      fCondense: d2 & 64,
      fExtend: d2 & 128
    };
    return out;
  }
  function write_FontFlags(font, o) {
    if (!o)
      o = new_buf(2);
    var grbit = (font.italic ? 2 : 0) | (font.strike ? 8 : 0) | (font.outline ? 16 : 0) | (font.shadow ? 32 : 0) | (font.condense ? 64 : 0) | (font.extend ? 128 : 0);
    o.write_shift(1, grbit);
    o.write_shift(1, 0);
    return o;
  }
  var VT_I2 = 2;
  var VT_I4 = 3;
  var VT_BOOL = 11;
  var VT_UI4 = 19;
  var VT_FILETIME = 64;
  var VT_BLOB = 65;
  var VT_CF = 71;
  var VT_VECTOR_VARIANT = 4108;
  var VT_VECTOR_LPSTR = 4126;
  var VT_STRING = 80;
  var DocSummaryPIDDSI = {
    /*::[*/
    1: { n: "CodePage", t: VT_I2 },
    /*::[*/
    2: { n: "Category", t: VT_STRING },
    /*::[*/
    3: { n: "PresentationFormat", t: VT_STRING },
    /*::[*/
    4: { n: "ByteCount", t: VT_I4 },
    /*::[*/
    5: { n: "LineCount", t: VT_I4 },
    /*::[*/
    6: { n: "ParagraphCount", t: VT_I4 },
    /*::[*/
    7: { n: "SlideCount", t: VT_I4 },
    /*::[*/
    8: { n: "NoteCount", t: VT_I4 },
    /*::[*/
    9: { n: "HiddenCount", t: VT_I4 },
    /*::[*/
    10: { n: "MultimediaClipCount", t: VT_I4 },
    /*::[*/
    11: { n: "ScaleCrop", t: VT_BOOL },
    /*::[*/
    12: {
      n: "HeadingPairs",
      t: VT_VECTOR_VARIANT
      /* VT_VECTOR | VT_VARIANT */
    },
    /*::[*/
    13: {
      n: "TitlesOfParts",
      t: VT_VECTOR_LPSTR
      /* VT_VECTOR | VT_LPSTR */
    },
    /*::[*/
    14: { n: "Manager", t: VT_STRING },
    /*::[*/
    15: { n: "Company", t: VT_STRING },
    /*::[*/
    16: { n: "LinksUpToDate", t: VT_BOOL },
    /*::[*/
    17: { n: "CharacterCount", t: VT_I4 },
    /*::[*/
    19: { n: "SharedDoc", t: VT_BOOL },
    /*::[*/
    22: { n: "HyperlinksChanged", t: VT_BOOL },
    /*::[*/
    23: { n: "AppVersion", t: VT_I4, p: "version" },
    /*::[*/
    24: { n: "DigSig", t: VT_BLOB },
    /*::[*/
    26: { n: "ContentType", t: VT_STRING },
    /*::[*/
    27: { n: "ContentStatus", t: VT_STRING },
    /*::[*/
    28: { n: "Language", t: VT_STRING },
    /*::[*/
    29: { n: "Version", t: VT_STRING },
    /*::[*/
    255: {},
    /* [MS-OLEPS] 2.18 */
    /*::[*/
    2147483648: { n: "Locale", t: VT_UI4 },
    /*::[*/
    2147483651: { n: "Behavior", t: VT_UI4 },
    /*::[*/
    1919054434: {}
  };
  var SummaryPIDSI = {
    /*::[*/
    1: { n: "CodePage", t: VT_I2 },
    /*::[*/
    2: { n: "Title", t: VT_STRING },
    /*::[*/
    3: { n: "Subject", t: VT_STRING },
    /*::[*/
    4: { n: "Author", t: VT_STRING },
    /*::[*/
    5: { n: "Keywords", t: VT_STRING },
    /*::[*/
    6: { n: "Comments", t: VT_STRING },
    /*::[*/
    7: { n: "Template", t: VT_STRING },
    /*::[*/
    8: { n: "LastAuthor", t: VT_STRING },
    /*::[*/
    9: { n: "RevNumber", t: VT_STRING },
    /*::[*/
    10: { n: "EditTime", t: VT_FILETIME },
    /*::[*/
    11: { n: "LastPrinted", t: VT_FILETIME },
    /*::[*/
    12: { n: "CreatedDate", t: VT_FILETIME },
    /*::[*/
    13: { n: "ModifiedDate", t: VT_FILETIME },
    /*::[*/
    14: { n: "PageCount", t: VT_I4 },
    /*::[*/
    15: { n: "WordCount", t: VT_I4 },
    /*::[*/
    16: { n: "CharCount", t: VT_I4 },
    /*::[*/
    17: { n: "Thumbnail", t: VT_CF },
    /*::[*/
    18: { n: "Application", t: VT_STRING },
    /*::[*/
    19: { n: "DocSecurity", t: VT_I4 },
    /*::[*/
    255: {},
    /* [MS-OLEPS] 2.18 */
    /*::[*/
    2147483648: { n: "Locale", t: VT_UI4 },
    /*::[*/
    2147483651: { n: "Behavior", t: VT_UI4 },
    /*::[*/
    1919054434: {}
  };
  function rgbify(arr) {
    return arr.map(function(x2) {
      return [x2 >> 16 & 255, x2 >> 8 & 255, x2 & 255];
    });
  }
  var _XLSIcv = /* @__PURE__ */ rgbify([
    /* Color Constants */
    0,
    16777215,
    16711680,
    65280,
    255,
    16776960,
    16711935,
    65535,
    /* Overridable Defaults */
    0,
    16777215,
    16711680,
    65280,
    255,
    16776960,
    16711935,
    65535,
    8388608,
    32768,
    128,
    8421376,
    8388736,
    32896,
    12632256,
    8421504,
    10066431,
    10040166,
    16777164,
    13434879,
    6684774,
    16744576,
    26316,
    13421823,
    128,
    16711935,
    16776960,
    65535,
    8388736,
    8388608,
    32896,
    255,
    52479,
    13434879,
    13434828,
    16777113,
    10079487,
    16751052,
    13408767,
    16764057,
    3368703,
    3394764,
    10079232,
    16763904,
    16750848,
    16737792,
    6710937,
    9868950,
    13158,
    3381606,
    13056,
    3355392,
    10040064,
    10040166,
    3355545,
    3355443,
    /* Other entries to appease BIFF8/12 */
    16777215,
    /* 0x40 icvForeground ?? */
    0,
    /* 0x41 icvBackground ?? */
    0,
    /* 0x42 icvFrame ?? */
    0,
    /* 0x43 icv3D ?? */
    0,
    /* 0x44 icv3DText ?? */
    0,
    /* 0x45 icv3DHilite ?? */
    0,
    /* 0x46 icv3DShadow ?? */
    0,
    /* 0x47 icvHilite ?? */
    0,
    /* 0x48 icvCtlText ?? */
    0,
    /* 0x49 icvCtlScrl ?? */
    0,
    /* 0x4A icvCtlInv ?? */
    0,
    /* 0x4B icvCtlBody ?? */
    0,
    /* 0x4C icvCtlFrame ?? */
    0,
    /* 0x4D icvCtlFore ?? */
    0,
    /* 0x4E icvCtlBack ?? */
    0,
    /* 0x4F icvCtlNeutral */
    0,
    /* 0x50 icvInfoBk ?? */
    0
    /* 0x51 icvInfoText ?? */
  ]);
  var XLSIcv = /* @__PURE__ */ dup(_XLSIcv);
  var BErr = {
    /*::[*/
    0: "#NULL!",
    /*::[*/
    7: "#DIV/0!",
    /*::[*/
    15: "#VALUE!",
    /*::[*/
    23: "#REF!",
    /*::[*/
    29: "#NAME?",
    /*::[*/
    36: "#NUM!",
    /*::[*/
    42: "#N/A",
    /*::[*/
    43: "#GETTING_DATA",
    /*::[*/
    255: "#WTF?"
  };
  var ct2type = {
    /* Workbook */
    "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml": "workbooks",
    "application/vnd.ms-excel.sheet.macroEnabled.main+xml": "workbooks",
    "application/vnd.ms-excel.sheet.binary.macroEnabled.main": "workbooks",
    "application/vnd.ms-excel.addin.macroEnabled.main+xml": "workbooks",
    "application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml": "workbooks",
    /* Worksheet */
    "application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml": "sheets",
    "application/vnd.ms-excel.worksheet": "sheets",
    "application/vnd.ms-excel.binIndexWs": "TODO",
    /* Binary Index */
    /* Chartsheet */
    "application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml": "charts",
    "application/vnd.ms-excel.chartsheet": "charts",
    /* Macrosheet */
    "application/vnd.ms-excel.macrosheet+xml": "macros",
    "application/vnd.ms-excel.macrosheet": "macros",
    "application/vnd.ms-excel.intlmacrosheet": "TODO",
    "application/vnd.ms-excel.binIndexMs": "TODO",
    /* Binary Index */
    /* Dialogsheet */
    "application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml": "dialogs",
    "application/vnd.ms-excel.dialogsheet": "dialogs",
    /* Shared Strings */
    "application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml": "strs",
    "application/vnd.ms-excel.sharedStrings": "strs",
    /* Styles */
    "application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml": "styles",
    "application/vnd.ms-excel.styles": "styles",
    /* File Properties */
    "application/vnd.openxmlformats-package.core-properties+xml": "coreprops",
    "application/vnd.openxmlformats-officedocument.custom-properties+xml": "custprops",
    "application/vnd.openxmlformats-officedocument.extended-properties+xml": "extprops",
    /* Custom Data Properties */
    "application/vnd.openxmlformats-officedocument.customXmlProperties+xml": "TODO",
    "application/vnd.openxmlformats-officedocument.spreadsheetml.customProperty": "TODO",
    /* Comments */
    "application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml": "comments",
    "application/vnd.ms-excel.comments": "comments",
    "application/vnd.ms-excel.threadedcomments+xml": "threadedcomments",
    "application/vnd.ms-excel.person+xml": "people",
    /* Metadata (Stock/Geography and Dynamic Array) */
    "application/vnd.openxmlformats-officedocument.spreadsheetml.sheetMetadata+xml": "metadata",
    "application/vnd.ms-excel.sheetMetadata": "metadata",
    /* PivotTable */
    "application/vnd.ms-excel.pivotTable": "TODO",
    "application/vnd.openxmlformats-officedocument.spreadsheetml.pivotTable+xml": "TODO",
    /* Chart Objects */
    "application/vnd.openxmlformats-officedocument.drawingml.chart+xml": "TODO",
    /* Chart Colors */
    "application/vnd.ms-office.chartcolorstyle+xml": "TODO",
    /* Chart Style */
    "application/vnd.ms-office.chartstyle+xml": "TODO",
    /* Chart Advanced */
    "application/vnd.ms-office.chartex+xml": "TODO",
    /* Calculation Chain */
    "application/vnd.ms-excel.calcChain": "calcchains",
    "application/vnd.openxmlformats-officedocument.spreadsheetml.calcChain+xml": "calcchains",
    /* Printer Settings */
    "application/vnd.openxmlformats-officedocument.spreadsheetml.printerSettings": "TODO",
    /* ActiveX */
    "application/vnd.ms-office.activeX": "TODO",
    "application/vnd.ms-office.activeX+xml": "TODO",
    /* Custom Toolbars */
    "application/vnd.ms-excel.attachedToolbars": "TODO",
    /* External Data Connections */
    "application/vnd.ms-excel.connections": "TODO",
    "application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml": "TODO",
    /* External Links */
    "application/vnd.ms-excel.externalLink": "links",
    "application/vnd.openxmlformats-officedocument.spreadsheetml.externalLink+xml": "links",
    /* PivotCache */
    "application/vnd.ms-excel.pivotCacheDefinition": "TODO",
    "application/vnd.ms-excel.pivotCacheRecords": "TODO",
    "application/vnd.openxmlformats-officedocument.spreadsheetml.pivotCacheDefinition+xml": "TODO",
    "application/vnd.openxmlformats-officedocument.spreadsheetml.pivotCacheRecords+xml": "TODO",
    /* Query Table */
    "application/vnd.ms-excel.queryTable": "TODO",
    "application/vnd.openxmlformats-officedocument.spreadsheetml.queryTable+xml": "TODO",
    /* Shared Workbook */
    "application/vnd.ms-excel.userNames": "TODO",
    "application/vnd.ms-excel.revisionHeaders": "TODO",
    "application/vnd.ms-excel.revisionLog": "TODO",
    "application/vnd.openxmlformats-officedocument.spreadsheetml.revisionHeaders+xml": "TODO",
    "application/vnd.openxmlformats-officedocument.spreadsheetml.revisionLog+xml": "TODO",
    "application/vnd.openxmlformats-officedocument.spreadsheetml.userNames+xml": "TODO",
    /* Single Cell Table */
    "application/vnd.ms-excel.tableSingleCells": "TODO",
    "application/vnd.openxmlformats-officedocument.spreadsheetml.tableSingleCells+xml": "TODO",
    /* Slicer */
    "application/vnd.ms-excel.slicer": "TODO",
    "application/vnd.ms-excel.slicerCache": "TODO",
    "application/vnd.ms-excel.slicer+xml": "TODO",
    "application/vnd.ms-excel.slicerCache+xml": "TODO",
    /* Sort Map */
    "application/vnd.ms-excel.wsSortMap": "TODO",
    /* Table */
    "application/vnd.ms-excel.table": "TODO",
    "application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml": "TODO",
    /* Themes */
    "application/vnd.openxmlformats-officedocument.theme+xml": "themes",
    /* Theme Override */
    "application/vnd.openxmlformats-officedocument.themeOverride+xml": "TODO",
    /* Timeline */
    "application/vnd.ms-excel.Timeline+xml": "TODO",
    /* verify */
    "application/vnd.ms-excel.TimelineCache+xml": "TODO",
    /* verify */
    /* VBA */
    "application/vnd.ms-office.vbaProject": "vba",
    "application/vnd.ms-office.vbaProjectSignature": "TODO",
    /* Volatile Dependencies */
    "application/vnd.ms-office.volatileDependencies": "TODO",
    "application/vnd.openxmlformats-officedocument.spreadsheetml.volatileDependencies+xml": "TODO",
    /* Control Properties */
    "application/vnd.ms-excel.controlproperties+xml": "TODO",
    /* Data Model */
    "application/vnd.openxmlformats-officedocument.model+data": "TODO",
    /* Survey */
    "application/vnd.ms-excel.Survey+xml": "TODO",
    /* Drawing */
    "application/vnd.openxmlformats-officedocument.drawing+xml": "drawings",
    "application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml": "TODO",
    "application/vnd.openxmlformats-officedocument.drawingml.diagramColors+xml": "TODO",
    "application/vnd.openxmlformats-officedocument.drawingml.diagramData+xml": "TODO",
    "application/vnd.openxmlformats-officedocument.drawingml.diagramLayout+xml": "TODO",
    "application/vnd.openxmlformats-officedocument.drawingml.diagramStyle+xml": "TODO",
    /* VML */
    "application/vnd.openxmlformats-officedocument.vmlDrawing": "TODO",
    "application/vnd.openxmlformats-package.relationships+xml": "rels",
    "application/vnd.openxmlformats-officedocument.oleObject": "TODO",
    /* Image */
    "image/png": "TODO",
    "sheet": "js"
  };
  var CT_LIST = {
    workbooks: {
      xlsx: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml",
      xlsm: "application/vnd.ms-excel.sheet.macroEnabled.main+xml",
      xlsb: "application/vnd.ms-excel.sheet.binary.macroEnabled.main",
      xlam: "application/vnd.ms-excel.addin.macroEnabled.main+xml",
      xltx: "application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml"
    },
    strs: {
      /* Shared Strings */
      xlsx: "application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml",
      xlsb: "application/vnd.ms-excel.sharedStrings"
    },
    comments: {
      /* Comments */
      xlsx: "application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml",
      xlsb: "application/vnd.ms-excel.comments"
    },
    sheets: {
      /* Worksheet */
      xlsx: "application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml",
      xlsb: "application/vnd.ms-excel.worksheet"
    },
    charts: {
      /* Chartsheet */
      xlsx: "application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml",
      xlsb: "application/vnd.ms-excel.chartsheet"
    },
    dialogs: {
      /* Dialogsheet */
      xlsx: "application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml",
      xlsb: "application/vnd.ms-excel.dialogsheet"
    },
    macros: {
      /* Macrosheet (Excel 4.0 Macros) */
      xlsx: "application/vnd.ms-excel.macrosheet+xml",
      xlsb: "application/vnd.ms-excel.macrosheet"
    },
    metadata: {
      /* Metadata (Stock/Geography and Dynamic Array) */
      xlsx: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheetMetadata+xml",
      xlsb: "application/vnd.ms-excel.sheetMetadata"
    },
    styles: {
      /* Styles */
      xlsx: "application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml",
      xlsb: "application/vnd.ms-excel.styles"
    }
  };
  function new_ct() {
    return {
      workbooks: [],
      sheets: [],
      charts: [],
      dialogs: [],
      macros: [],
      rels: [],
      strs: [],
      comments: [],
      threadedcomments: [],
      links: [],
      coreprops: [],
      extprops: [],
      custprops: [],
      themes: [],
      styles: [],
      calcchains: [],
      vba: [],
      drawings: [],
      metadata: [],
      people: [],
      TODO: [],
      xmlns: ""
    };
  }
  function write_ct(ct, opts) {
    var type2ct = evert_arr(ct2type);
    var o = [], v2;
    o[o.length] = XML_HEADER;
    o[o.length] = writextag("Types", null, {
      "xmlns": XMLNS.CT,
      "xmlns:xsd": XMLNS.xsd,
      "xmlns:xsi": XMLNS.xsi
    });
    o = o.concat([
      ["xml", "application/xml"],
      ["bin", "application/vnd.ms-excel.sheet.binary.macroEnabled.main"],
      ["vml", "application/vnd.openxmlformats-officedocument.vmlDrawing"],
      ["data", "application/vnd.openxmlformats-officedocument.model+data"],
      /* from test files */
      ["bmp", "image/bmp"],
      ["png", "image/png"],
      ["gif", "image/gif"],
      ["emf", "image/x-emf"],
      ["wmf", "image/x-wmf"],
      ["jpg", "image/jpeg"],
      ["jpeg", "image/jpeg"],
      ["tif", "image/tiff"],
      ["tiff", "image/tiff"],
      ["pdf", "application/pdf"],
      ["rels", "application/vnd.openxmlformats-package.relationships+xml"]
    ].map(function(x2) {
      return writextag("Default", null, { "Extension": x2[0], "ContentType": x2[1] });
    }));
    var f1 = function(w2) {
      if (ct[w2] && ct[w2].length > 0) {
        v2 = ct[w2][0];
        o[o.length] = writextag("Override", null, {
          "PartName": (v2[0] == "/" ? "" : "/") + v2,
          "ContentType": CT_LIST[w2][opts.bookType] || CT_LIST[w2]["xlsx"]
        });
      }
    };
    var f2 = function(w2) {
      (ct[w2] || []).forEach(function(v3) {
        o[o.length] = writextag("Override", null, {
          "PartName": (v3[0] == "/" ? "" : "/") + v3,
          "ContentType": CT_LIST[w2][opts.bookType] || CT_LIST[w2]["xlsx"]
        });
      });
    };
    var f3 = function(t2) {
      (ct[t2] || []).forEach(function(v3) {
        o[o.length] = writextag("Override", null, {
          "PartName": (v3[0] == "/" ? "" : "/") + v3,
          "ContentType": type2ct[t2][0]
        });
      });
    };
    f1("workbooks");
    f2("sheets");
    f2("charts");
    f3("themes");
    ["strs", "styles"].forEach(f1);
    ["coreprops", "extprops", "custprops"].forEach(f3);
    f3("vba");
    f3("comments");
    f3("threadedcomments");
    f3("drawings");
    f2("metadata");
    f3("people");
    if (o.length > 2) {
      o[o.length] = "</Types>";
      o[1] = o[1].replace("/>", ">");
    }
    return o.join("");
  }
  var RELS = {
    WB: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument",
    SHEET: "http://sheetjs.openxmlformats.org/officeDocument/2006/relationships/officeDocument",
    HLINK: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink",
    VML: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/vmlDrawing",
    XPATH: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/externalLinkPath",
    XMISS: "http://schemas.microsoft.com/office/2006/relationships/xlExternalLinkPath/xlPathMissing",
    XLINK: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/externalLink",
    CXML: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXml",
    CXMLP: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXmlProps",
    CMNT: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments",
    CORE_PROPS: "http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties",
    EXT_PROPS: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties",
    CUST_PROPS: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/custom-properties",
    SST: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings",
    STY: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles",
    THEME: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme",
    CHART: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/chart",
    CHARTEX: "http://schemas.microsoft.com/office/2014/relationships/chartEx",
    CS: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/chartsheet",
    WS: [
      "http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet",
      "http://purl.oclc.org/ooxml/officeDocument/relationships/worksheet"
    ],
    DS: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/dialogsheet",
    MS: "http://schemas.microsoft.com/office/2006/relationships/xlMacrosheet",
    IMG: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",
    DRAW: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/drawing",
    XLMETA: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/sheetMetadata",
    TCMNT: "http://schemas.microsoft.com/office/2017/10/relationships/threadedComment",
    PEOPLE: "http://schemas.microsoft.com/office/2017/10/relationships/person",
    VBA: "http://schemas.microsoft.com/office/2006/relationships/vbaProject"
  };
  function get_rels_path(file) {
    var n2 = file.lastIndexOf("/");
    return file.slice(0, n2 + 1) + "_rels/" + file.slice(n2 + 1) + ".rels";
  }
  function write_rels(rels) {
    var o = [XML_HEADER, writextag("Relationships", null, {
      //'xmlns:ns0': XMLNS.RELS,
      "xmlns": XMLNS.RELS
    })];
    keys2(rels["!id"]).forEach(function(rid) {
      o[o.length] = writextag("Relationship", null, rels["!id"][rid]);
    });
    if (o.length > 2) {
      o[o.length] = "</Relationships>";
      o[1] = o[1].replace("/>", ">");
    }
    return o.join("");
  }
  function add_rels(rels, rId, f2, type2, relobj, targetmode) {
    if (!relobj)
      relobj = {};
    if (!rels["!id"])
      rels["!id"] = {};
    if (!rels["!idx"])
      rels["!idx"] = 1;
    if (rId < 0)
      for (rId = rels["!idx"]; rels["!id"]["rId" + rId]; ++rId) {
      }
    rels["!idx"] = rId + 1;
    relobj.Id = "rId" + rId;
    relobj.Type = type2;
    relobj.Target = f2;
    if (targetmode)
      relobj.TargetMode = targetmode;
    else if ([RELS.HLINK, RELS.XPATH, RELS.XMISS].indexOf(relobj.Type) > -1)
      relobj.TargetMode = "External";
    if (rels["!id"][relobj.Id])
      throw new Error("Cannot rewrite rId " + rId);
    rels["!id"][relobj.Id] = relobj;
    rels[("/" + relobj.Target).replace("//", "/")] = relobj;
    return rId;
  }
  function write_manifest(manifest) {
    var o = [XML_HEADER];
    o.push('<manifest:manifest xmlns:manifest="urn:oasis:names:tc:opendocument:xmlns:manifest:1.0" manifest:version="1.2">\n');
    o.push('  <manifest:file-entry manifest:full-path="/" manifest:version="1.2" manifest:media-type="application/vnd.oasis.opendocument.spreadsheet"/>\n');
    for (var i = 0; i < manifest.length; ++i)
      o.push('  <manifest:file-entry manifest:full-path="' + manifest[i][0] + '" manifest:media-type="' + manifest[i][1] + '"/>\n');
    o.push("</manifest:manifest>");
    return o.join("");
  }
  function write_rdf_type(file, res, tag) {
    return [
      '  <rdf:Description rdf:about="' + file + '">\n',
      '    <rdf:type rdf:resource="http://docs.oasis-open.org/ns/office/1.2/meta/' + (tag || "odf") + "#" + res + '"/>\n',
      "  </rdf:Description>\n"
    ].join("");
  }
  function write_rdf_has(base, file) {
    return [
      '  <rdf:Description rdf:about="' + base + '">\n',
      '    <ns0:hasPart xmlns:ns0="http://docs.oasis-open.org/ns/office/1.2/meta/pkg#" rdf:resource="' + file + '"/>\n',
      "  </rdf:Description>\n"
    ].join("");
  }
  function write_rdf(rdf) {
    var o = [XML_HEADER];
    o.push('<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">\n');
    for (var i = 0; i != rdf.length; ++i) {
      o.push(write_rdf_type(rdf[i][0], rdf[i][1]));
      o.push(write_rdf_has("", rdf[i][0]));
    }
    o.push(write_rdf_type("", "Document", "pkg"));
    o.push("</rdf:RDF>");
    return o.join("");
  }
  function write_meta_ods() {
    return '<office:document-meta xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:xlink="http://www.w3.org/1999/xlink" office:version="1.2"><office:meta><meta:generator>SheetJS ' + XLSX.version + "</meta:generator></office:meta></office:document-meta>";
  }
  var CORE_PROPS = [
    ["cp:category", "Category"],
    ["cp:contentStatus", "ContentStatus"],
    ["cp:keywords", "Keywords"],
    ["cp:lastModifiedBy", "LastAuthor"],
    ["cp:lastPrinted", "LastPrinted"],
    ["cp:revision", "RevNumber"],
    ["cp:version", "Version"],
    ["dc:creator", "Author"],
    ["dc:description", "Comments"],
    ["dc:identifier", "Identifier"],
    ["dc:language", "Language"],
    ["dc:subject", "Subject"],
    ["dc:title", "Title"],
    ["dcterms:created", "CreatedDate", "date"],
    ["dcterms:modified", "ModifiedDate", "date"]
  ];
  function cp_doit(f2, g2, h2, o, p2) {
    if (p2[f2] != null || g2 == null || g2 === "")
      return;
    p2[f2] = g2;
    g2 = escapexml(g2);
    o[o.length] = h2 ? writextag(f2, g2, h2) : writetag(f2, g2);
  }
  function write_core_props(cp, _opts) {
    var opts = _opts || {};
    var o = [XML_HEADER, writextag("cp:coreProperties", null, {
      //'xmlns': XMLNS.CORE_PROPS,
      "xmlns:cp": XMLNS.CORE_PROPS,
      "xmlns:dc": XMLNS.dc,
      "xmlns:dcterms": XMLNS.dcterms,
      "xmlns:dcmitype": XMLNS.dcmitype,
      "xmlns:xsi": XMLNS.xsi
    })], p2 = {};
    if (!cp && !opts.Props)
      return o.join("");
    if (cp) {
      if (cp.CreatedDate != null)
        cp_doit("dcterms:created", typeof cp.CreatedDate === "string" ? cp.CreatedDate : write_w3cdtf(cp.CreatedDate, opts.WTF), { "xsi:type": "dcterms:W3CDTF" }, o, p2);
      if (cp.ModifiedDate != null)
        cp_doit("dcterms:modified", typeof cp.ModifiedDate === "string" ? cp.ModifiedDate : write_w3cdtf(cp.ModifiedDate, opts.WTF), { "xsi:type": "dcterms:W3CDTF" }, o, p2);
    }
    for (var i = 0; i != CORE_PROPS.length; ++i) {
      var f2 = CORE_PROPS[i];
      var v2 = opts.Props && opts.Props[f2[1]] != null ? opts.Props[f2[1]] : cp ? cp[f2[1]] : null;
      if (v2 === true)
        v2 = "1";
      else if (v2 === false)
        v2 = "0";
      else if (typeof v2 == "number")
        v2 = String(v2);
      if (v2 != null)
        cp_doit(f2[0], v2, null, o, p2);
    }
    if (o.length > 2) {
      o[o.length] = "</cp:coreProperties>";
      o[1] = o[1].replace("/>", ">");
    }
    return o.join("");
  }
  var EXT_PROPS = [
    ["Application", "Application", "string"],
    ["AppVersion", "AppVersion", "string"],
    ["Company", "Company", "string"],
    ["DocSecurity", "DocSecurity", "string"],
    ["Manager", "Manager", "string"],
    ["HyperlinksChanged", "HyperlinksChanged", "bool"],
    ["SharedDoc", "SharedDoc", "bool"],
    ["LinksUpToDate", "LinksUpToDate", "bool"],
    ["ScaleCrop", "ScaleCrop", "bool"],
    ["HeadingPairs", "HeadingPairs", "raw"],
    ["TitlesOfParts", "TitlesOfParts", "raw"]
  ];
  var PseudoPropsPairs = [
    "Worksheets",
    "SheetNames",
    "NamedRanges",
    "DefinedNames",
    "Chartsheets",
    "ChartNames"
  ];
  function write_ext_props(cp) {
    var o = [], W = writextag;
    if (!cp)
      cp = {};
    cp.Application = "SheetJS";
    o[o.length] = XML_HEADER;
    o[o.length] = writextag("Properties", null, {
      "xmlns": XMLNS.EXT_PROPS,
      "xmlns:vt": XMLNS.vt
    });
    EXT_PROPS.forEach(function(f2) {
      if (cp[f2[1]] === void 0)
        return;
      var v2;
      switch (f2[2]) {
        case "string":
          v2 = escapexml(String(cp[f2[1]]));
          break;
        case "bool":
          v2 = cp[f2[1]] ? "true" : "false";
          break;
      }
      if (v2 !== void 0)
        o[o.length] = W(f2[0], v2);
    });
    o[o.length] = W("HeadingPairs", W("vt:vector", W("vt:variant", "<vt:lpstr>Worksheets</vt:lpstr>") + W("vt:variant", W("vt:i4", String(cp.Worksheets))), { size: 2, baseType: "variant" }));
    o[o.length] = W("TitlesOfParts", W("vt:vector", cp.SheetNames.map(function(s) {
      return "<vt:lpstr>" + escapexml(s) + "</vt:lpstr>";
    }).join(""), { size: cp.Worksheets, baseType: "lpstr" }));
    if (o.length > 2) {
      o[o.length] = "</Properties>";
      o[1] = o[1].replace("/>", ">");
    }
    return o.join("");
  }
  function write_cust_props(cp) {
    var o = [XML_HEADER, writextag("Properties", null, {
      "xmlns": XMLNS.CUST_PROPS,
      "xmlns:vt": XMLNS.vt
    })];
    if (!cp)
      return o.join("");
    var pid = 1;
    keys2(cp).forEach(function custprop(k2) {
      ++pid;
      o[o.length] = writextag("property", write_vt(cp[k2], true), {
        "fmtid": "{D5CDD505-2E9C-101B-9397-08002B2CF9AE}",
        "pid": pid,
        "name": escapexml(k2)
      });
    });
    if (o.length > 2) {
      o[o.length] = "</Properties>";
      o[1] = o[1].replace("/>", ">");
    }
    return o.join("");
  }
  var XLMLDocPropsMap = {
    Title: "Title",
    Subject: "Subject",
    Author: "Author",
    Keywords: "Keywords",
    Comments: "Description",
    LastAuthor: "LastAuthor",
    RevNumber: "Revision",
    Application: "AppName",
    /* TotalTime: 'TotalTime', */
    LastPrinted: "LastPrinted",
    CreatedDate: "Created",
    ModifiedDate: "LastSaved",
    /* Pages */
    /* Words */
    /* Characters */
    Category: "Category",
    /* PresentationFormat */
    Manager: "Manager",
    Company: "Company",
    /* Guid */
    /* HyperlinkBase */
    /* Bytes */
    /* Lines */
    /* Paragraphs */
    /* CharactersWithSpaces */
    AppVersion: "Version",
    ContentStatus: "ContentStatus",
    /* NOTE: missing from schema */
    Identifier: "Identifier",
    /* NOTE: missing from schema */
    Language: "Language"
    /* NOTE: missing from schema */
  };
  function xlml_write_docprops(Props, opts) {
    var o = [];
    keys2(XLMLDocPropsMap).map(function(m2) {
      for (var i = 0; i < CORE_PROPS.length; ++i)
        if (CORE_PROPS[i][1] == m2)
          return CORE_PROPS[i];
      for (i = 0; i < EXT_PROPS.length; ++i)
        if (EXT_PROPS[i][1] == m2)
          return EXT_PROPS[i];
      throw m2;
    }).forEach(function(p2) {
      if (Props[p2[1]] == null)
        return;
      var m2 = opts && opts.Props && opts.Props[p2[1]] != null ? opts.Props[p2[1]] : Props[p2[1]];
      switch (p2[2]) {
        case "date":
          m2 = new Date(m2).toISOString().replace(/\.\d*Z/, "Z");
          break;
      }
      if (typeof m2 == "number")
        m2 = String(m2);
      else if (m2 === true || m2 === false) {
        m2 = m2 ? "1" : "0";
      } else if (m2 instanceof Date)
        m2 = new Date(m2).toISOString().replace(/\.\d*Z/, "");
      o.push(writetag(XLMLDocPropsMap[p2[1]] || p2[1], m2));
    });
    return writextag("DocumentProperties", o.join(""), { xmlns: XLMLNS.o });
  }
  function xlml_write_custprops(Props, Custprops) {
    var BLACKLIST = ["Worksheets", "SheetNames"];
    var T = "CustomDocumentProperties";
    var o = [];
    if (Props)
      keys2(Props).forEach(function(k2) {
        if (!Object.prototype.hasOwnProperty.call(Props, k2))
          return;
        for (var i = 0; i < CORE_PROPS.length; ++i)
          if (k2 == CORE_PROPS[i][1])
            return;
        for (i = 0; i < EXT_PROPS.length; ++i)
          if (k2 == EXT_PROPS[i][1])
            return;
        for (i = 0; i < BLACKLIST.length; ++i)
          if (k2 == BLACKLIST[i])
            return;
        var m2 = Props[k2];
        var t2 = "string";
        if (typeof m2 == "number") {
          t2 = "float";
          m2 = String(m2);
        } else if (m2 === true || m2 === false) {
          t2 = "boolean";
          m2 = m2 ? "1" : "0";
        } else
          m2 = String(m2);
        o.push(writextag(escapexmltag(k2), m2, { "dt:dt": t2 }));
      });
    if (Custprops)
      keys2(Custprops).forEach(function(k2) {
        if (!Object.prototype.hasOwnProperty.call(Custprops, k2))
          return;
        if (Props && Object.prototype.hasOwnProperty.call(Props, k2))
          return;
        var m2 = Custprops[k2];
        var t2 = "string";
        if (typeof m2 == "number") {
          t2 = "float";
          m2 = String(m2);
        } else if (m2 === true || m2 === false) {
          t2 = "boolean";
          m2 = m2 ? "1" : "0";
        } else if (m2 instanceof Date) {
          t2 = "dateTime.tz";
          m2 = m2.toISOString();
        } else
          m2 = String(m2);
        o.push(writextag(escapexmltag(k2), m2, { "dt:dt": t2 }));
      });
    return "<" + T + ' xmlns="' + XLMLNS.o + '">' + o.join("") + "</" + T + ">";
  }
  function write_FILETIME(time) {
    var date = typeof time == "string" ? new Date(Date.parse(time)) : time;
    var t2 = date.getTime() / 1e3 + 11644473600;
    var l2 = t2 % Math.pow(2, 32), h2 = (t2 - l2) / Math.pow(2, 32);
    l2 *= 1e7;
    h2 *= 1e7;
    var w2 = l2 / Math.pow(2, 32) | 0;
    if (w2 > 0) {
      l2 = l2 % Math.pow(2, 32);
      h2 += w2;
    }
    var o = new_buf(8);
    o.write_shift(4, l2);
    o.write_shift(4, h2);
    return o;
  }
  function write_TypedPropertyValue(type2, value) {
    var o = new_buf(4), p2 = new_buf(4);
    o.write_shift(4, type2 == 80 ? 31 : type2);
    switch (type2) {
      case 3:
        p2.write_shift(-4, value);
        break;
      case 5:
        p2 = new_buf(8);
        p2.write_shift(8, value, "f");
        break;
      case 11:
        p2.write_shift(4, value ? 1 : 0);
        break;
      case 64:
        p2 = write_FILETIME(value);
        break;
      case 31:
      case 80:
        p2 = new_buf(4 + 2 * (value.length + 1) + (value.length % 2 ? 0 : 2));
        p2.write_shift(4, value.length + 1);
        p2.write_shift(0, value, "dbcs");
        while (p2.l != p2.length)
          p2.write_shift(1, 0);
        break;
      default:
        throw new Error("TypedPropertyValue unrecognized type " + type2 + " " + value);
    }
    return bconcat([o, p2]);
  }
  var XLSPSSkip = ["CodePage", "Thumbnail", "_PID_LINKBASE", "_PID_HLINKS", "SystemIdentifier", "FMTID"];
  function guess_property_type(val) {
    switch (typeof val) {
      case "boolean":
        return 11;
      case "number":
        return (val | 0) == val ? 3 : 5;
      case "string":
        return 31;
      case "object":
        if (val instanceof Date)
          return 64;
        break;
    }
    return -1;
  }
  function write_PropertySet(entries, RE, PIDSI) {
    var hdr = new_buf(8), piao = [], prop = [];
    var sz = 8, i = 0;
    var pr = new_buf(8), pio = new_buf(8);
    pr.write_shift(4, 2);
    pr.write_shift(4, 1200);
    pio.write_shift(4, 1);
    prop.push(pr);
    piao.push(pio);
    sz += 8 + pr.length;
    if (!RE) {
      pio = new_buf(8);
      pio.write_shift(4, 0);
      piao.unshift(pio);
      var bufs = [new_buf(4)];
      bufs[0].write_shift(4, entries.length);
      for (i = 0; i < entries.length; ++i) {
        var value = entries[i][0];
        pr = new_buf(4 + 4 + 2 * (value.length + 1) + (value.length % 2 ? 0 : 2));
        pr.write_shift(4, i + 2);
        pr.write_shift(4, value.length + 1);
        pr.write_shift(0, value, "dbcs");
        while (pr.l != pr.length)
          pr.write_shift(1, 0);
        bufs.push(pr);
      }
      pr = bconcat(bufs);
      prop.unshift(pr);
      sz += 8 + pr.length;
    }
    for (i = 0; i < entries.length; ++i) {
      if (RE && !RE[entries[i][0]])
        continue;
      if (XLSPSSkip.indexOf(entries[i][0]) > -1 || PseudoPropsPairs.indexOf(entries[i][0]) > -1)
        continue;
      if (entries[i][1] == null)
        continue;
      var val = entries[i][1], idx = 0;
      if (RE) {
        idx = +RE[entries[i][0]];
        var pinfo = PIDSI[idx];
        if (pinfo.p == "version" && typeof val == "string") {
          var arr = val.split(".");
          val = (+arr[0] << 16) + (+arr[1] || 0);
        }
        pr = write_TypedPropertyValue(pinfo.t, val);
      } else {
        var T = guess_property_type(val);
        if (T == -1) {
          T = 31;
          val = String(val);
        }
        pr = write_TypedPropertyValue(T, val);
      }
      prop.push(pr);
      pio = new_buf(8);
      pio.write_shift(4, !RE ? 2 + i : idx);
      piao.push(pio);
      sz += 8 + pr.length;
    }
    var w2 = 8 * (prop.length + 1);
    for (i = 0; i < prop.length; ++i) {
      piao[i].write_shift(4, w2);
      w2 += prop[i].length;
    }
    hdr.write_shift(4, sz);
    hdr.write_shift(4, prop.length);
    return bconcat([hdr].concat(piao).concat(prop));
  }
  function write_PropertySetStream(entries, clsid, RE, PIDSI, entries2, clsid2) {
    var hdr = new_buf(entries2 ? 68 : 48);
    var bufs = [hdr];
    hdr.write_shift(2, 65534);
    hdr.write_shift(2, 0);
    hdr.write_shift(4, 842412599);
    hdr.write_shift(16, CFB.utils.consts.HEADER_CLSID, "hex");
    hdr.write_shift(4, entries2 ? 2 : 1);
    hdr.write_shift(16, clsid, "hex");
    hdr.write_shift(4, entries2 ? 68 : 48);
    var ps0 = write_PropertySet(entries, RE, PIDSI);
    bufs.push(ps0);
    if (entries2) {
      var ps1 = write_PropertySet(entries2, null, null);
      hdr.write_shift(16, clsid2, "hex");
      hdr.write_shift(4, 68 + ps0.length);
      bufs.push(ps1);
    }
    return bconcat(bufs);
  }
  function writezeroes(n2, o) {
    if (!o)
      o = new_buf(n2);
    for (var j = 0; j < n2; ++j)
      o.write_shift(1, 0);
    return o;
  }
  function parsebool(blob, length2) {
    return blob.read_shift(length2) === 1;
  }
  function writebool(v2, o) {
    if (!o)
      o = new_buf(2);
    o.write_shift(2, +!!v2);
    return o;
  }
  function parseuint16(blob) {
    return blob.read_shift(2, "u");
  }
  function writeuint16(v2, o) {
    if (!o)
      o = new_buf(2);
    o.write_shift(2, v2);
    return o;
  }
  function write_Bes(v2, t2, o) {
    if (!o)
      o = new_buf(2);
    o.write_shift(1, t2 == "e" ? +v2 : +!!v2);
    o.write_shift(1, t2 == "e" ? 1 : 0);
    return o;
  }
  function parse_ShortXLUnicodeString(blob, length2, opts) {
    var cch = blob.read_shift(opts && opts.biff >= 12 ? 2 : 1);
    var encoding = "sbcs-cont";
    if (opts && opts.biff >= 8)
      ;
    if (!opts || opts.biff == 8) {
      var fHighByte = blob.read_shift(1);
      if (fHighByte) {
        encoding = "dbcs-cont";
      }
    } else if (opts.biff == 12) {
      encoding = "wstr";
    }
    if (opts.biff >= 2 && opts.biff <= 5)
      encoding = "cpstr";
    var o = cch ? blob.read_shift(cch, encoding) : "";
    return o;
  }
  function write_XLUnicodeRichExtendedString(xlstr) {
    var str = xlstr.t || "";
    var hdr = new_buf(3 + 0);
    hdr.write_shift(2, str.length);
    hdr.write_shift(1, 0 | 1);
    var otext = new_buf(2 * str.length);
    otext.write_shift(2 * str.length, str, "utf16le");
    var out = [hdr, otext];
    return bconcat(out);
  }
  function parse_XLUnicodeStringNoCch(blob, cch, opts) {
    var retval;
    if (opts) {
      if (opts.biff >= 2 && opts.biff <= 5)
        return blob.read_shift(cch, "cpstr");
      if (opts.biff >= 12)
        return blob.read_shift(cch, "dbcs-cont");
    }
    var fHighByte = blob.read_shift(1);
    if (fHighByte === 0) {
      retval = blob.read_shift(cch, "sbcs-cont");
    } else {
      retval = blob.read_shift(cch, "dbcs-cont");
    }
    return retval;
  }
  function parse_XLUnicodeString(blob, length2, opts) {
    var cch = blob.read_shift(opts && opts.biff == 2 ? 1 : 2);
    if (cch === 0) {
      blob.l++;
      return "";
    }
    return parse_XLUnicodeStringNoCch(blob, cch, opts);
  }
  function parse_XLUnicodeString2(blob, length2, opts) {
    if (opts.biff > 5)
      return parse_XLUnicodeString(blob, length2, opts);
    var cch = blob.read_shift(1);
    if (cch === 0) {
      blob.l++;
      return "";
    }
    return blob.read_shift(cch, opts.biff <= 4 || !blob.lens ? "cpstr" : "sbcs-cont");
  }
  function write_XLUnicodeString(str, opts, o) {
    if (!o)
      o = new_buf(3 + 2 * str.length);
    o.write_shift(2, str.length);
    o.write_shift(1, 1);
    o.write_shift(31, str, "utf16le");
    return o;
  }
  function write_HyperlinkString(str, o) {
    if (!o)
      o = new_buf(6 + str.length * 2);
    o.write_shift(4, 1 + str.length);
    for (var i = 0; i < str.length; ++i)
      o.write_shift(2, str.charCodeAt(i));
    o.write_shift(2, 0);
    return o;
  }
  function write_Hyperlink(hl) {
    var out = new_buf(512), i = 0;
    var Target = hl.Target;
    if (Target.slice(0, 7) == "file://")
      Target = Target.slice(7);
    var hashidx = Target.indexOf("#");
    var F = hashidx > -1 ? 31 : 23;
    switch (Target.charAt(0)) {
      case "#":
        F = 28;
        break;
      case ".":
        F &= ~2;
        break;
    }
    out.write_shift(4, 2);
    out.write_shift(4, F);
    var data = [8, 6815827, 6619237, 4849780, 83];
    for (i = 0; i < data.length; ++i)
      out.write_shift(4, data[i]);
    if (F == 28) {
      Target = Target.slice(1);
      write_HyperlinkString(Target, out);
    } else if (F & 2) {
      data = "e0 c9 ea 79 f9 ba ce 11 8c 82 00 aa 00 4b a9 0b".split(" ");
      for (i = 0; i < data.length; ++i)
        out.write_shift(1, parseInt(data[i], 16));
      var Pretarget = hashidx > -1 ? Target.slice(0, hashidx) : Target;
      out.write_shift(4, 2 * (Pretarget.length + 1));
      for (i = 0; i < Pretarget.length; ++i)
        out.write_shift(2, Pretarget.charCodeAt(i));
      out.write_shift(2, 0);
      if (F & 8)
        write_HyperlinkString(hashidx > -1 ? Target.slice(hashidx + 1) : "", out);
    } else {
      data = "03 03 00 00 00 00 00 00 c0 00 00 00 00 00 00 46".split(" ");
      for (i = 0; i < data.length; ++i)
        out.write_shift(1, parseInt(data[i], 16));
      var P = 0;
      while (Target.slice(P * 3, P * 3 + 3) == "../" || Target.slice(P * 3, P * 3 + 3) == "..\\")
        ++P;
      out.write_shift(2, P);
      out.write_shift(4, Target.length - 3 * P + 1);
      for (i = 0; i < Target.length - 3 * P; ++i)
        out.write_shift(1, Target.charCodeAt(i + 3 * P) & 255);
      out.write_shift(1, 0);
      out.write_shift(2, 65535);
      out.write_shift(2, 57005);
      for (i = 0; i < 6; ++i)
        out.write_shift(4, 0);
    }
    return out.slice(0, out.l);
  }
  function write_XLSCell(R, C, ixfe, o) {
    if (!o)
      o = new_buf(6);
    o.write_shift(2, R);
    o.write_shift(2, C);
    o.write_shift(2, ixfe || 0);
    return o;
  }
  function parse_XTI(blob, length2, opts) {
    var w2 = opts.biff > 8 ? 4 : 2;
    var iSupBook = blob.read_shift(w2), itabFirst = blob.read_shift(w2, "i"), itabLast = blob.read_shift(w2, "i");
    return [iSupBook, itabFirst, itabLast];
  }
  function parse_Ref8U(blob) {
    var rwFirst = blob.read_shift(2);
    var rwLast = blob.read_shift(2);
    var colFirst = blob.read_shift(2);
    var colLast = blob.read_shift(2);
    return { s: { c: colFirst, r: rwFirst }, e: { c: colLast, r: rwLast } };
  }
  function write_Ref8U(r2, o) {
    if (!o)
      o = new_buf(8);
    o.write_shift(2, r2.s.r);
    o.write_shift(2, r2.e.r);
    o.write_shift(2, r2.s.c);
    o.write_shift(2, r2.e.c);
    return o;
  }
  function write_BOF(wb, t2, o) {
    var h2 = 1536, w2 = 16;
    switch (o.bookType) {
      case "biff8":
        break;
      case "biff5":
        h2 = 1280;
        w2 = 8;
        break;
      case "biff4":
        h2 = 4;
        w2 = 6;
        break;
      case "biff3":
        h2 = 3;
        w2 = 6;
        break;
      case "biff2":
        h2 = 2;
        w2 = 4;
        break;
      case "xla":
        break;
      default:
        throw new Error("unsupported BIFF version");
    }
    var out = new_buf(w2);
    out.write_shift(2, h2);
    out.write_shift(2, t2);
    if (w2 > 4)
      out.write_shift(2, 29282);
    if (w2 > 6)
      out.write_shift(2, 1997);
    if (w2 > 8) {
      out.write_shift(2, 49161);
      out.write_shift(2, 1);
      out.write_shift(2, 1798);
      out.write_shift(2, 0);
    }
    return out;
  }
  function write_WriteAccess(s, opts) {
    var b8 = !opts || opts.biff == 8;
    var o = new_buf(b8 ? 112 : 54);
    o.write_shift(opts.biff == 8 ? 2 : 1, 7);
    if (b8)
      o.write_shift(1, 0);
    o.write_shift(4, 859007059);
    o.write_shift(4, 5458548 | (b8 ? 0 : 536870912));
    while (o.l < o.length)
      o.write_shift(1, b8 ? 0 : 32);
    return o;
  }
  function write_BoundSheet8(data, opts) {
    var w2 = !opts || opts.biff >= 8 ? 2 : 1;
    var o = new_buf(8 + w2 * data.name.length);
    o.write_shift(4, data.pos);
    o.write_shift(1, data.hs || 0);
    o.write_shift(1, data.dt);
    o.write_shift(1, data.name.length);
    if (opts.biff >= 8)
      o.write_shift(1, 1);
    o.write_shift(w2 * data.name.length, data.name, opts.biff < 8 ? "sbcs" : "utf16le");
    var out = o.slice(0, o.l);
    out.l = o.l;
    return out;
  }
  function write_SST(sst, opts) {
    var header = new_buf(8);
    header.write_shift(4, sst.Count);
    header.write_shift(4, sst.Unique);
    var strs = [];
    for (var j = 0; j < sst.length; ++j)
      strs[j] = write_XLUnicodeRichExtendedString(sst[j]);
    var o = bconcat([header].concat(strs));
    o.parts = [header.length].concat(strs.map(function(str) {
      return str.length;
    }));
    return o;
  }
  function write_Window1() {
    var o = new_buf(18);
    o.write_shift(2, 0);
    o.write_shift(2, 0);
    o.write_shift(2, 29280);
    o.write_shift(2, 17600);
    o.write_shift(2, 56);
    o.write_shift(2, 0);
    o.write_shift(2, 0);
    o.write_shift(2, 1);
    o.write_shift(2, 500);
    return o;
  }
  function write_Window2(view) {
    var o = new_buf(18), f2 = 1718;
    if (view && view.RTL)
      f2 |= 64;
    o.write_shift(2, f2);
    o.write_shift(4, 0);
    o.write_shift(4, 64);
    o.write_shift(4, 0);
    o.write_shift(4, 0);
    return o;
  }
  function write_Font(data, opts) {
    var name = data.name || "Arial";
    var b5 = opts && opts.biff == 5, w2 = b5 ? 15 + name.length : 16 + 2 * name.length;
    var o = new_buf(w2);
    o.write_shift(2, (data.sz || 12) * 20);
    o.write_shift(4, 0);
    o.write_shift(2, 400);
    o.write_shift(4, 0);
    o.write_shift(2, 0);
    o.write_shift(1, name.length);
    if (!b5)
      o.write_shift(1, 1);
    o.write_shift((b5 ? 1 : 2) * name.length, name, b5 ? "sbcs" : "utf16le");
    return o;
  }
  function write_LabelSst(R, C, v2, os) {
    var o = new_buf(10);
    write_XLSCell(R, C, os, o);
    o.write_shift(4, v2);
    return o;
  }
  function write_Label(R, C, v2, os, opts) {
    var b8 = !opts || opts.biff == 8;
    var o = new_buf(6 + 2 + +b8 + (1 + b8) * v2.length);
    write_XLSCell(R, C, os, o);
    o.write_shift(2, v2.length);
    if (b8)
      o.write_shift(1, 1);
    o.write_shift((1 + b8) * v2.length, v2, b8 ? "utf16le" : "sbcs");
    return o;
  }
  function write_Format(i, f2, opts, o) {
    var b5 = opts && opts.biff == 5;
    if (!o)
      o = new_buf(b5 ? 3 + f2.length : 5 + 2 * f2.length);
    o.write_shift(2, i);
    o.write_shift(b5 ? 1 : 2, f2.length);
    if (!b5)
      o.write_shift(1, 1);
    o.write_shift((b5 ? 1 : 2) * f2.length, f2, b5 ? "sbcs" : "utf16le");
    var out = o.length > o.l ? o.slice(0, o.l) : o;
    if (out.l == null)
      out.l = out.length;
    return out;
  }
  function write_Dimensions(range, opts) {
    var w2 = opts.biff == 8 || !opts.biff ? 4 : 2;
    var o = new_buf(2 * w2 + 6);
    o.write_shift(w2, range.s.r);
    o.write_shift(w2, range.e.r + 1);
    o.write_shift(2, range.s.c);
    o.write_shift(2, range.e.c + 1);
    o.write_shift(2, 0);
    return o;
  }
  function write_XF(data, ixfeP, opts, o) {
    var b5 = opts && opts.biff == 5;
    if (!o)
      o = new_buf(b5 ? 16 : 20);
    o.write_shift(2, 0);
    if (data.style) {
      o.write_shift(2, data.numFmtId || 0);
      o.write_shift(2, 65524);
    } else {
      o.write_shift(2, data.numFmtId || 0);
      o.write_shift(2, ixfeP << 4);
    }
    var f2 = 0;
    if (data.numFmtId > 0 && b5)
      f2 |= 1024;
    o.write_shift(4, f2);
    o.write_shift(4, 0);
    if (!b5)
      o.write_shift(4, 0);
    o.write_shift(2, 0);
    return o;
  }
  function write_Guts(guts) {
    var o = new_buf(8);
    o.write_shift(4, 0);
    o.write_shift(2, guts[0] ? guts[0] + 1 : 0);
    o.write_shift(2, guts[1] ? guts[1] + 1 : 0);
    return o;
  }
  function write_BoolErr(R, C, v2, os, opts, t2) {
    var o = new_buf(8);
    write_XLSCell(R, C, os, o);
    write_Bes(v2, t2, o);
    return o;
  }
  function write_Number(R, C, v2, os) {
    var o = new_buf(14);
    write_XLSCell(R, C, os, o);
    write_Xnum(v2, o);
    return o;
  }
  function parse_ExternSheet(blob, length2, opts) {
    if (opts.biff < 8)
      return parse_BIFF5ExternSheet(blob, length2, opts);
    var o = [], target = blob.l + length2, len = blob.read_shift(opts.biff > 8 ? 4 : 2);
    while (len-- !== 0)
      o.push(parse_XTI(blob, opts.biff > 8 ? 12 : 6, opts));
    if (blob.l != target)
      throw new Error("Bad ExternSheet: " + blob.l + " != " + target);
    return o;
  }
  function parse_BIFF5ExternSheet(blob, length2, opts) {
    if (blob[blob.l + 1] == 3)
      blob[blob.l]++;
    var o = parse_ShortXLUnicodeString(blob, length2, opts);
    return o.charCodeAt(0) == 3 ? o.slice(1) : o;
  }
  function write_MergeCells(merges) {
    var o = new_buf(2 + merges.length * 8);
    o.write_shift(2, merges.length);
    for (var i = 0; i < merges.length; ++i)
      write_Ref8U(merges[i], o);
    return o;
  }
  function write_HLink(hl) {
    var O = new_buf(24);
    var ref = decode_cell(hl[0]);
    O.write_shift(2, ref.r);
    O.write_shift(2, ref.r);
    O.write_shift(2, ref.c);
    O.write_shift(2, ref.c);
    var clsid = "d0 c9 ea 79 f9 ba ce 11 8c 82 00 aa 00 4b a9 0b".split(" ");
    for (var i = 0; i < 16; ++i)
      O.write_shift(1, parseInt(clsid[i], 16));
    return bconcat([O, write_Hyperlink(hl[1])]);
  }
  function write_HLinkTooltip(hl) {
    var TT = hl[1].Tooltip;
    var O = new_buf(10 + 2 * (TT.length + 1));
    O.write_shift(2, 2048);
    var ref = decode_cell(hl[0]);
    O.write_shift(2, ref.r);
    O.write_shift(2, ref.r);
    O.write_shift(2, ref.c);
    O.write_shift(2, ref.c);
    for (var i = 0; i < TT.length; ++i)
      O.write_shift(2, TT.charCodeAt(i));
    O.write_shift(2, 0);
    return O;
  }
  function write_Country(o) {
    if (!o)
      o = new_buf(4);
    o.write_shift(2, 1);
    o.write_shift(2, 1);
    return o;
  }
  function parse_ColInfo(blob, length2, opts) {
    if (!opts.cellStyles)
      return parsenoop(blob, length2);
    var w2 = opts && opts.biff >= 12 ? 4 : 2;
    var colFirst = blob.read_shift(w2);
    var colLast = blob.read_shift(w2);
    var coldx = blob.read_shift(w2);
    var ixfe = blob.read_shift(w2);
    var flags = blob.read_shift(2);
    if (w2 == 2)
      blob.l += 2;
    var o = { s: colFirst, e: colLast, w: coldx, ixfe, flags };
    if (opts.biff >= 5 || !opts.biff)
      o.level = flags >> 8 & 7;
    return o;
  }
  function write_ColInfo(col, idx) {
    var o = new_buf(12);
    o.write_shift(2, idx);
    o.write_shift(2, idx);
    o.write_shift(2, col.width * 256);
    o.write_shift(2, 0);
    var f2 = 0;
    if (col.hidden)
      f2 |= 1;
    o.write_shift(1, f2);
    f2 = col.level || 0;
    o.write_shift(1, f2);
    o.write_shift(2, 0);
    return o;
  }
  function write_RRTabId(n2) {
    var out = new_buf(2 * n2);
    for (var i = 0; i < n2; ++i)
      out.write_shift(2, i + 1);
    return out;
  }
  function write_BIFF2NUM(r2, c2, val) {
    var out = new_buf(15);
    write_BIFF2Cell(out, r2, c2);
    out.write_shift(8, val, "f");
    return out;
  }
  function write_BIFF2INT(r2, c2, val) {
    var out = new_buf(9);
    write_BIFF2Cell(out, r2, c2);
    out.write_shift(2, val);
    return out;
  }
  var DBF = /* @__PURE__ */ function() {
    var dbf_codepage_map = {
      /* Code Pages Supported by Visual FoxPro */
      /*::[*/
      1: 437,
      /*::[*/
      2: 850,
      /*::[*/
      3: 1252,
      /*::[*/
      4: 1e4,
      /*::[*/
      100: 852,
      /*::[*/
      101: 866,
      /*::[*/
      102: 865,
      /*::[*/
      103: 861,
      /*::[*/
      104: 895,
      /*::[*/
      105: 620,
      /*::[*/
      106: 737,
      /*::[*/
      107: 857,
      /*::[*/
      120: 950,
      /*::[*/
      121: 949,
      /*::[*/
      122: 936,
      /*::[*/
      123: 932,
      /*::[*/
      124: 874,
      /*::[*/
      125: 1255,
      /*::[*/
      126: 1256,
      /*::[*/
      150: 10007,
      /*::[*/
      151: 10029,
      /*::[*/
      152: 10006,
      /*::[*/
      200: 1250,
      /*::[*/
      201: 1251,
      /*::[*/
      202: 1254,
      /*::[*/
      203: 1253,
      /* shapefile DBF extension */
      /*::[*/
      0: 20127,
      /*::[*/
      8: 865,
      /*::[*/
      9: 437,
      /*::[*/
      10: 850,
      /*::[*/
      11: 437,
      /*::[*/
      13: 437,
      /*::[*/
      14: 850,
      /*::[*/
      15: 437,
      /*::[*/
      16: 850,
      /*::[*/
      17: 437,
      /*::[*/
      18: 850,
      /*::[*/
      19: 932,
      /*::[*/
      20: 850,
      /*::[*/
      21: 437,
      /*::[*/
      22: 850,
      /*::[*/
      23: 865,
      /*::[*/
      24: 437,
      /*::[*/
      25: 437,
      /*::[*/
      26: 850,
      /*::[*/
      27: 437,
      /*::[*/
      28: 863,
      /*::[*/
      29: 850,
      /*::[*/
      31: 852,
      /*::[*/
      34: 852,
      /*::[*/
      35: 852,
      /*::[*/
      36: 860,
      /*::[*/
      37: 850,
      /*::[*/
      38: 866,
      /*::[*/
      55: 850,
      /*::[*/
      64: 852,
      /*::[*/
      77: 936,
      /*::[*/
      78: 949,
      /*::[*/
      79: 950,
      /*::[*/
      80: 874,
      /*::[*/
      87: 1252,
      /*::[*/
      88: 1252,
      /*::[*/
      89: 1252,
      /*::[*/
      108: 863,
      /*::[*/
      134: 737,
      /*::[*/
      135: 852,
      /*::[*/
      136: 857,
      /*::[*/
      204: 1257,
      /*::[*/
      255: 16969
    };
    var dbf_reverse_map = evert({
      /*::[*/
      1: 437,
      /*::[*/
      2: 850,
      /*::[*/
      3: 1252,
      /*::[*/
      4: 1e4,
      /*::[*/
      100: 852,
      /*::[*/
      101: 866,
      /*::[*/
      102: 865,
      /*::[*/
      103: 861,
      /*::[*/
      104: 895,
      /*::[*/
      105: 620,
      /*::[*/
      106: 737,
      /*::[*/
      107: 857,
      /*::[*/
      120: 950,
      /*::[*/
      121: 949,
      /*::[*/
      122: 936,
      /*::[*/
      123: 932,
      /*::[*/
      124: 874,
      /*::[*/
      125: 1255,
      /*::[*/
      126: 1256,
      /*::[*/
      150: 10007,
      /*::[*/
      151: 10029,
      /*::[*/
      152: 10006,
      /*::[*/
      200: 1250,
      /*::[*/
      201: 1251,
      /*::[*/
      202: 1254,
      /*::[*/
      203: 1253,
      /*::[*/
      0: 20127
    });
    function dbf_to_aoa(buf, opts) {
      var out = [];
      var d2 = new_raw_buf(1);
      switch (opts.type) {
        case "base64":
          d2 = s2a(Base64_decode(buf));
          break;
        case "binary":
          d2 = s2a(buf);
          break;
        case "buffer":
        case "array":
          d2 = buf;
          break;
      }
      prep_blob(d2, 0);
      var ft = d2.read_shift(1);
      var memo = !!(ft & 136);
      var vfp = false, l7 = false;
      switch (ft) {
        case 2:
          break;
        case 3:
          break;
        case 48:
          vfp = true;
          memo = true;
          break;
        case 49:
          vfp = true;
          memo = true;
          break;
        case 131:
          break;
        case 139:
          break;
        case 140:
          l7 = true;
          break;
        case 245:
          break;
        default:
          throw new Error("DBF Unsupported Version: " + ft.toString(16));
      }
      var nrow = 0, fpos = 521;
      if (ft == 2)
        nrow = d2.read_shift(2);
      d2.l += 3;
      if (ft != 2)
        nrow = d2.read_shift(4);
      if (nrow > 1048576)
        nrow = 1e6;
      if (ft != 2)
        fpos = d2.read_shift(2);
      var rlen = d2.read_shift(2);
      var current_cp = opts.codepage || 1252;
      if (ft != 2) {
        d2.l += 16;
        d2.read_shift(1);
        if (d2[d2.l] !== 0)
          current_cp = dbf_codepage_map[d2[d2.l]];
        d2.l += 1;
        d2.l += 2;
      }
      if (l7)
        d2.l += 36;
      var fields = [], field = {};
      var hend = Math.min(d2.length, ft == 2 ? 521 : fpos - 10 - (vfp ? 264 : 0));
      var ww = l7 ? 32 : 11;
      while (d2.l < hend && d2[d2.l] != 13) {
        field = {};
        field.name = $cptable.utils.decode(current_cp, d2.slice(d2.l, d2.l + ww)).replace(/[\u0000\r\n].*$/g, "");
        d2.l += ww;
        field.type = String.fromCharCode(d2.read_shift(1));
        if (ft != 2 && !l7)
          field.offset = d2.read_shift(4);
        field.len = d2.read_shift(1);
        if (ft == 2)
          field.offset = d2.read_shift(2);
        field.dec = d2.read_shift(1);
        if (field.name.length)
          fields.push(field);
        if (ft != 2)
          d2.l += l7 ? 13 : 14;
        switch (field.type) {
          case "B":
            if ((!vfp || field.len != 8) && opts.WTF)
              console.log("Skipping " + field.name + ":" + field.type);
            break;
          case "G":
          case "P":
            if (opts.WTF)
              console.log("Skipping " + field.name + ":" + field.type);
            break;
          case "+":
          case "0":
          case "@":
          case "C":
          case "D":
          case "F":
          case "I":
          case "L":
          case "M":
          case "N":
          case "O":
          case "T":
          case "Y":
            break;
          default:
            throw new Error("Unknown Field Type: " + field.type);
        }
      }
      if (d2[d2.l] !== 13)
        d2.l = fpos - 1;
      if (d2.read_shift(1) !== 13)
        throw new Error("DBF Terminator not found " + d2.l + " " + d2[d2.l]);
      d2.l = fpos;
      var R = 0, C = 0;
      out[0] = [];
      for (C = 0; C != fields.length; ++C)
        out[0][C] = fields[C].name;
      while (nrow-- > 0) {
        if (d2[d2.l] === 42) {
          d2.l += rlen;
          continue;
        }
        ++d2.l;
        out[++R] = [];
        C = 0;
        for (C = 0; C != fields.length; ++C) {
          var dd = d2.slice(d2.l, d2.l + fields[C].len);
          d2.l += fields[C].len;
          prep_blob(dd, 0);
          var s = $cptable.utils.decode(current_cp, dd);
          switch (fields[C].type) {
            case "C":
              if (s.trim().length)
                out[R][C] = s.replace(/\s+$/, "");
              break;
            case "D":
              if (s.length === 8)
                out[R][C] = new Date(+s.slice(0, 4), +s.slice(4, 6) - 1, +s.slice(6, 8));
              else
                out[R][C] = s;
              break;
            case "F":
              out[R][C] = parseFloat(s.trim());
              break;
            case "+":
            case "I":
              out[R][C] = l7 ? dd.read_shift(-4, "i") ^ 2147483648 : dd.read_shift(4, "i");
              break;
            case "L":
              switch (s.trim().toUpperCase()) {
                case "Y":
                case "T":
                  out[R][C] = true;
                  break;
                case "N":
                case "F":
                  out[R][C] = false;
                  break;
                case "":
                case "?":
                  break;
                default:
                  throw new Error("DBF Unrecognized L:|" + s + "|");
              }
              break;
            case "M":
              if (!memo)
                throw new Error("DBF Unexpected MEMO for type " + ft.toString(16));
              out[R][C] = "##MEMO##" + (l7 ? parseInt(s.trim(), 10) : dd.read_shift(4));
              break;
            case "N":
              s = s.replace(/\u0000/g, "").trim();
              if (s && s != ".")
                out[R][C] = +s || 0;
              break;
            case "@":
              out[R][C] = new Date(dd.read_shift(-8, "f") - 621356832e5);
              break;
            case "T":
              out[R][C] = new Date((dd.read_shift(4) - 2440588) * 864e5 + dd.read_shift(4));
              break;
            case "Y":
              out[R][C] = dd.read_shift(4, "i") / 1e4 + dd.read_shift(4, "i") / 1e4 * Math.pow(2, 32);
              break;
            case "O":
              out[R][C] = -dd.read_shift(-8, "f");
              break;
            case "B":
              if (vfp && fields[C].len == 8) {
                out[R][C] = dd.read_shift(8, "f");
                break;
              }
            case "G":
            case "P":
              dd.l += fields[C].len;
              break;
            case "0":
              if (fields[C].name === "_NullFlags")
                break;
            default:
              throw new Error("DBF Unsupported data type " + fields[C].type);
          }
        }
      }
      if (ft != 2) {
        if (d2.l < d2.length && d2[d2.l++] != 26)
          throw new Error("DBF EOF Marker missing " + (d2.l - 1) + " of " + d2.length + " " + d2[d2.l - 1].toString(16));
      }
      if (opts && opts.sheetRows)
        out = out.slice(0, opts.sheetRows);
      opts.DBF = fields;
      return out;
    }
    function dbf_to_sheet(buf, opts) {
      var o = opts || {};
      if (!o.dateNF)
        o.dateNF = "yyyymmdd";
      var ws = aoa_to_sheet(dbf_to_aoa(buf, o), o);
      ws["!cols"] = o.DBF.map(function(field) {
        return {
          wch: field.len,
          DBF: field
        };
      });
      delete o.DBF;
      return ws;
    }
    function dbf_to_workbook(buf, opts) {
      try {
        return sheet_to_workbook(dbf_to_sheet(buf, opts), opts);
      } catch (e2) {
        if (opts && opts.WTF)
          throw e2;
      }
      return { SheetNames: [], Sheets: {} };
    }
    var _RLEN = { "B": 8, "C": 250, "L": 1, "D": 8, "?": 0, "": 0 };
    function sheet_to_dbf(ws, opts) {
      var o = opts || {};
      if (+o.codepage >= 0)
        set_cp(+o.codepage);
      if (o.type == "string")
        throw new Error("Cannot write DBF to JS string");
      var ba = buf_array();
      var aoa = sheet_to_json(ws, { header: 1, raw: true, cellDates: true });
      var headers = aoa[0], data = aoa.slice(1), cols = ws["!cols"] || [];
      var i = 0, j = 0, hcnt = 0, rlen = 1;
      for (i = 0; i < headers.length; ++i) {
        if (((cols[i] || {}).DBF || {}).name) {
          headers[i] = cols[i].DBF.name;
          ++hcnt;
          continue;
        }
        if (headers[i] == null)
          continue;
        ++hcnt;
        if (typeof headers[i] === "number")
          headers[i] = headers[i].toString(10);
        if (typeof headers[i] !== "string")
          throw new Error("DBF Invalid column name " + headers[i] + " |" + typeof headers[i] + "|");
        if (headers.indexOf(headers[i]) !== i) {
          for (j = 0; j < 1024; ++j)
            if (headers.indexOf(headers[i] + "_" + j) == -1) {
              headers[i] += "_" + j;
              break;
            }
        }
      }
      var range = safe_decode_range(ws["!ref"]);
      var coltypes = [];
      var colwidths = [];
      var coldecimals = [];
      for (i = 0; i <= range.e.c - range.s.c; ++i) {
        var guess = "", _guess = "", maxlen = 0;
        var col = [];
        for (j = 0; j < data.length; ++j) {
          if (data[j][i] != null)
            col.push(data[j][i]);
        }
        if (col.length == 0 || headers[i] == null) {
          coltypes[i] = "?";
          continue;
        }
        for (j = 0; j < col.length; ++j) {
          switch (typeof col[j]) {
            case "number":
              _guess = "B";
              break;
            case "string":
              _guess = "C";
              break;
            case "boolean":
              _guess = "L";
              break;
            case "object":
              _guess = col[j] instanceof Date ? "D" : "C";
              break;
            default:
              _guess = "C";
          }
          maxlen = Math.max(maxlen, String(col[j]).length);
          guess = guess && guess != _guess ? "C" : _guess;
        }
        if (maxlen > 250)
          maxlen = 250;
        _guess = ((cols[i] || {}).DBF || {}).type;
        if (_guess == "C") {
          if (cols[i].DBF.len > maxlen)
            maxlen = cols[i].DBF.len;
        }
        if (guess == "B" && _guess == "N") {
          guess = "N";
          coldecimals[i] = cols[i].DBF.dec;
          maxlen = cols[i].DBF.len;
        }
        colwidths[i] = guess == "C" || _guess == "N" ? maxlen : _RLEN[guess] || 0;
        rlen += colwidths[i];
        coltypes[i] = guess;
      }
      var h2 = ba.next(32);
      h2.write_shift(4, 318902576);
      h2.write_shift(4, data.length);
      h2.write_shift(2, 296 + 32 * hcnt);
      h2.write_shift(2, rlen);
      for (i = 0; i < 4; ++i)
        h2.write_shift(4, 0);
      h2.write_shift(4, 0 | (+dbf_reverse_map[
        /*::String(*/
        current_ansi
        /*::)*/
      ] || 3) << 8);
      for (i = 0, j = 0; i < headers.length; ++i) {
        if (headers[i] == null)
          continue;
        var hf = ba.next(32);
        var _f = (headers[i].slice(-10) + "\0\0\0\0\0\0\0\0\0\0\0").slice(0, 11);
        hf.write_shift(1, _f, "sbcs");
        hf.write_shift(1, coltypes[i] == "?" ? "C" : coltypes[i], "sbcs");
        hf.write_shift(4, j);
        hf.write_shift(1, colwidths[i] || _RLEN[coltypes[i]] || 0);
        hf.write_shift(1, coldecimals[i] || 0);
        hf.write_shift(1, 2);
        hf.write_shift(4, 0);
        hf.write_shift(1, 0);
        hf.write_shift(4, 0);
        hf.write_shift(4, 0);
        j += colwidths[i] || _RLEN[coltypes[i]] || 0;
      }
      var hb = ba.next(264);
      hb.write_shift(4, 13);
      for (i = 0; i < 65; ++i)
        hb.write_shift(4, 0);
      for (i = 0; i < data.length; ++i) {
        var rout = ba.next(rlen);
        rout.write_shift(1, 0);
        for (j = 0; j < headers.length; ++j) {
          if (headers[j] == null)
            continue;
          switch (coltypes[j]) {
            case "L":
              rout.write_shift(1, data[i][j] == null ? 63 : data[i][j] ? 84 : 70);
              break;
            case "B":
              rout.write_shift(8, data[i][j] || 0, "f");
              break;
            case "N":
              var _n = "0";
              if (typeof data[i][j] == "number")
                _n = data[i][j].toFixed(coldecimals[j] || 0);
              for (hcnt = 0; hcnt < colwidths[j] - _n.length; ++hcnt)
                rout.write_shift(1, 32);
              rout.write_shift(1, _n, "sbcs");
              break;
            case "D":
              if (!data[i][j])
                rout.write_shift(8, "00000000", "sbcs");
              else {
                rout.write_shift(4, ("0000" + data[i][j].getFullYear()).slice(-4), "sbcs");
                rout.write_shift(2, ("00" + (data[i][j].getMonth() + 1)).slice(-2), "sbcs");
                rout.write_shift(2, ("00" + data[i][j].getDate()).slice(-2), "sbcs");
              }
              break;
            case "C":
              var _s = String(data[i][j] != null ? data[i][j] : "").slice(0, colwidths[j]);
              rout.write_shift(1, _s, "sbcs");
              for (hcnt = 0; hcnt < colwidths[j] - _s.length; ++hcnt)
                rout.write_shift(1, 32);
              break;
          }
        }
      }
      ba.next(1).write_shift(1, 26);
      return ba.end();
    }
    return {
      to_workbook: dbf_to_workbook,
      to_sheet: dbf_to_sheet,
      from_sheet: sheet_to_dbf
    };
  }();
  var SYLK = /* @__PURE__ */ function() {
    var sylk_escapes = {
      AA: "À",
      BA: "Á",
      CA: "Â",
      DA: 195,
      HA: "Ä",
      JA: 197,
      AE: "È",
      BE: "É",
      CE: "Ê",
      HE: "Ë",
      AI: "Ì",
      BI: "Í",
      CI: "Î",
      HI: "Ï",
      AO: "Ò",
      BO: "Ó",
      CO: "Ô",
      DO: 213,
      HO: "Ö",
      AU: "Ù",
      BU: "Ú",
      CU: "Û",
      HU: "Ü",
      Aa: "à",
      Ba: "á",
      Ca: "â",
      Da: 227,
      Ha: "ä",
      Ja: 229,
      Ae: "è",
      Be: "é",
      Ce: "ê",
      He: "ë",
      Ai: "ì",
      Bi: "í",
      Ci: "î",
      Hi: "ï",
      Ao: "ò",
      Bo: "ó",
      Co: "ô",
      Do: 245,
      Ho: "ö",
      Au: "ù",
      Bu: "ú",
      Cu: "û",
      Hu: "ü",
      KC: "Ç",
      Kc: "ç",
      q: "æ",
      z: "œ",
      a: "Æ",
      j: "Œ",
      DN: 209,
      Dn: 241,
      Hy: 255,
      S: 169,
      c: 170,
      R: 174,
      "B ": 180,
      /*::[*/
      0: 176,
      /*::[*/
      1: 177,
      /*::[*/
      2: 178,
      /*::[*/
      3: 179,
      /*::[*/
      5: 181,
      /*::[*/
      6: 182,
      /*::[*/
      7: 183,
      Q: 185,
      k: 186,
      b: 208,
      i: 216,
      l: 222,
      s: 240,
      y: 248,
      "!": 161,
      '"': 162,
      "#": 163,
      "(": 164,
      "%": 165,
      "'": 167,
      "H ": 168,
      "+": 171,
      ";": 187,
      "<": 188,
      "=": 189,
      ">": 190,
      "?": 191,
      "{": 223
    };
    var sylk_char_regex = new RegExp("\x1BN(" + keys2(sylk_escapes).join("|").replace(/\|\|\|/, "|\\||").replace(/([?()+])/g, "\\$1") + "|\\|)", "gm");
    var sylk_char_fn = function(_, $1) {
      var o = sylk_escapes[$1];
      return typeof o == "number" ? _getansi(o) : o;
    };
    var decode_sylk_char = function($$, $1, $2) {
      var newcc = $1.charCodeAt(0) - 32 << 4 | $2.charCodeAt(0) - 48;
      return newcc == 59 ? $$ : _getansi(newcc);
    };
    sylk_escapes["|"] = 254;
    function sylk_to_aoa(d2, opts) {
      switch (opts.type) {
        case "base64":
          return sylk_to_aoa_str(Base64_decode(d2), opts);
        case "binary":
          return sylk_to_aoa_str(d2, opts);
        case "buffer":
          return sylk_to_aoa_str(has_buf && Buffer.isBuffer(d2) ? d2.toString("binary") : a2s(d2), opts);
        case "array":
          return sylk_to_aoa_str(cc2str(d2), opts);
      }
      throw new Error("Unrecognized type " + opts.type);
    }
    function sylk_to_aoa_str(str, opts) {
      var records = str.split(/[\n\r]+/), R = -1, C = -1, ri = 0, rj = 0, arr = [];
      var formats = [];
      var next_cell_format = null;
      var sht = {}, rowinfo = [], colinfo = [], cw = [];
      var Mval = 0, j;
      if (+opts.codepage >= 0)
        set_cp(+opts.codepage);
      for (; ri !== records.length; ++ri) {
        Mval = 0;
        var rstr = records[ri].trim().replace(/\x1B([\x20-\x2F])([\x30-\x3F])/g, decode_sylk_char).replace(sylk_char_regex, sylk_char_fn);
        var record = rstr.replace(/;;/g, "\0").split(";").map(function(x2) {
          return x2.replace(/\u0000/g, ";");
        });
        var RT = record[0], val;
        if (rstr.length > 0)
          switch (RT) {
            case "ID":
              break;
            case "E":
              break;
            case "B":
              break;
            case "O":
              break;
            case "W":
              break;
            case "P":
              if (record[1].charAt(0) == "P")
                formats.push(rstr.slice(3).replace(/;;/g, ";"));
              break;
            case "C":
              var C_seen_K = false, C_seen_X = false, C_seen_S = false, C_seen_E = false, _R = -1, _C = -1;
              for (rj = 1; rj < record.length; ++rj)
                switch (record[rj].charAt(0)) {
                  case "A":
                    break;
                  case "X":
                    C = parseInt(record[rj].slice(1)) - 1;
                    C_seen_X = true;
                    break;
                  case "Y":
                    R = parseInt(record[rj].slice(1)) - 1;
                    if (!C_seen_X)
                      C = 0;
                    for (j = arr.length; j <= R; ++j)
                      arr[j] = [];
                    break;
                  case "K":
                    val = record[rj].slice(1);
                    if (val.charAt(0) === '"')
                      val = val.slice(1, val.length - 1);
                    else if (val === "TRUE")
                      val = true;
                    else if (val === "FALSE")
                      val = false;
                    else if (!isNaN(fuzzynum(val))) {
                      val = fuzzynum(val);
                      if (next_cell_format !== null && fmt_is_date(next_cell_format))
                        val = numdate(val);
                    } else if (!isNaN(fuzzydate(val).getDate())) {
                      val = parseDate(val);
                    }
                    C_seen_K = true;
                    break;
                  case "E":
                    C_seen_E = true;
                    var formula = rc_to_a1(record[rj].slice(1), { r: R, c: C });
                    arr[R][C] = [arr[R][C], formula];
                    break;
                  case "S":
                    C_seen_S = true;
                    arr[R][C] = [arr[R][C], "S5S"];
                    break;
                  case "G":
                    break;
                  case "R":
                    _R = parseInt(record[rj].slice(1)) - 1;
                    break;
                  case "C":
                    _C = parseInt(record[rj].slice(1)) - 1;
                    break;
                  default:
                    if (opts && opts.WTF)
                      throw new Error("SYLK bad record " + rstr);
                }
              if (C_seen_K) {
                if (arr[R][C] && arr[R][C].length == 2)
                  arr[R][C][0] = val;
                else
                  arr[R][C] = val;
                next_cell_format = null;
              }
              if (C_seen_S) {
                if (C_seen_E)
                  throw new Error("SYLK shared formula cannot have own formula");
                var shrbase = _R > -1 && arr[_R][_C];
                if (!shrbase || !shrbase[1])
                  throw new Error("SYLK shared formula cannot find base");
                arr[R][C][1] = shift_formula_str(shrbase[1], { r: R - _R, c: C - _C });
              }
              break;
            case "F":
              var F_seen = 0;
              for (rj = 1; rj < record.length; ++rj)
                switch (record[rj].charAt(0)) {
                  case "X":
                    C = parseInt(record[rj].slice(1)) - 1;
                    ++F_seen;
                    break;
                  case "Y":
                    R = parseInt(record[rj].slice(1)) - 1;
                    for (j = arr.length; j <= R; ++j)
                      arr[j] = [];
                    break;
                  case "M":
                    Mval = parseInt(record[rj].slice(1)) / 20;
                    break;
                  case "F":
                    break;
                  case "G":
                    break;
                  case "P":
                    next_cell_format = formats[parseInt(record[rj].slice(1))];
                    break;
                  case "S":
                    break;
                  case "D":
                    break;
                  case "N":
                    break;
                  case "W":
                    cw = record[rj].slice(1).split(" ");
                    for (j = parseInt(cw[0], 10); j <= parseInt(cw[1], 10); ++j) {
                      Mval = parseInt(cw[2], 10);
                      colinfo[j - 1] = Mval === 0 ? { hidden: true } : { wch: Mval };
                      process_col(colinfo[j - 1]);
                    }
                    break;
                  case "C":
                    C = parseInt(record[rj].slice(1)) - 1;
                    if (!colinfo[C])
                      colinfo[C] = {};
                    break;
                  case "R":
                    R = parseInt(record[rj].slice(1)) - 1;
                    if (!rowinfo[R])
                      rowinfo[R] = {};
                    if (Mval > 0) {
                      rowinfo[R].hpt = Mval;
                      rowinfo[R].hpx = pt2px(Mval);
                    } else if (Mval === 0)
                      rowinfo[R].hidden = true;
                    break;
                  default:
                    if (opts && opts.WTF)
                      throw new Error("SYLK bad record " + rstr);
                }
              if (F_seen < 1)
                next_cell_format = null;
              break;
            default:
              if (opts && opts.WTF)
                throw new Error("SYLK bad record " + rstr);
          }
      }
      if (rowinfo.length > 0)
        sht["!rows"] = rowinfo;
      if (colinfo.length > 0)
        sht["!cols"] = colinfo;
      if (opts && opts.sheetRows)
        arr = arr.slice(0, opts.sheetRows);
      return [arr, sht];
    }
    function sylk_to_sheet(d2, opts) {
      var aoasht = sylk_to_aoa(d2, opts);
      var aoa = aoasht[0], ws = aoasht[1];
      var o = aoa_to_sheet(aoa, opts);
      keys2(ws).forEach(function(k2) {
        o[k2] = ws[k2];
      });
      return o;
    }
    function sylk_to_workbook(d2, opts) {
      return sheet_to_workbook(sylk_to_sheet(d2, opts), opts);
    }
    function write_ws_cell_sylk(cell5, ws, R, C) {
      var o = "C;Y" + (R + 1) + ";X" + (C + 1) + ";K";
      switch (cell5.t) {
        case "n":
          o += cell5.v || 0;
          if (cell5.f && !cell5.F)
            o += ";E" + a1_to_rc(cell5.f, { r: R, c: C });
          break;
        case "b":
          o += cell5.v ? "TRUE" : "FALSE";
          break;
        case "e":
          o += cell5.w || cell5.v;
          break;
        case "d":
          o += '"' + (cell5.w || cell5.v) + '"';
          break;
        case "s":
          o += '"' + cell5.v.replace(/"/g, "").replace(/;/g, ";;") + '"';
          break;
      }
      return o;
    }
    function write_ws_cols_sylk(out, cols) {
      cols.forEach(function(col, i) {
        var rec = "F;W" + (i + 1) + " " + (i + 1) + " ";
        if (col.hidden)
          rec += "0";
        else {
          if (typeof col.width == "number" && !col.wpx)
            col.wpx = width2px(col.width);
          if (typeof col.wpx == "number" && !col.wch)
            col.wch = px2char(col.wpx);
          if (typeof col.wch == "number")
            rec += Math.round(col.wch);
        }
        if (rec.charAt(rec.length - 1) != " ")
          out.push(rec);
      });
    }
    function write_ws_rows_sylk(out, rows) {
      rows.forEach(function(row, i) {
        var rec = "F;";
        if (row.hidden)
          rec += "M0;";
        else if (row.hpt)
          rec += "M" + 20 * row.hpt + ";";
        else if (row.hpx)
          rec += "M" + 20 * px2pt(row.hpx) + ";";
        if (rec.length > 2)
          out.push(rec + "R" + (i + 1));
      });
    }
    function sheet_to_sylk(ws, opts) {
      var preamble = ["ID;PWXL;N;E"], o = [];
      var r2 = safe_decode_range(ws["!ref"]), cell5;
      var dense = Array.isArray(ws);
      var RS = "\r\n";
      preamble.push("P;PGeneral");
      preamble.push("F;P0;DG0G8;M255");
      if (ws["!cols"])
        write_ws_cols_sylk(preamble, ws["!cols"]);
      if (ws["!rows"])
        write_ws_rows_sylk(preamble, ws["!rows"]);
      preamble.push("B;Y" + (r2.e.r - r2.s.r + 1) + ";X" + (r2.e.c - r2.s.c + 1) + ";D" + [r2.s.c, r2.s.r, r2.e.c, r2.e.r].join(" "));
      for (var R = r2.s.r; R <= r2.e.r; ++R) {
        for (var C = r2.s.c; C <= r2.e.c; ++C) {
          var coord = encode_cell({ r: R, c: C });
          cell5 = dense ? (ws[R] || [])[C] : ws[coord];
          if (!cell5 || cell5.v == null && (!cell5.f || cell5.F))
            continue;
          o.push(write_ws_cell_sylk(cell5, ws, R, C));
        }
      }
      return preamble.join(RS) + RS + o.join(RS) + RS + "E" + RS;
    }
    return {
      to_workbook: sylk_to_workbook,
      to_sheet: sylk_to_sheet,
      from_sheet: sheet_to_sylk
    };
  }();
  var DIF = /* @__PURE__ */ function() {
    function dif_to_aoa(d2, opts) {
      switch (opts.type) {
        case "base64":
          return dif_to_aoa_str(Base64_decode(d2), opts);
        case "binary":
          return dif_to_aoa_str(d2, opts);
        case "buffer":
          return dif_to_aoa_str(has_buf && Buffer.isBuffer(d2) ? d2.toString("binary") : a2s(d2), opts);
        case "array":
          return dif_to_aoa_str(cc2str(d2), opts);
      }
      throw new Error("Unrecognized type " + opts.type);
    }
    function dif_to_aoa_str(str, opts) {
      var records = str.split("\n"), R = -1, C = -1, ri = 0, arr = [];
      for (; ri !== records.length; ++ri) {
        if (records[ri].trim() === "BOT") {
          arr[++R] = [];
          C = 0;
          continue;
        }
        if (R < 0)
          continue;
        var metadata = records[ri].trim().split(",");
        var type2 = metadata[0], value = metadata[1];
        ++ri;
        var data = records[ri] || "";
        while ((data.match(/["]/g) || []).length & 1 && ri < records.length - 1)
          data += "\n" + records[++ri];
        data = data.trim();
        switch (+type2) {
          case -1:
            if (data === "BOT") {
              arr[++R] = [];
              C = 0;
              continue;
            } else if (data !== "EOD")
              throw new Error("Unrecognized DIF special command " + data);
            break;
          case 0:
            if (data === "TRUE")
              arr[R][C] = true;
            else if (data === "FALSE")
              arr[R][C] = false;
            else if (!isNaN(fuzzynum(value)))
              arr[R][C] = fuzzynum(value);
            else if (!isNaN(fuzzydate(value).getDate()))
              arr[R][C] = parseDate(value);
            else
              arr[R][C] = value;
            ++C;
            break;
          case 1:
            data = data.slice(1, data.length - 1);
            data = data.replace(/""/g, '"');
            if (data && data.match(/^=".*"$/))
              data = data.slice(2, -1);
            arr[R][C++] = data !== "" ? data : null;
            break;
        }
        if (data === "EOD")
          break;
      }
      if (opts && opts.sheetRows)
        arr = arr.slice(0, opts.sheetRows);
      return arr;
    }
    function dif_to_sheet(str, opts) {
      return aoa_to_sheet(dif_to_aoa(str, opts), opts);
    }
    function dif_to_workbook(str, opts) {
      return sheet_to_workbook(dif_to_sheet(str, opts), opts);
    }
    var sheet_to_dif = /* @__PURE__ */ function() {
      var push_field = function pf(o, topic, v2, n2, s) {
        o.push(topic);
        o.push(v2 + "," + n2);
        o.push('"' + s.replace(/"/g, '""') + '"');
      };
      var push_value = function po(o, type2, v2, s) {
        o.push(type2 + "," + v2);
        o.push(type2 == 1 ? '"' + s.replace(/"/g, '""') + '"' : s);
      };
      return function sheet_to_dif2(ws) {
        var o = [];
        var r2 = safe_decode_range(ws["!ref"]), cell5;
        var dense = Array.isArray(ws);
        push_field(o, "TABLE", 0, 1, "sheetjs");
        push_field(o, "VECTORS", 0, r2.e.r - r2.s.r + 1, "");
        push_field(o, "TUPLES", 0, r2.e.c - r2.s.c + 1, "");
        push_field(o, "DATA", 0, 0, "");
        for (var R = r2.s.r; R <= r2.e.r; ++R) {
          push_value(o, -1, 0, "BOT");
          for (var C = r2.s.c; C <= r2.e.c; ++C) {
            var coord = encode_cell({ r: R, c: C });
            cell5 = dense ? (ws[R] || [])[C] : ws[coord];
            if (!cell5) {
              push_value(o, 1, 0, "");
              continue;
            }
            switch (cell5.t) {
              case "n":
                var val = cell5.w;
                if (!val && cell5.v != null)
                  val = cell5.v;
                if (val == null) {
                  if (cell5.f && !cell5.F)
                    push_value(o, 1, 0, "=" + cell5.f);
                  else
                    push_value(o, 1, 0, "");
                } else
                  push_value(o, 0, val, "V");
                break;
              case "b":
                push_value(o, 0, cell5.v ? 1 : 0, cell5.v ? "TRUE" : "FALSE");
                break;
              case "s":
                push_value(o, 1, 0, isNaN(cell5.v) ? cell5.v : '="' + cell5.v + '"');
                break;
              case "d":
                if (!cell5.w)
                  cell5.w = SSF_format(cell5.z || table_fmt[14], datenum(parseDate(cell5.v)));
                push_value(o, 0, cell5.w, "V");
                break;
              default:
                push_value(o, 1, 0, "");
            }
          }
        }
        push_value(o, -1, 0, "EOD");
        var RS = "\r\n";
        var oo = o.join(RS);
        return oo;
      };
    }();
    return {
      to_workbook: dif_to_workbook,
      to_sheet: dif_to_sheet,
      from_sheet: sheet_to_dif
    };
  }();
  var ETH = /* @__PURE__ */ function() {
    function decode(s) {
      return s.replace(/\\b/g, "\\").replace(/\\c/g, ":").replace(/\\n/g, "\n");
    }
    function encode(s) {
      return s.replace(/\\/g, "\\b").replace(/:/g, "\\c").replace(/\n/g, "\\n");
    }
    function eth_to_aoa(str, opts) {
      var records = str.split("\n"), R = -1, C = -1, ri = 0, arr = [];
      for (; ri !== records.length; ++ri) {
        var record = records[ri].trim().split(":");
        if (record[0] !== "cell")
          continue;
        var addr = decode_cell(record[1]);
        if (arr.length <= addr.r) {
          for (R = arr.length; R <= addr.r; ++R)
            if (!arr[R])
              arr[R] = [];
        }
        R = addr.r;
        C = addr.c;
        switch (record[2]) {
          case "t":
            arr[R][C] = decode(record[3]);
            break;
          case "v":
            arr[R][C] = +record[3];
            break;
          case "vtf":
            var _f = record[record.length - 1];
          case "vtc":
            switch (record[3]) {
              case "nl":
                arr[R][C] = +record[4] ? true : false;
                break;
              default:
                arr[R][C] = +record[4];
                break;
            }
            if (record[2] == "vtf")
              arr[R][C] = [arr[R][C], _f];
        }
      }
      if (opts && opts.sheetRows)
        arr = arr.slice(0, opts.sheetRows);
      return arr;
    }
    function eth_to_sheet(d2, opts) {
      return aoa_to_sheet(eth_to_aoa(d2, opts), opts);
    }
    function eth_to_workbook(d2, opts) {
      return sheet_to_workbook(eth_to_sheet(d2, opts), opts);
    }
    var header = [
      "socialcalc:version:1.5",
      "MIME-Version: 1.0",
      "Content-Type: multipart/mixed; boundary=SocialCalcSpreadsheetControlSave"
    ].join("\n");
    var sep = [
      "--SocialCalcSpreadsheetControlSave",
      "Content-type: text/plain; charset=UTF-8"
    ].join("\n") + "\n";
    var meta2 = [
      "# SocialCalc Spreadsheet Control Save",
      "part:sheet"
    ].join("\n");
    var end = "--SocialCalcSpreadsheetControlSave--";
    function sheet_to_eth_data(ws) {
      if (!ws || !ws["!ref"])
        return "";
      var o = [], oo = [], cell5, coord = "";
      var r2 = decode_range(ws["!ref"]);
      var dense = Array.isArray(ws);
      for (var R = r2.s.r; R <= r2.e.r; ++R) {
        for (var C = r2.s.c; C <= r2.e.c; ++C) {
          coord = encode_cell({ r: R, c: C });
          cell5 = dense ? (ws[R] || [])[C] : ws[coord];
          if (!cell5 || cell5.v == null || cell5.t === "z")
            continue;
          oo = ["cell", coord, "t"];
          switch (cell5.t) {
            case "s":
            case "str":
              oo.push(encode(cell5.v));
              break;
            case "n":
              if (!cell5.f) {
                oo[2] = "v";
                oo[3] = cell5.v;
              } else {
                oo[2] = "vtf";
                oo[3] = "n";
                oo[4] = cell5.v;
                oo[5] = encode(cell5.f);
              }
              break;
            case "b":
              oo[2] = "vt" + (cell5.f ? "f" : "c");
              oo[3] = "nl";
              oo[4] = cell5.v ? "1" : "0";
              oo[5] = encode(cell5.f || (cell5.v ? "TRUE" : "FALSE"));
              break;
            case "d":
              var t2 = datenum(parseDate(cell5.v));
              oo[2] = "vtc";
              oo[3] = "nd";
              oo[4] = "" + t2;
              oo[5] = cell5.w || SSF_format(cell5.z || table_fmt[14], t2);
              break;
            case "e":
              continue;
          }
          o.push(oo.join(":"));
        }
      }
      o.push("sheet:c:" + (r2.e.c - r2.s.c + 1) + ":r:" + (r2.e.r - r2.s.r + 1) + ":tvf:1");
      o.push("valueformat:1:text-wiki");
      return o.join("\n");
    }
    function sheet_to_eth(ws) {
      return [header, sep, meta2, sep, sheet_to_eth_data(ws), end].join("\n");
    }
    return {
      to_workbook: eth_to_workbook,
      to_sheet: eth_to_sheet,
      from_sheet: sheet_to_eth
    };
  }();
  var PRN = /* @__PURE__ */ function() {
    function set_text_arr(data, arr, R, C, o) {
      if (o.raw)
        arr[R][C] = data;
      else if (data === "")
        ;
      else if (data === "TRUE")
        arr[R][C] = true;
      else if (data === "FALSE")
        arr[R][C] = false;
      else if (!isNaN(fuzzynum(data)))
        arr[R][C] = fuzzynum(data);
      else if (!isNaN(fuzzydate(data).getDate()))
        arr[R][C] = parseDate(data);
      else
        arr[R][C] = data;
    }
    function prn_to_aoa_str(f2, opts) {
      var o = opts || {};
      var arr = [];
      if (!f2 || f2.length === 0)
        return arr;
      var lines = f2.split(/[\r\n]/);
      var L = lines.length - 1;
      while (L >= 0 && lines[L].length === 0)
        --L;
      var start = 10, idx = 0;
      var R = 0;
      for (; R <= L; ++R) {
        idx = lines[R].indexOf(" ");
        if (idx == -1)
          idx = lines[R].length;
        else
          idx++;
        start = Math.max(start, idx);
      }
      for (R = 0; R <= L; ++R) {
        arr[R] = [];
        var C = 0;
        set_text_arr(lines[R].slice(0, start).trim(), arr, R, C, o);
        for (C = 1; C <= (lines[R].length - start) / 10 + 1; ++C)
          set_text_arr(lines[R].slice(start + (C - 1) * 10, start + C * 10).trim(), arr, R, C, o);
      }
      if (o.sheetRows)
        arr = arr.slice(0, o.sheetRows);
      return arr;
    }
    var guess_seps = {
      /*::[*/
      44: ",",
      /*::[*/
      9: "	",
      /*::[*/
      59: ";",
      /*::[*/
      124: "|"
    };
    var guess_sep_weights = {
      /*::[*/
      44: 3,
      /*::[*/
      9: 2,
      /*::[*/
      59: 1,
      /*::[*/
      124: 0
    };
    function guess_sep(str) {
      var cnt = {}, instr = false, end = 0, cc = 0;
      for (; end < str.length; ++end) {
        if ((cc = str.charCodeAt(end)) == 34)
          instr = !instr;
        else if (!instr && cc in guess_seps)
          cnt[cc] = (cnt[cc] || 0) + 1;
      }
      cc = [];
      for (end in cnt)
        if (Object.prototype.hasOwnProperty.call(cnt, end)) {
          cc.push([cnt[end], end]);
        }
      if (!cc.length) {
        cnt = guess_sep_weights;
        for (end in cnt)
          if (Object.prototype.hasOwnProperty.call(cnt, end)) {
            cc.push([cnt[end], end]);
          }
      }
      cc.sort(function(a, b2) {
        return a[0] - b2[0] || guess_sep_weights[a[1]] - guess_sep_weights[b2[1]];
      });
      return guess_seps[cc.pop()[1]] || 44;
    }
    function dsv_to_sheet_str(str, opts) {
      var o = opts || {};
      var sep = "";
      var ws = o.dense ? [] : {};
      var range = { s: { c: 0, r: 0 }, e: { c: 0, r: 0 } };
      if (str.slice(0, 4) == "sep=") {
        if (str.charCodeAt(5) == 13 && str.charCodeAt(6) == 10) {
          sep = str.charAt(4);
          str = str.slice(7);
        } else if (str.charCodeAt(5) == 13 || str.charCodeAt(5) == 10) {
          sep = str.charAt(4);
          str = str.slice(6);
        } else
          sep = guess_sep(str.slice(0, 1024));
      } else if (o && o.FS)
        sep = o.FS;
      else
        sep = guess_sep(str.slice(0, 1024));
      var R = 0, C = 0, v2 = 0;
      var start = 0, end = 0, sepcc = sep.charCodeAt(0), instr = false, cc = 0, startcc = str.charCodeAt(0);
      str = str.replace(/\r\n/mg, "\n");
      var _re = o.dateNF != null ? dateNF_regex(o.dateNF) : null;
      function finish_cell() {
        var s = str.slice(start, end);
        var cell5 = {};
        if (s.charAt(0) == '"' && s.charAt(s.length - 1) == '"')
          s = s.slice(1, -1).replace(/""/g, '"');
        if (s.length === 0)
          cell5.t = "z";
        else if (o.raw) {
          cell5.t = "s";
          cell5.v = s;
        } else if (s.trim().length === 0) {
          cell5.t = "s";
          cell5.v = s;
        } else if (s.charCodeAt(0) == 61) {
          if (s.charCodeAt(1) == 34 && s.charCodeAt(s.length - 1) == 34) {
            cell5.t = "s";
            cell5.v = s.slice(2, -1).replace(/""/g, '"');
          } else if (fuzzyfmla(s)) {
            cell5.t = "n";
            cell5.f = s.slice(1);
          } else {
            cell5.t = "s";
            cell5.v = s;
          }
        } else if (s == "TRUE") {
          cell5.t = "b";
          cell5.v = true;
        } else if (s == "FALSE") {
          cell5.t = "b";
          cell5.v = false;
        } else if (!isNaN(v2 = fuzzynum(s))) {
          cell5.t = "n";
          if (o.cellText !== false)
            cell5.w = s;
          cell5.v = v2;
        } else if (!isNaN(fuzzydate(s).getDate()) || _re && s.match(_re)) {
          cell5.z = o.dateNF || table_fmt[14];
          var k2 = 0;
          if (_re && s.match(_re)) {
            s = dateNF_fix(s, o.dateNF, s.match(_re) || []);
            k2 = 1;
          }
          if (o.cellDates) {
            cell5.t = "d";
            cell5.v = parseDate(s, k2);
          } else {
            cell5.t = "n";
            cell5.v = datenum(parseDate(s, k2));
          }
          if (o.cellText !== false)
            cell5.w = SSF_format(cell5.z, cell5.v instanceof Date ? datenum(cell5.v) : cell5.v);
          if (!o.cellNF)
            delete cell5.z;
        } else {
          cell5.t = "s";
          cell5.v = s;
        }
        if (cell5.t == "z")
          ;
        else if (o.dense) {
          if (!ws[R])
            ws[R] = [];
          ws[R][C] = cell5;
        } else
          ws[encode_cell({ c: C, r: R })] = cell5;
        start = end + 1;
        startcc = str.charCodeAt(start);
        if (range.e.c < C)
          range.e.c = C;
        if (range.e.r < R)
          range.e.r = R;
        if (cc == sepcc)
          ++C;
        else {
          C = 0;
          ++R;
          if (o.sheetRows && o.sheetRows <= R)
            return true;
        }
      }
      outer:
        for (; end < str.length; ++end)
          switch (cc = str.charCodeAt(end)) {
            case 34:
              if (startcc === 34)
                instr = !instr;
              break;
            case sepcc:
            case 10:
            case 13:
              if (!instr && finish_cell())
                break outer;
              break;
          }
      if (end - start > 0)
        finish_cell();
      ws["!ref"] = encode_range(range);
      return ws;
    }
    function prn_to_sheet_str(str, opts) {
      if (!(opts && opts.PRN))
        return dsv_to_sheet_str(str, opts);
      if (opts.FS)
        return dsv_to_sheet_str(str, opts);
      if (str.slice(0, 4) == "sep=")
        return dsv_to_sheet_str(str, opts);
      if (str.indexOf("	") >= 0 || str.indexOf(",") >= 0 || str.indexOf(";") >= 0)
        return dsv_to_sheet_str(str, opts);
      return aoa_to_sheet(prn_to_aoa_str(str, opts), opts);
    }
    function prn_to_sheet(d2, opts) {
      var str = "", bytes = opts.type == "string" ? [0, 0, 0, 0] : firstbyte(d2, opts);
      switch (opts.type) {
        case "base64":
          str = Base64_decode(d2);
          break;
        case "binary":
          str = d2;
          break;
        case "buffer":
          if (opts.codepage == 65001)
            str = d2.toString("utf8");
          else if (opts.codepage && typeof $cptable !== "undefined")
            str = $cptable.utils.decode(opts.codepage, d2);
          else
            str = has_buf && Buffer.isBuffer(d2) ? d2.toString("binary") : a2s(d2);
          break;
        case "array":
          str = cc2str(d2);
          break;
        case "string":
          str = d2;
          break;
        default:
          throw new Error("Unrecognized type " + opts.type);
      }
      if (bytes[0] == 239 && bytes[1] == 187 && bytes[2] == 191)
        str = utf8read(str.slice(3));
      else if (opts.type != "string" && opts.type != "buffer" && opts.codepage == 65001)
        str = utf8read(str);
      else if (opts.type == "binary" && typeof $cptable !== "undefined" && opts.codepage)
        str = $cptable.utils.decode(opts.codepage, $cptable.utils.encode(28591, str));
      if (str.slice(0, 19) == "socialcalc:version:")
        return ETH.to_sheet(opts.type == "string" ? str : utf8read(str), opts);
      return prn_to_sheet_str(str, opts);
    }
    function prn_to_workbook(d2, opts) {
      return sheet_to_workbook(prn_to_sheet(d2, opts), opts);
    }
    function sheet_to_prn(ws) {
      var o = [];
      var r2 = safe_decode_range(ws["!ref"]), cell5;
      var dense = Array.isArray(ws);
      for (var R = r2.s.r; R <= r2.e.r; ++R) {
        var oo = [];
        for (var C = r2.s.c; C <= r2.e.c; ++C) {
          var coord = encode_cell({ r: R, c: C });
          cell5 = dense ? (ws[R] || [])[C] : ws[coord];
          if (!cell5 || cell5.v == null) {
            oo.push("          ");
            continue;
          }
          var w2 = (cell5.w || (format_cell(cell5), cell5.w) || "").slice(0, 10);
          while (w2.length < 10)
            w2 += " ";
          oo.push(w2 + (C === 0 ? " " : ""));
        }
        o.push(oo.join(""));
      }
      return o.join("\n");
    }
    return {
      to_workbook: prn_to_workbook,
      to_sheet: prn_to_sheet,
      from_sheet: sheet_to_prn
    };
  }();
  var WK_ = /* @__PURE__ */ function() {
    function lotushopper(data, cb, opts) {
      if (!data)
        return;
      prep_blob(data, data.l || 0);
      var Enum = opts.Enum || WK1Enum;
      while (data.l < data.length) {
        var RT = data.read_shift(2);
        var R = Enum[RT] || Enum[65535];
        var length2 = data.read_shift(2);
        var tgt = data.l + length2;
        var d2 = R.f && R.f(data, length2, opts);
        data.l = tgt;
        if (cb(d2, R, RT))
          return;
      }
    }
    function lotus_to_workbook(d2, opts) {
      switch (opts.type) {
        case "base64":
          return lotus_to_workbook_buf(s2a(Base64_decode(d2)), opts);
        case "binary":
          return lotus_to_workbook_buf(s2a(d2), opts);
        case "buffer":
        case "array":
          return lotus_to_workbook_buf(d2, opts);
      }
      throw "Unsupported type " + opts.type;
    }
    function lotus_to_workbook_buf(d2, opts) {
      if (!d2)
        return d2;
      var o = opts || {};
      var s = o.dense ? [] : {}, n2 = "Sheet1", next_n = "", sidx = 0;
      var sheets = {}, snames = [], realnames = [];
      var refguess = { s: { r: 0, c: 0 }, e: { r: 0, c: 0 } };
      var sheetRows = o.sheetRows || 0;
      if (d2[2] == 0) {
        if (d2[3] == 8 || d2[3] == 9) {
          if (d2.length >= 16 && d2[14] == 5 && d2[15] === 108)
            throw new Error("Unsupported Works 3 for Mac file");
        }
      }
      if (d2[2] == 2) {
        o.Enum = WK1Enum;
        lotushopper(d2, function(val, R, RT) {
          switch (RT) {
            case 0:
              o.vers = val;
              if (val >= 4096)
                o.qpro = true;
              break;
            case 6:
              refguess = val;
              break;
            case 204:
              if (val)
                next_n = val;
              break;
            case 222:
              next_n = val;
              break;
            case 15:
            case 51:
              if (!o.qpro)
                val[1].v = val[1].v.slice(1);
            case 13:
            case 14:
            case 16:
              if (RT == 14 && (val[2] & 112) == 112 && (val[2] & 15) > 1 && (val[2] & 15) < 15) {
                val[1].z = o.dateNF || table_fmt[14];
                if (o.cellDates) {
                  val[1].t = "d";
                  val[1].v = numdate(val[1].v);
                }
              }
              if (o.qpro) {
                if (val[3] > sidx) {
                  s["!ref"] = encode_range(refguess);
                  sheets[n2] = s;
                  snames.push(n2);
                  s = o.dense ? [] : {};
                  refguess = { s: { r: 0, c: 0 }, e: { r: 0, c: 0 } };
                  sidx = val[3];
                  n2 = next_n || "Sheet" + (sidx + 1);
                  next_n = "";
                }
              }
              var tmpcell = o.dense ? (s[val[0].r] || [])[val[0].c] : s[encode_cell(val[0])];
              if (tmpcell) {
                tmpcell.t = val[1].t;
                tmpcell.v = val[1].v;
                if (val[1].z != null)
                  tmpcell.z = val[1].z;
                if (val[1].f != null)
                  tmpcell.f = val[1].f;
                break;
              }
              if (o.dense) {
                if (!s[val[0].r])
                  s[val[0].r] = [];
                s[val[0].r][val[0].c] = val[1];
              } else
                s[encode_cell(val[0])] = val[1];
              break;
          }
        }, o);
      } else if (d2[2] == 26 || d2[2] == 14) {
        o.Enum = WK3Enum;
        if (d2[2] == 14) {
          o.qpro = true;
          d2.l = 0;
        }
        lotushopper(d2, function(val, R, RT) {
          switch (RT) {
            case 204:
              n2 = val;
              break;
            case 22:
              val[1].v = val[1].v.slice(1);
            case 23:
            case 24:
            case 25:
            case 37:
            case 39:
            case 40:
              if (val[3] > sidx) {
                s["!ref"] = encode_range(refguess);
                sheets[n2] = s;
                snames.push(n2);
                s = o.dense ? [] : {};
                refguess = { s: { r: 0, c: 0 }, e: { r: 0, c: 0 } };
                sidx = val[3];
                n2 = "Sheet" + (sidx + 1);
              }
              if (sheetRows > 0 && val[0].r >= sheetRows)
                break;
              if (o.dense) {
                if (!s[val[0].r])
                  s[val[0].r] = [];
                s[val[0].r][val[0].c] = val[1];
              } else
                s[encode_cell(val[0])] = val[1];
              if (refguess.e.c < val[0].c)
                refguess.e.c = val[0].c;
              if (refguess.e.r < val[0].r)
                refguess.e.r = val[0].r;
              break;
            case 27:
              if (val[14e3])
                realnames[val[14e3][0]] = val[14e3][1];
              break;
            case 1537:
              realnames[val[0]] = val[1];
              if (val[0] == sidx)
                n2 = val[1];
              break;
          }
        }, o);
      } else
        throw new Error("Unrecognized LOTUS BOF " + d2[2]);
      s["!ref"] = encode_range(refguess);
      sheets[next_n || n2] = s;
      snames.push(next_n || n2);
      if (!realnames.length)
        return { SheetNames: snames, Sheets: sheets };
      var osheets = {}, rnames = [];
      for (var i = 0; i < realnames.length; ++i)
        if (sheets[snames[i]]) {
          rnames.push(realnames[i] || snames[i]);
          osheets[realnames[i]] = sheets[realnames[i]] || sheets[snames[i]];
        } else {
          rnames.push(realnames[i]);
          osheets[realnames[i]] = { "!ref": "A1" };
        }
      return { SheetNames: rnames, Sheets: osheets };
    }
    function sheet_to_wk1(ws, opts) {
      var o = opts || {};
      if (+o.codepage >= 0)
        set_cp(+o.codepage);
      if (o.type == "string")
        throw new Error("Cannot write WK1 to JS string");
      var ba = buf_array();
      var range = safe_decode_range(ws["!ref"]);
      var dense = Array.isArray(ws);
      var cols = [];
      write_biff_rec(ba, 0, write_BOF_WK1(1030));
      write_biff_rec(ba, 6, write_RANGE(range));
      var max_R = Math.min(range.e.r, 8191);
      for (var R = range.s.r; R <= max_R; ++R) {
        var rr = encode_row(R);
        for (var C = range.s.c; C <= range.e.c; ++C) {
          if (R === range.s.r)
            cols[C] = encode_col(C);
          var ref = cols[C] + rr;
          var cell5 = dense ? (ws[R] || [])[C] : ws[ref];
          if (!cell5 || cell5.t == "z")
            continue;
          if (cell5.t == "n") {
            if ((cell5.v | 0) == cell5.v && cell5.v >= -32768 && cell5.v <= 32767)
              write_biff_rec(ba, 13, write_INTEGER(R, C, cell5.v));
            else
              write_biff_rec(ba, 14, write_NUMBER(R, C, cell5.v));
          } else {
            var str = format_cell(cell5);
            write_biff_rec(ba, 15, write_LABEL(R, C, str.slice(0, 239)));
          }
        }
      }
      write_biff_rec(ba, 1);
      return ba.end();
    }
    function book_to_wk3(wb, opts) {
      var o = opts || {};
      if (+o.codepage >= 0)
        set_cp(+o.codepage);
      if (o.type == "string")
        throw new Error("Cannot write WK3 to JS string");
      var ba = buf_array();
      write_biff_rec(ba, 0, write_BOF_WK3(wb));
      for (var i = 0, cnt = 0; i < wb.SheetNames.length; ++i)
        if ((wb.Sheets[wb.SheetNames[i]] || {})["!ref"])
          write_biff_rec(ba, 27, write_XFORMAT_SHEETNAME(wb.SheetNames[i], cnt++));
      var wsidx = 0;
      for (i = 0; i < wb.SheetNames.length; ++i) {
        var ws = wb.Sheets[wb.SheetNames[i]];
        if (!ws || !ws["!ref"])
          continue;
        var range = safe_decode_range(ws["!ref"]);
        var dense = Array.isArray(ws);
        var cols = [];
        var max_R = Math.min(range.e.r, 8191);
        for (var R = range.s.r; R <= max_R; ++R) {
          var rr = encode_row(R);
          for (var C = range.s.c; C <= range.e.c; ++C) {
            if (R === range.s.r)
              cols[C] = encode_col(C);
            var ref = cols[C] + rr;
            var cell5 = dense ? (ws[R] || [])[C] : ws[ref];
            if (!cell5 || cell5.t == "z")
              continue;
            if (cell5.t == "n") {
              write_biff_rec(ba, 23, write_NUMBER_17(R, C, wsidx, cell5.v));
            } else {
              var str = format_cell(cell5);
              write_biff_rec(ba, 22, write_LABEL_16(R, C, wsidx, str.slice(0, 239)));
            }
          }
        }
        ++wsidx;
      }
      write_biff_rec(ba, 1);
      return ba.end();
    }
    function write_BOF_WK1(v2) {
      var out = new_buf(2);
      out.write_shift(2, v2);
      return out;
    }
    function write_BOF_WK3(wb) {
      var out = new_buf(26);
      out.write_shift(2, 4096);
      out.write_shift(2, 4);
      out.write_shift(4, 0);
      var rows = 0, cols = 0, wscnt = 0;
      for (var i = 0; i < wb.SheetNames.length; ++i) {
        var name = wb.SheetNames[i];
        var ws = wb.Sheets[name];
        if (!ws || !ws["!ref"])
          continue;
        ++wscnt;
        var range = decode_range(ws["!ref"]);
        if (rows < range.e.r)
          rows = range.e.r;
        if (cols < range.e.c)
          cols = range.e.c;
      }
      if (rows > 8191)
        rows = 8191;
      out.write_shift(2, rows);
      out.write_shift(1, wscnt);
      out.write_shift(1, cols);
      out.write_shift(2, 0);
      out.write_shift(2, 0);
      out.write_shift(1, 1);
      out.write_shift(1, 2);
      out.write_shift(4, 0);
      out.write_shift(4, 0);
      return out;
    }
    function parse_RANGE(blob, length2, opts) {
      var o = { s: { c: 0, r: 0 }, e: { c: 0, r: 0 } };
      if (length2 == 8 && opts.qpro) {
        o.s.c = blob.read_shift(1);
        blob.l++;
        o.s.r = blob.read_shift(2);
        o.e.c = blob.read_shift(1);
        blob.l++;
        o.e.r = blob.read_shift(2);
        return o;
      }
      o.s.c = blob.read_shift(2);
      o.s.r = blob.read_shift(2);
      if (length2 == 12 && opts.qpro)
        blob.l += 2;
      o.e.c = blob.read_shift(2);
      o.e.r = blob.read_shift(2);
      if (length2 == 12 && opts.qpro)
        blob.l += 2;
      if (o.s.c == 65535)
        o.s.c = o.e.c = o.s.r = o.e.r = 0;
      return o;
    }
    function write_RANGE(range) {
      var out = new_buf(8);
      out.write_shift(2, range.s.c);
      out.write_shift(2, range.s.r);
      out.write_shift(2, range.e.c);
      out.write_shift(2, range.e.r);
      return out;
    }
    function parse_cell(blob, length2, opts) {
      var o = [{ c: 0, r: 0 }, { t: "n", v: 0 }, 0, 0];
      if (opts.qpro && opts.vers != 20768) {
        o[0].c = blob.read_shift(1);
        o[3] = blob.read_shift(1);
        o[0].r = blob.read_shift(2);
        blob.l += 2;
      } else {
        o[2] = blob.read_shift(1);
        o[0].c = blob.read_shift(2);
        o[0].r = blob.read_shift(2);
      }
      return o;
    }
    function parse_LABEL(blob, length2, opts) {
      var tgt = blob.l + length2;
      var o = parse_cell(blob, length2, opts);
      o[1].t = "s";
      if (opts.vers == 20768) {
        blob.l++;
        var len = blob.read_shift(1);
        o[1].v = blob.read_shift(len, "utf8");
        return o;
      }
      if (opts.qpro)
        blob.l++;
      o[1].v = blob.read_shift(tgt - blob.l, "cstr");
      return o;
    }
    function write_LABEL(R, C, s) {
      var o = new_buf(7 + s.length);
      o.write_shift(1, 255);
      o.write_shift(2, C);
      o.write_shift(2, R);
      o.write_shift(1, 39);
      for (var i = 0; i < o.length; ++i) {
        var cc = s.charCodeAt(i);
        o.write_shift(1, cc >= 128 ? 95 : cc);
      }
      o.write_shift(1, 0);
      return o;
    }
    function parse_INTEGER(blob, length2, opts) {
      var o = parse_cell(blob, length2, opts);
      o[1].v = blob.read_shift(2, "i");
      return o;
    }
    function write_INTEGER(R, C, v2) {
      var o = new_buf(7);
      o.write_shift(1, 255);
      o.write_shift(2, C);
      o.write_shift(2, R);
      o.write_shift(2, v2, "i");
      return o;
    }
    function parse_NUMBER(blob, length2, opts) {
      var o = parse_cell(blob, length2, opts);
      o[1].v = blob.read_shift(8, "f");
      return o;
    }
    function write_NUMBER(R, C, v2) {
      var o = new_buf(13);
      o.write_shift(1, 255);
      o.write_shift(2, C);
      o.write_shift(2, R);
      o.write_shift(8, v2, "f");
      return o;
    }
    function parse_FORMULA(blob, length2, opts) {
      var tgt = blob.l + length2;
      var o = parse_cell(blob, length2, opts);
      o[1].v = blob.read_shift(8, "f");
      if (opts.qpro)
        blob.l = tgt;
      else {
        var flen = blob.read_shift(2);
        wk1_fmla_to_csf(blob.slice(blob.l, blob.l + flen), o);
        blob.l += flen;
      }
      return o;
    }
    function wk1_parse_rc(B, V, col) {
      var rel = V & 32768;
      V &= ~32768;
      V = (rel ? B : 0) + (V >= 8192 ? V - 16384 : V);
      return (rel ? "" : "$") + (col ? encode_col(V) : encode_row(V));
    }
    var FuncTab = {
      51: ["FALSE", 0],
      52: ["TRUE", 0],
      70: ["LEN", 1],
      80: ["SUM", 69],
      81: ["AVERAGEA", 69],
      82: ["COUNTA", 69],
      83: ["MINA", 69],
      84: ["MAXA", 69],
      111: ["T", 1]
    };
    var BinOpTab = [
      "",
      "",
      "",
      "",
      "",
      "",
      "",
      "",
      // eslint-disable-line no-mixed-spaces-and-tabs
      "",
      "+",
      "-",
      "*",
      "/",
      "^",
      "=",
      "<>",
      // eslint-disable-line no-mixed-spaces-and-tabs
      "<=",
      ">=",
      "<",
      ">",
      "",
      "",
      "",
      "",
      // eslint-disable-line no-mixed-spaces-and-tabs
      "&",
      "",
      "",
      "",
      "",
      "",
      "",
      ""
      // eslint-disable-line no-mixed-spaces-and-tabs
    ];
    function wk1_fmla_to_csf(blob, o) {
      prep_blob(blob, 0);
      var out = [], argc = 0, R = "", C = "", argL = "", argR = "";
      while (blob.l < blob.length) {
        var cc = blob[blob.l++];
        switch (cc) {
          case 0:
            out.push(blob.read_shift(8, "f"));
            break;
          case 1:
            {
              C = wk1_parse_rc(o[0].c, blob.read_shift(2), true);
              R = wk1_parse_rc(o[0].r, blob.read_shift(2), false);
              out.push(C + R);
            }
            break;
          case 2:
            {
              var c2 = wk1_parse_rc(o[0].c, blob.read_shift(2), true);
              var r2 = wk1_parse_rc(o[0].r, blob.read_shift(2), false);
              C = wk1_parse_rc(o[0].c, blob.read_shift(2), true);
              R = wk1_parse_rc(o[0].r, blob.read_shift(2), false);
              out.push(c2 + r2 + ":" + C + R);
            }
            break;
          case 3:
            if (blob.l < blob.length) {
              console.error("WK1 premature formula end");
              return;
            }
            break;
          case 4:
            out.push("(" + out.pop() + ")");
            break;
          case 5:
            out.push(blob.read_shift(2));
            break;
          case 6:
            {
              var Z = "";
              while (cc = blob[blob.l++])
                Z += String.fromCharCode(cc);
              out.push('"' + Z.replace(/"/g, '""') + '"');
            }
            break;
          case 8:
            out.push("-" + out.pop());
            break;
          case 23:
            out.push("+" + out.pop());
            break;
          case 22:
            out.push("NOT(" + out.pop() + ")");
            break;
          case 20:
          case 21:
            {
              argR = out.pop();
              argL = out.pop();
              out.push(["AND", "OR"][cc - 20] + "(" + argL + "," + argR + ")");
            }
            break;
          default:
            if (cc < 32 && BinOpTab[cc]) {
              argR = out.pop();
              argL = out.pop();
              out.push(argL + BinOpTab[cc] + argR);
            } else if (FuncTab[cc]) {
              argc = FuncTab[cc][1];
              if (argc == 69)
                argc = blob[blob.l++];
              if (argc > out.length) {
                console.error("WK1 bad formula parse 0x" + cc.toString(16) + ":|" + out.join("|") + "|");
                return;
              }
              var args = out.slice(-argc);
              out.length -= argc;
              out.push(FuncTab[cc][0] + "(" + args.join(",") + ")");
            } else if (cc <= 7)
              return console.error("WK1 invalid opcode " + cc.toString(16));
            else if (cc <= 24)
              return console.error("WK1 unsupported op " + cc.toString(16));
            else if (cc <= 30)
              return console.error("WK1 invalid opcode " + cc.toString(16));
            else if (cc <= 115)
              return console.error("WK1 unsupported function opcode " + cc.toString(16));
            else
              return console.error("WK1 unrecognized opcode " + cc.toString(16));
        }
      }
      if (out.length == 1)
        o[1].f = "" + out[0];
      else
        console.error("WK1 bad formula parse |" + out.join("|") + "|");
    }
    function parse_cell_3(blob) {
      var o = [{ c: 0, r: 0 }, { t: "n", v: 0 }, 0];
      o[0].r = blob.read_shift(2);
      o[3] = blob[blob.l++];
      o[0].c = blob[blob.l++];
      return o;
    }
    function parse_LABEL_16(blob, length2) {
      var o = parse_cell_3(blob);
      o[1].t = "s";
      o[1].v = blob.read_shift(length2 - 4, "cstr");
      return o;
    }
    function write_LABEL_16(R, C, wsidx, s) {
      var o = new_buf(6 + s.length);
      o.write_shift(2, R);
      o.write_shift(1, wsidx);
      o.write_shift(1, C);
      o.write_shift(1, 39);
      for (var i = 0; i < s.length; ++i) {
        var cc = s.charCodeAt(i);
        o.write_shift(1, cc >= 128 ? 95 : cc);
      }
      o.write_shift(1, 0);
      return o;
    }
    function parse_NUMBER_18(blob, length2) {
      var o = parse_cell_3(blob);
      o[1].v = blob.read_shift(2);
      var v2 = o[1].v >> 1;
      if (o[1].v & 1) {
        switch (v2 & 7) {
          case 0:
            v2 = (v2 >> 3) * 5e3;
            break;
          case 1:
            v2 = (v2 >> 3) * 500;
            break;
          case 2:
            v2 = (v2 >> 3) / 20;
            break;
          case 3:
            v2 = (v2 >> 3) / 200;
            break;
          case 4:
            v2 = (v2 >> 3) / 2e3;
            break;
          case 5:
            v2 = (v2 >> 3) / 2e4;
            break;
          case 6:
            v2 = (v2 >> 3) / 16;
            break;
          case 7:
            v2 = (v2 >> 3) / 64;
            break;
        }
      }
      o[1].v = v2;
      return o;
    }
    function parse_NUMBER_17(blob, length2) {
      var o = parse_cell_3(blob);
      var v1 = blob.read_shift(4);
      var v2 = blob.read_shift(4);
      var e2 = blob.read_shift(2);
      if (e2 == 65535) {
        if (v1 === 0 && v2 === 3221225472) {
          o[1].t = "e";
          o[1].v = 15;
        } else if (v1 === 0 && v2 === 3489660928) {
          o[1].t = "e";
          o[1].v = 42;
        } else
          o[1].v = 0;
        return o;
      }
      var s = e2 & 32768;
      e2 = (e2 & 32767) - 16446;
      o[1].v = (1 - s * 2) * (v2 * Math.pow(2, e2 + 32) + v1 * Math.pow(2, e2));
      return o;
    }
    function write_NUMBER_17(R, C, wsidx, v2) {
      var o = new_buf(14);
      o.write_shift(2, R);
      o.write_shift(1, wsidx);
      o.write_shift(1, C);
      if (v2 == 0) {
        o.write_shift(4, 0);
        o.write_shift(4, 0);
        o.write_shift(2, 65535);
        return o;
      }
      var s = 0, e2 = 0, v1 = 0, v22 = 0;
      if (v2 < 0) {
        s = 1;
        v2 = -v2;
      }
      e2 = Math.log2(v2) | 0;
      v2 /= Math.pow(2, e2 - 31);
      v22 = v2 >>> 0;
      if ((v22 & 2147483648) == 0) {
        v2 /= 2;
        ++e2;
        v22 = v2 >>> 0;
      }
      v2 -= v22;
      v22 |= 2147483648;
      v22 >>>= 0;
      v2 *= Math.pow(2, 32);
      v1 = v2 >>> 0;
      o.write_shift(4, v1);
      o.write_shift(4, v22);
      e2 += 16383 + (s ? 32768 : 0);
      o.write_shift(2, e2);
      return o;
    }
    function parse_FORMULA_19(blob, length2) {
      var o = parse_NUMBER_17(blob);
      blob.l += length2 - 14;
      return o;
    }
    function parse_NUMBER_25(blob, length2) {
      var o = parse_cell_3(blob);
      var v1 = blob.read_shift(4);
      o[1].v = v1 >> 6;
      return o;
    }
    function parse_NUMBER_27(blob, length2) {
      var o = parse_cell_3(blob);
      var v1 = blob.read_shift(8, "f");
      o[1].v = v1;
      return o;
    }
    function parse_FORMULA_28(blob, length2) {
      var o = parse_NUMBER_27(blob);
      blob.l += length2 - 10;
      return o;
    }
    function parse_SHEETNAMECS(blob, length2) {
      return blob[blob.l + length2 - 1] == 0 ? blob.read_shift(length2, "cstr") : "";
    }
    function parse_SHEETNAMELP(blob, length2) {
      var len = blob[blob.l++];
      if (len > length2 - 1)
        len = length2 - 1;
      var o = "";
      while (o.length < len)
        o += String.fromCharCode(blob[blob.l++]);
      return o;
    }
    function parse_SHEETINFOQP(blob, length2, opts) {
      if (!opts.qpro || length2 < 21)
        return;
      var id2 = blob.read_shift(1);
      blob.l += 17;
      blob.l += 1;
      blob.l += 2;
      var nm = blob.read_shift(length2 - 21, "cstr");
      return [id2, nm];
    }
    function parse_XFORMAT(blob, length2) {
      var o = {}, tgt = blob.l + length2;
      while (blob.l < tgt) {
        var dt = blob.read_shift(2);
        if (dt == 14e3) {
          o[dt] = [0, ""];
          o[dt][0] = blob.read_shift(2);
          while (blob[blob.l]) {
            o[dt][1] += String.fromCharCode(blob[blob.l]);
            blob.l++;
          }
          blob.l++;
        }
      }
      return o;
    }
    function write_XFORMAT_SHEETNAME(name, wsidx) {
      var out = new_buf(5 + name.length);
      out.write_shift(2, 14e3);
      out.write_shift(2, wsidx);
      for (var i = 0; i < name.length; ++i) {
        var cc = name.charCodeAt(i);
        out[out.l++] = cc > 127 ? 95 : cc;
      }
      out[out.l++] = 0;
      return out;
    }
    var WK1Enum = {
      /*::[*/
      0: { n: "BOF", f: parseuint16 },
      /*::[*/
      1: { n: "EOF" },
      /*::[*/
      2: { n: "CALCMODE" },
      /*::[*/
      3: { n: "CALCORDER" },
      /*::[*/
      4: { n: "SPLIT" },
      /*::[*/
      5: { n: "SYNC" },
      /*::[*/
      6: { n: "RANGE", f: parse_RANGE },
      /*::[*/
      7: { n: "WINDOW1" },
      /*::[*/
      8: { n: "COLW1" },
      /*::[*/
      9: { n: "WINTWO" },
      /*::[*/
      10: { n: "COLW2" },
      /*::[*/
      11: { n: "NAME" },
      /*::[*/
      12: { n: "BLANK" },
      /*::[*/
      13: { n: "INTEGER", f: parse_INTEGER },
      /*::[*/
      14: { n: "NUMBER", f: parse_NUMBER },
      /*::[*/
      15: { n: "LABEL", f: parse_LABEL },
      /*::[*/
      16: { n: "FORMULA", f: parse_FORMULA },
      /*::[*/
      24: { n: "TABLE" },
      /*::[*/
      25: { n: "ORANGE" },
      /*::[*/
      26: { n: "PRANGE" },
      /*::[*/
      27: { n: "SRANGE" },
      /*::[*/
      28: { n: "FRANGE" },
      /*::[*/
      29: { n: "KRANGE1" },
      /*::[*/
      32: { n: "HRANGE" },
      /*::[*/
      35: { n: "KRANGE2" },
      /*::[*/
      36: { n: "PROTEC" },
      /*::[*/
      37: { n: "FOOTER" },
      /*::[*/
      38: { n: "HEADER" },
      /*::[*/
      39: { n: "SETUP" },
      /*::[*/
      40: { n: "MARGINS" },
      /*::[*/
      41: { n: "LABELFMT" },
      /*::[*/
      42: { n: "TITLES" },
      /*::[*/
      43: { n: "SHEETJS" },
      /*::[*/
      45: { n: "GRAPH" },
      /*::[*/
      46: { n: "NGRAPH" },
      /*::[*/
      47: { n: "CALCCOUNT" },
      /*::[*/
      48: { n: "UNFORMATTED" },
      /*::[*/
      49: { n: "CURSORW12" },
      /*::[*/
      50: { n: "WINDOW" },
      /*::[*/
      51: { n: "STRING", f: parse_LABEL },
      /*::[*/
      55: { n: "PASSWORD" },
      /*::[*/
      56: { n: "LOCKED" },
      /*::[*/
      60: { n: "QUERY" },
      /*::[*/
      61: { n: "QUERYNAME" },
      /*::[*/
      62: { n: "PRINT" },
      /*::[*/
      63: { n: "PRINTNAME" },
      /*::[*/
      64: { n: "GRAPH2" },
      /*::[*/
      65: { n: "GRAPHNAME" },
      /*::[*/
      66: { n: "ZOOM" },
      /*::[*/
      67: { n: "SYMSPLIT" },
      /*::[*/
      68: { n: "NSROWS" },
      /*::[*/
      69: { n: "NSCOLS" },
      /*::[*/
      70: { n: "RULER" },
      /*::[*/
      71: { n: "NNAME" },
      /*::[*/
      72: { n: "ACOMM" },
      /*::[*/
      73: { n: "AMACRO" },
      /*::[*/
      74: { n: "PARSE" },
      /*::[*/
      102: { n: "PRANGES??" },
      /*::[*/
      103: { n: "RRANGES??" },
      /*::[*/
      104: { n: "FNAME??" },
      /*::[*/
      105: { n: "MRANGES??" },
      /*::[*/
      204: { n: "SHEETNAMECS", f: parse_SHEETNAMECS },
      /*::[*/
      222: { n: "SHEETNAMELP", f: parse_SHEETNAMELP },
      /*::[*/
      65535: { n: "" }
    };
    var WK3Enum = {
      /*::[*/
      0: { n: "BOF" },
      /*::[*/
      1: { n: "EOF" },
      /*::[*/
      2: { n: "PASSWORD" },
      /*::[*/
      3: { n: "CALCSET" },
      /*::[*/
      4: { n: "WINDOWSET" },
      /*::[*/
      5: { n: "SHEETCELLPTR" },
      /*::[*/
      6: { n: "SHEETLAYOUT" },
      /*::[*/
      7: { n: "COLUMNWIDTH" },
      /*::[*/
      8: { n: "HIDDENCOLUMN" },
      /*::[*/
      9: { n: "USERRANGE" },
      /*::[*/
      10: { n: "SYSTEMRANGE" },
      /*::[*/
      11: { n: "ZEROFORCE" },
      /*::[*/
      12: { n: "SORTKEYDIR" },
      /*::[*/
      13: { n: "FILESEAL" },
      /*::[*/
      14: { n: "DATAFILLNUMS" },
      /*::[*/
      15: { n: "PRINTMAIN" },
      /*::[*/
      16: { n: "PRINTSTRING" },
      /*::[*/
      17: { n: "GRAPHMAIN" },
      /*::[*/
      18: { n: "GRAPHSTRING" },
      /*::[*/
      19: { n: "??" },
      /*::[*/
      20: { n: "ERRCELL" },
      /*::[*/
      21: { n: "NACELL" },
      /*::[*/
      22: { n: "LABEL16", f: parse_LABEL_16 },
      /*::[*/
      23: { n: "NUMBER17", f: parse_NUMBER_17 },
      /*::[*/
      24: { n: "NUMBER18", f: parse_NUMBER_18 },
      /*::[*/
      25: { n: "FORMULA19", f: parse_FORMULA_19 },
      /*::[*/
      26: { n: "FORMULA1A" },
      /*::[*/
      27: { n: "XFORMAT", f: parse_XFORMAT },
      /*::[*/
      28: { n: "DTLABELMISC" },
      /*::[*/
      29: { n: "DTLABELCELL" },
      /*::[*/
      30: { n: "GRAPHWINDOW" },
      /*::[*/
      31: { n: "CPA" },
      /*::[*/
      32: { n: "LPLAUTO" },
      /*::[*/
      33: { n: "QUERY" },
      /*::[*/
      34: { n: "HIDDENSHEET" },
      /*::[*/
      35: { n: "??" },
      /*::[*/
      37: { n: "NUMBER25", f: parse_NUMBER_25 },
      /*::[*/
      38: { n: "??" },
      /*::[*/
      39: { n: "NUMBER27", f: parse_NUMBER_27 },
      /*::[*/
      40: { n: "FORMULA28", f: parse_FORMULA_28 },
      /*::[*/
      142: { n: "??" },
      /*::[*/
      147: { n: "??" },
      /*::[*/
      150: { n: "??" },
      /*::[*/
      151: { n: "??" },
      /*::[*/
      152: { n: "??" },
      /*::[*/
      153: { n: "??" },
      /*::[*/
      154: { n: "??" },
      /*::[*/
      155: { n: "??" },
      /*::[*/
      156: { n: "??" },
      /*::[*/
      163: { n: "??" },
      /*::[*/
      174: { n: "??" },
      /*::[*/
      175: { n: "??" },
      /*::[*/
      176: { n: "??" },
      /*::[*/
      177: { n: "??" },
      /*::[*/
      184: { n: "??" },
      /*::[*/
      185: { n: "??" },
      /*::[*/
      186: { n: "??" },
      /*::[*/
      187: { n: "??" },
      /*::[*/
      188: { n: "??" },
      /*::[*/
      195: { n: "??" },
      /*::[*/
      201: { n: "??" },
      /*::[*/
      204: { n: "SHEETNAMECS", f: parse_SHEETNAMECS },
      /*::[*/
      205: { n: "??" },
      /*::[*/
      206: { n: "??" },
      /*::[*/
      207: { n: "??" },
      /*::[*/
      208: { n: "??" },
      /*::[*/
      256: { n: "??" },
      /*::[*/
      259: { n: "??" },
      /*::[*/
      260: { n: "??" },
      /*::[*/
      261: { n: "??" },
      /*::[*/
      262: { n: "??" },
      /*::[*/
      263: { n: "??" },
      /*::[*/
      265: { n: "??" },
      /*::[*/
      266: { n: "??" },
      /*::[*/
      267: { n: "??" },
      /*::[*/
      268: { n: "??" },
      /*::[*/
      270: { n: "??" },
      /*::[*/
      271: { n: "??" },
      /*::[*/
      384: { n: "??" },
      /*::[*/
      389: { n: "??" },
      /*::[*/
      390: { n: "??" },
      /*::[*/
      393: { n: "??" },
      /*::[*/
      396: { n: "??" },
      /*::[*/
      512: { n: "??" },
      /*::[*/
      514: { n: "??" },
      /*::[*/
      513: { n: "??" },
      /*::[*/
      516: { n: "??" },
      /*::[*/
      517: { n: "??" },
      /*::[*/
      640: { n: "??" },
      /*::[*/
      641: { n: "??" },
      /*::[*/
      642: { n: "??" },
      /*::[*/
      643: { n: "??" },
      /*::[*/
      644: { n: "??" },
      /*::[*/
      645: { n: "??" },
      /*::[*/
      646: { n: "??" },
      /*::[*/
      647: { n: "??" },
      /*::[*/
      648: { n: "??" },
      /*::[*/
      658: { n: "??" },
      /*::[*/
      659: { n: "??" },
      /*::[*/
      660: { n: "??" },
      /*::[*/
      661: { n: "??" },
      /*::[*/
      662: { n: "??" },
      /*::[*/
      665: { n: "??" },
      /*::[*/
      666: { n: "??" },
      /*::[*/
      768: { n: "??" },
      /*::[*/
      772: { n: "??" },
      /*::[*/
      1537: { n: "SHEETINFOQP", f: parse_SHEETINFOQP },
      /*::[*/
      1600: { n: "??" },
      /*::[*/
      1602: { n: "??" },
      /*::[*/
      1793: { n: "??" },
      /*::[*/
      1794: { n: "??" },
      /*::[*/
      1795: { n: "??" },
      /*::[*/
      1796: { n: "??" },
      /*::[*/
      1920: { n: "??" },
      /*::[*/
      2048: { n: "??" },
      /*::[*/
      2049: { n: "??" },
      /*::[*/
      2052: { n: "??" },
      /*::[*/
      2688: { n: "??" },
      /*::[*/
      10998: { n: "??" },
      /*::[*/
      12849: { n: "??" },
      /*::[*/
      28233: { n: "??" },
      /*::[*/
      28484: { n: "??" },
      /*::[*/
      65535: { n: "" }
    };
    return {
      sheet_to_wk1,
      book_to_wk3,
      to_workbook: lotus_to_workbook
    };
  }();
  var straywsregex = /^\s|\s$|[\t\n\r]/;
  function write_sst_xml(sst, opts) {
    if (!opts.bookSST)
      return "";
    var o = [XML_HEADER];
    o[o.length] = writextag("sst", null, {
      xmlns: XMLNS_main[0],
      count: sst.Count,
      uniqueCount: sst.Unique
    });
    for (var i = 0; i != sst.length; ++i) {
      if (sst[i] == null)
        continue;
      var s = sst[i];
      var sitag = "<si>";
      if (s.r)
        sitag += s.r;
      else {
        sitag += "<t";
        if (!s.t)
          s.t = "";
        if (s.t.match(straywsregex))
          sitag += ' xml:space="preserve"';
        sitag += ">" + escapexml(s.t) + "</t>";
      }
      sitag += "</si>";
      o[o.length] = sitag;
    }
    if (o.length > 2) {
      o[o.length] = "</sst>";
      o[1] = o[1].replace("/>", ">");
    }
    return o.join("");
  }
  function parse_BrtBeginSst(data) {
    return [data.read_shift(4), data.read_shift(4)];
  }
  function write_BrtBeginSst(sst, o) {
    if (!o)
      o = new_buf(8);
    o.write_shift(4, sst.Count);
    o.write_shift(4, sst.Unique);
    return o;
  }
  var write_BrtSSTItem = write_RichStr;
  function write_sst_bin(sst) {
    var ba = buf_array();
    write_record(ba, 159, write_BrtBeginSst(sst));
    for (var i = 0; i < sst.length; ++i)
      write_record(ba, 19, write_BrtSSTItem(sst[i]));
    write_record(
      ba,
      160
      /* BrtEndSst */
    );
    return ba.end();
  }
  function _JS2ANSI(str) {
    var o = [], oo = str.split("");
    for (var i = 0; i < oo.length; ++i)
      o[i] = oo[i].charCodeAt(0);
    return o;
  }
  function crypto_CreatePasswordVerifier_Method1(Password2) {
    var Verifier = 0, PasswordArray;
    var PasswordDecoded = _JS2ANSI(Password2);
    var len = PasswordDecoded.length + 1, i, PasswordByte;
    var Intermediate1, Intermediate2, Intermediate3;
    PasswordArray = new_raw_buf(len);
    PasswordArray[0] = PasswordDecoded.length;
    for (i = 1; i != len; ++i)
      PasswordArray[i] = PasswordDecoded[i - 1];
    for (i = len - 1; i >= 0; --i) {
      PasswordByte = PasswordArray[i];
      Intermediate1 = (Verifier & 16384) === 0 ? 0 : 1;
      Intermediate2 = Verifier << 1 & 32767;
      Intermediate3 = Intermediate1 | Intermediate2;
      Verifier = Intermediate3 ^ PasswordByte;
    }
    return Verifier ^ 52811;
  }
  var RTF = /* @__PURE__ */ function() {
    function rtf_to_sheet(d2, opts) {
      switch (opts.type) {
        case "base64":
          return rtf_to_sheet_str(Base64_decode(d2), opts);
        case "binary":
          return rtf_to_sheet_str(d2, opts);
        case "buffer":
          return rtf_to_sheet_str(has_buf && Buffer.isBuffer(d2) ? d2.toString("binary") : a2s(d2), opts);
        case "array":
          return rtf_to_sheet_str(cc2str(d2), opts);
      }
      throw new Error("Unrecognized type " + opts.type);
    }
    function rtf_to_sheet_str(str, opts) {
      var o = opts || {};
      var ws = o.dense ? [] : {};
      var rows = str.match(/\\trowd.*?\\row\b/g);
      if (!rows.length)
        throw new Error("RTF missing table");
      var range = { s: { c: 0, r: 0 }, e: { c: 0, r: rows.length - 1 } };
      rows.forEach(function(rowtf, R) {
        if (Array.isArray(ws))
          ws[R] = [];
        var rtfre = /\\\w+\b/g;
        var last_index = 0;
        var res;
        var C = -1;
        while (res = rtfre.exec(rowtf)) {
          switch (res[0]) {
            case "\\cell":
              var data = rowtf.slice(last_index, rtfre.lastIndex - res[0].length);
              if (data[0] == " ")
                data = data.slice(1);
              ++C;
              if (data.length) {
                var cell5 = { v: data, t: "s" };
                if (Array.isArray(ws))
                  ws[R][C] = cell5;
                else
                  ws[encode_cell({ r: R, c: C })] = cell5;
              }
              break;
          }
          last_index = rtfre.lastIndex;
        }
        if (C > range.e.c)
          range.e.c = C;
      });
      ws["!ref"] = encode_range(range);
      return ws;
    }
    function rtf_to_workbook(d2, opts) {
      return sheet_to_workbook(rtf_to_sheet(d2, opts), opts);
    }
    function sheet_to_rtf(ws) {
      var o = ["{\\rtf1\\ansi"];
      var r2 = safe_decode_range(ws["!ref"]), cell5;
      var dense = Array.isArray(ws);
      for (var R = r2.s.r; R <= r2.e.r; ++R) {
        o.push("\\trowd\\trautofit1");
        for (var C = r2.s.c; C <= r2.e.c; ++C)
          o.push("\\cellx" + (C + 1));
        o.push("\\pard\\intbl");
        for (C = r2.s.c; C <= r2.e.c; ++C) {
          var coord = encode_cell({ r: R, c: C });
          cell5 = dense ? (ws[R] || [])[C] : ws[coord];
          if (!cell5 || cell5.v == null && (!cell5.f || cell5.F))
            continue;
          o.push(" " + (cell5.w || (format_cell(cell5), cell5.w)));
          o.push("\\cell");
        }
        o.push("\\pard\\intbl\\row");
      }
      return o.join("") + "}";
    }
    return {
      to_workbook: rtf_to_workbook,
      to_sheet: rtf_to_sheet,
      from_sheet: sheet_to_rtf
    };
  }();
  function rgb2Hex(rgb) {
    for (var i = 0, o = 1; i != 3; ++i)
      o = o * 256 + (rgb[i] > 255 ? 255 : rgb[i] < 0 ? 0 : rgb[i]);
    return o.toString(16).toUpperCase().slice(1);
  }
  var DEF_MDW = 6, MDW = DEF_MDW;
  function width2px(width) {
    return Math.floor((width + Math.round(128 / MDW) / 256) * MDW);
  }
  function px2char(px2) {
    return Math.floor((px2 - 5) / MDW * 100 + 0.5) / 100;
  }
  function char2width(chr) {
    return Math.round((chr * MDW + 5) / MDW * 256) / 256;
  }
  function process_col(coll) {
    if (coll.width) {
      coll.wpx = width2px(coll.width);
      coll.wch = px2char(coll.wpx);
      coll.MDW = MDW;
    } else if (coll.wpx) {
      coll.wch = px2char(coll.wpx);
      coll.width = char2width(coll.wch);
      coll.MDW = MDW;
    } else if (typeof coll.wch == "number") {
      coll.width = char2width(coll.wch);
      coll.wpx = width2px(coll.width);
      coll.MDW = MDW;
    }
    if (coll.customWidth)
      delete coll.customWidth;
  }
  var DEF_PPI = 96, PPI = DEF_PPI;
  function px2pt(px2) {
    return px2 * 96 / PPI;
  }
  function pt2px(pt) {
    return pt * PPI / 96;
  }
  function write_numFmts(NF) {
    var o = ["<numFmts>"];
    [[5, 8], [23, 26], [41, 44], [
      /*63*/
      50,
      /*66],[164,*/
      392
    ]].forEach(function(r2) {
      for (var i = r2[0]; i <= r2[1]; ++i)
        if (NF[i] != null)
          o[o.length] = writextag("numFmt", null, { numFmtId: i, formatCode: escapexml(NF[i]) });
    });
    if (o.length === 1)
      return "";
    o[o.length] = "</numFmts>";
    o[0] = writextag("numFmts", null, { count: o.length - 2 }).replace("/>", ">");
    return o.join("");
  }
  function write_cellXfs(cellXfs) {
    var o = [];
    o[o.length] = writextag("cellXfs", null);
    cellXfs.forEach(function(c2) {
      o[o.length] = writextag("xf", null, c2);
    });
    o[o.length] = "</cellXfs>";
    if (o.length === 2)
      return "";
    o[0] = writextag("cellXfs", null, { count: o.length - 2 }).replace("/>", ">");
    return o.join("");
  }
  function write_sty_xml(wb, opts) {
    var o = [XML_HEADER, writextag("styleSheet", null, {
      "xmlns": XMLNS_main[0],
      "xmlns:vt": XMLNS.vt
    })], w2;
    if (wb.SSF && (w2 = write_numFmts(wb.SSF)) != null)
      o[o.length] = w2;
    o[o.length] = '<fonts count="1"><font><sz val="12"/><color theme="1"/><name val="Calibri"/><family val="2"/><scheme val="minor"/></font></fonts>';
    o[o.length] = '<fills count="2"><fill><patternFill patternType="none"/></fill><fill><patternFill patternType="gray125"/></fill></fills>';
    o[o.length] = '<borders count="1"><border><left/><right/><top/><bottom/><diagonal/></border></borders>';
    o[o.length] = '<cellStyleXfs count="1"><xf numFmtId="0" fontId="0" fillId="0" borderId="0"/></cellStyleXfs>';
    if (w2 = write_cellXfs(opts.cellXfs))
      o[o.length] = w2;
    o[o.length] = '<cellStyles count="1"><cellStyle name="Normal" xfId="0" builtinId="0"/></cellStyles>';
    o[o.length] = '<dxfs count="0"/>';
    o[o.length] = '<tableStyles count="0" defaultTableStyle="TableStyleMedium9" defaultPivotStyle="PivotStyleMedium4"/>';
    if (o.length > 2) {
      o[o.length] = "</styleSheet>";
      o[1] = o[1].replace("/>", ">");
    }
    return o.join("");
  }
  function parse_BrtFmt(data, length2) {
    var numFmtId = data.read_shift(2);
    var stFmtCode = parse_XLWideString(data);
    return [numFmtId, stFmtCode];
  }
  function write_BrtFmt(i, f2, o) {
    if (!o)
      o = new_buf(6 + 4 * f2.length);
    o.write_shift(2, i);
    write_XLWideString(f2, o);
    var out = o.length > o.l ? o.slice(0, o.l) : o;
    if (o.l == null)
      o.l = o.length;
    return out;
  }
  function parse_BrtFont(data, length2, opts) {
    var out = {};
    out.sz = data.read_shift(2) / 20;
    var grbit = parse_FontFlags(data);
    if (grbit.fItalic)
      out.italic = 1;
    if (grbit.fCondense)
      out.condense = 1;
    if (grbit.fExtend)
      out.extend = 1;
    if (grbit.fShadow)
      out.shadow = 1;
    if (grbit.fOutline)
      out.outline = 1;
    if (grbit.fStrikeout)
      out.strike = 1;
    var bls = data.read_shift(2);
    if (bls === 700)
      out.bold = 1;
    switch (data.read_shift(2)) {
      case 1:
        out.vertAlign = "superscript";
        break;
      case 2:
        out.vertAlign = "subscript";
        break;
    }
    var underline = data.read_shift(1);
    if (underline != 0)
      out.underline = underline;
    var family = data.read_shift(1);
    if (family > 0)
      out.family = family;
    var bCharSet = data.read_shift(1);
    if (bCharSet > 0)
      out.charset = bCharSet;
    data.l++;
    out.color = parse_BrtColor(data);
    switch (data.read_shift(1)) {
      case 1:
        out.scheme = "major";
        break;
      case 2:
        out.scheme = "minor";
        break;
    }
    out.name = parse_XLWideString(data);
    return out;
  }
  function write_BrtFont(font, o) {
    if (!o)
      o = new_buf(25 + 4 * 32);
    o.write_shift(2, font.sz * 20);
    write_FontFlags(font, o);
    o.write_shift(2, font.bold ? 700 : 400);
    var sss = 0;
    if (font.vertAlign == "superscript")
      sss = 1;
    else if (font.vertAlign == "subscript")
      sss = 2;
    o.write_shift(2, sss);
    o.write_shift(1, font.underline || 0);
    o.write_shift(1, font.family || 0);
    o.write_shift(1, font.charset || 0);
    o.write_shift(1, 0);
    write_BrtColor(font.color, o);
    var scheme = 0;
    if (font.scheme == "major")
      scheme = 1;
    if (font.scheme == "minor")
      scheme = 2;
    o.write_shift(1, scheme);
    write_XLWideString(font.name, o);
    return o.length > o.l ? o.slice(0, o.l) : o;
  }
  var XLSBFillPTNames = [
    "none",
    "solid",
    "mediumGray",
    "darkGray",
    "lightGray",
    "darkHorizontal",
    "darkVertical",
    "darkDown",
    "darkUp",
    "darkGrid",
    "darkTrellis",
    "lightHorizontal",
    "lightVertical",
    "lightDown",
    "lightUp",
    "lightGrid",
    "lightTrellis",
    "gray125",
    "gray0625"
  ];
  var rev_XLSBFillPTNames;
  var parse_BrtFill = parsenoop;
  function write_BrtFill(fill2, o) {
    if (!o)
      o = new_buf(4 * 3 + 8 * 7 + 16 * 1);
    if (!rev_XLSBFillPTNames)
      rev_XLSBFillPTNames = evert(XLSBFillPTNames);
    var fls = rev_XLSBFillPTNames[fill2.patternType];
    if (fls == null)
      fls = 40;
    o.write_shift(4, fls);
    var j = 0;
    if (fls != 40) {
      write_BrtColor({ auto: 1 }, o);
      write_BrtColor({ auto: 1 }, o);
      for (; j < 12; ++j)
        o.write_shift(4, 0);
    } else {
      for (; j < 4; ++j)
        o.write_shift(4, 0);
      for (; j < 12; ++j)
        o.write_shift(4, 0);
    }
    return o.length > o.l ? o.slice(0, o.l) : o;
  }
  function parse_BrtXF(data, length2) {
    var tgt = data.l + length2;
    var ixfeParent = data.read_shift(2);
    var ifmt = data.read_shift(2);
    data.l = tgt;
    return { ixfe: ixfeParent, numFmtId: ifmt };
  }
  function write_BrtXF(data, ixfeP, o) {
    if (!o)
      o = new_buf(16);
    o.write_shift(2, ixfeP || 0);
    o.write_shift(2, data.numFmtId || 0);
    o.write_shift(2, 0);
    o.write_shift(2, 0);
    o.write_shift(2, 0);
    o.write_shift(1, 0);
    o.write_shift(1, 0);
    var flow = 0;
    o.write_shift(1, flow);
    o.write_shift(1, 0);
    o.write_shift(1, 0);
    o.write_shift(1, 0);
    return o;
  }
  function write_Blxf(data, o) {
    if (!o)
      o = new_buf(10);
    o.write_shift(1, 0);
    o.write_shift(1, 0);
    o.write_shift(4, 0);
    o.write_shift(4, 0);
    return o;
  }
  var parse_BrtBorder = parsenoop;
  function write_BrtBorder(border, o) {
    if (!o)
      o = new_buf(51);
    o.write_shift(1, 0);
    write_Blxf(null, o);
    write_Blxf(null, o);
    write_Blxf(null, o);
    write_Blxf(null, o);
    write_Blxf(null, o);
    return o.length > o.l ? o.slice(0, o.l) : o;
  }
  function write_BrtStyle(style, o) {
    if (!o)
      o = new_buf(12 + 4 * 10);
    o.write_shift(4, style.xfId);
    o.write_shift(2, 1);
    o.write_shift(1, +style.builtinId);
    o.write_shift(1, 0);
    write_XLNullableWideString(style.name || "", o);
    return o.length > o.l ? o.slice(0, o.l) : o;
  }
  function write_BrtBeginTableStyles(cnt, defTableStyle, defPivotStyle) {
    var o = new_buf(4 + 256 * 2 * 4);
    o.write_shift(4, cnt);
    write_XLNullableWideString(defTableStyle, o);
    write_XLNullableWideString(defPivotStyle, o);
    return o.length > o.l ? o.slice(0, o.l) : o;
  }
  function write_FMTS_bin(ba, NF) {
    if (!NF)
      return;
    var cnt = 0;
    [[5, 8], [23, 26], [41, 44], [
      /*63*/
      50,
      /*66],[164,*/
      392
    ]].forEach(function(r2) {
      for (var i = r2[0]; i <= r2[1]; ++i)
        if (NF[i] != null)
          ++cnt;
    });
    if (cnt == 0)
      return;
    write_record(ba, 615, write_UInt32LE(cnt));
    [[5, 8], [23, 26], [41, 44], [
      /*63*/
      50,
      /*66],[164,*/
      392
    ]].forEach(function(r2) {
      for (var i = r2[0]; i <= r2[1]; ++i)
        if (NF[i] != null)
          write_record(ba, 44, write_BrtFmt(i, NF[i]));
    });
    write_record(
      ba,
      616
      /* BrtEndFmts */
    );
  }
  function write_FONTS_bin(ba) {
    var cnt = 1;
    write_record(ba, 611, write_UInt32LE(cnt));
    write_record(ba, 43, write_BrtFont({
      sz: 12,
      color: { theme: 1 },
      name: "Calibri",
      family: 2,
      scheme: "minor"
    }));
    write_record(
      ba,
      612
      /* BrtEndFonts */
    );
  }
  function write_FILLS_bin(ba) {
    var cnt = 2;
    write_record(ba, 603, write_UInt32LE(cnt));
    write_record(ba, 45, write_BrtFill({ patternType: "none" }));
    write_record(ba, 45, write_BrtFill({ patternType: "gray125" }));
    write_record(
      ba,
      604
      /* BrtEndFills */
    );
  }
  function write_BORDERS_bin(ba) {
    var cnt = 1;
    write_record(ba, 613, write_UInt32LE(cnt));
    write_record(ba, 46, write_BrtBorder());
    write_record(
      ba,
      614
      /* BrtEndBorders */
    );
  }
  function write_CELLSTYLEXFS_bin(ba) {
    var cnt = 1;
    write_record(ba, 626, write_UInt32LE(cnt));
    write_record(ba, 47, write_BrtXF({
      numFmtId: 0,
      fontId: 0,
      fillId: 0,
      borderId: 0
    }, 65535));
    write_record(
      ba,
      627
      /* BrtEndCellStyleXFs */
    );
  }
  function write_CELLXFS_bin(ba, data) {
    write_record(ba, 617, write_UInt32LE(data.length));
    data.forEach(function(c2) {
      write_record(ba, 47, write_BrtXF(c2, 0));
    });
    write_record(
      ba,
      618
      /* BrtEndCellXFs */
    );
  }
  function write_STYLES_bin(ba) {
    var cnt = 1;
    write_record(ba, 619, write_UInt32LE(cnt));
    write_record(ba, 48, write_BrtStyle({
      xfId: 0,
      builtinId: 0,
      name: "Normal"
    }));
    write_record(
      ba,
      620
      /* BrtEndStyles */
    );
  }
  function write_DXFS_bin(ba) {
    var cnt = 0;
    write_record(ba, 505, write_UInt32LE(cnt));
    write_record(
      ba,
      506
      /* BrtEndDXFs */
    );
  }
  function write_TABLESTYLES_bin(ba) {
    var cnt = 0;
    write_record(ba, 508, write_BrtBeginTableStyles(cnt, "TableStyleMedium9", "PivotStyleMedium4"));
    write_record(
      ba,
      509
      /* BrtEndTableStyles */
    );
  }
  function write_sty_bin(wb, opts) {
    var ba = buf_array();
    write_record(
      ba,
      278
      /* BrtBeginStyleSheet */
    );
    write_FMTS_bin(ba, wb.SSF);
    write_FONTS_bin(ba);
    write_FILLS_bin(ba);
    write_BORDERS_bin(ba);
    write_CELLSTYLEXFS_bin(ba);
    write_CELLXFS_bin(ba, opts.cellXfs);
    write_STYLES_bin(ba);
    write_DXFS_bin(ba);
    write_TABLESTYLES_bin(ba);
    write_record(
      ba,
      279
      /* BrtEndStyleSheet */
    );
    return ba.end();
  }
  function write_theme(Themes, opts) {
    if (opts && opts.themeXLSX)
      return opts.themeXLSX;
    if (Themes && typeof Themes.raw == "string")
      return Themes.raw;
    var o = [XML_HEADER];
    o[o.length] = '<a:theme xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" name="Office Theme">';
    o[o.length] = "<a:themeElements>";
    o[o.length] = '<a:clrScheme name="Office">';
    o[o.length] = '<a:dk1><a:sysClr val="windowText" lastClr="000000"/></a:dk1>';
    o[o.length] = '<a:lt1><a:sysClr val="window" lastClr="FFFFFF"/></a:lt1>';
    o[o.length] = '<a:dk2><a:srgbClr val="1F497D"/></a:dk2>';
    o[o.length] = '<a:lt2><a:srgbClr val="EEECE1"/></a:lt2>';
    o[o.length] = '<a:accent1><a:srgbClr val="4F81BD"/></a:accent1>';
    o[o.length] = '<a:accent2><a:srgbClr val="C0504D"/></a:accent2>';
    o[o.length] = '<a:accent3><a:srgbClr val="9BBB59"/></a:accent3>';
    o[o.length] = '<a:accent4><a:srgbClr val="8064A2"/></a:accent4>';
    o[o.length] = '<a:accent5><a:srgbClr val="4BACC6"/></a:accent5>';
    o[o.length] = '<a:accent6><a:srgbClr val="F79646"/></a:accent6>';
    o[o.length] = '<a:hlink><a:srgbClr val="0000FF"/></a:hlink>';
    o[o.length] = '<a:folHlink><a:srgbClr val="800080"/></a:folHlink>';
    o[o.length] = "</a:clrScheme>";
    o[o.length] = '<a:fontScheme name="Office">';
    o[o.length] = "<a:majorFont>";
    o[o.length] = '<a:latin typeface="Cambria"/>';
    o[o.length] = '<a:ea typeface=""/>';
    o[o.length] = '<a:cs typeface=""/>';
    o[o.length] = '<a:font script="Jpan" typeface="MS Pゴシック"/>';
    o[o.length] = '<a:font script="Hang" typeface="맑은 고딕"/>';
    o[o.length] = '<a:font script="Hans" typeface="宋体"/>';
    o[o.length] = '<a:font script="Hant" typeface="新細明體"/>';
    o[o.length] = '<a:font script="Arab" typeface="Times New Roman"/>';
    o[o.length] = '<a:font script="Hebr" typeface="Times New Roman"/>';
    o[o.length] = '<a:font script="Thai" typeface="Tahoma"/>';
    o[o.length] = '<a:font script="Ethi" typeface="Nyala"/>';
    o[o.length] = '<a:font script="Beng" typeface="Vrinda"/>';
    o[o.length] = '<a:font script="Gujr" typeface="Shruti"/>';
    o[o.length] = '<a:font script="Khmr" typeface="MoolBoran"/>';
    o[o.length] = '<a:font script="Knda" typeface="Tunga"/>';
    o[o.length] = '<a:font script="Guru" typeface="Raavi"/>';
    o[o.length] = '<a:font script="Cans" typeface="Euphemia"/>';
    o[o.length] = '<a:font script="Cher" typeface="Plantagenet Cherokee"/>';
    o[o.length] = '<a:font script="Yiii" typeface="Microsoft Yi Baiti"/>';
    o[o.length] = '<a:font script="Tibt" typeface="Microsoft Himalaya"/>';
    o[o.length] = '<a:font script="Thaa" typeface="MV Boli"/>';
    o[o.length] = '<a:font script="Deva" typeface="Mangal"/>';
    o[o.length] = '<a:font script="Telu" typeface="Gautami"/>';
    o[o.length] = '<a:font script="Taml" typeface="Latha"/>';
    o[o.length] = '<a:font script="Syrc" typeface="Estrangelo Edessa"/>';
    o[o.length] = '<a:font script="Orya" typeface="Kalinga"/>';
    o[o.length] = '<a:font script="Mlym" typeface="Kartika"/>';
    o[o.length] = '<a:font script="Laoo" typeface="DokChampa"/>';
    o[o.length] = '<a:font script="Sinh" typeface="Iskoola Pota"/>';
    o[o.length] = '<a:font script="Mong" typeface="Mongolian Baiti"/>';
    o[o.length] = '<a:font script="Viet" typeface="Times New Roman"/>';
    o[o.length] = '<a:font script="Uigh" typeface="Microsoft Uighur"/>';
    o[o.length] = '<a:font script="Geor" typeface="Sylfaen"/>';
    o[o.length] = "</a:majorFont>";
    o[o.length] = "<a:minorFont>";
    o[o.length] = '<a:latin typeface="Calibri"/>';
    o[o.length] = '<a:ea typeface=""/>';
    o[o.length] = '<a:cs typeface=""/>';
    o[o.length] = '<a:font script="Jpan" typeface="MS Pゴシック"/>';
    o[o.length] = '<a:font script="Hang" typeface="맑은 고딕"/>';
    o[o.length] = '<a:font script="Hans" typeface="宋体"/>';
    o[o.length] = '<a:font script="Hant" typeface="新細明體"/>';
    o[o.length] = '<a:font script="Arab" typeface="Arial"/>';
    o[o.length] = '<a:font script="Hebr" typeface="Arial"/>';
    o[o.length] = '<a:font script="Thai" typeface="Tahoma"/>';
    o[o.length] = '<a:font script="Ethi" typeface="Nyala"/>';
    o[o.length] = '<a:font script="Beng" typeface="Vrinda"/>';
    o[o.length] = '<a:font script="Gujr" typeface="Shruti"/>';
    o[o.length] = '<a:font script="Khmr" typeface="DaunPenh"/>';
    o[o.length] = '<a:font script="Knda" typeface="Tunga"/>';
    o[o.length] = '<a:font script="Guru" typeface="Raavi"/>';
    o[o.length] = '<a:font script="Cans" typeface="Euphemia"/>';
    o[o.length] = '<a:font script="Cher" typeface="Plantagenet Cherokee"/>';
    o[o.length] = '<a:font script="Yiii" typeface="Microsoft Yi Baiti"/>';
    o[o.length] = '<a:font script="Tibt" typeface="Microsoft Himalaya"/>';
    o[o.length] = '<a:font script="Thaa" typeface="MV Boli"/>';
    o[o.length] = '<a:font script="Deva" typeface="Mangal"/>';
    o[o.length] = '<a:font script="Telu" typeface="Gautami"/>';
    o[o.length] = '<a:font script="Taml" typeface="Latha"/>';
    o[o.length] = '<a:font script="Syrc" typeface="Estrangelo Edessa"/>';
    o[o.length] = '<a:font script="Orya" typeface="Kalinga"/>';
    o[o.length] = '<a:font script="Mlym" typeface="Kartika"/>';
    o[o.length] = '<a:font script="Laoo" typeface="DokChampa"/>';
    o[o.length] = '<a:font script="Sinh" typeface="Iskoola Pota"/>';
    o[o.length] = '<a:font script="Mong" typeface="Mongolian Baiti"/>';
    o[o.length] = '<a:font script="Viet" typeface="Arial"/>';
    o[o.length] = '<a:font script="Uigh" typeface="Microsoft Uighur"/>';
    o[o.length] = '<a:font script="Geor" typeface="Sylfaen"/>';
    o[o.length] = "</a:minorFont>";
    o[o.length] = "</a:fontScheme>";
    o[o.length] = '<a:fmtScheme name="Office">';
    o[o.length] = "<a:fillStyleLst>";
    o[o.length] = '<a:solidFill><a:schemeClr val="phClr"/></a:solidFill>';
    o[o.length] = '<a:gradFill rotWithShape="1">';
    o[o.length] = "<a:gsLst>";
    o[o.length] = '<a:gs pos="0"><a:schemeClr val="phClr"><a:tint val="50000"/><a:satMod val="300000"/></a:schemeClr></a:gs>';
    o[o.length] = '<a:gs pos="35000"><a:schemeClr val="phClr"><a:tint val="37000"/><a:satMod val="300000"/></a:schemeClr></a:gs>';
    o[o.length] = '<a:gs pos="100000"><a:schemeClr val="phClr"><a:tint val="15000"/><a:satMod val="350000"/></a:schemeClr></a:gs>';
    o[o.length] = "</a:gsLst>";
    o[o.length] = '<a:lin ang="16200000" scaled="1"/>';
    o[o.length] = "</a:gradFill>";
    o[o.length] = '<a:gradFill rotWithShape="1">';
    o[o.length] = "<a:gsLst>";
    o[o.length] = '<a:gs pos="0"><a:schemeClr val="phClr"><a:tint val="100000"/><a:shade val="100000"/><a:satMod val="130000"/></a:schemeClr></a:gs>';
    o[o.length] = '<a:gs pos="100000"><a:schemeClr val="phClr"><a:tint val="50000"/><a:shade val="100000"/><a:satMod val="350000"/></a:schemeClr></a:gs>';
    o[o.length] = "</a:gsLst>";
    o[o.length] = '<a:lin ang="16200000" scaled="0"/>';
    o[o.length] = "</a:gradFill>";
    o[o.length] = "</a:fillStyleLst>";
    o[o.length] = "<a:lnStyleLst>";
    o[o.length] = '<a:ln w="9525" cap="flat" cmpd="sng" algn="ctr"><a:solidFill><a:schemeClr val="phClr"><a:shade val="95000"/><a:satMod val="105000"/></a:schemeClr></a:solidFill><a:prstDash val="solid"/></a:ln>';
    o[o.length] = '<a:ln w="25400" cap="flat" cmpd="sng" algn="ctr"><a:solidFill><a:schemeClr val="phClr"/></a:solidFill><a:prstDash val="solid"/></a:ln>';
    o[o.length] = '<a:ln w="38100" cap="flat" cmpd="sng" algn="ctr"><a:solidFill><a:schemeClr val="phClr"/></a:solidFill><a:prstDash val="solid"/></a:ln>';
    o[o.length] = "</a:lnStyleLst>";
    o[o.length] = "<a:effectStyleLst>";
    o[o.length] = "<a:effectStyle>";
    o[o.length] = "<a:effectLst>";
    o[o.length] = '<a:outerShdw blurRad="40000" dist="20000" dir="5400000" rotWithShape="0"><a:srgbClr val="000000"><a:alpha val="38000"/></a:srgbClr></a:outerShdw>';
    o[o.length] = "</a:effectLst>";
    o[o.length] = "</a:effectStyle>";
    o[o.length] = "<a:effectStyle>";
    o[o.length] = "<a:effectLst>";
    o[o.length] = '<a:outerShdw blurRad="40000" dist="23000" dir="5400000" rotWithShape="0"><a:srgbClr val="000000"><a:alpha val="35000"/></a:srgbClr></a:outerShdw>';
    o[o.length] = "</a:effectLst>";
    o[o.length] = "</a:effectStyle>";
    o[o.length] = "<a:effectStyle>";
    o[o.length] = "<a:effectLst>";
    o[o.length] = '<a:outerShdw blurRad="40000" dist="23000" dir="5400000" rotWithShape="0"><a:srgbClr val="000000"><a:alpha val="35000"/></a:srgbClr></a:outerShdw>';
    o[o.length] = "</a:effectLst>";
    o[o.length] = '<a:scene3d><a:camera prst="orthographicFront"><a:rot lat="0" lon="0" rev="0"/></a:camera><a:lightRig rig="threePt" dir="t"><a:rot lat="0" lon="0" rev="1200000"/></a:lightRig></a:scene3d>';
    o[o.length] = '<a:sp3d><a:bevelT w="63500" h="25400"/></a:sp3d>';
    o[o.length] = "</a:effectStyle>";
    o[o.length] = "</a:effectStyleLst>";
    o[o.length] = "<a:bgFillStyleLst>";
    o[o.length] = '<a:solidFill><a:schemeClr val="phClr"/></a:solidFill>';
    o[o.length] = '<a:gradFill rotWithShape="1">';
    o[o.length] = "<a:gsLst>";
    o[o.length] = '<a:gs pos="0"><a:schemeClr val="phClr"><a:tint val="40000"/><a:satMod val="350000"/></a:schemeClr></a:gs>';
    o[o.length] = '<a:gs pos="40000"><a:schemeClr val="phClr"><a:tint val="45000"/><a:shade val="99000"/><a:satMod val="350000"/></a:schemeClr></a:gs>';
    o[o.length] = '<a:gs pos="100000"><a:schemeClr val="phClr"><a:shade val="20000"/><a:satMod val="255000"/></a:schemeClr></a:gs>';
    o[o.length] = "</a:gsLst>";
    o[o.length] = '<a:path path="circle"><a:fillToRect l="50000" t="-80000" r="50000" b="180000"/></a:path>';
    o[o.length] = "</a:gradFill>";
    o[o.length] = '<a:gradFill rotWithShape="1">';
    o[o.length] = "<a:gsLst>";
    o[o.length] = '<a:gs pos="0"><a:schemeClr val="phClr"><a:tint val="80000"/><a:satMod val="300000"/></a:schemeClr></a:gs>';
    o[o.length] = '<a:gs pos="100000"><a:schemeClr val="phClr"><a:shade val="30000"/><a:satMod val="200000"/></a:schemeClr></a:gs>';
    o[o.length] = "</a:gsLst>";
    o[o.length] = '<a:path path="circle"><a:fillToRect l="50000" t="50000" r="50000" b="50000"/></a:path>';
    o[o.length] = "</a:gradFill>";
    o[o.length] = "</a:bgFillStyleLst>";
    o[o.length] = "</a:fmtScheme>";
    o[o.length] = "</a:themeElements>";
    o[o.length] = "<a:objectDefaults>";
    o[o.length] = "<a:spDef>";
    o[o.length] = '<a:spPr/><a:bodyPr/><a:lstStyle/><a:style><a:lnRef idx="1"><a:schemeClr val="accent1"/></a:lnRef><a:fillRef idx="3"><a:schemeClr val="accent1"/></a:fillRef><a:effectRef idx="2"><a:schemeClr val="accent1"/></a:effectRef><a:fontRef idx="minor"><a:schemeClr val="lt1"/></a:fontRef></a:style>';
    o[o.length] = "</a:spDef>";
    o[o.length] = "<a:lnDef>";
    o[o.length] = '<a:spPr/><a:bodyPr/><a:lstStyle/><a:style><a:lnRef idx="2"><a:schemeClr val="accent1"/></a:lnRef><a:fillRef idx="0"><a:schemeClr val="accent1"/></a:fillRef><a:effectRef idx="1"><a:schemeClr val="accent1"/></a:effectRef><a:fontRef idx="minor"><a:schemeClr val="tx1"/></a:fontRef></a:style>';
    o[o.length] = "</a:lnDef>";
    o[o.length] = "</a:objectDefaults>";
    o[o.length] = "<a:extraClrSchemeLst/>";
    o[o.length] = "</a:theme>";
    return o.join("");
  }
  function parse_BrtMdtinfo(data, length2) {
    return {
      flags: data.read_shift(4),
      version: data.read_shift(4),
      name: parse_XLWideString(data)
    };
  }
  function write_BrtMdtinfo(data) {
    var o = new_buf(12 + 2 * data.name.length);
    o.write_shift(4, data.flags);
    o.write_shift(4, data.version);
    write_XLWideString(data.name, o);
    return o.slice(0, o.l);
  }
  function parse_BrtMdb(data) {
    var out = [];
    var cnt = data.read_shift(4);
    while (cnt-- > 0)
      out.push([data.read_shift(4), data.read_shift(4)]);
    return out;
  }
  function write_BrtMdb(mdb) {
    var o = new_buf(4 + 8 * mdb.length);
    o.write_shift(4, mdb.length);
    for (var i = 0; i < mdb.length; ++i) {
      o.write_shift(4, mdb[i][0]);
      o.write_shift(4, mdb[i][1]);
    }
    return o;
  }
  function write_BrtBeginEsfmd(cnt, name) {
    var o = new_buf(8 + 2 * name.length);
    o.write_shift(4, cnt);
    write_XLWideString(name, o);
    return o.slice(0, o.l);
  }
  function parse_BrtBeginEsmdb(data) {
    data.l += 4;
    return data.read_shift(4) != 0;
  }
  function write_BrtBeginEsmdb(cnt, cm) {
    var o = new_buf(8);
    o.write_shift(4, cnt);
    o.write_shift(4, cm ? 1 : 0);
    return o;
  }
  function write_xlmeta_bin() {
    var ba = buf_array();
    write_record(ba, 332);
    write_record(ba, 334, write_UInt32LE(1));
    write_record(ba, 335, write_BrtMdtinfo({
      name: "XLDAPR",
      version: 12e4,
      flags: 3496657072
    }));
    write_record(ba, 336);
    write_record(ba, 339, write_BrtBeginEsfmd(1, "XLDAPR"));
    write_record(ba, 52);
    write_record(ba, 35, write_UInt32LE(514));
    write_record(ba, 4096, write_UInt32LE(0));
    write_record(ba, 4097, writeuint16(1));
    write_record(ba, 36);
    write_record(ba, 53);
    write_record(ba, 340);
    write_record(ba, 337, write_BrtBeginEsmdb(1, true));
    write_record(ba, 51, write_BrtMdb([[1, 0]]));
    write_record(ba, 338);
    write_record(ba, 333);
    return ba.end();
  }
  function write_xlmeta_xml() {
    var o = [XML_HEADER];
    o.push('<metadata xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:xlrd="http://schemas.microsoft.com/office/spreadsheetml/2017/richdata" xmlns:xda="http://schemas.microsoft.com/office/spreadsheetml/2017/dynamicarray">\n  <metadataTypes count="1">\n    <metadataType name="XLDAPR" minSupportedVersion="120000" copy="1" pasteAll="1" pasteValues="1" merge="1" splitFirst="1" rowColShift="1" clearFormats="1" clearComments="1" assign="1" coerce="1" cellMeta="1"/>\n  </metadataTypes>\n  <futureMetadata name="XLDAPR" count="1">\n    <bk>\n      <extLst>\n        <ext uri="{bdbb8cdc-fa1e-496e-a857-3c3f30c029c3}">\n          <xda:dynamicArrayProperties fDynamic="1" fCollapsed="0"/>\n        </ext>\n      </extLst>\n    </bk>\n  </futureMetadata>\n  <cellMetadata count="1">\n    <bk>\n      <rc t="1" v="0"/>\n    </bk>\n  </cellMetadata>\n</metadata>');
    return o.join("");
  }
  function parse_BrtCalcChainItem$(data) {
    var out = {};
    out.i = data.read_shift(4);
    var cell5 = {};
    cell5.r = data.read_shift(4);
    cell5.c = data.read_shift(4);
    out.r = encode_cell(cell5);
    var flags = data.read_shift(1);
    if (flags & 2)
      out.l = "1";
    if (flags & 8)
      out.a = "1";
    return out;
  }
  var _shapeid = 1024;
  function write_comments_vml(rId, comments) {
    var csize = [21600, 21600];
    var bbox = ["m0,0l0", csize[1], csize[0], csize[1], csize[0], "0xe"].join(",");
    var o = [
      writextag("xml", null, { "xmlns:v": XLMLNS.v, "xmlns:o": XLMLNS.o, "xmlns:x": XLMLNS.x, "xmlns:mv": XLMLNS.mv }).replace(/\/>/, ">"),
      writextag("o:shapelayout", writextag("o:idmap", null, { "v:ext": "edit", "data": rId }), { "v:ext": "edit" }),
      writextag("v:shapetype", [
        writextag("v:stroke", null, { joinstyle: "miter" }),
        writextag("v:path", null, { gradientshapeok: "t", "o:connecttype": "rect" })
      ].join(""), { id: "_x0000_t202", "o:spt": 202, coordsize: csize.join(","), path: bbox })
    ];
    while (_shapeid < rId * 1e3)
      _shapeid += 1e3;
    comments.forEach(function(x2) {
      var c2 = decode_cell(x2[0]);
      var fillopts = (
        /*::(*/
        { "color2": "#BEFF82", "type": "gradient" }
      );
      if (fillopts.type == "gradient")
        fillopts.angle = "-180";
      var fillparm = fillopts.type == "gradient" ? writextag("o:fill", null, { type: "gradientUnscaled", "v:ext": "view" }) : null;
      var fillxml = writextag("v:fill", fillparm, fillopts);
      var shadata = { on: "t", "obscured": "t" };
      ++_shapeid;
      o = o.concat([
        "<v:shape" + wxt_helper({
          id: "_x0000_s" + _shapeid,
          type: "#_x0000_t202",
          style: "position:absolute; margin-left:80pt;margin-top:5pt;width:104pt;height:64pt;z-index:10" + (x2[1].hidden ? ";visibility:hidden" : ""),
          fillcolor: "#ECFAD4",
          strokecolor: "#edeaa1"
        }) + ">",
        fillxml,
        writextag("v:shadow", null, shadata),
        writextag("v:path", null, { "o:connecttype": "none" }),
        '<v:textbox><div style="text-align:left"></div></v:textbox>',
        '<x:ClientData ObjectType="Note">',
        "<x:MoveWithCells/>",
        "<x:SizeWithCells/>",
        /* Part 4 19.4.2.3 Anchor (Anchor) */
        writetag("x:Anchor", [c2.c + 1, 0, c2.r + 1, 0, c2.c + 3, 20, c2.r + 5, 20].join(",")),
        writetag("x:AutoFill", "False"),
        writetag("x:Row", String(c2.r)),
        writetag("x:Column", String(c2.c)),
        x2[1].hidden ? "" : "<x:Visible/>",
        "</x:ClientData>",
        "</v:shape>"
      ]);
    });
    o.push("</xml>");
    return o.join("");
  }
  function write_comments_xml(data) {
    var o = [XML_HEADER, writextag("comments", null, { "xmlns": XMLNS_main[0] })];
    var iauthor = [];
    o.push("<authors>");
    data.forEach(function(x2) {
      x2[1].forEach(function(w2) {
        var a = escapexml(w2.a);
        if (iauthor.indexOf(a) == -1) {
          iauthor.push(a);
          o.push("<author>" + a + "</author>");
        }
        if (w2.T && w2.ID && iauthor.indexOf("tc=" + w2.ID) == -1) {
          iauthor.push("tc=" + w2.ID);
          o.push("<author>tc=" + w2.ID + "</author>");
        }
      });
    });
    if (iauthor.length == 0) {
      iauthor.push("SheetJ5");
      o.push("<author>SheetJ5</author>");
    }
    o.push("</authors>");
    o.push("<commentList>");
    data.forEach(function(d2) {
      var lastauthor = 0, ts = [];
      if (d2[1][0] && d2[1][0].T && d2[1][0].ID)
        lastauthor = iauthor.indexOf("tc=" + d2[1][0].ID);
      else
        d2[1].forEach(function(c2) {
          if (c2.a)
            lastauthor = iauthor.indexOf(escapexml(c2.a));
          ts.push(c2.t || "");
        });
      o.push('<comment ref="' + d2[0] + '" authorId="' + lastauthor + '"><text>');
      if (ts.length <= 1)
        o.push(writetag("t", escapexml(ts[0] || "")));
      else {
        var t2 = "Comment:\n    " + ts[0] + "\n";
        for (var i = 1; i < ts.length; ++i)
          t2 += "Reply:\n    " + ts[i] + "\n";
        o.push(writetag("t", escapexml(t2)));
      }
      o.push("</text></comment>");
    });
    o.push("</commentList>");
    if (o.length > 2) {
      o[o.length] = "</comments>";
      o[1] = o[1].replace("/>", ">");
    }
    return o.join("");
  }
  function write_tcmnt_xml(comments, people, opts) {
    var o = [XML_HEADER, writextag("ThreadedComments", null, { "xmlns": XMLNS.TCMNT }).replace(/[\/]>/, ">")];
    comments.forEach(function(carr) {
      var rootid = "";
      (carr[1] || []).forEach(function(c2, idx) {
        if (!c2.T) {
          delete c2.ID;
          return;
        }
        if (c2.a && people.indexOf(c2.a) == -1)
          people.push(c2.a);
        var tcopts = {
          ref: carr[0],
          id: "{54EE7951-7262-4200-6969-" + ("000000000000" + opts.tcid++).slice(-12) + "}"
        };
        if (idx == 0)
          rootid = tcopts.id;
        else
          tcopts.parentId = rootid;
        c2.ID = tcopts.id;
        if (c2.a)
          tcopts.personId = "{54EE7950-7262-4200-6969-" + ("000000000000" + people.indexOf(c2.a)).slice(-12) + "}";
        o.push(writextag("threadedComment", writetag("text", c2.t || ""), tcopts));
      });
    });
    o.push("</ThreadedComments>");
    return o.join("");
  }
  function write_people_xml(people) {
    var o = [XML_HEADER, writextag("personList", null, {
      "xmlns": XMLNS.TCMNT,
      "xmlns:x": XMLNS_main[0]
    }).replace(/[\/]>/, ">")];
    people.forEach(function(person, idx) {
      o.push(writextag("person", null, {
        displayName: person,
        id: "{54EE7950-7262-4200-6969-" + ("000000000000" + idx).slice(-12) + "}",
        userId: person,
        providerId: "None"
      }));
    });
    o.push("</personList>");
    return o.join("");
  }
  function parse_BrtBeginComment(data) {
    var out = {};
    out.iauthor = data.read_shift(4);
    var rfx = parse_UncheckedRfX(data);
    out.rfx = rfx.s;
    out.ref = encode_cell(rfx.s);
    data.l += 16;
    return out;
  }
  function write_BrtBeginComment(data, o) {
    if (o == null)
      o = new_buf(36);
    o.write_shift(4, data[1].iauthor);
    write_UncheckedRfX(data[0], o);
    o.write_shift(4, 0);
    o.write_shift(4, 0);
    o.write_shift(4, 0);
    o.write_shift(4, 0);
    return o;
  }
  var parse_BrtCommentAuthor = parse_XLWideString;
  function write_BrtCommentAuthor(data) {
    return write_XLWideString(data.slice(0, 54));
  }
  function write_comments_bin(data) {
    var ba = buf_array();
    var iauthor = [];
    write_record(
      ba,
      628
      /* BrtBeginComments */
    );
    write_record(
      ba,
      630
      /* BrtBeginCommentAuthors */
    );
    data.forEach(function(comment) {
      comment[1].forEach(function(c2) {
        if (iauthor.indexOf(c2.a) > -1)
          return;
        iauthor.push(c2.a.slice(0, 54));
        write_record(ba, 632, write_BrtCommentAuthor(c2.a));
      });
    });
    write_record(
      ba,
      631
      /* BrtEndCommentAuthors */
    );
    write_record(
      ba,
      633
      /* BrtBeginCommentList */
    );
    data.forEach(function(comment) {
      comment[1].forEach(function(c2) {
        c2.iauthor = iauthor.indexOf(c2.a);
        var range = { s: decode_cell(comment[0]), e: decode_cell(comment[0]) };
        write_record(ba, 635, write_BrtBeginComment([range, c2]));
        if (c2.t && c2.t.length > 0)
          write_record(ba, 637, write_BrtCommentText(c2));
        write_record(
          ba,
          636
          /* BrtEndComment */
        );
        delete c2.iauthor;
      });
    });
    write_record(
      ba,
      634
      /* BrtEndCommentList */
    );
    write_record(
      ba,
      629
      /* BrtEndComments */
    );
    return ba.end();
  }
  function fill_vba_xls(cfb, vba) {
    vba.FullPaths.forEach(function(p2, i) {
      if (i == 0)
        return;
      var newpath = p2.replace(/[^\/]*[\/]/, "/_VBA_PROJECT_CUR/");
      if (newpath.slice(-1) !== "/")
        CFB.utils.cfb_add(cfb, newpath, vba.FileIndex[i].content);
    });
  }
  var VBAFMTS = ["xlsb", "xlsm", "xlam", "biff8", "xla"];
  var rc_to_a1 = /* @__PURE__ */ function() {
    var rcregex = /(^|[^A-Za-z_])R(\[?-?\d+\]|[1-9]\d*|)C(\[?-?\d+\]|[1-9]\d*|)(?![A-Za-z0-9_])/g;
    var rcbase = { r: 0, c: 0 };
    function rcfunc($$, $1, $2, $3) {
      var cRel = false, rRel = false;
      if ($2.length == 0)
        rRel = true;
      else if ($2.charAt(0) == "[") {
        rRel = true;
        $2 = $2.slice(1, -1);
      }
      if ($3.length == 0)
        cRel = true;
      else if ($3.charAt(0) == "[") {
        cRel = true;
        $3 = $3.slice(1, -1);
      }
      var R = $2.length > 0 ? parseInt($2, 10) | 0 : 0, C = $3.length > 0 ? parseInt($3, 10) | 0 : 0;
      if (cRel)
        C += rcbase.c;
      else
        --C;
      if (rRel)
        R += rcbase.r;
      else
        --R;
      return $1 + (cRel ? "" : "$") + encode_col(C) + (rRel ? "" : "$") + encode_row(R);
    }
    return function rc_to_a12(fstr, base) {
      rcbase = base;
      return fstr.replace(rcregex, rcfunc);
    };
  }();
  var crefregex = /(^|[^._A-Z0-9])([$]?)([A-Z]{1,2}|[A-W][A-Z]{2}|X[A-E][A-Z]|XF[A-D])([$]?)(10[0-3]\d{4}|104[0-7]\d{3}|1048[0-4]\d{2}|10485[0-6]\d|104857[0-6]|[1-9]\d{0,5})(?![_.\(A-Za-z0-9])/g;
  var a1_to_rc = /* @__PURE__ */ function() {
    return function a1_to_rc2(fstr, base) {
      return fstr.replace(crefregex, function($0, $1, $2, $3, $4, $5) {
        var c2 = decode_col($3) - ($2 ? 0 : base.c);
        var r2 = decode_row($5) - ($4 ? 0 : base.r);
        var R = r2 == 0 ? "" : !$4 ? "[" + r2 + "]" : r2 + 1;
        var C = c2 == 0 ? "" : !$2 ? "[" + c2 + "]" : c2 + 1;
        return $1 + "R" + R + "C" + C;
      });
    };
  }();
  function shift_formula_str(f2, delta) {
    return f2.replace(crefregex, function($0, $1, $2, $3, $4, $5) {
      return $1 + ($2 == "$" ? $2 + $3 : encode_col(decode_col($3) + delta.c)) + ($4 == "$" ? $4 + $5 : encode_row(decode_row($5) + delta.r));
    });
  }
  function fuzzyfmla(f2) {
    if (f2.length == 1)
      return false;
    return true;
  }
  function parseread1(blob) {
    blob.l += 1;
    return;
  }
  function parse_ColRelU(blob, length2) {
    var c2 = blob.read_shift(length2 == 1 ? 1 : 2);
    return [c2 & 16383, c2 >> 14 & 1, c2 >> 15 & 1];
  }
  function parse_RgceArea(blob, length2, opts) {
    var w2 = 2;
    if (opts) {
      if (opts.biff >= 2 && opts.biff <= 5)
        return parse_RgceArea_BIFF2(blob);
      else if (opts.biff == 12)
        w2 = 4;
    }
    var r2 = blob.read_shift(w2), R = blob.read_shift(w2);
    var c2 = parse_ColRelU(blob, 2);
    var C = parse_ColRelU(blob, 2);
    return { s: { r: r2, c: c2[0], cRel: c2[1], rRel: c2[2] }, e: { r: R, c: C[0], cRel: C[1], rRel: C[2] } };
  }
  function parse_RgceArea_BIFF2(blob) {
    var r2 = parse_ColRelU(blob, 2), R = parse_ColRelU(blob, 2);
    var c2 = blob.read_shift(1);
    var C = blob.read_shift(1);
    return { s: { r: r2[0], c: c2, cRel: r2[1], rRel: r2[2] }, e: { r: R[0], c: C, cRel: R[1], rRel: R[2] } };
  }
  function parse_RgceAreaRel(blob, length2, opts) {
    if (opts.biff < 8)
      return parse_RgceArea_BIFF2(blob);
    var r2 = blob.read_shift(opts.biff == 12 ? 4 : 2), R = blob.read_shift(opts.biff == 12 ? 4 : 2);
    var c2 = parse_ColRelU(blob, 2);
    var C = parse_ColRelU(blob, 2);
    return { s: { r: r2, c: c2[0], cRel: c2[1], rRel: c2[2] }, e: { r: R, c: C[0], cRel: C[1], rRel: C[2] } };
  }
  function parse_RgceLoc(blob, length2, opts) {
    if (opts && opts.biff >= 2 && opts.biff <= 5)
      return parse_RgceLoc_BIFF2(blob);
    var r2 = blob.read_shift(opts && opts.biff == 12 ? 4 : 2);
    var c2 = parse_ColRelU(blob, 2);
    return { r: r2, c: c2[0], cRel: c2[1], rRel: c2[2] };
  }
  function parse_RgceLoc_BIFF2(blob) {
    var r2 = parse_ColRelU(blob, 2);
    var c2 = blob.read_shift(1);
    return { r: r2[0], c: c2, cRel: r2[1], rRel: r2[2] };
  }
  function parse_RgceElfLoc(blob) {
    var r2 = blob.read_shift(2);
    var c2 = blob.read_shift(2);
    return { r: r2, c: c2 & 255, fQuoted: !!(c2 & 16384), cRel: c2 >> 15, rRel: c2 >> 15 };
  }
  function parse_RgceLocRel(blob, length2, opts) {
    var biff = opts && opts.biff ? opts.biff : 8;
    if (biff >= 2 && biff <= 5)
      return parse_RgceLocRel_BIFF2(blob);
    var r2 = blob.read_shift(biff >= 12 ? 4 : 2);
    var cl = blob.read_shift(2);
    var cRel = (cl & 16384) >> 14, rRel = (cl & 32768) >> 15;
    cl &= 16383;
    if (rRel == 1)
      while (r2 > 524287)
        r2 -= 1048576;
    if (cRel == 1)
      while (cl > 8191)
        cl = cl - 16384;
    return { r: r2, c: cl, cRel, rRel };
  }
  function parse_RgceLocRel_BIFF2(blob) {
    var rl = blob.read_shift(2);
    var c2 = blob.read_shift(1);
    var rRel = (rl & 32768) >> 15, cRel = (rl & 16384) >> 14;
    rl &= 16383;
    if (rRel == 1 && rl >= 8192)
      rl = rl - 16384;
    if (cRel == 1 && c2 >= 128)
      c2 = c2 - 256;
    return { r: rl, c: c2, cRel, rRel };
  }
  function parse_PtgArea(blob, length2, opts) {
    var type2 = (blob[blob.l++] & 96) >> 5;
    var area = parse_RgceArea(blob, opts.biff >= 2 && opts.biff <= 5 ? 6 : 8, opts);
    return [type2, area];
  }
  function parse_PtgArea3d(blob, length2, opts) {
    var type2 = (blob[blob.l++] & 96) >> 5;
    var ixti = blob.read_shift(2, "i");
    var w2 = 8;
    if (opts)
      switch (opts.biff) {
        case 5:
          blob.l += 12;
          w2 = 6;
          break;
        case 12:
          w2 = 12;
          break;
      }
    var area = parse_RgceArea(blob, w2, opts);
    return [type2, ixti, area];
  }
  function parse_PtgAreaErr(blob, length2, opts) {
    var type2 = (blob[blob.l++] & 96) >> 5;
    blob.l += opts && opts.biff > 8 ? 12 : opts.biff < 8 ? 6 : 8;
    return [type2];
  }
  function parse_PtgAreaErr3d(blob, length2, opts) {
    var type2 = (blob[blob.l++] & 96) >> 5;
    var ixti = blob.read_shift(2);
    var w2 = 8;
    if (opts)
      switch (opts.biff) {
        case 5:
          blob.l += 12;
          w2 = 6;
          break;
        case 12:
          w2 = 12;
          break;
      }
    blob.l += w2;
    return [type2, ixti];
  }
  function parse_PtgAreaN(blob, length2, opts) {
    var type2 = (blob[blob.l++] & 96) >> 5;
    var area = parse_RgceAreaRel(blob, length2 - 1, opts);
    return [type2, area];
  }
  function parse_PtgArray(blob, length2, opts) {
    var type2 = (blob[blob.l++] & 96) >> 5;
    blob.l += opts.biff == 2 ? 6 : opts.biff == 12 ? 14 : 7;
    return [type2];
  }
  function parse_PtgAttrBaxcel(blob) {
    var bitSemi = blob[blob.l + 1] & 1;
    var bitBaxcel = 1;
    blob.l += 4;
    return [bitSemi, bitBaxcel];
  }
  function parse_PtgAttrChoose(blob, length2, opts) {
    blob.l += 2;
    var offset = blob.read_shift(opts && opts.biff == 2 ? 1 : 2);
    var o = [];
    for (var i = 0; i <= offset; ++i)
      o.push(blob.read_shift(opts && opts.biff == 2 ? 1 : 2));
    return o;
  }
  function parse_PtgAttrGoto(blob, length2, opts) {
    var bitGoto = blob[blob.l + 1] & 255 ? 1 : 0;
    blob.l += 2;
    return [bitGoto, blob.read_shift(opts && opts.biff == 2 ? 1 : 2)];
  }
  function parse_PtgAttrIf(blob, length2, opts) {
    var bitIf = blob[blob.l + 1] & 255 ? 1 : 0;
    blob.l += 2;
    return [bitIf, blob.read_shift(opts && opts.biff == 2 ? 1 : 2)];
  }
  function parse_PtgAttrIfError(blob) {
    var bitIf = blob[blob.l + 1] & 255 ? 1 : 0;
    blob.l += 2;
    return [bitIf, blob.read_shift(2)];
  }
  function parse_PtgAttrSemi(blob, length2, opts) {
    var bitSemi = blob[blob.l + 1] & 255 ? 1 : 0;
    blob.l += opts && opts.biff == 2 ? 3 : 4;
    return [bitSemi];
  }
  function parse_PtgAttrSpaceType(blob) {
    var type2 = blob.read_shift(1), cch = blob.read_shift(1);
    return [type2, cch];
  }
  function parse_PtgAttrSpace(blob) {
    blob.read_shift(2);
    return parse_PtgAttrSpaceType(blob);
  }
  function parse_PtgAttrSpaceSemi(blob) {
    blob.read_shift(2);
    return parse_PtgAttrSpaceType(blob);
  }
  function parse_PtgRef(blob, length2, opts) {
    var type2 = (blob[blob.l] & 96) >> 5;
    blob.l += 1;
    var loc = parse_RgceLoc(blob, 0, opts);
    return [type2, loc];
  }
  function parse_PtgRefN(blob, length2, opts) {
    var type2 = (blob[blob.l] & 96) >> 5;
    blob.l += 1;
    var loc = parse_RgceLocRel(blob, 0, opts);
    return [type2, loc];
  }
  function parse_PtgRef3d(blob, length2, opts) {
    var type2 = (blob[blob.l] & 96) >> 5;
    blob.l += 1;
    var ixti = blob.read_shift(2);
    if (opts && opts.biff == 5)
      blob.l += 12;
    var loc = parse_RgceLoc(blob, 0, opts);
    return [type2, ixti, loc];
  }
  function parse_PtgFunc(blob, length2, opts) {
    var type2 = (blob[blob.l] & 96) >> 5;
    blob.l += 1;
    var iftab = blob.read_shift(opts && opts.biff <= 3 ? 1 : 2);
    return [FtabArgc[iftab], Ftab[iftab], type2];
  }
  function parse_PtgFuncVar(blob, length2, opts) {
    var type2 = blob[blob.l++];
    var cparams = blob.read_shift(1), tab = opts && opts.biff <= 3 ? [type2 == 88 ? -1 : 0, blob.read_shift(1)] : parsetab(blob);
    return [cparams, (tab[0] === 0 ? Ftab : Cetab)[tab[1]]];
  }
  function parsetab(blob) {
    return [blob[blob.l + 1] >> 7, blob.read_shift(2) & 32767];
  }
  function parse_PtgAttrSum(blob, length2, opts) {
    blob.l += opts && opts.biff == 2 ? 3 : 4;
    return;
  }
  function parse_PtgExp(blob, length2, opts) {
    blob.l++;
    if (opts && opts.biff == 12)
      return [blob.read_shift(4, "i"), 0];
    var row = blob.read_shift(2);
    var col = blob.read_shift(opts && opts.biff == 2 ? 1 : 2);
    return [row, col];
  }
  function parse_PtgErr(blob) {
    blob.l++;
    return BErr[blob.read_shift(1)];
  }
  function parse_PtgInt(blob) {
    blob.l++;
    return blob.read_shift(2);
  }
  function parse_PtgBool(blob) {
    blob.l++;
    return blob.read_shift(1) !== 0;
  }
  function parse_PtgNum(blob) {
    blob.l++;
    return parse_Xnum(blob);
  }
  function parse_PtgStr(blob, length2, opts) {
    blob.l++;
    return parse_ShortXLUnicodeString(blob, length2 - 1, opts);
  }
  function parse_SerAr(blob, biff) {
    var val = [blob.read_shift(1)];
    if (biff == 12)
      switch (val[0]) {
        case 2:
          val[0] = 4;
          break;
        case 4:
          val[0] = 16;
          break;
        case 0:
          val[0] = 1;
          break;
        case 1:
          val[0] = 2;
          break;
      }
    switch (val[0]) {
      case 4:
        val[1] = parsebool(blob, 1) ? "TRUE" : "FALSE";
        if (biff != 12)
          blob.l += 7;
        break;
      case 37:
      case 16:
        val[1] = BErr[blob[blob.l]];
        blob.l += biff == 12 ? 4 : 8;
        break;
      case 0:
        blob.l += 8;
        break;
      case 1:
        val[1] = parse_Xnum(blob);
        break;
      case 2:
        val[1] = parse_XLUnicodeString2(blob, 0, { biff: biff > 0 && biff < 8 ? 2 : biff });
        break;
      default:
        throw new Error("Bad SerAr: " + val[0]);
    }
    return val;
  }
  function parse_PtgExtraMem(blob, cce, opts) {
    var count = blob.read_shift(opts.biff == 12 ? 4 : 2);
    var out = [];
    for (var i = 0; i != count; ++i)
      out.push((opts.biff == 12 ? parse_UncheckedRfX : parse_Ref8U)(blob));
    return out;
  }
  function parse_PtgExtraArray(blob, length2, opts) {
    var rows = 0, cols = 0;
    if (opts.biff == 12) {
      rows = blob.read_shift(4);
      cols = blob.read_shift(4);
    } else {
      cols = 1 + blob.read_shift(1);
      rows = 1 + blob.read_shift(2);
    }
    if (opts.biff >= 2 && opts.biff < 8) {
      --rows;
      if (--cols == 0)
        cols = 256;
    }
    for (var i = 0, o = []; i != rows && (o[i] = []); ++i)
      for (var j = 0; j != cols; ++j)
        o[i][j] = parse_SerAr(blob, opts.biff);
    return o;
  }
  function parse_PtgName(blob, length2, opts) {
    var type2 = blob.read_shift(1) >>> 5 & 3;
    var w2 = !opts || opts.biff >= 8 ? 4 : 2;
    var nameindex = blob.read_shift(w2);
    switch (opts.biff) {
      case 2:
        blob.l += 5;
        break;
      case 3:
      case 4:
        blob.l += 8;
        break;
      case 5:
        blob.l += 12;
        break;
    }
    return [type2, 0, nameindex];
  }
  function parse_PtgNameX(blob, length2, opts) {
    if (opts.biff == 5)
      return parse_PtgNameX_BIFF5(blob);
    var type2 = blob.read_shift(1) >>> 5 & 3;
    var ixti = blob.read_shift(2);
    var nameindex = blob.read_shift(4);
    return [type2, ixti, nameindex];
  }
  function parse_PtgNameX_BIFF5(blob) {
    var type2 = blob.read_shift(1) >>> 5 & 3;
    var ixti = blob.read_shift(2, "i");
    blob.l += 8;
    var nameindex = blob.read_shift(2);
    blob.l += 12;
    return [type2, ixti, nameindex];
  }
  function parse_PtgMemArea(blob, length2, opts) {
    var type2 = blob.read_shift(1) >>> 5 & 3;
    blob.l += opts && opts.biff == 2 ? 3 : 4;
    var cce = blob.read_shift(opts && opts.biff == 2 ? 1 : 2);
    return [type2, cce];
  }
  function parse_PtgMemFunc(blob, length2, opts) {
    var type2 = blob.read_shift(1) >>> 5 & 3;
    var cce = blob.read_shift(opts && opts.biff == 2 ? 1 : 2);
    return [type2, cce];
  }
  function parse_PtgRefErr(blob, length2, opts) {
    var type2 = blob.read_shift(1) >>> 5 & 3;
    blob.l += 4;
    if (opts.biff < 8)
      blob.l--;
    if (opts.biff == 12)
      blob.l += 2;
    return [type2];
  }
  function parse_PtgRefErr3d(blob, length2, opts) {
    var type2 = (blob[blob.l++] & 96) >> 5;
    var ixti = blob.read_shift(2);
    var w2 = 4;
    if (opts)
      switch (opts.biff) {
        case 5:
          w2 = 15;
          break;
        case 12:
          w2 = 6;
          break;
      }
    blob.l += w2;
    return [type2, ixti];
  }
  var parse_PtgMemErr = parsenoop;
  var parse_PtgMemNoMem = parsenoop;
  var parse_PtgTbl = parsenoop;
  function parse_PtgElfLoc(blob, length2, opts) {
    blob.l += 2;
    return [parse_RgceElfLoc(blob)];
  }
  function parse_PtgElfNoop(blob) {
    blob.l += 6;
    return [];
  }
  var parse_PtgElfCol = parse_PtgElfLoc;
  var parse_PtgElfColS = parse_PtgElfNoop;
  var parse_PtgElfColSV = parse_PtgElfNoop;
  var parse_PtgElfColV = parse_PtgElfLoc;
  function parse_PtgElfLel(blob) {
    blob.l += 2;
    return [parseuint16(blob), blob.read_shift(2) & 1];
  }
  var parse_PtgElfRadical = parse_PtgElfLoc;
  var parse_PtgElfRadicalLel = parse_PtgElfLel;
  var parse_PtgElfRadicalS = parse_PtgElfNoop;
  var parse_PtgElfRw = parse_PtgElfLoc;
  var parse_PtgElfRwV = parse_PtgElfLoc;
  var PtgListRT = [
    "Data",
    "All",
    "Headers",
    "??",
    "?Data2",
    "??",
    "?DataHeaders",
    "??",
    "Totals",
    "??",
    "??",
    "??",
    "?DataTotals",
    "??",
    "??",
    "??",
    "?Current"
  ];
  function parse_PtgList(blob) {
    blob.l += 2;
    var ixti = blob.read_shift(2);
    var flags = blob.read_shift(2);
    var idx = blob.read_shift(4);
    var c2 = blob.read_shift(2);
    var C = blob.read_shift(2);
    var rt = PtgListRT[flags >> 2 & 31];
    return { ixti, coltype: flags & 3, rt, idx, c: c2, C };
  }
  function parse_PtgSxName(blob) {
    blob.l += 2;
    return [blob.read_shift(4)];
  }
  function parse_PtgSheet(blob, length2, opts) {
    blob.l += 5;
    blob.l += 2;
    blob.l += opts.biff == 2 ? 1 : 4;
    return ["PTGSHEET"];
  }
  function parse_PtgEndSheet(blob, length2, opts) {
    blob.l += opts.biff == 2 ? 4 : 5;
    return ["PTGENDSHEET"];
  }
  function parse_PtgMemAreaN(blob) {
    var type2 = blob.read_shift(1) >>> 5 & 3;
    var cce = blob.read_shift(2);
    return [type2, cce];
  }
  function parse_PtgMemNoMemN(blob) {
    var type2 = blob.read_shift(1) >>> 5 & 3;
    var cce = blob.read_shift(2);
    return [type2, cce];
  }
  function parse_PtgAttrNoop(blob) {
    blob.l += 4;
    return [0, 0];
  }
  var PtgTypes = {
    /*::[*/
    1: { n: "PtgExp", f: parse_PtgExp },
    /*::[*/
    2: { n: "PtgTbl", f: parse_PtgTbl },
    /*::[*/
    3: { n: "PtgAdd", f: parseread1 },
    /*::[*/
    4: { n: "PtgSub", f: parseread1 },
    /*::[*/
    5: { n: "PtgMul", f: parseread1 },
    /*::[*/
    6: { n: "PtgDiv", f: parseread1 },
    /*::[*/
    7: { n: "PtgPower", f: parseread1 },
    /*::[*/
    8: { n: "PtgConcat", f: parseread1 },
    /*::[*/
    9: { n: "PtgLt", f: parseread1 },
    /*::[*/
    10: { n: "PtgLe", f: parseread1 },
    /*::[*/
    11: { n: "PtgEq", f: parseread1 },
    /*::[*/
    12: { n: "PtgGe", f: parseread1 },
    /*::[*/
    13: { n: "PtgGt", f: parseread1 },
    /*::[*/
    14: { n: "PtgNe", f: parseread1 },
    /*::[*/
    15: { n: "PtgIsect", f: parseread1 },
    /*::[*/
    16: { n: "PtgUnion", f: parseread1 },
    /*::[*/
    17: { n: "PtgRange", f: parseread1 },
    /*::[*/
    18: { n: "PtgUplus", f: parseread1 },
    /*::[*/
    19: { n: "PtgUminus", f: parseread1 },
    /*::[*/
    20: { n: "PtgPercent", f: parseread1 },
    /*::[*/
    21: { n: "PtgParen", f: parseread1 },
    /*::[*/
    22: { n: "PtgMissArg", f: parseread1 },
    /*::[*/
    23: { n: "PtgStr", f: parse_PtgStr },
    /*::[*/
    26: { n: "PtgSheet", f: parse_PtgSheet },
    /*::[*/
    27: { n: "PtgEndSheet", f: parse_PtgEndSheet },
    /*::[*/
    28: { n: "PtgErr", f: parse_PtgErr },
    /*::[*/
    29: { n: "PtgBool", f: parse_PtgBool },
    /*::[*/
    30: { n: "PtgInt", f: parse_PtgInt },
    /*::[*/
    31: { n: "PtgNum", f: parse_PtgNum },
    /*::[*/
    32: { n: "PtgArray", f: parse_PtgArray },
    /*::[*/
    33: { n: "PtgFunc", f: parse_PtgFunc },
    /*::[*/
    34: { n: "PtgFuncVar", f: parse_PtgFuncVar },
    /*::[*/
    35: { n: "PtgName", f: parse_PtgName },
    /*::[*/
    36: { n: "PtgRef", f: parse_PtgRef },
    /*::[*/
    37: { n: "PtgArea", f: parse_PtgArea },
    /*::[*/
    38: { n: "PtgMemArea", f: parse_PtgMemArea },
    /*::[*/
    39: { n: "PtgMemErr", f: parse_PtgMemErr },
    /*::[*/
    40: { n: "PtgMemNoMem", f: parse_PtgMemNoMem },
    /*::[*/
    41: { n: "PtgMemFunc", f: parse_PtgMemFunc },
    /*::[*/
    42: { n: "PtgRefErr", f: parse_PtgRefErr },
    /*::[*/
    43: { n: "PtgAreaErr", f: parse_PtgAreaErr },
    /*::[*/
    44: { n: "PtgRefN", f: parse_PtgRefN },
    /*::[*/
    45: { n: "PtgAreaN", f: parse_PtgAreaN },
    /*::[*/
    46: { n: "PtgMemAreaN", f: parse_PtgMemAreaN },
    /*::[*/
    47: { n: "PtgMemNoMemN", f: parse_PtgMemNoMemN },
    /*::[*/
    57: { n: "PtgNameX", f: parse_PtgNameX },
    /*::[*/
    58: { n: "PtgRef3d", f: parse_PtgRef3d },
    /*::[*/
    59: { n: "PtgArea3d", f: parse_PtgArea3d },
    /*::[*/
    60: { n: "PtgRefErr3d", f: parse_PtgRefErr3d },
    /*::[*/
    61: { n: "PtgAreaErr3d", f: parse_PtgAreaErr3d },
    /*::[*/
    255: {}
  };
  var PtgDupes = {
    /*::[*/
    64: 32,
    /*::[*/
    96: 32,
    /*::[*/
    65: 33,
    /*::[*/
    97: 33,
    /*::[*/
    66: 34,
    /*::[*/
    98: 34,
    /*::[*/
    67: 35,
    /*::[*/
    99: 35,
    /*::[*/
    68: 36,
    /*::[*/
    100: 36,
    /*::[*/
    69: 37,
    /*::[*/
    101: 37,
    /*::[*/
    70: 38,
    /*::[*/
    102: 38,
    /*::[*/
    71: 39,
    /*::[*/
    103: 39,
    /*::[*/
    72: 40,
    /*::[*/
    104: 40,
    /*::[*/
    73: 41,
    /*::[*/
    105: 41,
    /*::[*/
    74: 42,
    /*::[*/
    106: 42,
    /*::[*/
    75: 43,
    /*::[*/
    107: 43,
    /*::[*/
    76: 44,
    /*::[*/
    108: 44,
    /*::[*/
    77: 45,
    /*::[*/
    109: 45,
    /*::[*/
    78: 46,
    /*::[*/
    110: 46,
    /*::[*/
    79: 47,
    /*::[*/
    111: 47,
    /*::[*/
    88: 34,
    /*::[*/
    120: 34,
    /*::[*/
    89: 57,
    /*::[*/
    121: 57,
    /*::[*/
    90: 58,
    /*::[*/
    122: 58,
    /*::[*/
    91: 59,
    /*::[*/
    123: 59,
    /*::[*/
    92: 60,
    /*::[*/
    124: 60,
    /*::[*/
    93: 61,
    /*::[*/
    125: 61
  };
  var Ptg18 = {
    /*::[*/
    1: { n: "PtgElfLel", f: parse_PtgElfLel },
    /*::[*/
    2: { n: "PtgElfRw", f: parse_PtgElfRw },
    /*::[*/
    3: { n: "PtgElfCol", f: parse_PtgElfCol },
    /*::[*/
    6: { n: "PtgElfRwV", f: parse_PtgElfRwV },
    /*::[*/
    7: { n: "PtgElfColV", f: parse_PtgElfColV },
    /*::[*/
    10: { n: "PtgElfRadical", f: parse_PtgElfRadical },
    /*::[*/
    11: { n: "PtgElfRadicalS", f: parse_PtgElfRadicalS },
    /*::[*/
    13: { n: "PtgElfColS", f: parse_PtgElfColS },
    /*::[*/
    15: { n: "PtgElfColSV", f: parse_PtgElfColSV },
    /*::[*/
    16: { n: "PtgElfRadicalLel", f: parse_PtgElfRadicalLel },
    /*::[*/
    25: { n: "PtgList", f: parse_PtgList },
    /*::[*/
    29: { n: "PtgSxName", f: parse_PtgSxName },
    /*::[*/
    255: {}
  };
  var Ptg19 = {
    /*::[*/
    0: { n: "PtgAttrNoop", f: parse_PtgAttrNoop },
    /*::[*/
    1: { n: "PtgAttrSemi", f: parse_PtgAttrSemi },
    /*::[*/
    2: { n: "PtgAttrIf", f: parse_PtgAttrIf },
    /*::[*/
    4: { n: "PtgAttrChoose", f: parse_PtgAttrChoose },
    /*::[*/
    8: { n: "PtgAttrGoto", f: parse_PtgAttrGoto },
    /*::[*/
    16: { n: "PtgAttrSum", f: parse_PtgAttrSum },
    /*::[*/
    32: { n: "PtgAttrBaxcel", f: parse_PtgAttrBaxcel },
    /*::[*/
    33: { n: "PtgAttrBaxcel", f: parse_PtgAttrBaxcel },
    /*::[*/
    64: { n: "PtgAttrSpace", f: parse_PtgAttrSpace },
    /*::[*/
    65: { n: "PtgAttrSpaceSemi", f: parse_PtgAttrSpaceSemi },
    /*::[*/
    128: { n: "PtgAttrIfError", f: parse_PtgAttrIfError },
    /*::[*/
    255: {}
  };
  function parse_RgbExtra(blob, length2, rgce, opts) {
    if (opts.biff < 8)
      return parsenoop(blob, length2);
    var target = blob.l + length2;
    var o = [];
    for (var i = 0; i !== rgce.length; ++i) {
      switch (rgce[i][0]) {
        case "PtgArray":
          rgce[i][1] = parse_PtgExtraArray(blob, 0, opts);
          o.push(rgce[i][1]);
          break;
        case "PtgMemArea":
          rgce[i][2] = parse_PtgExtraMem(blob, rgce[i][1], opts);
          o.push(rgce[i][2]);
          break;
        case "PtgExp":
          if (opts && opts.biff == 12) {
            rgce[i][1][1] = blob.read_shift(4);
            o.push(rgce[i][1]);
          }
          break;
        case "PtgList":
        case "PtgElfRadicalS":
        case "PtgElfColS":
        case "PtgElfColSV":
          throw "Unsupported " + rgce[i][0];
      }
    }
    length2 = target - blob.l;
    if (length2 !== 0)
      o.push(parsenoop(blob, length2));
    return o;
  }
  function parse_Rgce(blob, length2, opts) {
    var target = blob.l + length2;
    var R, id2, ptgs = [];
    while (target != blob.l) {
      length2 = target - blob.l;
      id2 = blob[blob.l];
      R = PtgTypes[id2] || PtgTypes[PtgDupes[id2]];
      if (id2 === 24 || id2 === 25)
        R = (id2 === 24 ? Ptg18 : Ptg19)[blob[blob.l + 1]];
      if (!R || !R.f) {
        parsenoop(blob, length2);
      } else {
        ptgs.push([R.n, R.f(blob, length2, opts)]);
      }
    }
    return ptgs;
  }
  function stringify_array(f2) {
    var o = [];
    for (var i = 0; i < f2.length; ++i) {
      var x2 = f2[i], r2 = [];
      for (var j = 0; j < x2.length; ++j) {
        var y2 = x2[j];
        if (y2)
          switch (y2[0]) {
            case 2:
              r2.push('"' + y2[1].replace(/"/g, '""') + '"');
              break;
            default:
              r2.push(y2[1]);
          }
        else
          r2.push("");
      }
      o.push(r2.join(","));
    }
    return o.join(";");
  }
  var PtgBinOp = {
    PtgAdd: "+",
    PtgConcat: "&",
    PtgDiv: "/",
    PtgEq: "=",
    PtgGe: ">=",
    PtgGt: ">",
    PtgLe: "<=",
    PtgLt: "<",
    PtgMul: "*",
    PtgNe: "<>",
    PtgPower: "^",
    PtgSub: "-"
  };
  function formula_quote_sheet_name(sname, opts) {
    if (!sname && !(opts && opts.biff <= 5 && opts.biff >= 2))
      throw new Error("empty sheet name");
    if (/[^\w\u4E00-\u9FFF\u3040-\u30FF]/.test(sname))
      return "'" + sname + "'";
    return sname;
  }
  function get_ixti_raw(supbooks, ixti, opts) {
    if (!supbooks)
      return "SH33TJSERR0";
    if (opts.biff > 8 && (!supbooks.XTI || !supbooks.XTI[ixti]))
      return supbooks.SheetNames[ixti];
    if (!supbooks.XTI)
      return "SH33TJSERR6";
    var XTI = supbooks.XTI[ixti];
    if (opts.biff < 8) {
      if (ixti > 1e4)
        ixti -= 65536;
      if (ixti < 0)
        ixti = -ixti;
      return ixti == 0 ? "" : supbooks.XTI[ixti - 1];
    }
    if (!XTI)
      return "SH33TJSERR1";
    var o = "";
    if (opts.biff > 8)
      switch (supbooks[XTI[0]][0]) {
        case 357:
          o = XTI[1] == -1 ? "#REF" : supbooks.SheetNames[XTI[1]];
          return XTI[1] == XTI[2] ? o : o + ":" + supbooks.SheetNames[XTI[2]];
        case 358:
          if (opts.SID != null)
            return supbooks.SheetNames[opts.SID];
          return "SH33TJSSAME" + supbooks[XTI[0]][0];
        case 355:
        default:
          return "SH33TJSSRC" + supbooks[XTI[0]][0];
      }
    switch (supbooks[XTI[0]][0][0]) {
      case 1025:
        o = XTI[1] == -1 ? "#REF" : supbooks.SheetNames[XTI[1]] || "SH33TJSERR3";
        return XTI[1] == XTI[2] ? o : o + ":" + supbooks.SheetNames[XTI[2]];
      case 14849:
        return supbooks[XTI[0]].slice(1).map(function(name) {
          return name.Name;
        }).join(";;");
      default:
        if (!supbooks[XTI[0]][0][3])
          return "SH33TJSERR2";
        o = XTI[1] == -1 ? "#REF" : supbooks[XTI[0]][0][3][XTI[1]] || "SH33TJSERR4";
        return XTI[1] == XTI[2] ? o : o + ":" + supbooks[XTI[0]][0][3][XTI[2]];
    }
  }
  function get_ixti(supbooks, ixti, opts) {
    var ixtiraw = get_ixti_raw(supbooks, ixti, opts);
    return ixtiraw == "#REF" ? ixtiraw : formula_quote_sheet_name(ixtiraw, opts);
  }
  function stringify_formula(formula, range, cell5, supbooks, opts) {
    var biff = opts && opts.biff || 8;
    var _range = (
      /*range != null ? range :*/
      { s: { c: 0, r: 0 }, e: { c: 0, r: 0 } }
    );
    var stack = [], e1, e2, c2, ixti = 0, nameidx = 0, r2, sname = "";
    if (!formula[0] || !formula[0][0])
      return "";
    var last_sp = -1, sp = "";
    for (var ff = 0, fflen = formula[0].length; ff < fflen; ++ff) {
      var f2 = formula[0][ff];
      switch (f2[0]) {
        case "PtgUminus":
          stack.push("-" + stack.pop());
          break;
        case "PtgUplus":
          stack.push("+" + stack.pop());
          break;
        case "PtgPercent":
          stack.push(stack.pop() + "%");
          break;
        case "PtgAdd":
        case "PtgConcat":
        case "PtgDiv":
        case "PtgEq":
        case "PtgGe":
        case "PtgGt":
        case "PtgLe":
        case "PtgLt":
        case "PtgMul":
        case "PtgNe":
        case "PtgPower":
        case "PtgSub":
          e1 = stack.pop();
          e2 = stack.pop();
          if (last_sp >= 0) {
            switch (formula[0][last_sp][1][0]) {
              case 0:
                sp = fill(" ", formula[0][last_sp][1][1]);
                break;
              case 1:
                sp = fill("\r", formula[0][last_sp][1][1]);
                break;
              default:
                sp = "";
                if (opts.WTF)
                  throw new Error("Unexpected PtgAttrSpaceType " + formula[0][last_sp][1][0]);
            }
            e2 = e2 + sp;
            last_sp = -1;
          }
          stack.push(e2 + PtgBinOp[f2[0]] + e1);
          break;
        case "PtgIsect":
          e1 = stack.pop();
          e2 = stack.pop();
          stack.push(e2 + " " + e1);
          break;
        case "PtgUnion":
          e1 = stack.pop();
          e2 = stack.pop();
          stack.push(e2 + "," + e1);
          break;
        case "PtgRange":
          e1 = stack.pop();
          e2 = stack.pop();
          stack.push(e2 + ":" + e1);
          break;
        case "PtgAttrChoose":
          break;
        case "PtgAttrGoto":
          break;
        case "PtgAttrIf":
          break;
        case "PtgAttrIfError":
          break;
        case "PtgRef":
          c2 = shift_cell_xls(f2[1][1], _range, opts);
          stack.push(encode_cell_xls(c2, biff));
          break;
        case "PtgRefN":
          c2 = cell5 ? shift_cell_xls(f2[1][1], cell5, opts) : f2[1][1];
          stack.push(encode_cell_xls(c2, biff));
          break;
        case "PtgRef3d":
          ixti = /*::Number(*/
          f2[1][1];
          c2 = shift_cell_xls(f2[1][2], _range, opts);
          sname = get_ixti(supbooks, ixti, opts);
          stack.push(sname + "!" + encode_cell_xls(c2, biff));
          break;
        case "PtgFunc":
        case "PtgFuncVar":
          var argc = f2[1][0], func2 = f2[1][1];
          if (!argc)
            argc = 0;
          argc &= 127;
          var args = argc == 0 ? [] : stack.slice(-argc);
          stack.length -= argc;
          if (func2 === "User")
            func2 = args.shift();
          stack.push(func2 + "(" + args.join(",") + ")");
          break;
        case "PtgBool":
          stack.push(f2[1] ? "TRUE" : "FALSE");
          break;
        case "PtgInt":
          stack.push(
            /*::String(*/
            f2[1]
            /*::)*/
          );
          break;
        case "PtgNum":
          stack.push(String(f2[1]));
          break;
        case "PtgStr":
          stack.push('"' + f2[1].replace(/"/g, '""') + '"');
          break;
        case "PtgErr":
          stack.push(
            /*::String(*/
            f2[1]
            /*::)*/
          );
          break;
        case "PtgAreaN":
          r2 = shift_range_xls(f2[1][1], cell5 ? { s: cell5 } : _range, opts);
          stack.push(encode_range_xls(r2, opts));
          break;
        case "PtgArea":
          r2 = shift_range_xls(f2[1][1], _range, opts);
          stack.push(encode_range_xls(r2, opts));
          break;
        case "PtgArea3d":
          ixti = /*::Number(*/
          f2[1][1];
          r2 = f2[1][2];
          sname = get_ixti(supbooks, ixti, opts);
          stack.push(sname + "!" + encode_range_xls(r2, opts));
          break;
        case "PtgAttrSum":
          stack.push("SUM(" + stack.pop() + ")");
          break;
        case "PtgAttrBaxcel":
        case "PtgAttrSemi":
          break;
        case "PtgName":
          nameidx = f2[1][2];
          var lbl = (supbooks.names || [])[nameidx - 1] || (supbooks[0] || [])[nameidx];
          var name = lbl ? lbl.Name : "SH33TJSNAME" + String(nameidx);
          if (name && name.slice(0, 6) == "_xlfn." && !opts.xlfn)
            name = name.slice(6);
          stack.push(name);
          break;
        case "PtgNameX":
          var bookidx = f2[1][1];
          nameidx = f2[1][2];
          var externbook;
          if (opts.biff <= 5) {
            if (bookidx < 0)
              bookidx = -bookidx;
            if (supbooks[bookidx])
              externbook = supbooks[bookidx][nameidx];
          } else {
            var o = "";
            if (((supbooks[bookidx] || [])[0] || [])[0] == 14849)
              ;
            else if (((supbooks[bookidx] || [])[0] || [])[0] == 1025) {
              if (supbooks[bookidx][nameidx] && supbooks[bookidx][nameidx].itab > 0) {
                o = supbooks.SheetNames[supbooks[bookidx][nameidx].itab - 1] + "!";
              }
            } else
              o = supbooks.SheetNames[nameidx - 1] + "!";
            if (supbooks[bookidx] && supbooks[bookidx][nameidx])
              o += supbooks[bookidx][nameidx].Name;
            else if (supbooks[0] && supbooks[0][nameidx])
              o += supbooks[0][nameidx].Name;
            else {
              var ixtidata = (get_ixti_raw(supbooks, bookidx, opts) || "").split(";;");
              if (ixtidata[nameidx - 1])
                o = ixtidata[nameidx - 1];
              else
                o += "SH33TJSERRX";
            }
            stack.push(o);
            break;
          }
          if (!externbook)
            externbook = { Name: "SH33TJSERRY" };
          stack.push(externbook.Name);
          break;
        case "PtgParen":
          var lp = "(", rp = ")";
          if (last_sp >= 0) {
            sp = "";
            switch (formula[0][last_sp][1][0]) {
              case 2:
                lp = fill(" ", formula[0][last_sp][1][1]) + lp;
                break;
              case 3:
                lp = fill("\r", formula[0][last_sp][1][1]) + lp;
                break;
              case 4:
                rp = fill(" ", formula[0][last_sp][1][1]) + rp;
                break;
              case 5:
                rp = fill("\r", formula[0][last_sp][1][1]) + rp;
                break;
              default:
                if (opts.WTF)
                  throw new Error("Unexpected PtgAttrSpaceType " + formula[0][last_sp][1][0]);
            }
            last_sp = -1;
          }
          stack.push(lp + stack.pop() + rp);
          break;
        case "PtgRefErr":
          stack.push("#REF!");
          break;
        case "PtgRefErr3d":
          stack.push("#REF!");
          break;
        case "PtgExp":
          c2 = { c: f2[1][1], r: f2[1][0] };
          var q2 = { c: cell5.c, r: cell5.r };
          if (supbooks.sharedf[encode_cell(c2)]) {
            var parsedf = supbooks.sharedf[encode_cell(c2)];
            stack.push(stringify_formula(parsedf, _range, q2, supbooks, opts));
          } else {
            var fnd = false;
            for (e1 = 0; e1 != supbooks.arrayf.length; ++e1) {
              e2 = supbooks.arrayf[e1];
              if (c2.c < e2[0].s.c || c2.c > e2[0].e.c)
                continue;
              if (c2.r < e2[0].s.r || c2.r > e2[0].e.r)
                continue;
              stack.push(stringify_formula(e2[1], _range, q2, supbooks, opts));
              fnd = true;
              break;
            }
            if (!fnd)
              stack.push(
                /*::String(*/
                f2[1]
                /*::)*/
              );
          }
          break;
        case "PtgArray":
          stack.push("{" + stringify_array(
            /*::(*/
            f2[1]
            /*:: :any)*/
          ) + "}");
          break;
        case "PtgMemArea":
          break;
        case "PtgAttrSpace":
        case "PtgAttrSpaceSemi":
          last_sp = ff;
          break;
        case "PtgTbl":
          break;
        case "PtgMemErr":
          break;
        case "PtgMissArg":
          stack.push("");
          break;
        case "PtgAreaErr":
          stack.push("#REF!");
          break;
        case "PtgAreaErr3d":
          stack.push("#REF!");
          break;
        case "PtgList":
          stack.push("Table" + f2[1].idx + "[#" + f2[1].rt + "]");
          break;
        case "PtgMemAreaN":
        case "PtgMemNoMemN":
        case "PtgAttrNoop":
        case "PtgSheet":
        case "PtgEndSheet":
          break;
        case "PtgMemFunc":
          break;
        case "PtgMemNoMem":
          break;
        case "PtgElfCol":
        case "PtgElfColS":
        case "PtgElfColSV":
        case "PtgElfColV":
        case "PtgElfLel":
        case "PtgElfRadical":
        case "PtgElfRadicalLel":
        case "PtgElfRadicalS":
        case "PtgElfRw":
        case "PtgElfRwV":
          throw new Error("Unsupported ELFs");
        case "PtgSxName":
          throw new Error("Unrecognized Formula Token: " + String(f2));
        default:
          throw new Error("Unrecognized Formula Token: " + String(f2));
      }
      var PtgNonDisp = ["PtgAttrSpace", "PtgAttrSpaceSemi", "PtgAttrGoto"];
      if (opts.biff != 3) {
        if (last_sp >= 0 && PtgNonDisp.indexOf(formula[0][ff][0]) == -1) {
          f2 = formula[0][last_sp];
          var _left = true;
          switch (f2[1][0]) {
            case 4:
              _left = false;
            case 0:
              sp = fill(" ", f2[1][1]);
              break;
            case 5:
              _left = false;
            case 1:
              sp = fill("\r", f2[1][1]);
              break;
            default:
              sp = "";
              if (opts.WTF)
                throw new Error("Unexpected PtgAttrSpaceType " + f2[1][0]);
          }
          stack.push((_left ? sp : "") + stack.pop() + (_left ? "" : sp));
          last_sp = -1;
        }
      }
    }
    if (stack.length > 1 && opts.WTF)
      throw new Error("bad formula stack");
    return stack[0];
  }
  function write_FormulaValue(value) {
    if (value == null) {
      var o = new_buf(8);
      o.write_shift(1, 3);
      o.write_shift(1, 0);
      o.write_shift(2, 0);
      o.write_shift(2, 0);
      o.write_shift(2, 65535);
      return o;
    } else if (typeof value == "number")
      return write_Xnum(value);
    return write_Xnum(0);
  }
  function write_Formula(cell5, R, C, opts, os) {
    var o1 = write_XLSCell(R, C, os);
    var o2 = write_FormulaValue(cell5.v);
    var o3 = new_buf(6);
    var flags = 1 | 32;
    o3.write_shift(2, flags);
    o3.write_shift(4, 0);
    var bf = new_buf(cell5.bf.length);
    for (var i = 0; i < cell5.bf.length; ++i)
      bf[i] = cell5.bf[i];
    var out = bconcat([o1, o2, o3, bf]);
    return out;
  }
  function parse_XLSBParsedFormula(data, length2, opts) {
    var cce = data.read_shift(4);
    var rgce = parse_Rgce(data, cce, opts);
    var cb = data.read_shift(4);
    var rgcb = cb > 0 ? parse_RgbExtra(data, cb, rgce, opts) : null;
    return [rgce, rgcb];
  }
  var parse_XLSBArrayParsedFormula = parse_XLSBParsedFormula;
  var parse_XLSBCellParsedFormula = parse_XLSBParsedFormula;
  var parse_XLSBNameParsedFormula = parse_XLSBParsedFormula;
  var parse_XLSBSharedParsedFormula = parse_XLSBParsedFormula;
  var Cetab = {
    0: "BEEP",
    1: "OPEN",
    2: "OPEN.LINKS",
    3: "CLOSE.ALL",
    4: "SAVE",
    5: "SAVE.AS",
    6: "FILE.DELETE",
    7: "PAGE.SETUP",
    8: "PRINT",
    9: "PRINTER.SETUP",
    10: "QUIT",
    11: "NEW.WINDOW",
    12: "ARRANGE.ALL",
    13: "WINDOW.SIZE",
    14: "WINDOW.MOVE",
    15: "FULL",
    16: "CLOSE",
    17: "RUN",
    22: "SET.PRINT.AREA",
    23: "SET.PRINT.TITLES",
    24: "SET.PAGE.BREAK",
    25: "REMOVE.PAGE.BREAK",
    26: "FONT",
    27: "DISPLAY",
    28: "PROTECT.DOCUMENT",
    29: "PRECISION",
    30: "A1.R1C1",
    31: "CALCULATE.NOW",
    32: "CALCULATION",
    34: "DATA.FIND",
    35: "EXTRACT",
    36: "DATA.DELETE",
    37: "SET.DATABASE",
    38: "SET.CRITERIA",
    39: "SORT",
    40: "DATA.SERIES",
    41: "TABLE",
    42: "FORMAT.NUMBER",
    43: "ALIGNMENT",
    44: "STYLE",
    45: "BORDER",
    46: "CELL.PROTECTION",
    47: "COLUMN.WIDTH",
    48: "UNDO",
    49: "CUT",
    50: "COPY",
    51: "PASTE",
    52: "CLEAR",
    53: "PASTE.SPECIAL",
    54: "EDIT.DELETE",
    55: "INSERT",
    56: "FILL.RIGHT",
    57: "FILL.DOWN",
    61: "DEFINE.NAME",
    62: "CREATE.NAMES",
    63: "FORMULA.GOTO",
    64: "FORMULA.FIND",
    65: "SELECT.LAST.CELL",
    66: "SHOW.ACTIVE.CELL",
    67: "GALLERY.AREA",
    68: "GALLERY.BAR",
    69: "GALLERY.COLUMN",
    70: "GALLERY.LINE",
    71: "GALLERY.PIE",
    72: "GALLERY.SCATTER",
    73: "COMBINATION",
    74: "PREFERRED",
    75: "ADD.OVERLAY",
    76: "GRIDLINES",
    77: "SET.PREFERRED",
    78: "AXES",
    79: "LEGEND",
    80: "ATTACH.TEXT",
    81: "ADD.ARROW",
    82: "SELECT.CHART",
    83: "SELECT.PLOT.AREA",
    84: "PATTERNS",
    85: "MAIN.CHART",
    86: "OVERLAY",
    87: "SCALE",
    88: "FORMAT.LEGEND",
    89: "FORMAT.TEXT",
    90: "EDIT.REPEAT",
    91: "PARSE",
    92: "JUSTIFY",
    93: "HIDE",
    94: "UNHIDE",
    95: "WORKSPACE",
    96: "FORMULA",
    97: "FORMULA.FILL",
    98: "FORMULA.ARRAY",
    99: "DATA.FIND.NEXT",
    100: "DATA.FIND.PREV",
    101: "FORMULA.FIND.NEXT",
    102: "FORMULA.FIND.PREV",
    103: "ACTIVATE",
    104: "ACTIVATE.NEXT",
    105: "ACTIVATE.PREV",
    106: "UNLOCKED.NEXT",
    107: "UNLOCKED.PREV",
    108: "COPY.PICTURE",
    109: "SELECT",
    110: "DELETE.NAME",
    111: "DELETE.FORMAT",
    112: "VLINE",
    113: "HLINE",
    114: "VPAGE",
    115: "HPAGE",
    116: "VSCROLL",
    117: "HSCROLL",
    118: "ALERT",
    119: "NEW",
    120: "CANCEL.COPY",
    121: "SHOW.CLIPBOARD",
    122: "MESSAGE",
    124: "PASTE.LINK",
    125: "APP.ACTIVATE",
    126: "DELETE.ARROW",
    127: "ROW.HEIGHT",
    128: "FORMAT.MOVE",
    129: "FORMAT.SIZE",
    130: "FORMULA.REPLACE",
    131: "SEND.KEYS",
    132: "SELECT.SPECIAL",
    133: "APPLY.NAMES",
    134: "REPLACE.FONT",
    135: "FREEZE.PANES",
    136: "SHOW.INFO",
    137: "SPLIT",
    138: "ON.WINDOW",
    139: "ON.DATA",
    140: "DISABLE.INPUT",
    142: "OUTLINE",
    143: "LIST.NAMES",
    144: "FILE.CLOSE",
    145: "SAVE.WORKBOOK",
    146: "DATA.FORM",
    147: "COPY.CHART",
    148: "ON.TIME",
    149: "WAIT",
    150: "FORMAT.FONT",
    151: "FILL.UP",
    152: "FILL.LEFT",
    153: "DELETE.OVERLAY",
    155: "SHORT.MENUS",
    159: "SET.UPDATE.STATUS",
    161: "COLOR.PALETTE",
    162: "DELETE.STYLE",
    163: "WINDOW.RESTORE",
    164: "WINDOW.MAXIMIZE",
    166: "CHANGE.LINK",
    167: "CALCULATE.DOCUMENT",
    168: "ON.KEY",
    169: "APP.RESTORE",
    170: "APP.MOVE",
    171: "APP.SIZE",
    172: "APP.MINIMIZE",
    173: "APP.MAXIMIZE",
    174: "BRING.TO.FRONT",
    175: "SEND.TO.BACK",
    185: "MAIN.CHART.TYPE",
    186: "OVERLAY.CHART.TYPE",
    187: "SELECT.END",
    188: "OPEN.MAIL",
    189: "SEND.MAIL",
    190: "STANDARD.FONT",
    191: "CONSOLIDATE",
    192: "SORT.SPECIAL",
    193: "GALLERY.3D.AREA",
    194: "GALLERY.3D.COLUMN",
    195: "GALLERY.3D.LINE",
    196: "GALLERY.3D.PIE",
    197: "VIEW.3D",
    198: "GOAL.SEEK",
    199: "WORKGROUP",
    200: "FILL.GROUP",
    201: "UPDATE.LINK",
    202: "PROMOTE",
    203: "DEMOTE",
    204: "SHOW.DETAIL",
    206: "UNGROUP",
    207: "OBJECT.PROPERTIES",
    208: "SAVE.NEW.OBJECT",
    209: "SHARE",
    210: "SHARE.NAME",
    211: "DUPLICATE",
    212: "APPLY.STYLE",
    213: "ASSIGN.TO.OBJECT",
    214: "OBJECT.PROTECTION",
    215: "HIDE.OBJECT",
    216: "SET.EXTRACT",
    217: "CREATE.PUBLISHER",
    218: "SUBSCRIBE.TO",
    219: "ATTRIBUTES",
    220: "SHOW.TOOLBAR",
    222: "PRINT.PREVIEW",
    223: "EDIT.COLOR",
    224: "SHOW.LEVELS",
    225: "FORMAT.MAIN",
    226: "FORMAT.OVERLAY",
    227: "ON.RECALC",
    228: "EDIT.SERIES",
    229: "DEFINE.STYLE",
    240: "LINE.PRINT",
    243: "ENTER.DATA",
    249: "GALLERY.RADAR",
    250: "MERGE.STYLES",
    251: "EDITION.OPTIONS",
    252: "PASTE.PICTURE",
    253: "PASTE.PICTURE.LINK",
    254: "SPELLING",
    256: "ZOOM",
    259: "INSERT.OBJECT",
    260: "WINDOW.MINIMIZE",
    265: "SOUND.NOTE",
    266: "SOUND.PLAY",
    267: "FORMAT.SHAPE",
    268: "EXTEND.POLYGON",
    269: "FORMAT.AUTO",
    272: "GALLERY.3D.BAR",
    273: "GALLERY.3D.SURFACE",
    274: "FILL.AUTO",
    276: "CUSTOMIZE.TOOLBAR",
    277: "ADD.TOOL",
    278: "EDIT.OBJECT",
    279: "ON.DOUBLECLICK",
    280: "ON.ENTRY",
    281: "WORKBOOK.ADD",
    282: "WORKBOOK.MOVE",
    283: "WORKBOOK.COPY",
    284: "WORKBOOK.OPTIONS",
    285: "SAVE.WORKSPACE",
    288: "CHART.WIZARD",
    289: "DELETE.TOOL",
    290: "MOVE.TOOL",
    291: "WORKBOOK.SELECT",
    292: "WORKBOOK.ACTIVATE",
    293: "ASSIGN.TO.TOOL",
    295: "COPY.TOOL",
    296: "RESET.TOOL",
    297: "CONSTRAIN.NUMERIC",
    298: "PASTE.TOOL",
    302: "WORKBOOK.NEW",
    305: "SCENARIO.CELLS",
    306: "SCENARIO.DELETE",
    307: "SCENARIO.ADD",
    308: "SCENARIO.EDIT",
    309: "SCENARIO.SHOW",
    310: "SCENARIO.SHOW.NEXT",
    311: "SCENARIO.SUMMARY",
    312: "PIVOT.TABLE.WIZARD",
    313: "PIVOT.FIELD.PROPERTIES",
    314: "PIVOT.FIELD",
    315: "PIVOT.ITEM",
    316: "PIVOT.ADD.FIELDS",
    318: "OPTIONS.CALCULATION",
    319: "OPTIONS.EDIT",
    320: "OPTIONS.VIEW",
    321: "ADDIN.MANAGER",
    322: "MENU.EDITOR",
    323: "ATTACH.TOOLBARS",
    324: "VBAActivate",
    325: "OPTIONS.CHART",
    328: "VBA.INSERT.FILE",
    330: "VBA.PROCEDURE.DEFINITION",
    336: "ROUTING.SLIP",
    338: "ROUTE.DOCUMENT",
    339: "MAIL.LOGON",
    342: "INSERT.PICTURE",
    343: "EDIT.TOOL",
    344: "GALLERY.DOUGHNUT",
    350: "CHART.TREND",
    352: "PIVOT.ITEM.PROPERTIES",
    354: "WORKBOOK.INSERT",
    355: "OPTIONS.TRANSITION",
    356: "OPTIONS.GENERAL",
    370: "FILTER.ADVANCED",
    373: "MAIL.ADD.MAILER",
    374: "MAIL.DELETE.MAILER",
    375: "MAIL.REPLY",
    376: "MAIL.REPLY.ALL",
    377: "MAIL.FORWARD",
    378: "MAIL.NEXT.LETTER",
    379: "DATA.LABEL",
    380: "INSERT.TITLE",
    381: "FONT.PROPERTIES",
    382: "MACRO.OPTIONS",
    383: "WORKBOOK.HIDE",
    384: "WORKBOOK.UNHIDE",
    385: "WORKBOOK.DELETE",
    386: "WORKBOOK.NAME",
    388: "GALLERY.CUSTOM",
    390: "ADD.CHART.AUTOFORMAT",
    391: "DELETE.CHART.AUTOFORMAT",
    392: "CHART.ADD.DATA",
    393: "AUTO.OUTLINE",
    394: "TAB.ORDER",
    395: "SHOW.DIALOG",
    396: "SELECT.ALL",
    397: "UNGROUP.SHEETS",
    398: "SUBTOTAL.CREATE",
    399: "SUBTOTAL.REMOVE",
    400: "RENAME.OBJECT",
    412: "WORKBOOK.SCROLL",
    413: "WORKBOOK.NEXT",
    414: "WORKBOOK.PREV",
    415: "WORKBOOK.TAB.SPLIT",
    416: "FULL.SCREEN",
    417: "WORKBOOK.PROTECT",
    420: "SCROLLBAR.PROPERTIES",
    421: "PIVOT.SHOW.PAGES",
    422: "TEXT.TO.COLUMNS",
    423: "FORMAT.CHARTTYPE",
    424: "LINK.FORMAT",
    425: "TRACER.DISPLAY",
    430: "TRACER.NAVIGATE",
    431: "TRACER.CLEAR",
    432: "TRACER.ERROR",
    433: "PIVOT.FIELD.GROUP",
    434: "PIVOT.FIELD.UNGROUP",
    435: "CHECKBOX.PROPERTIES",
    436: "LABEL.PROPERTIES",
    437: "LISTBOX.PROPERTIES",
    438: "EDITBOX.PROPERTIES",
    439: "PIVOT.REFRESH",
    440: "LINK.COMBO",
    441: "OPEN.TEXT",
    442: "HIDE.DIALOG",
    443: "SET.DIALOG.FOCUS",
    444: "ENABLE.OBJECT",
    445: "PUSHBUTTON.PROPERTIES",
    446: "SET.DIALOG.DEFAULT",
    447: "FILTER",
    448: "FILTER.SHOW.ALL",
    449: "CLEAR.OUTLINE",
    450: "FUNCTION.WIZARD",
    451: "ADD.LIST.ITEM",
    452: "SET.LIST.ITEM",
    453: "REMOVE.LIST.ITEM",
    454: "SELECT.LIST.ITEM",
    455: "SET.CONTROL.VALUE",
    456: "SAVE.COPY.AS",
    458: "OPTIONS.LISTS.ADD",
    459: "OPTIONS.LISTS.DELETE",
    460: "SERIES.AXES",
    461: "SERIES.X",
    462: "SERIES.Y",
    463: "ERRORBAR.X",
    464: "ERRORBAR.Y",
    465: "FORMAT.CHART",
    466: "SERIES.ORDER",
    467: "MAIL.LOGOFF",
    468: "CLEAR.ROUTING.SLIP",
    469: "APP.ACTIVATE.MICROSOFT",
    470: "MAIL.EDIT.MAILER",
    471: "ON.SHEET",
    472: "STANDARD.WIDTH",
    473: "SCENARIO.MERGE",
    474: "SUMMARY.INFO",
    475: "FIND.FILE",
    476: "ACTIVE.CELL.FONT",
    477: "ENABLE.TIPWIZARD",
    478: "VBA.MAKE.ADDIN",
    480: "INSERTDATATABLE",
    481: "WORKGROUP.OPTIONS",
    482: "MAIL.SEND.MAILER",
    485: "AUTOCORRECT",
    489: "POST.DOCUMENT",
    491: "PICKLIST",
    493: "VIEW.SHOW",
    494: "VIEW.DEFINE",
    495: "VIEW.DELETE",
    509: "SHEET.BACKGROUND",
    510: "INSERT.MAP.OBJECT",
    511: "OPTIONS.MENONO",
    517: "MSOCHECKS",
    518: "NORMAL",
    519: "LAYOUT",
    520: "RM.PRINT.AREA",
    521: "CLEAR.PRINT.AREA",
    522: "ADD.PRINT.AREA",
    523: "MOVE.BRK",
    545: "HIDECURR.NOTE",
    546: "HIDEALL.NOTES",
    547: "DELETE.NOTE",
    548: "TRAVERSE.NOTES",
    549: "ACTIVATE.NOTES",
    620: "PROTECT.REVISIONS",
    621: "UNPROTECT.REVISIONS",
    647: "OPTIONS.ME",
    653: "WEB.PUBLISH",
    667: "NEWWEBQUERY",
    673: "PIVOT.TABLE.CHART",
    753: "OPTIONS.SAVE",
    755: "OPTIONS.SPELL",
    808: "HIDEALL.INKANNOTS"
  };
  var Ftab = {
    0: "COUNT",
    1: "IF",
    2: "ISNA",
    3: "ISERROR",
    4: "SUM",
    5: "AVERAGE",
    6: "MIN",
    7: "MAX",
    8: "ROW",
    9: "COLUMN",
    10: "NA",
    11: "NPV",
    12: "STDEV",
    13: "DOLLAR",
    14: "FIXED",
    15: "SIN",
    16: "COS",
    17: "TAN",
    18: "ATAN",
    19: "PI",
    20: "SQRT",
    21: "EXP",
    22: "LN",
    23: "LOG10",
    24: "ABS",
    25: "INT",
    26: "SIGN",
    27: "ROUND",
    28: "LOOKUP",
    29: "INDEX",
    30: "REPT",
    31: "MID",
    32: "LEN",
    33: "VALUE",
    34: "TRUE",
    35: "FALSE",
    36: "AND",
    37: "OR",
    38: "NOT",
    39: "MOD",
    40: "DCOUNT",
    41: "DSUM",
    42: "DAVERAGE",
    43: "DMIN",
    44: "DMAX",
    45: "DSTDEV",
    46: "VAR",
    47: "DVAR",
    48: "TEXT",
    49: "LINEST",
    50: "TREND",
    51: "LOGEST",
    52: "GROWTH",
    53: "GOTO",
    54: "HALT",
    55: "RETURN",
    56: "PV",
    57: "FV",
    58: "NPER",
    59: "PMT",
    60: "RATE",
    61: "MIRR",
    62: "IRR",
    63: "RAND",
    64: "MATCH",
    65: "DATE",
    66: "TIME",
    67: "DAY",
    68: "MONTH",
    69: "YEAR",
    70: "WEEKDAY",
    71: "HOUR",
    72: "MINUTE",
    73: "SECOND",
    74: "NOW",
    75: "AREAS",
    76: "ROWS",
    77: "COLUMNS",
    78: "OFFSET",
    79: "ABSREF",
    80: "RELREF",
    81: "ARGUMENT",
    82: "SEARCH",
    83: "TRANSPOSE",
    84: "ERROR",
    85: "STEP",
    86: "TYPE",
    87: "ECHO",
    88: "SET.NAME",
    89: "CALLER",
    90: "DEREF",
    91: "WINDOWS",
    92: "SERIES",
    93: "DOCUMENTS",
    94: "ACTIVE.CELL",
    95: "SELECTION",
    96: "RESULT",
    97: "ATAN2",
    98: "ASIN",
    99: "ACOS",
    100: "CHOOSE",
    101: "HLOOKUP",
    102: "VLOOKUP",
    103: "LINKS",
    104: "INPUT",
    105: "ISREF",
    106: "GET.FORMULA",
    107: "GET.NAME",
    108: "SET.VALUE",
    109: "LOG",
    110: "EXEC",
    111: "CHAR",
    112: "LOWER",
    113: "UPPER",
    114: "PROPER",
    115: "LEFT",
    116: "RIGHT",
    117: "EXACT",
    118: "TRIM",
    119: "REPLACE",
    120: "SUBSTITUTE",
    121: "CODE",
    122: "NAMES",
    123: "DIRECTORY",
    124: "FIND",
    125: "CELL",
    126: "ISERR",
    127: "ISTEXT",
    128: "ISNUMBER",
    129: "ISBLANK",
    130: "T",
    131: "N",
    132: "FOPEN",
    133: "FCLOSE",
    134: "FSIZE",
    135: "FREADLN",
    136: "FREAD",
    137: "FWRITELN",
    138: "FWRITE",
    139: "FPOS",
    140: "DATEVALUE",
    141: "TIMEVALUE",
    142: "SLN",
    143: "SYD",
    144: "DDB",
    145: "GET.DEF",
    146: "REFTEXT",
    147: "TEXTREF",
    148: "INDIRECT",
    149: "REGISTER",
    150: "CALL",
    151: "ADD.BAR",
    152: "ADD.MENU",
    153: "ADD.COMMAND",
    154: "ENABLE.COMMAND",
    155: "CHECK.COMMAND",
    156: "RENAME.COMMAND",
    157: "SHOW.BAR",
    158: "DELETE.MENU",
    159: "DELETE.COMMAND",
    160: "GET.CHART.ITEM",
    161: "DIALOG.BOX",
    162: "CLEAN",
    163: "MDETERM",
    164: "MINVERSE",
    165: "MMULT",
    166: "FILES",
    167: "IPMT",
    168: "PPMT",
    169: "COUNTA",
    170: "CANCEL.KEY",
    171: "FOR",
    172: "WHILE",
    173: "BREAK",
    174: "NEXT",
    175: "INITIATE",
    176: "REQUEST",
    177: "POKE",
    178: "EXECUTE",
    179: "TERMINATE",
    180: "RESTART",
    181: "HELP",
    182: "GET.BAR",
    183: "PRODUCT",
    184: "FACT",
    185: "GET.CELL",
    186: "GET.WORKSPACE",
    187: "GET.WINDOW",
    188: "GET.DOCUMENT",
    189: "DPRODUCT",
    190: "ISNONTEXT",
    191: "GET.NOTE",
    192: "NOTE",
    193: "STDEVP",
    194: "VARP",
    195: "DSTDEVP",
    196: "DVARP",
    197: "TRUNC",
    198: "ISLOGICAL",
    199: "DCOUNTA",
    200: "DELETE.BAR",
    201: "UNREGISTER",
    204: "USDOLLAR",
    205: "FINDB",
    206: "SEARCHB",
    207: "REPLACEB",
    208: "LEFTB",
    209: "RIGHTB",
    210: "MIDB",
    211: "LENB",
    212: "ROUNDUP",
    213: "ROUNDDOWN",
    214: "ASC",
    215: "DBCS",
    216: "RANK",
    219: "ADDRESS",
    220: "DAYS360",
    221: "TODAY",
    222: "VDB",
    223: "ELSE",
    224: "ELSE.IF",
    225: "END.IF",
    226: "FOR.CELL",
    227: "MEDIAN",
    228: "SUMPRODUCT",
    229: "SINH",
    230: "COSH",
    231: "TANH",
    232: "ASINH",
    233: "ACOSH",
    234: "ATANH",
    235: "DGET",
    236: "CREATE.OBJECT",
    237: "VOLATILE",
    238: "LAST.ERROR",
    239: "CUSTOM.UNDO",
    240: "CUSTOM.REPEAT",
    241: "FORMULA.CONVERT",
    242: "GET.LINK.INFO",
    243: "TEXT.BOX",
    244: "INFO",
    245: "GROUP",
    246: "GET.OBJECT",
    247: "DB",
    248: "PAUSE",
    251: "RESUME",
    252: "FREQUENCY",
    253: "ADD.TOOLBAR",
    254: "DELETE.TOOLBAR",
    255: "User",
    256: "RESET.TOOLBAR",
    257: "EVALUATE",
    258: "GET.TOOLBAR",
    259: "GET.TOOL",
    260: "SPELLING.CHECK",
    261: "ERROR.TYPE",
    262: "APP.TITLE",
    263: "WINDOW.TITLE",
    264: "SAVE.TOOLBAR",
    265: "ENABLE.TOOL",
    266: "PRESS.TOOL",
    267: "REGISTER.ID",
    268: "GET.WORKBOOK",
    269: "AVEDEV",
    270: "BETADIST",
    271: "GAMMALN",
    272: "BETAINV",
    273: "BINOMDIST",
    274: "CHIDIST",
    275: "CHIINV",
    276: "COMBIN",
    277: "CONFIDENCE",
    278: "CRITBINOM",
    279: "EVEN",
    280: "EXPONDIST",
    281: "FDIST",
    282: "FINV",
    283: "FISHER",
    284: "FISHERINV",
    285: "FLOOR",
    286: "GAMMADIST",
    287: "GAMMAINV",
    288: "CEILING",
    289: "HYPGEOMDIST",
    290: "LOGNORMDIST",
    291: "LOGINV",
    292: "NEGBINOMDIST",
    293: "NORMDIST",
    294: "NORMSDIST",
    295: "NORMINV",
    296: "NORMSINV",
    297: "STANDARDIZE",
    298: "ODD",
    299: "PERMUT",
    300: "POISSON",
    301: "TDIST",
    302: "WEIBULL",
    303: "SUMXMY2",
    304: "SUMX2MY2",
    305: "SUMX2PY2",
    306: "CHITEST",
    307: "CORREL",
    308: "COVAR",
    309: "FORECAST",
    310: "FTEST",
    311: "INTERCEPT",
    312: "PEARSON",
    313: "RSQ",
    314: "STEYX",
    315: "SLOPE",
    316: "TTEST",
    317: "PROB",
    318: "DEVSQ",
    319: "GEOMEAN",
    320: "HARMEAN",
    321: "SUMSQ",
    322: "KURT",
    323: "SKEW",
    324: "ZTEST",
    325: "LARGE",
    326: "SMALL",
    327: "QUARTILE",
    328: "PERCENTILE",
    329: "PERCENTRANK",
    330: "MODE",
    331: "TRIMMEAN",
    332: "TINV",
    334: "MOVIE.COMMAND",
    335: "GET.MOVIE",
    336: "CONCATENATE",
    337: "POWER",
    338: "PIVOT.ADD.DATA",
    339: "GET.PIVOT.TABLE",
    340: "GET.PIVOT.FIELD",
    341: "GET.PIVOT.ITEM",
    342: "RADIANS",
    343: "DEGREES",
    344: "SUBTOTAL",
    345: "SUMIF",
    346: "COUNTIF",
    347: "COUNTBLANK",
    348: "SCENARIO.GET",
    349: "OPTIONS.LISTS.GET",
    350: "ISPMT",
    351: "DATEDIF",
    352: "DATESTRING",
    353: "NUMBERSTRING",
    354: "ROMAN",
    355: "OPEN.DIALOG",
    356: "SAVE.DIALOG",
    357: "VIEW.GET",
    358: "GETPIVOTDATA",
    359: "HYPERLINK",
    360: "PHONETIC",
    361: "AVERAGEA",
    362: "MAXA",
    363: "MINA",
    364: "STDEVPA",
    365: "VARPA",
    366: "STDEVA",
    367: "VARA",
    368: "BAHTTEXT",
    369: "THAIDAYOFWEEK",
    370: "THAIDIGIT",
    371: "THAIMONTHOFYEAR",
    372: "THAINUMSOUND",
    373: "THAINUMSTRING",
    374: "THAISTRINGLENGTH",
    375: "ISTHAIDIGIT",
    376: "ROUNDBAHTDOWN",
    377: "ROUNDBAHTUP",
    378: "THAIYEAR",
    379: "RTD",
    380: "CUBEVALUE",
    381: "CUBEMEMBER",
    382: "CUBEMEMBERPROPERTY",
    383: "CUBERANKEDMEMBER",
    384: "HEX2BIN",
    385: "HEX2DEC",
    386: "HEX2OCT",
    387: "DEC2BIN",
    388: "DEC2HEX",
    389: "DEC2OCT",
    390: "OCT2BIN",
    391: "OCT2HEX",
    392: "OCT2DEC",
    393: "BIN2DEC",
    394: "BIN2OCT",
    395: "BIN2HEX",
    396: "IMSUB",
    397: "IMDIV",
    398: "IMPOWER",
    399: "IMABS",
    400: "IMSQRT",
    401: "IMLN",
    402: "IMLOG2",
    403: "IMLOG10",
    404: "IMSIN",
    405: "IMCOS",
    406: "IMEXP",
    407: "IMARGUMENT",
    408: "IMCONJUGATE",
    409: "IMAGINARY",
    410: "IMREAL",
    411: "COMPLEX",
    412: "IMSUM",
    413: "IMPRODUCT",
    414: "SERIESSUM",
    415: "FACTDOUBLE",
    416: "SQRTPI",
    417: "QUOTIENT",
    418: "DELTA",
    419: "GESTEP",
    420: "ISEVEN",
    421: "ISODD",
    422: "MROUND",
    423: "ERF",
    424: "ERFC",
    425: "BESSELJ",
    426: "BESSELK",
    427: "BESSELY",
    428: "BESSELI",
    429: "XIRR",
    430: "XNPV",
    431: "PRICEMAT",
    432: "YIELDMAT",
    433: "INTRATE",
    434: "RECEIVED",
    435: "DISC",
    436: "PRICEDISC",
    437: "YIELDDISC",
    438: "TBILLEQ",
    439: "TBILLPRICE",
    440: "TBILLYIELD",
    441: "PRICE",
    442: "YIELD",
    443: "DOLLARDE",
    444: "DOLLARFR",
    445: "NOMINAL",
    446: "EFFECT",
    447: "CUMPRINC",
    448: "CUMIPMT",
    449: "EDATE",
    450: "EOMONTH",
    451: "YEARFRAC",
    452: "COUPDAYBS",
    453: "COUPDAYS",
    454: "COUPDAYSNC",
    455: "COUPNCD",
    456: "COUPNUM",
    457: "COUPPCD",
    458: "DURATION",
    459: "MDURATION",
    460: "ODDLPRICE",
    461: "ODDLYIELD",
    462: "ODDFPRICE",
    463: "ODDFYIELD",
    464: "RANDBETWEEN",
    465: "WEEKNUM",
    466: "AMORDEGRC",
    467: "AMORLINC",
    468: "CONVERT",
    724: "SHEETJS",
    469: "ACCRINT",
    470: "ACCRINTM",
    471: "WORKDAY",
    472: "NETWORKDAYS",
    473: "GCD",
    474: "MULTINOMIAL",
    475: "LCM",
    476: "FVSCHEDULE",
    477: "CUBEKPIMEMBER",
    478: "CUBESET",
    479: "CUBESETCOUNT",
    480: "IFERROR",
    481: "COUNTIFS",
    482: "SUMIFS",
    483: "AVERAGEIF",
    484: "AVERAGEIFS"
  };
  var FtabArgc = {
    2: 1,
    3: 1,
    10: 0,
    15: 1,
    16: 1,
    17: 1,
    18: 1,
    19: 0,
    20: 1,
    21: 1,
    22: 1,
    23: 1,
    24: 1,
    25: 1,
    26: 1,
    27: 2,
    30: 2,
    31: 3,
    32: 1,
    33: 1,
    34: 0,
    35: 0,
    38: 1,
    39: 2,
    40: 3,
    41: 3,
    42: 3,
    43: 3,
    44: 3,
    45: 3,
    47: 3,
    48: 2,
    53: 1,
    61: 3,
    63: 0,
    65: 3,
    66: 3,
    67: 1,
    68: 1,
    69: 1,
    70: 1,
    71: 1,
    72: 1,
    73: 1,
    74: 0,
    75: 1,
    76: 1,
    77: 1,
    79: 2,
    80: 2,
    83: 1,
    85: 0,
    86: 1,
    89: 0,
    90: 1,
    94: 0,
    95: 0,
    97: 2,
    98: 1,
    99: 1,
    101: 3,
    102: 3,
    105: 1,
    106: 1,
    108: 2,
    111: 1,
    112: 1,
    113: 1,
    114: 1,
    117: 2,
    118: 1,
    119: 4,
    121: 1,
    126: 1,
    127: 1,
    128: 1,
    129: 1,
    130: 1,
    131: 1,
    133: 1,
    134: 1,
    135: 1,
    136: 2,
    137: 2,
    138: 2,
    140: 1,
    141: 1,
    142: 3,
    143: 4,
    144: 4,
    161: 1,
    162: 1,
    163: 1,
    164: 1,
    165: 2,
    172: 1,
    175: 2,
    176: 2,
    177: 3,
    178: 2,
    179: 1,
    184: 1,
    186: 1,
    189: 3,
    190: 1,
    195: 3,
    196: 3,
    197: 1,
    198: 1,
    199: 3,
    201: 1,
    207: 4,
    210: 3,
    211: 1,
    212: 2,
    213: 2,
    214: 1,
    215: 1,
    225: 0,
    229: 1,
    230: 1,
    231: 1,
    232: 1,
    233: 1,
    234: 1,
    235: 3,
    244: 1,
    247: 4,
    252: 2,
    257: 1,
    261: 1,
    271: 1,
    273: 4,
    274: 2,
    275: 2,
    276: 2,
    277: 3,
    278: 3,
    279: 1,
    280: 3,
    281: 3,
    282: 3,
    283: 1,
    284: 1,
    285: 2,
    286: 4,
    287: 3,
    288: 2,
    289: 4,
    290: 3,
    291: 3,
    292: 3,
    293: 4,
    294: 1,
    295: 3,
    296: 1,
    297: 3,
    298: 1,
    299: 2,
    300: 3,
    301: 3,
    302: 4,
    303: 2,
    304: 2,
    305: 2,
    306: 2,
    307: 2,
    308: 2,
    309: 3,
    310: 2,
    311: 2,
    312: 2,
    313: 2,
    314: 2,
    315: 2,
    316: 4,
    325: 2,
    326: 2,
    327: 2,
    328: 2,
    331: 2,
    332: 2,
    337: 2,
    342: 1,
    343: 1,
    346: 2,
    347: 1,
    350: 4,
    351: 3,
    352: 1,
    353: 2,
    360: 1,
    368: 1,
    369: 1,
    370: 1,
    371: 1,
    372: 1,
    373: 1,
    374: 1,
    375: 1,
    376: 1,
    377: 1,
    378: 1,
    382: 3,
    385: 1,
    392: 1,
    393: 1,
    396: 2,
    397: 2,
    398: 2,
    399: 1,
    400: 1,
    401: 1,
    402: 1,
    403: 1,
    404: 1,
    405: 1,
    406: 1,
    407: 1,
    408: 1,
    409: 1,
    410: 1,
    414: 4,
    415: 1,
    416: 1,
    417: 2,
    420: 1,
    421: 1,
    422: 2,
    424: 1,
    425: 2,
    426: 2,
    427: 2,
    428: 2,
    430: 3,
    438: 3,
    439: 3,
    440: 3,
    443: 2,
    444: 2,
    445: 2,
    446: 2,
    447: 6,
    448: 6,
    449: 2,
    450: 2,
    464: 2,
    468: 3,
    476: 2,
    479: 1,
    480: 2,
    65535: 0
  };
  function csf_to_ods_formula(f2) {
    var o = "of:=" + f2.replace(crefregex, "$1[.$2$3$4$5]").replace(/\]:\[/g, ":");
    return o.replace(/;/g, "|").replace(/,/g, ";");
  }
  function csf_to_ods_3D(r2) {
    return r2.replace(/\./, "!");
  }
  var browser_has_Map = typeof Map !== "undefined";
  function get_sst_id(sst, str, rev) {
    var i = 0, len = sst.length;
    if (rev) {
      if (browser_has_Map ? rev.has(str) : Object.prototype.hasOwnProperty.call(rev, str)) {
        var revarr = browser_has_Map ? rev.get(str) : rev[str];
        for (; i < revarr.length; ++i) {
          if (sst[revarr[i]].t === str) {
            sst.Count++;
            return revarr[i];
          }
        }
      }
    } else
      for (; i < len; ++i) {
        if (sst[i].t === str) {
          sst.Count++;
          return i;
        }
      }
    sst[len] = { t: str };
    sst.Count++;
    sst.Unique++;
    if (rev) {
      if (browser_has_Map) {
        if (!rev.has(str))
          rev.set(str, []);
        rev.get(str).push(len);
      } else {
        if (!Object.prototype.hasOwnProperty.call(rev, str))
          rev[str] = [];
        rev[str].push(len);
      }
    }
    return len;
  }
  function col_obj_w(C, col) {
    var p2 = { min: C + 1, max: C + 1 };
    var wch = -1;
    if (col.MDW)
      MDW = col.MDW;
    if (col.width != null)
      p2.customWidth = 1;
    else if (col.wpx != null)
      wch = px2char(col.wpx);
    else if (col.wch != null)
      wch = col.wch;
    if (wch > -1) {
      p2.width = char2width(wch);
      p2.customWidth = 1;
    } else if (col.width != null)
      p2.width = col.width;
    if (col.hidden)
      p2.hidden = true;
    if (col.level != null) {
      p2.outlineLevel = p2.level = col.level;
    }
    return p2;
  }
  function default_margins(margins, mode) {
    if (!margins)
      return;
    var defs = [0.7, 0.7, 0.75, 0.75, 0.3, 0.3];
    if (mode == "xlml")
      defs = [1, 1, 1, 1, 0.5, 0.5];
    if (margins.left == null)
      margins.left = defs[0];
    if (margins.right == null)
      margins.right = defs[1];
    if (margins.top == null)
      margins.top = defs[2];
    if (margins.bottom == null)
      margins.bottom = defs[3];
    if (margins.header == null)
      margins.header = defs[4];
    if (margins.footer == null)
      margins.footer = defs[5];
  }
  function get_cell_style(styles, cell5, opts) {
    var z2 = opts.revssf[cell5.z != null ? cell5.z : "General"];
    var i = 60, len = styles.length;
    if (z2 == null && opts.ssf) {
      for (; i < 392; ++i)
        if (opts.ssf[i] == null) {
          SSF_load(cell5.z, i);
          opts.ssf[i] = cell5.z;
          opts.revssf[cell5.z] = z2 = i;
          break;
        }
    }
    for (i = 0; i != len; ++i)
      if (styles[i].numFmtId === z2)
        return i;
    styles[len] = {
      numFmtId: z2,
      fontId: 0,
      fillId: 0,
      borderId: 0,
      xfId: 0,
      applyNumberFormat: 1
    };
    return len;
  }
  function check_ws(ws, sname, i) {
    if (ws && ws["!ref"]) {
      var range = safe_decode_range(ws["!ref"]);
      if (range.e.c < range.s.c || range.e.r < range.s.r)
        throw new Error("Bad range (" + i + "): " + ws["!ref"]);
    }
  }
  function write_ws_xml_merges(merges) {
    if (merges.length === 0)
      return "";
    var o = '<mergeCells count="' + merges.length + '">';
    for (var i = 0; i != merges.length; ++i)
      o += '<mergeCell ref="' + encode_range(merges[i]) + '"/>';
    return o + "</mergeCells>";
  }
  function write_ws_xml_sheetpr(ws, wb, idx, opts, o) {
    var needed = false;
    var props = {}, payload = null;
    if (opts.bookType !== "xlsx" && wb.vbaraw) {
      var cname = wb.SheetNames[idx];
      try {
        if (wb.Workbook)
          cname = wb.Workbook.Sheets[idx].CodeName || cname;
      } catch (e2) {
      }
      needed = true;
      props.codeName = utf8write(escapexml(cname));
    }
    if (ws && ws["!outline"]) {
      var outlineprops = { summaryBelow: 1, summaryRight: 1 };
      if (ws["!outline"].above)
        outlineprops.summaryBelow = 0;
      if (ws["!outline"].left)
        outlineprops.summaryRight = 0;
      payload = (payload || "") + writextag("outlinePr", null, outlineprops);
    }
    if (!needed && !payload)
      return;
    o[o.length] = writextag("sheetPr", payload, props);
  }
  var sheetprot_deffalse = ["objects", "scenarios", "selectLockedCells", "selectUnlockedCells"];
  var sheetprot_deftrue = [
    "formatColumns",
    "formatRows",
    "formatCells",
    "insertColumns",
    "insertRows",
    "insertHyperlinks",
    "deleteColumns",
    "deleteRows",
    "sort",
    "autoFilter",
    "pivotTables"
  ];
  function write_ws_xml_protection(sp) {
    var o = { sheet: 1 };
    sheetprot_deffalse.forEach(function(n2) {
      if (sp[n2] != null && sp[n2])
        o[n2] = "1";
    });
    sheetprot_deftrue.forEach(function(n2) {
      if (sp[n2] != null && !sp[n2])
        o[n2] = "0";
    });
    if (sp.password)
      o.password = crypto_CreatePasswordVerifier_Method1(sp.password).toString(16).toUpperCase();
    return writextag("sheetProtection", null, o);
  }
  function write_ws_xml_margins(margin) {
    default_margins(margin);
    return writextag("pageMargins", null, margin);
  }
  function write_ws_xml_cols(ws, cols) {
    var o = ["<cols>"], col;
    for (var i = 0; i != cols.length; ++i) {
      if (!(col = cols[i]))
        continue;
      o[o.length] = writextag("col", null, col_obj_w(i, col));
    }
    o[o.length] = "</cols>";
    return o.join("");
  }
  function write_ws_xml_autofilter(data, ws, wb, idx) {
    var ref = typeof data.ref == "string" ? data.ref : encode_range(data.ref);
    if (!wb.Workbook)
      wb.Workbook = { Sheets: [] };
    if (!wb.Workbook.Names)
      wb.Workbook.Names = [];
    var names = wb.Workbook.Names;
    var range = decode_range(ref);
    if (range.s.r == range.e.r) {
      range.e.r = decode_range(ws["!ref"]).e.r;
      ref = encode_range(range);
    }
    for (var i = 0; i < names.length; ++i) {
      var name = names[i];
      if (name.Name != "_xlnm._FilterDatabase")
        continue;
      if (name.Sheet != idx)
        continue;
      name.Ref = "'" + wb.SheetNames[idx] + "'!" + ref;
      break;
    }
    if (i == names.length)
      names.push({ Name: "_xlnm._FilterDatabase", Sheet: idx, Ref: "'" + wb.SheetNames[idx] + "'!" + ref });
    return writextag("autoFilter", null, { ref });
  }
  function write_ws_xml_sheetviews(ws, opts, idx, wb) {
    var sview = { workbookViewId: "0" };
    if ((((wb || {}).Workbook || {}).Views || [])[0])
      sview.rightToLeft = wb.Workbook.Views[0].RTL ? "1" : "0";
    return writextag("sheetViews", writextag("sheetView", null, sview), {});
  }
  function write_ws_xml_cell(cell5, ref, ws, opts) {
    if (cell5.c)
      ws["!comments"].push([ref, cell5.c]);
    if (cell5.v === void 0 && typeof cell5.f !== "string" || cell5.t === "z" && !cell5.f)
      return "";
    var vv = "";
    var oldt = cell5.t, oldv = cell5.v;
    if (cell5.t !== "z")
      switch (cell5.t) {
        case "b":
          vv = cell5.v ? "1" : "0";
          break;
        case "n":
          vv = "" + cell5.v;
          break;
        case "e":
          vv = BErr[cell5.v];
          break;
        case "d":
          if (opts && opts.cellDates)
            vv = parseDate(cell5.v, -1).toISOString();
          else {
            cell5 = dup(cell5);
            cell5.t = "n";
            vv = "" + (cell5.v = datenum(parseDate(cell5.v)));
          }
          if (typeof cell5.z === "undefined")
            cell5.z = table_fmt[14];
          break;
        default:
          vv = cell5.v;
          break;
      }
    var v2 = writetag("v", escapexml(vv)), o = { r: ref };
    var os = get_cell_style(opts.cellXfs, cell5, opts);
    if (os !== 0)
      o.s = os;
    switch (cell5.t) {
      case "n":
        break;
      case "d":
        o.t = "d";
        break;
      case "b":
        o.t = "b";
        break;
      case "e":
        o.t = "e";
        break;
      case "z":
        break;
      default:
        if (cell5.v == null) {
          delete cell5.t;
          break;
        }
        if (cell5.v.length > 32767)
          throw new Error("Text length must not exceed 32767 characters");
        if (opts && opts.bookSST) {
          v2 = writetag("v", "" + get_sst_id(opts.Strings, cell5.v, opts.revStrings));
          o.t = "s";
          break;
        }
        o.t = "str";
        break;
    }
    if (cell5.t != oldt) {
      cell5.t = oldt;
      cell5.v = oldv;
    }
    if (typeof cell5.f == "string" && cell5.f) {
      var ff = cell5.F && cell5.F.slice(0, ref.length) == ref ? { t: "array", ref: cell5.F } : null;
      v2 = writextag("f", escapexml(cell5.f), ff) + (cell5.v != null ? v2 : "");
    }
    if (cell5.l)
      ws["!links"].push([ref, cell5.l]);
    if (cell5.D)
      o.cm = 1;
    return writextag("c", v2, o);
  }
  function write_ws_xml_data(ws, opts, idx, wb) {
    var o = [], r2 = [], range = safe_decode_range(ws["!ref"]), cell5 = "", ref, rr = "", cols = [], R = 0, C = 0, rows = ws["!rows"];
    var dense = Array.isArray(ws);
    var params = { r: rr }, row, height = -1;
    for (C = range.s.c; C <= range.e.c; ++C)
      cols[C] = encode_col(C);
    for (R = range.s.r; R <= range.e.r; ++R) {
      r2 = [];
      rr = encode_row(R);
      for (C = range.s.c; C <= range.e.c; ++C) {
        ref = cols[C] + rr;
        var _cell = dense ? (ws[R] || [])[C] : ws[ref];
        if (_cell === void 0)
          continue;
        if ((cell5 = write_ws_xml_cell(_cell, ref, ws, opts)) != null)
          r2.push(cell5);
      }
      if (r2.length > 0 || rows && rows[R]) {
        params = { r: rr };
        if (rows && rows[R]) {
          row = rows[R];
          if (row.hidden)
            params.hidden = 1;
          height = -1;
          if (row.hpx)
            height = px2pt(row.hpx);
          else if (row.hpt)
            height = row.hpt;
          if (height > -1) {
            params.ht = height;
            params.customHeight = 1;
          }
          if (row.level) {
            params.outlineLevel = row.level;
          }
        }
        o[o.length] = writextag("row", r2.join(""), params);
      }
    }
    if (rows)
      for (; R < rows.length; ++R) {
        if (rows && rows[R]) {
          params = { r: R + 1 };
          row = rows[R];
          if (row.hidden)
            params.hidden = 1;
          height = -1;
          if (row.hpx)
            height = px2pt(row.hpx);
          else if (row.hpt)
            height = row.hpt;
          if (height > -1) {
            params.ht = height;
            params.customHeight = 1;
          }
          if (row.level) {
            params.outlineLevel = row.level;
          }
          o[o.length] = writextag("row", "", params);
        }
      }
    return o.join("");
  }
  function write_ws_xml(idx, opts, wb, rels) {
    var o = [XML_HEADER, writextag("worksheet", null, {
      "xmlns": XMLNS_main[0],
      "xmlns:r": XMLNS.r
    })];
    var s = wb.SheetNames[idx], sidx = 0, rdata = "";
    var ws = wb.Sheets[s];
    if (ws == null)
      ws = {};
    var ref = ws["!ref"] || "A1";
    var range = safe_decode_range(ref);
    if (range.e.c > 16383 || range.e.r > 1048575) {
      if (opts.WTF)
        throw new Error("Range " + ref + " exceeds format limit A1:XFD1048576");
      range.e.c = Math.min(range.e.c, 16383);
      range.e.r = Math.min(range.e.c, 1048575);
      ref = encode_range(range);
    }
    if (!rels)
      rels = {};
    ws["!comments"] = [];
    var _drawing = [];
    write_ws_xml_sheetpr(ws, wb, idx, opts, o);
    o[o.length] = writextag("dimension", null, { "ref": ref });
    o[o.length] = write_ws_xml_sheetviews(ws, opts, idx, wb);
    if (opts.sheetFormat)
      o[o.length] = writextag("sheetFormatPr", null, {
        defaultRowHeight: opts.sheetFormat.defaultRowHeight || "16",
        baseColWidth: opts.sheetFormat.baseColWidth || "10",
        outlineLevelRow: opts.sheetFormat.outlineLevelRow || "7"
      });
    if (ws["!cols"] != null && ws["!cols"].length > 0)
      o[o.length] = write_ws_xml_cols(ws, ws["!cols"]);
    o[sidx = o.length] = "<sheetData/>";
    ws["!links"] = [];
    if (ws["!ref"] != null) {
      rdata = write_ws_xml_data(ws, opts);
      if (rdata.length > 0)
        o[o.length] = rdata;
    }
    if (o.length > sidx + 1) {
      o[o.length] = "</sheetData>";
      o[sidx] = o[sidx].replace("/>", ">");
    }
    if (ws["!protect"])
      o[o.length] = write_ws_xml_protection(ws["!protect"]);
    if (ws["!autofilter"] != null)
      o[o.length] = write_ws_xml_autofilter(ws["!autofilter"], ws, wb, idx);
    if (ws["!merges"] != null && ws["!merges"].length > 0)
      o[o.length] = write_ws_xml_merges(ws["!merges"]);
    var relc = -1, rel, rId = -1;
    if (
      /*::(*/
      ws["!links"].length > 0
    ) {
      o[o.length] = "<hyperlinks>";
      ws["!links"].forEach(function(l2) {
        if (!l2[1].Target)
          return;
        rel = { "ref": l2[0] };
        if (l2[1].Target.charAt(0) != "#") {
          rId = add_rels(rels, -1, escapexml(l2[1].Target).replace(/#.*$/, ""), RELS.HLINK);
          rel["r:id"] = "rId" + rId;
        }
        if ((relc = l2[1].Target.indexOf("#")) > -1)
          rel.location = escapexml(l2[1].Target.slice(relc + 1));
        if (l2[1].Tooltip)
          rel.tooltip = escapexml(l2[1].Tooltip);
        o[o.length] = writextag("hyperlink", null, rel);
      });
      o[o.length] = "</hyperlinks>";
    }
    delete ws["!links"];
    if (ws["!margins"] != null)
      o[o.length] = write_ws_xml_margins(ws["!margins"]);
    if (!opts || opts.ignoreEC || opts.ignoreEC == void 0)
      o[o.length] = writetag("ignoredErrors", writextag("ignoredError", null, { numberStoredAsText: 1, sqref: ref }));
    if (_drawing.length > 0) {
      rId = add_rels(rels, -1, "../drawings/drawing" + (idx + 1) + ".xml", RELS.DRAW);
      o[o.length] = writextag("drawing", null, { "r:id": "rId" + rId });
      ws["!drawing"] = _drawing;
    }
    if (ws["!comments"].length > 0) {
      rId = add_rels(rels, -1, "../drawings/vmlDrawing" + (idx + 1) + ".vml", RELS.VML);
      o[o.length] = writextag("legacyDrawing", null, { "r:id": "rId" + rId });
      ws["!legacy"] = rId;
    }
    if (o.length > 1) {
      o[o.length] = "</worksheet>";
      o[1] = o[1].replace("/>", ">");
    }
    return o.join("");
  }
  function parse_BrtRowHdr(data, length2) {
    var z2 = {};
    var tgt = data.l + length2;
    z2.r = data.read_shift(4);
    data.l += 4;
    var miyRw = data.read_shift(2);
    data.l += 1;
    var flags = data.read_shift(1);
    data.l = tgt;
    if (flags & 7)
      z2.level = flags & 7;
    if (flags & 16)
      z2.hidden = true;
    if (flags & 32)
      z2.hpt = miyRw / 20;
    return z2;
  }
  function write_BrtRowHdr(R, range, ws) {
    var o = new_buf(17 + 8 * 16);
    var row = (ws["!rows"] || [])[R] || {};
    o.write_shift(4, R);
    o.write_shift(4, 0);
    var miyRw = 320;
    if (row.hpx)
      miyRw = px2pt(row.hpx) * 20;
    else if (row.hpt)
      miyRw = row.hpt * 20;
    o.write_shift(2, miyRw);
    o.write_shift(1, 0);
    var flags = 0;
    if (row.level)
      flags |= row.level;
    if (row.hidden)
      flags |= 16;
    if (row.hpx || row.hpt)
      flags |= 32;
    o.write_shift(1, flags);
    o.write_shift(1, 0);
    var ncolspan = 0, lcs = o.l;
    o.l += 4;
    var caddr = { r: R, c: 0 };
    for (var i = 0; i < 16; ++i) {
      if (range.s.c > i + 1 << 10 || range.e.c < i << 10)
        continue;
      var first = -1, last = -1;
      for (var j = i << 10; j < i + 1 << 10; ++j) {
        caddr.c = j;
        var cell5 = Array.isArray(ws) ? (ws[caddr.r] || [])[caddr.c] : ws[encode_cell(caddr)];
        if (cell5) {
          if (first < 0)
            first = j;
          last = j;
        }
      }
      if (first < 0)
        continue;
      ++ncolspan;
      o.write_shift(4, first);
      o.write_shift(4, last);
    }
    var l2 = o.l;
    o.l = lcs;
    o.write_shift(4, ncolspan);
    o.l = l2;
    return o.length > o.l ? o.slice(0, o.l) : o;
  }
  function write_row_header(ba, ws, range, R) {
    var o = write_BrtRowHdr(R, range, ws);
    if (o.length > 17 || (ws["!rows"] || [])[R])
      write_record(ba, 0, o);
  }
  var parse_BrtWsDim = parse_UncheckedRfX;
  var write_BrtWsDim = write_UncheckedRfX;
  function parse_BrtWsFmtInfo() {
  }
  function parse_BrtWsProp(data, length2) {
    var z2 = {};
    var f2 = data[data.l];
    ++data.l;
    z2.above = !(f2 & 64);
    z2.left = !(f2 & 128);
    data.l += 18;
    z2.name = parse_XLSBCodeName(data);
    return z2;
  }
  function write_BrtWsProp(str, outl, o) {
    if (o == null)
      o = new_buf(84 + 4 * str.length);
    var f2 = 192;
    if (outl) {
      if (outl.above)
        f2 &= ~64;
      if (outl.left)
        f2 &= ~128;
    }
    o.write_shift(1, f2);
    for (var i = 1; i < 3; ++i)
      o.write_shift(1, 0);
    write_BrtColor({ auto: 1 }, o);
    o.write_shift(-4, -1);
    o.write_shift(-4, -1);
    write_XLSBCodeName(str, o);
    return o.slice(0, o.l);
  }
  function parse_BrtCellBlank(data) {
    var cell5 = parse_XLSBCell(data);
    return [cell5];
  }
  function write_BrtCellBlank(cell5, ncell, o) {
    if (o == null)
      o = new_buf(8);
    return write_XLSBCell(ncell, o);
  }
  function parse_BrtShortBlank(data) {
    var cell5 = parse_XLSBShortCell(data);
    return [cell5];
  }
  function write_BrtShortBlank(cell5, ncell, o) {
    if (o == null)
      o = new_buf(4);
    return write_XLSBShortCell(ncell, o);
  }
  function parse_BrtCellBool(data) {
    var cell5 = parse_XLSBCell(data);
    var fBool = data.read_shift(1);
    return [cell5, fBool, "b"];
  }
  function write_BrtCellBool(cell5, ncell, o) {
    if (o == null)
      o = new_buf(9);
    write_XLSBCell(ncell, o);
    o.write_shift(1, cell5.v ? 1 : 0);
    return o;
  }
  function parse_BrtShortBool(data) {
    var cell5 = parse_XLSBShortCell(data);
    var fBool = data.read_shift(1);
    return [cell5, fBool, "b"];
  }
  function write_BrtShortBool(cell5, ncell, o) {
    if (o == null)
      o = new_buf(5);
    write_XLSBShortCell(ncell, o);
    o.write_shift(1, cell5.v ? 1 : 0);
    return o;
  }
  function parse_BrtCellError(data) {
    var cell5 = parse_XLSBCell(data);
    var bError = data.read_shift(1);
    return [cell5, bError, "e"];
  }
  function write_BrtCellError(cell5, ncell, o) {
    if (o == null)
      o = new_buf(9);
    write_XLSBCell(ncell, o);
    o.write_shift(1, cell5.v);
    return o;
  }
  function parse_BrtShortError(data) {
    var cell5 = parse_XLSBShortCell(data);
    var bError = data.read_shift(1);
    return [cell5, bError, "e"];
  }
  function write_BrtShortError(cell5, ncell, o) {
    if (o == null)
      o = new_buf(8);
    write_XLSBShortCell(ncell, o);
    o.write_shift(1, cell5.v);
    o.write_shift(2, 0);
    o.write_shift(1, 0);
    return o;
  }
  function parse_BrtCellIsst(data) {
    var cell5 = parse_XLSBCell(data);
    var isst = data.read_shift(4);
    return [cell5, isst, "s"];
  }
  function write_BrtCellIsst(cell5, ncell, o) {
    if (o == null)
      o = new_buf(12);
    write_XLSBCell(ncell, o);
    o.write_shift(4, ncell.v);
    return o;
  }
  function parse_BrtShortIsst(data) {
    var cell5 = parse_XLSBShortCell(data);
    var isst = data.read_shift(4);
    return [cell5, isst, "s"];
  }
  function write_BrtShortIsst(cell5, ncell, o) {
    if (o == null)
      o = new_buf(8);
    write_XLSBShortCell(ncell, o);
    o.write_shift(4, ncell.v);
    return o;
  }
  function parse_BrtCellReal(data) {
    var cell5 = parse_XLSBCell(data);
    var value = parse_Xnum(data);
    return [cell5, value, "n"];
  }
  function write_BrtCellReal(cell5, ncell, o) {
    if (o == null)
      o = new_buf(16);
    write_XLSBCell(ncell, o);
    write_Xnum(cell5.v, o);
    return o;
  }
  function parse_BrtShortReal(data) {
    var cell5 = parse_XLSBShortCell(data);
    var value = parse_Xnum(data);
    return [cell5, value, "n"];
  }
  function write_BrtShortReal(cell5, ncell, o) {
    if (o == null)
      o = new_buf(12);
    write_XLSBShortCell(ncell, o);
    write_Xnum(cell5.v, o);
    return o;
  }
  function parse_BrtCellRk(data) {
    var cell5 = parse_XLSBCell(data);
    var value = parse_RkNumber(data);
    return [cell5, value, "n"];
  }
  function write_BrtCellRk(cell5, ncell, o) {
    if (o == null)
      o = new_buf(12);
    write_XLSBCell(ncell, o);
    write_RkNumber(cell5.v, o);
    return o;
  }
  function parse_BrtShortRk(data) {
    var cell5 = parse_XLSBShortCell(data);
    var value = parse_RkNumber(data);
    return [cell5, value, "n"];
  }
  function write_BrtShortRk(cell5, ncell, o) {
    if (o == null)
      o = new_buf(8);
    write_XLSBShortCell(ncell, o);
    write_RkNumber(cell5.v, o);
    return o;
  }
  function parse_BrtCellRString(data) {
    var cell5 = parse_XLSBCell(data);
    var value = parse_RichStr(data);
    return [cell5, value, "is"];
  }
  function parse_BrtCellSt(data) {
    var cell5 = parse_XLSBCell(data);
    var value = parse_XLWideString(data);
    return [cell5, value, "str"];
  }
  function write_BrtCellSt(cell5, ncell, o) {
    if (o == null)
      o = new_buf(12 + 4 * cell5.v.length);
    write_XLSBCell(ncell, o);
    write_XLWideString(cell5.v, o);
    return o.length > o.l ? o.slice(0, o.l) : o;
  }
  function parse_BrtShortSt(data) {
    var cell5 = parse_XLSBShortCell(data);
    var value = parse_XLWideString(data);
    return [cell5, value, "str"];
  }
  function write_BrtShortSt(cell5, ncell, o) {
    if (o == null)
      o = new_buf(8 + 4 * cell5.v.length);
    write_XLSBShortCell(ncell, o);
    write_XLWideString(cell5.v, o);
    return o.length > o.l ? o.slice(0, o.l) : o;
  }
  function parse_BrtFmlaBool(data, length2, opts) {
    var end = data.l + length2;
    var cell5 = parse_XLSBCell(data);
    cell5.r = opts["!row"];
    var value = data.read_shift(1);
    var o = [cell5, value, "b"];
    if (opts.cellFormula) {
      data.l += 2;
      var formula = parse_XLSBCellParsedFormula(data, end - data.l, opts);
      o[3] = stringify_formula(formula, null, cell5, opts.supbooks, opts);
    } else
      data.l = end;
    return o;
  }
  function parse_BrtFmlaError(data, length2, opts) {
    var end = data.l + length2;
    var cell5 = parse_XLSBCell(data);
    cell5.r = opts["!row"];
    var value = data.read_shift(1);
    var o = [cell5, value, "e"];
    if (opts.cellFormula) {
      data.l += 2;
      var formula = parse_XLSBCellParsedFormula(data, end - data.l, opts);
      o[3] = stringify_formula(formula, null, cell5, opts.supbooks, opts);
    } else
      data.l = end;
    return o;
  }
  function parse_BrtFmlaNum(data, length2, opts) {
    var end = data.l + length2;
    var cell5 = parse_XLSBCell(data);
    cell5.r = opts["!row"];
    var value = parse_Xnum(data);
    var o = [cell5, value, "n"];
    if (opts.cellFormula) {
      data.l += 2;
      var formula = parse_XLSBCellParsedFormula(data, end - data.l, opts);
      o[3] = stringify_formula(formula, null, cell5, opts.supbooks, opts);
    } else
      data.l = end;
    return o;
  }
  function parse_BrtFmlaString(data, length2, opts) {
    var end = data.l + length2;
    var cell5 = parse_XLSBCell(data);
    cell5.r = opts["!row"];
    var value = parse_XLWideString(data);
    var o = [cell5, value, "str"];
    if (opts.cellFormula) {
      data.l += 2;
      var formula = parse_XLSBCellParsedFormula(data, end - data.l, opts);
      o[3] = stringify_formula(formula, null, cell5, opts.supbooks, opts);
    } else
      data.l = end;
    return o;
  }
  var parse_BrtMergeCell = parse_UncheckedRfX;
  var write_BrtMergeCell = write_UncheckedRfX;
  function write_BrtBeginMergeCells(cnt, o) {
    if (o == null)
      o = new_buf(4);
    o.write_shift(4, cnt);
    return o;
  }
  function parse_BrtHLink(data, length2) {
    var end = data.l + length2;
    var rfx = parse_UncheckedRfX(data);
    var relId = parse_XLNullableWideString(data);
    var loc = parse_XLWideString(data);
    var tooltip = parse_XLWideString(data);
    var display = parse_XLWideString(data);
    data.l = end;
    var o = { rfx, relId, loc, display };
    if (tooltip)
      o.Tooltip = tooltip;
    return o;
  }
  function write_BrtHLink(l2, rId) {
    var o = new_buf(50 + 4 * (l2[1].Target.length + (l2[1].Tooltip || "").length));
    write_UncheckedRfX({ s: decode_cell(l2[0]), e: decode_cell(l2[0]) }, o);
    write_RelID("rId" + rId, o);
    var locidx = l2[1].Target.indexOf("#");
    var loc = locidx == -1 ? "" : l2[1].Target.slice(locidx + 1);
    write_XLWideString(loc || "", o);
    write_XLWideString(l2[1].Tooltip || "", o);
    write_XLWideString("", o);
    return o.slice(0, o.l);
  }
  function parse_BrtPane() {
  }
  function parse_BrtArrFmla(data, length2, opts) {
    var end = data.l + length2;
    var rfx = parse_RfX(data);
    var fAlwaysCalc = data.read_shift(1);
    var o = [rfx];
    o[2] = fAlwaysCalc;
    if (opts.cellFormula) {
      var formula = parse_XLSBArrayParsedFormula(data, end - data.l, opts);
      o[1] = formula;
    } else
      data.l = end;
    return o;
  }
  function parse_BrtShrFmla(data, length2, opts) {
    var end = data.l + length2;
    var rfx = parse_UncheckedRfX(data);
    var o = [rfx];
    if (opts.cellFormula) {
      var formula = parse_XLSBSharedParsedFormula(data, end - data.l, opts);
      o[1] = formula;
      data.l = end;
    } else
      data.l = end;
    return o;
  }
  function write_BrtColInfo(C, col, o) {
    if (o == null)
      o = new_buf(18);
    var p2 = col_obj_w(C, col);
    o.write_shift(-4, C);
    o.write_shift(-4, C);
    o.write_shift(4, (p2.width || 10) * 256);
    o.write_shift(
      4,
      0
      /*ixfe*/
    );
    var flags = 0;
    if (col.hidden)
      flags |= 1;
    if (typeof p2.width == "number")
      flags |= 2;
    if (col.level)
      flags |= col.level << 8;
    o.write_shift(2, flags);
    return o;
  }
  var BrtMarginKeys = ["left", "right", "top", "bottom", "header", "footer"];
  function parse_BrtMargins(data) {
    var margins = {};
    BrtMarginKeys.forEach(function(k2) {
      margins[k2] = parse_Xnum(data);
    });
    return margins;
  }
  function write_BrtMargins(margins, o) {
    if (o == null)
      o = new_buf(6 * 8);
    default_margins(margins);
    BrtMarginKeys.forEach(function(k2) {
      write_Xnum(margins[k2], o);
    });
    return o;
  }
  function parse_BrtBeginWsView(data) {
    var f2 = data.read_shift(2);
    data.l += 28;
    return { RTL: f2 & 32 };
  }
  function write_BrtBeginWsView(ws, Workbook, o) {
    if (o == null)
      o = new_buf(30);
    var f2 = 924;
    if ((((Workbook || {}).Views || [])[0] || {}).RTL)
      f2 |= 32;
    o.write_shift(2, f2);
    o.write_shift(4, 0);
    o.write_shift(4, 0);
    o.write_shift(4, 0);
    o.write_shift(1, 0);
    o.write_shift(1, 0);
    o.write_shift(2, 0);
    o.write_shift(2, 100);
    o.write_shift(2, 0);
    o.write_shift(2, 0);
    o.write_shift(2, 0);
    o.write_shift(4, 0);
    return o;
  }
  function write_BrtCellIgnoreEC(ref) {
    var o = new_buf(24);
    o.write_shift(4, 4);
    o.write_shift(4, 1);
    write_UncheckedRfX(ref, o);
    return o;
  }
  function write_BrtSheetProtection(sp, o) {
    if (o == null)
      o = new_buf(16 * 4 + 2);
    o.write_shift(2, sp.password ? crypto_CreatePasswordVerifier_Method1(sp.password) : 0);
    o.write_shift(4, 1);
    [
      ["objects", false],
      // fObjects
      ["scenarios", false],
      // fScenarios
      ["formatCells", true],
      // fFormatCells
      ["formatColumns", true],
      // fFormatColumns
      ["formatRows", true],
      // fFormatRows
      ["insertColumns", true],
      // fInsertColumns
      ["insertRows", true],
      // fInsertRows
      ["insertHyperlinks", true],
      // fInsertHyperlinks
      ["deleteColumns", true],
      // fDeleteColumns
      ["deleteRows", true],
      // fDeleteRows
      ["selectLockedCells", false],
      // fSelLockedCells
      ["sort", true],
      // fSort
      ["autoFilter", true],
      // fAutoFilter
      ["pivotTables", true],
      // fPivotTables
      ["selectUnlockedCells", false]
      // fSelUnlockedCells
    ].forEach(function(n2) {
      if (n2[1])
        o.write_shift(4, sp[n2[0]] != null && !sp[n2[0]] ? 1 : 0);
      else
        o.write_shift(4, sp[n2[0]] != null && sp[n2[0]] ? 0 : 1);
    });
    return o;
  }
  function parse_BrtDVal() {
  }
  function parse_BrtDVal14() {
  }
  function write_ws_bin_cell(ba, cell5, R, C, opts, ws, last_seen) {
    if (cell5.v === void 0)
      return false;
    var vv = "";
    switch (cell5.t) {
      case "b":
        vv = cell5.v ? "1" : "0";
        break;
      case "d":
        cell5 = dup(cell5);
        cell5.z = cell5.z || table_fmt[14];
        cell5.v = datenum(parseDate(cell5.v));
        cell5.t = "n";
        break;
      case "n":
      case "e":
        vv = "" + cell5.v;
        break;
      default:
        vv = cell5.v;
        break;
    }
    var o = { r: R, c: C };
    o.s = get_cell_style(opts.cellXfs, cell5, opts);
    if (cell5.l)
      ws["!links"].push([encode_cell(o), cell5.l]);
    if (cell5.c)
      ws["!comments"].push([encode_cell(o), cell5.c]);
    switch (cell5.t) {
      case "s":
      case "str":
        if (opts.bookSST) {
          vv = get_sst_id(opts.Strings, cell5.v, opts.revStrings);
          o.t = "s";
          o.v = vv;
          if (last_seen)
            write_record(ba, 18, write_BrtShortIsst(cell5, o));
          else
            write_record(ba, 7, write_BrtCellIsst(cell5, o));
        } else {
          o.t = "str";
          if (last_seen)
            write_record(ba, 17, write_BrtShortSt(cell5, o));
          else
            write_record(ba, 6, write_BrtCellSt(cell5, o));
        }
        return true;
      case "n":
        if (cell5.v == (cell5.v | 0) && cell5.v > -1e3 && cell5.v < 1e3) {
          if (last_seen)
            write_record(ba, 13, write_BrtShortRk(cell5, o));
          else
            write_record(ba, 2, write_BrtCellRk(cell5, o));
        } else {
          if (last_seen)
            write_record(ba, 16, write_BrtShortReal(cell5, o));
          else
            write_record(ba, 5, write_BrtCellReal(cell5, o));
        }
        return true;
      case "b":
        o.t = "b";
        if (last_seen)
          write_record(ba, 15, write_BrtShortBool(cell5, o));
        else
          write_record(ba, 4, write_BrtCellBool(cell5, o));
        return true;
      case "e":
        o.t = "e";
        if (last_seen)
          write_record(ba, 14, write_BrtShortError(cell5, o));
        else
          write_record(ba, 3, write_BrtCellError(cell5, o));
        return true;
    }
    if (last_seen)
      write_record(ba, 12, write_BrtShortBlank(cell5, o));
    else
      write_record(ba, 1, write_BrtCellBlank(cell5, o));
    return true;
  }
  function write_CELLTABLE(ba, ws, idx, opts) {
    var range = safe_decode_range(ws["!ref"] || "A1"), ref, rr = "", cols = [];
    write_record(
      ba,
      145
      /* BrtBeginSheetData */
    );
    var dense = Array.isArray(ws);
    var cap = range.e.r;
    if (ws["!rows"])
      cap = Math.max(range.e.r, ws["!rows"].length - 1);
    for (var R = range.s.r; R <= cap; ++R) {
      rr = encode_row(R);
      write_row_header(ba, ws, range, R);
      var last_seen = false;
      if (R <= range.e.r)
        for (var C = range.s.c; C <= range.e.c; ++C) {
          if (R === range.s.r)
            cols[C] = encode_col(C);
          ref = cols[C] + rr;
          var cell5 = dense ? (ws[R] || [])[C] : ws[ref];
          if (!cell5) {
            last_seen = false;
            continue;
          }
          last_seen = write_ws_bin_cell(ba, cell5, R, C, opts, ws, last_seen);
        }
    }
    write_record(
      ba,
      146
      /* BrtEndSheetData */
    );
  }
  function write_MERGECELLS(ba, ws) {
    if (!ws || !ws["!merges"])
      return;
    write_record(ba, 177, write_BrtBeginMergeCells(ws["!merges"].length));
    ws["!merges"].forEach(function(m2) {
      write_record(ba, 176, write_BrtMergeCell(m2));
    });
    write_record(
      ba,
      178
      /* BrtEndMergeCells */
    );
  }
  function write_COLINFOS(ba, ws) {
    if (!ws || !ws["!cols"])
      return;
    write_record(
      ba,
      390
      /* BrtBeginColInfos */
    );
    ws["!cols"].forEach(function(m2, i) {
      if (m2)
        write_record(ba, 60, write_BrtColInfo(i, m2));
    });
    write_record(
      ba,
      391
      /* BrtEndColInfos */
    );
  }
  function write_IGNOREECS(ba, ws) {
    if (!ws || !ws["!ref"])
      return;
    write_record(
      ba,
      648
      /* BrtBeginCellIgnoreECs */
    );
    write_record(ba, 649, write_BrtCellIgnoreEC(safe_decode_range(ws["!ref"])));
    write_record(
      ba,
      650
      /* BrtEndCellIgnoreECs */
    );
  }
  function write_HLINKS(ba, ws, rels) {
    ws["!links"].forEach(function(l2) {
      if (!l2[1].Target)
        return;
      var rId = add_rels(rels, -1, l2[1].Target.replace(/#.*$/, ""), RELS.HLINK);
      write_record(ba, 494, write_BrtHLink(l2, rId));
    });
    delete ws["!links"];
  }
  function write_LEGACYDRAWING(ba, ws, idx, rels) {
    if (ws["!comments"].length > 0) {
      var rId = add_rels(rels, -1, "../drawings/vmlDrawing" + (idx + 1) + ".vml", RELS.VML);
      write_record(ba, 551, write_RelID("rId" + rId));
      ws["!legacy"] = rId;
    }
  }
  function write_AUTOFILTER(ba, ws, wb, idx) {
    if (!ws["!autofilter"])
      return;
    var data = ws["!autofilter"];
    var ref = typeof data.ref === "string" ? data.ref : encode_range(data.ref);
    if (!wb.Workbook)
      wb.Workbook = { Sheets: [] };
    if (!wb.Workbook.Names)
      wb.Workbook.Names = [];
    var names = wb.Workbook.Names;
    var range = decode_range(ref);
    if (range.s.r == range.e.r) {
      range.e.r = decode_range(ws["!ref"]).e.r;
      ref = encode_range(range);
    }
    for (var i = 0; i < names.length; ++i) {
      var name = names[i];
      if (name.Name != "_xlnm._FilterDatabase")
        continue;
      if (name.Sheet != idx)
        continue;
      name.Ref = "'" + wb.SheetNames[idx] + "'!" + ref;
      break;
    }
    if (i == names.length)
      names.push({ Name: "_xlnm._FilterDatabase", Sheet: idx, Ref: "'" + wb.SheetNames[idx] + "'!" + ref });
    write_record(ba, 161, write_UncheckedRfX(safe_decode_range(ref)));
    write_record(
      ba,
      162
      /* BrtEndAFilter */
    );
  }
  function write_WSVIEWS2(ba, ws, Workbook) {
    write_record(
      ba,
      133
      /* BrtBeginWsViews */
    );
    {
      write_record(ba, 137, write_BrtBeginWsView(ws, Workbook));
      write_record(
        ba,
        138
        /* BrtEndWsView */
      );
    }
    write_record(
      ba,
      134
      /* BrtEndWsViews */
    );
  }
  function write_SHEETPROTECT(ba, ws) {
    if (!ws["!protect"])
      return;
    write_record(ba, 535, write_BrtSheetProtection(ws["!protect"]));
  }
  function write_ws_bin(idx, opts, wb, rels) {
    var ba = buf_array();
    var s = wb.SheetNames[idx], ws = wb.Sheets[s] || {};
    var c2 = s;
    try {
      if (wb && wb.Workbook)
        c2 = wb.Workbook.Sheets[idx].CodeName || c2;
    } catch (e2) {
    }
    var r2 = safe_decode_range(ws["!ref"] || "A1");
    if (r2.e.c > 16383 || r2.e.r > 1048575) {
      if (opts.WTF)
        throw new Error("Range " + (ws["!ref"] || "A1") + " exceeds format limit A1:XFD1048576");
      r2.e.c = Math.min(r2.e.c, 16383);
      r2.e.r = Math.min(r2.e.c, 1048575);
    }
    ws["!links"] = [];
    ws["!comments"] = [];
    write_record(
      ba,
      129
      /* BrtBeginSheet */
    );
    if (wb.vbaraw || ws["!outline"])
      write_record(ba, 147, write_BrtWsProp(c2, ws["!outline"]));
    write_record(ba, 148, write_BrtWsDim(r2));
    write_WSVIEWS2(ba, ws, wb.Workbook);
    write_COLINFOS(ba, ws);
    write_CELLTABLE(ba, ws, idx, opts);
    write_SHEETPROTECT(ba, ws);
    write_AUTOFILTER(ba, ws, wb, idx);
    write_MERGECELLS(ba, ws);
    write_HLINKS(ba, ws, rels);
    if (ws["!margins"])
      write_record(ba, 476, write_BrtMargins(ws["!margins"]));
    if (!opts || opts.ignoreEC || opts.ignoreEC == void 0)
      write_IGNOREECS(ba, ws);
    write_LEGACYDRAWING(ba, ws, idx, rels);
    write_record(
      ba,
      130
      /* BrtEndSheet */
    );
    return ba.end();
  }
  function parse_BrtCsProp(data, length2) {
    data.l += 10;
    var name = parse_XLWideString(data);
    return { name };
  }
  var WBPropsDef = [
    ["allowRefreshQuery", false, "bool"],
    ["autoCompressPictures", true, "bool"],
    ["backupFile", false, "bool"],
    ["checkCompatibility", false, "bool"],
    ["CodeName", ""],
    ["date1904", false, "bool"],
    ["defaultThemeVersion", 0, "int"],
    ["filterPrivacy", false, "bool"],
    ["hidePivotFieldList", false, "bool"],
    ["promptedSolutions", false, "bool"],
    ["publishItems", false, "bool"],
    ["refreshAllConnections", false, "bool"],
    ["saveExternalLinkValues", true, "bool"],
    ["showBorderUnselectedTables", true, "bool"],
    ["showInkAnnotation", true, "bool"],
    ["showObjects", "all"],
    ["showPivotChartFilter", false, "bool"],
    ["updateLinks", "userSet"]
  ];
  function safe1904(wb) {
    if (!wb.Workbook)
      return "false";
    if (!wb.Workbook.WBProps)
      return "false";
    return parsexmlbool(wb.Workbook.WBProps.date1904) ? "true" : "false";
  }
  var badchars = /* @__PURE__ */ "][*?/\\".split("");
  function check_ws_name(n2, safe) {
    if (n2.length > 31) {
      if (safe)
        return false;
      throw new Error("Sheet names cannot exceed 31 chars");
    }
    var _good = true;
    badchars.forEach(function(c2) {
      if (n2.indexOf(c2) == -1)
        return;
      if (!safe)
        throw new Error("Sheet name cannot contain : \\ / ? * [ ]");
      _good = false;
    });
    return _good;
  }
  function check_wb_names(N, S, codes) {
    N.forEach(function(n2, i) {
      check_ws_name(n2);
      for (var j = 0; j < i; ++j)
        if (n2 == N[j])
          throw new Error("Duplicate Sheet Name: " + n2);
      if (codes) {
        var cn = S && S[i] && S[i].CodeName || n2;
        if (cn.charCodeAt(0) == 95 && cn.length > 22)
          throw new Error("Bad Code Name: Worksheet" + cn);
      }
    });
  }
  function check_wb(wb) {
    if (!wb || !wb.SheetNames || !wb.Sheets)
      throw new Error("Invalid Workbook");
    if (!wb.SheetNames.length)
      throw new Error("Workbook is empty");
    var Sheets = wb.Workbook && wb.Workbook.Sheets || [];
    check_wb_names(wb.SheetNames, Sheets, !!wb.vbaraw);
    for (var i = 0; i < wb.SheetNames.length; ++i)
      check_ws(wb.Sheets[wb.SheetNames[i]], wb.SheetNames[i], i);
  }
  function write_wb_xml(wb) {
    var o = [XML_HEADER];
    o[o.length] = writextag("workbook", null, {
      "xmlns": XMLNS_main[0],
      //'xmlns:mx': XMLNS.mx,
      //'xmlns:s': XMLNS_main[0],
      "xmlns:r": XMLNS.r
    });
    var write_names = wb.Workbook && (wb.Workbook.Names || []).length > 0;
    var workbookPr = { codeName: "ThisWorkbook" };
    if (wb.Workbook && wb.Workbook.WBProps) {
      WBPropsDef.forEach(function(x2) {
        if (wb.Workbook.WBProps[x2[0]] == null)
          return;
        if (wb.Workbook.WBProps[x2[0]] == x2[1])
          return;
        workbookPr[x2[0]] = wb.Workbook.WBProps[x2[0]];
      });
      if (wb.Workbook.WBProps.CodeName) {
        workbookPr.codeName = wb.Workbook.WBProps.CodeName;
        delete workbookPr.CodeName;
      }
    }
    o[o.length] = writextag("workbookPr", null, workbookPr);
    var sheets = wb.Workbook && wb.Workbook.Sheets || [];
    var i = 0;
    if (sheets && sheets[0] && !!sheets[0].Hidden) {
      o[o.length] = "<bookViews>";
      for (i = 0; i != wb.SheetNames.length; ++i) {
        if (!sheets[i])
          break;
        if (!sheets[i].Hidden)
          break;
      }
      if (i == wb.SheetNames.length)
        i = 0;
      o[o.length] = '<workbookView firstSheet="' + i + '" activeTab="' + i + '"/>';
      o[o.length] = "</bookViews>";
    }
    o[o.length] = "<sheets>";
    for (i = 0; i != wb.SheetNames.length; ++i) {
      var sht = { name: escapexml(wb.SheetNames[i].slice(0, 31)) };
      sht.sheetId = "" + (i + 1);
      sht["r:id"] = "rId" + (i + 1);
      if (sheets[i])
        switch (sheets[i].Hidden) {
          case 1:
            sht.state = "hidden";
            break;
          case 2:
            sht.state = "veryHidden";
            break;
        }
      o[o.length] = writextag("sheet", null, sht);
    }
    o[o.length] = "</sheets>";
    if (write_names) {
      o[o.length] = "<definedNames>";
      if (wb.Workbook && wb.Workbook.Names)
        wb.Workbook.Names.forEach(function(n2) {
          var d2 = { name: n2.Name };
          if (n2.Comment)
            d2.comment = n2.Comment;
          if (n2.Sheet != null)
            d2.localSheetId = "" + n2.Sheet;
          if (n2.Hidden)
            d2.hidden = "1";
          if (!n2.Ref)
            return;
          o[o.length] = writextag("definedName", escapexml(n2.Ref), d2);
        });
      o[o.length] = "</definedNames>";
    }
    if (o.length > 2) {
      o[o.length] = "</workbook>";
      o[1] = o[1].replace("/>", ">");
    }
    return o.join("");
  }
  function parse_BrtBundleSh(data, length2) {
    var z2 = {};
    z2.Hidden = data.read_shift(4);
    z2.iTabID = data.read_shift(4);
    z2.strRelID = parse_RelID(data);
    z2.name = parse_XLWideString(data);
    return z2;
  }
  function write_BrtBundleSh(data, o) {
    if (!o)
      o = new_buf(127);
    o.write_shift(4, data.Hidden);
    o.write_shift(4, data.iTabID);
    write_RelID(data.strRelID, o);
    write_XLWideString(data.name.slice(0, 31), o);
    return o.length > o.l ? o.slice(0, o.l) : o;
  }
  function parse_BrtWbProp(data, length2) {
    var o = {};
    var flags = data.read_shift(4);
    o.defaultThemeVersion = data.read_shift(4);
    var strName = length2 > 8 ? parse_XLWideString(data) : "";
    if (strName.length > 0)
      o.CodeName = strName;
    o.autoCompressPictures = !!(flags & 65536);
    o.backupFile = !!(flags & 64);
    o.checkCompatibility = !!(flags & 4096);
    o.date1904 = !!(flags & 1);
    o.filterPrivacy = !!(flags & 8);
    o.hidePivotFieldList = !!(flags & 1024);
    o.promptedSolutions = !!(flags & 16);
    o.publishItems = !!(flags & 2048);
    o.refreshAllConnections = !!(flags & 262144);
    o.saveExternalLinkValues = !!(flags & 128);
    o.showBorderUnselectedTables = !!(flags & 4);
    o.showInkAnnotation = !!(flags & 32);
    o.showObjects = ["all", "placeholders", "none"][flags >> 13 & 3];
    o.showPivotChartFilter = !!(flags & 32768);
    o.updateLinks = ["userSet", "never", "always"][flags >> 8 & 3];
    return o;
  }
  function write_BrtWbProp(data, o) {
    if (!o)
      o = new_buf(72);
    var flags = 0;
    if (data) {
      if (data.filterPrivacy)
        flags |= 8;
    }
    o.write_shift(4, flags);
    o.write_shift(4, 0);
    write_XLSBCodeName(data && data.CodeName || "ThisWorkbook", o);
    return o.slice(0, o.l);
  }
  function parse_BrtName(data, length2, opts) {
    var end = data.l + length2;
    data.l += 4;
    data.l += 1;
    var itab = data.read_shift(4);
    var name = parse_XLNameWideString(data);
    var formula = parse_XLSBNameParsedFormula(data, 0, opts);
    var comment = parse_XLNullableWideString(data);
    data.l = end;
    var out = { Name: name, Ptg: formula };
    if (itab < 268435455)
      out.Sheet = itab;
    if (comment)
      out.Comment = comment;
    return out;
  }
  function write_BUNDLESHS(ba, wb) {
    write_record(
      ba,
      143
      /* BrtBeginBundleShs */
    );
    for (var idx = 0; idx != wb.SheetNames.length; ++idx) {
      var viz = wb.Workbook && wb.Workbook.Sheets && wb.Workbook.Sheets[idx] && wb.Workbook.Sheets[idx].Hidden || 0;
      var d2 = { Hidden: viz, iTabID: idx + 1, strRelID: "rId" + (idx + 1), name: wb.SheetNames[idx] };
      write_record(ba, 156, write_BrtBundleSh(d2));
    }
    write_record(
      ba,
      144
      /* BrtEndBundleShs */
    );
  }
  function write_BrtFileVersion(data, o) {
    if (!o)
      o = new_buf(127);
    for (var i = 0; i != 4; ++i)
      o.write_shift(4, 0);
    write_XLWideString("SheetJS", o);
    write_XLWideString(XLSX.version, o);
    write_XLWideString(XLSX.version, o);
    write_XLWideString("7262", o);
    return o.length > o.l ? o.slice(0, o.l) : o;
  }
  function write_BrtBookView(idx, o) {
    if (!o)
      o = new_buf(29);
    o.write_shift(-4, 0);
    o.write_shift(-4, 460);
    o.write_shift(4, 28800);
    o.write_shift(4, 17600);
    o.write_shift(4, 500);
    o.write_shift(4, idx);
    o.write_shift(4, idx);
    var flags = 120;
    o.write_shift(1, flags);
    return o.length > o.l ? o.slice(0, o.l) : o;
  }
  function write_BOOKVIEWS(ba, wb) {
    if (!wb.Workbook || !wb.Workbook.Sheets)
      return;
    var sheets = wb.Workbook.Sheets;
    var i = 0, vistab = -1, hidden = -1;
    for (; i < sheets.length; ++i) {
      if (!sheets[i] || !sheets[i].Hidden && vistab == -1)
        vistab = i;
      else if (sheets[i].Hidden == 1 && hidden == -1)
        hidden = i;
    }
    if (hidden > vistab)
      return;
    write_record(
      ba,
      135
      /* BrtBeginBookViews */
    );
    write_record(ba, 158, write_BrtBookView(vistab));
    write_record(
      ba,
      136
      /* BrtEndBookViews */
    );
  }
  function write_wb_bin(wb, opts) {
    var ba = buf_array();
    write_record(
      ba,
      131
      /* BrtBeginBook */
    );
    write_record(ba, 128, write_BrtFileVersion());
    write_record(ba, 153, write_BrtWbProp(wb.Workbook && wb.Workbook.WBProps || null));
    write_BOOKVIEWS(ba, wb);
    write_BUNDLESHS(ba, wb);
    write_record(
      ba,
      132
      /* BrtEndBook */
    );
    return ba.end();
  }
  function write_wb(wb, name, opts) {
    return (name.slice(-4) === ".bin" ? write_wb_bin : write_wb_xml)(wb);
  }
  function write_ws(data, name, opts, wb, rels) {
    return (name.slice(-4) === ".bin" ? write_ws_bin : write_ws_xml)(data, opts, wb, rels);
  }
  function write_sty(data, name, opts) {
    return (name.slice(-4) === ".bin" ? write_sty_bin : write_sty_xml)(data, opts);
  }
  function write_sst(data, name, opts) {
    return (name.slice(-4) === ".bin" ? write_sst_bin : write_sst_xml)(data, opts);
  }
  function write_cmnt(data, name, opts) {
    return (name.slice(-4) === ".bin" ? write_comments_bin : write_comments_xml)(data);
  }
  function write_xlmeta(name) {
    return (name.slice(-4) === ".bin" ? write_xlmeta_bin : write_xlmeta_xml)();
  }
  function write_props_xlml(wb, opts) {
    var o = [];
    if (wb.Props)
      o.push(xlml_write_docprops(wb.Props, opts));
    if (wb.Custprops)
      o.push(xlml_write_custprops(wb.Props, wb.Custprops));
    return o.join("");
  }
  function write_wb_xlml() {
    return "";
  }
  function write_sty_xlml(wb, opts) {
    var styles = ['<Style ss:ID="Default" ss:Name="Normal"><NumberFormat/></Style>'];
    opts.cellXfs.forEach(function(xf, id2) {
      var payload = [];
      payload.push(writextag("NumberFormat", null, { "ss:Format": escapexml(table_fmt[xf.numFmtId]) }));
      var o = (
        /*::(*/
        { "ss:ID": "s" + (21 + id2) }
      );
      styles.push(writextag("Style", payload.join(""), o));
    });
    return writextag("Styles", styles.join(""));
  }
  function write_name_xlml(n2) {
    return writextag("NamedRange", null, { "ss:Name": n2.Name, "ss:RefersTo": "=" + a1_to_rc(n2.Ref, { r: 0, c: 0 }) });
  }
  function write_names_xlml(wb) {
    if (!((wb || {}).Workbook || {}).Names)
      return "";
    var names = wb.Workbook.Names;
    var out = [];
    for (var i = 0; i < names.length; ++i) {
      var n2 = names[i];
      if (n2.Sheet != null)
        continue;
      if (n2.Name.match(/^_xlfn\./))
        continue;
      out.push(write_name_xlml(n2));
    }
    return writextag("Names", out.join(""));
  }
  function write_ws_xlml_names(ws, opts, idx, wb) {
    if (!ws)
      return "";
    if (!((wb || {}).Workbook || {}).Names)
      return "";
    var names = wb.Workbook.Names;
    var out = [];
    for (var i = 0; i < names.length; ++i) {
      var n2 = names[i];
      if (n2.Sheet != idx)
        continue;
      if (n2.Name.match(/^_xlfn\./))
        continue;
      out.push(write_name_xlml(n2));
    }
    return out.join("");
  }
  function write_ws_xlml_wsopts(ws, opts, idx, wb) {
    if (!ws)
      return "";
    var o = [];
    if (ws["!margins"]) {
      o.push("<PageSetup>");
      if (ws["!margins"].header)
        o.push(writextag("Header", null, { "x:Margin": ws["!margins"].header }));
      if (ws["!margins"].footer)
        o.push(writextag("Footer", null, { "x:Margin": ws["!margins"].footer }));
      o.push(writextag("PageMargins", null, {
        "x:Bottom": ws["!margins"].bottom || "0.75",
        "x:Left": ws["!margins"].left || "0.7",
        "x:Right": ws["!margins"].right || "0.7",
        "x:Top": ws["!margins"].top || "0.75"
      }));
      o.push("</PageSetup>");
    }
    if (wb && wb.Workbook && wb.Workbook.Sheets && wb.Workbook.Sheets[idx]) {
      if (wb.Workbook.Sheets[idx].Hidden)
        o.push(writextag("Visible", wb.Workbook.Sheets[idx].Hidden == 1 ? "SheetHidden" : "SheetVeryHidden", {}));
      else {
        for (var i = 0; i < idx; ++i)
          if (wb.Workbook.Sheets[i] && !wb.Workbook.Sheets[i].Hidden)
            break;
        if (i == idx)
          o.push("<Selected/>");
      }
    }
    if (((((wb || {}).Workbook || {}).Views || [])[0] || {}).RTL)
      o.push("<DisplayRightToLeft/>");
    if (ws["!protect"]) {
      o.push(writetag("ProtectContents", "True"));
      if (ws["!protect"].objects)
        o.push(writetag("ProtectObjects", "True"));
      if (ws["!protect"].scenarios)
        o.push(writetag("ProtectScenarios", "True"));
      if (ws["!protect"].selectLockedCells != null && !ws["!protect"].selectLockedCells)
        o.push(writetag("EnableSelection", "NoSelection"));
      else if (ws["!protect"].selectUnlockedCells != null && !ws["!protect"].selectUnlockedCells)
        o.push(writetag("EnableSelection", "UnlockedCells"));
      [
        ["formatCells", "AllowFormatCells"],
        ["formatColumns", "AllowSizeCols"],
        ["formatRows", "AllowSizeRows"],
        ["insertColumns", "AllowInsertCols"],
        ["insertRows", "AllowInsertRows"],
        ["insertHyperlinks", "AllowInsertHyperlinks"],
        ["deleteColumns", "AllowDeleteCols"],
        ["deleteRows", "AllowDeleteRows"],
        ["sort", "AllowSort"],
        ["autoFilter", "AllowFilter"],
        ["pivotTables", "AllowUsePivotTables"]
      ].forEach(function(x2) {
        if (ws["!protect"][x2[0]])
          o.push("<" + x2[1] + "/>");
      });
    }
    if (o.length == 0)
      return "";
    return writextag("WorksheetOptions", o.join(""), { xmlns: XLMLNS.x });
  }
  function write_ws_xlml_comment(comments) {
    return comments.map(function(c2) {
      var t2 = xlml_unfixstr(c2.t || "");
      var d2 = writextag("ss:Data", t2, { "xmlns": "http://www.w3.org/TR/REC-html40" });
      return writextag("Comment", d2, { "ss:Author": c2.a });
    }).join("");
  }
  function write_ws_xlml_cell(cell5, ref, ws, opts, idx, wb, addr) {
    if (!cell5 || cell5.v == void 0 && cell5.f == void 0)
      return "";
    var attr = {};
    if (cell5.f)
      attr["ss:Formula"] = "=" + escapexml(a1_to_rc(cell5.f, addr));
    if (cell5.F && cell5.F.slice(0, ref.length) == ref) {
      var end = decode_cell(cell5.F.slice(ref.length + 1));
      attr["ss:ArrayRange"] = "RC:R" + (end.r == addr.r ? "" : "[" + (end.r - addr.r) + "]") + "C" + (end.c == addr.c ? "" : "[" + (end.c - addr.c) + "]");
    }
    if (cell5.l && cell5.l.Target) {
      attr["ss:HRef"] = escapexml(cell5.l.Target);
      if (cell5.l.Tooltip)
        attr["x:HRefScreenTip"] = escapexml(cell5.l.Tooltip);
    }
    if (ws["!merges"]) {
      var marr = ws["!merges"];
      for (var mi = 0; mi != marr.length; ++mi) {
        if (marr[mi].s.c != addr.c || marr[mi].s.r != addr.r)
          continue;
        if (marr[mi].e.c > marr[mi].s.c)
          attr["ss:MergeAcross"] = marr[mi].e.c - marr[mi].s.c;
        if (marr[mi].e.r > marr[mi].s.r)
          attr["ss:MergeDown"] = marr[mi].e.r - marr[mi].s.r;
      }
    }
    var t2 = "", p2 = "";
    switch (cell5.t) {
      case "z":
        if (!opts.sheetStubs)
          return "";
        break;
      case "n":
        t2 = "Number";
        p2 = String(cell5.v);
        break;
      case "b":
        t2 = "Boolean";
        p2 = cell5.v ? "1" : "0";
        break;
      case "e":
        t2 = "Error";
        p2 = BErr[cell5.v];
        break;
      case "d":
        t2 = "DateTime";
        p2 = new Date(cell5.v).toISOString();
        if (cell5.z == null)
          cell5.z = cell5.z || table_fmt[14];
        break;
      case "s":
        t2 = "String";
        p2 = escapexlml(cell5.v || "");
        break;
    }
    var os = get_cell_style(opts.cellXfs, cell5, opts);
    attr["ss:StyleID"] = "s" + (21 + os);
    attr["ss:Index"] = addr.c + 1;
    var _v = cell5.v != null ? p2 : "";
    var m2 = cell5.t == "z" ? "" : '<Data ss:Type="' + t2 + '">' + _v + "</Data>";
    if ((cell5.c || []).length > 0)
      m2 += write_ws_xlml_comment(cell5.c);
    return writextag("Cell", m2, attr);
  }
  function write_ws_xlml_row(R, row) {
    var o = '<Row ss:Index="' + (R + 1) + '"';
    if (row) {
      if (row.hpt && !row.hpx)
        row.hpx = pt2px(row.hpt);
      if (row.hpx)
        o += ' ss:AutoFitHeight="0" ss:Height="' + row.hpx + '"';
      if (row.hidden)
        o += ' ss:Hidden="1"';
    }
    return o + ">";
  }
  function write_ws_xlml_table(ws, opts, idx, wb) {
    if (!ws["!ref"])
      return "";
    var range = safe_decode_range(ws["!ref"]);
    var marr = ws["!merges"] || [], mi = 0;
    var o = [];
    if (ws["!cols"])
      ws["!cols"].forEach(function(n2, i) {
        process_col(n2);
        var w2 = !!n2.width;
        var p2 = col_obj_w(i, n2);
        var k2 = { "ss:Index": i + 1 };
        if (w2)
          k2["ss:Width"] = width2px(p2.width);
        if (n2.hidden)
          k2["ss:Hidden"] = "1";
        o.push(writextag("Column", null, k2));
      });
    var dense = Array.isArray(ws);
    for (var R = range.s.r; R <= range.e.r; ++R) {
      var row = [write_ws_xlml_row(R, (ws["!rows"] || [])[R])];
      for (var C = range.s.c; C <= range.e.c; ++C) {
        var skip = false;
        for (mi = 0; mi != marr.length; ++mi) {
          if (marr[mi].s.c > C)
            continue;
          if (marr[mi].s.r > R)
            continue;
          if (marr[mi].e.c < C)
            continue;
          if (marr[mi].e.r < R)
            continue;
          if (marr[mi].s.c != C || marr[mi].s.r != R)
            skip = true;
          break;
        }
        if (skip)
          continue;
        var addr = { r: R, c: C };
        var ref = encode_cell(addr), cell5 = dense ? (ws[R] || [])[C] : ws[ref];
        row.push(write_ws_xlml_cell(cell5, ref, ws, opts, idx, wb, addr));
      }
      row.push("</Row>");
      if (row.length > 2)
        o.push(row.join(""));
    }
    return o.join("");
  }
  function write_ws_xlml(idx, opts, wb) {
    var o = [];
    var s = wb.SheetNames[idx];
    var ws = wb.Sheets[s];
    var t2 = ws ? write_ws_xlml_names(ws, opts, idx, wb) : "";
    if (t2.length > 0)
      o.push("<Names>" + t2 + "</Names>");
    t2 = ws ? write_ws_xlml_table(ws, opts, idx, wb) : "";
    if (t2.length > 0)
      o.push("<Table>" + t2 + "</Table>");
    o.push(write_ws_xlml_wsopts(ws, opts, idx, wb));
    return o.join("");
  }
  function write_xlml(wb, opts) {
    if (!opts)
      opts = {};
    if (!wb.SSF)
      wb.SSF = dup(table_fmt);
    if (wb.SSF) {
      make_ssf();
      SSF_load_table(wb.SSF);
      opts.revssf = evert_num(wb.SSF);
      opts.revssf[wb.SSF[65535]] = 0;
      opts.ssf = wb.SSF;
      opts.cellXfs = [];
      get_cell_style(opts.cellXfs, {}, { revssf: { "General": 0 } });
    }
    var d2 = [];
    d2.push(write_props_xlml(wb, opts));
    d2.push(write_wb_xlml());
    d2.push("");
    d2.push("");
    for (var i = 0; i < wb.SheetNames.length; ++i)
      d2.push(writextag("Worksheet", write_ws_xlml(i, opts, wb), { "ss:Name": escapexml(wb.SheetNames[i]) }));
    d2[2] = write_sty_xlml(wb, opts);
    d2[3] = write_names_xlml(wb);
    return XML_HEADER + writextag("Workbook", d2.join(""), {
      "xmlns": XLMLNS.ss,
      "xmlns:o": XLMLNS.o,
      "xmlns:x": XLMLNS.x,
      "xmlns:ss": XLMLNS.ss,
      "xmlns:dt": XLMLNS.dt,
      "xmlns:html": XLMLNS.html
    });
  }
  var PSCLSID = {
    SI: "e0859ff2f94f6810ab9108002b27b3d9",
    DSI: "02d5cdd59c2e1b10939708002b2cf9ae",
    UDI: "05d5cdd59c2e1b10939708002b2cf9ae"
  };
  function write_xls_props(wb, cfb) {
    var DSEntries = [], SEntries = [], CEntries = [];
    var i = 0, Keys;
    var DocSummaryRE = evert_key(DocSummaryPIDDSI, "n");
    var SummaryRE = evert_key(SummaryPIDSI, "n");
    if (wb.Props) {
      Keys = keys2(wb.Props);
      for (i = 0; i < Keys.length; ++i)
        (Object.prototype.hasOwnProperty.call(DocSummaryRE, Keys[i]) ? DSEntries : Object.prototype.hasOwnProperty.call(SummaryRE, Keys[i]) ? SEntries : CEntries).push([Keys[i], wb.Props[Keys[i]]]);
    }
    if (wb.Custprops) {
      Keys = keys2(wb.Custprops);
      for (i = 0; i < Keys.length; ++i)
        if (!Object.prototype.hasOwnProperty.call(wb.Props || {}, Keys[i]))
          (Object.prototype.hasOwnProperty.call(DocSummaryRE, Keys[i]) ? DSEntries : Object.prototype.hasOwnProperty.call(SummaryRE, Keys[i]) ? SEntries : CEntries).push([Keys[i], wb.Custprops[Keys[i]]]);
    }
    var CEntries2 = [];
    for (i = 0; i < CEntries.length; ++i) {
      if (XLSPSSkip.indexOf(CEntries[i][0]) > -1 || PseudoPropsPairs.indexOf(CEntries[i][0]) > -1)
        continue;
      if (CEntries[i][1] == null)
        continue;
      CEntries2.push(CEntries[i]);
    }
    if (SEntries.length)
      CFB.utils.cfb_add(cfb, "/SummaryInformation", write_PropertySetStream(SEntries, PSCLSID.SI, SummaryRE, SummaryPIDSI));
    if (DSEntries.length || CEntries2.length)
      CFB.utils.cfb_add(cfb, "/DocumentSummaryInformation", write_PropertySetStream(DSEntries, PSCLSID.DSI, DocSummaryRE, DocSummaryPIDDSI, CEntries2.length ? CEntries2 : null, PSCLSID.UDI));
  }
  function write_xlscfb(wb, opts) {
    var o = opts || {};
    var cfb = CFB.utils.cfb_new({ root: "R" });
    var wbpath = "/Workbook";
    switch (o.bookType || "xls") {
      case "xls":
        o.bookType = "biff8";
      case "xla":
        if (!o.bookType)
          o.bookType = "xla";
      case "biff8":
        wbpath = "/Workbook";
        o.biff = 8;
        break;
      case "biff5":
        wbpath = "/Book";
        o.biff = 5;
        break;
      default:
        throw new Error("invalid type " + o.bookType + " for XLS CFB");
    }
    CFB.utils.cfb_add(cfb, wbpath, write_biff_buf(wb, o));
    if (o.biff == 8 && (wb.Props || wb.Custprops))
      write_xls_props(wb, cfb);
    if (o.biff == 8 && wb.vbaraw)
      fill_vba_xls(cfb, CFB.read(wb.vbaraw, { type: typeof wb.vbaraw == "string" ? "binary" : "buffer" }));
    return cfb;
  }
  var XLSBRecordEnum = {
    /*::[*/
    0: {
      /* n:"BrtRowHdr", */
      f: parse_BrtRowHdr
    },
    /*::[*/
    1: {
      /* n:"BrtCellBlank", */
      f: parse_BrtCellBlank
    },
    /*::[*/
    2: {
      /* n:"BrtCellRk", */
      f: parse_BrtCellRk
    },
    /*::[*/
    3: {
      /* n:"BrtCellError", */
      f: parse_BrtCellError
    },
    /*::[*/
    4: {
      /* n:"BrtCellBool", */
      f: parse_BrtCellBool
    },
    /*::[*/
    5: {
      /* n:"BrtCellReal", */
      f: parse_BrtCellReal
    },
    /*::[*/
    6: {
      /* n:"BrtCellSt", */
      f: parse_BrtCellSt
    },
    /*::[*/
    7: {
      /* n:"BrtCellIsst", */
      f: parse_BrtCellIsst
    },
    /*::[*/
    8: {
      /* n:"BrtFmlaString", */
      f: parse_BrtFmlaString
    },
    /*::[*/
    9: {
      /* n:"BrtFmlaNum", */
      f: parse_BrtFmlaNum
    },
    /*::[*/
    10: {
      /* n:"BrtFmlaBool", */
      f: parse_BrtFmlaBool
    },
    /*::[*/
    11: {
      /* n:"BrtFmlaError", */
      f: parse_BrtFmlaError
    },
    /*::[*/
    12: {
      /* n:"BrtShortBlank", */
      f: parse_BrtShortBlank
    },
    /*::[*/
    13: {
      /* n:"BrtShortRk", */
      f: parse_BrtShortRk
    },
    /*::[*/
    14: {
      /* n:"BrtShortError", */
      f: parse_BrtShortError
    },
    /*::[*/
    15: {
      /* n:"BrtShortBool", */
      f: parse_BrtShortBool
    },
    /*::[*/
    16: {
      /* n:"BrtShortReal", */
      f: parse_BrtShortReal
    },
    /*::[*/
    17: {
      /* n:"BrtShortSt", */
      f: parse_BrtShortSt
    },
    /*::[*/
    18: {
      /* n:"BrtShortIsst", */
      f: parse_BrtShortIsst
    },
    /*::[*/
    19: {
      /* n:"BrtSSTItem", */
      f: parse_RichStr
    },
    /*::[*/
    20: {
      /* n:"BrtPCDIMissing" */
    },
    /*::[*/
    21: {
      /* n:"BrtPCDINumber" */
    },
    /*::[*/
    22: {
      /* n:"BrtPCDIBoolean" */
    },
    /*::[*/
    23: {
      /* n:"BrtPCDIError" */
    },
    /*::[*/
    24: {
      /* n:"BrtPCDIString" */
    },
    /*::[*/
    25: {
      /* n:"BrtPCDIDatetime" */
    },
    /*::[*/
    26: {
      /* n:"BrtPCDIIndex" */
    },
    /*::[*/
    27: {
      /* n:"BrtPCDIAMissing" */
    },
    /*::[*/
    28: {
      /* n:"BrtPCDIANumber" */
    },
    /*::[*/
    29: {
      /* n:"BrtPCDIABoolean" */
    },
    /*::[*/
    30: {
      /* n:"BrtPCDIAError" */
    },
    /*::[*/
    31: {
      /* n:"BrtPCDIAString" */
    },
    /*::[*/
    32: {
      /* n:"BrtPCDIADatetime" */
    },
    /*::[*/
    33: {
      /* n:"BrtPCRRecord" */
    },
    /*::[*/
    34: {
      /* n:"BrtPCRRecordDt" */
    },
    /*::[*/
    35: {
      /* n:"BrtFRTBegin", */
      T: 1
    },
    /*::[*/
    36: {
      /* n:"BrtFRTEnd", */
      T: -1
    },
    /*::[*/
    37: {
      /* n:"BrtACBegin", */
      T: 1
    },
    /*::[*/
    38: {
      /* n:"BrtACEnd", */
      T: -1
    },
    /*::[*/
    39: {
      /* n:"BrtName", */
      f: parse_BrtName
    },
    /*::[*/
    40: {
      /* n:"BrtIndexRowBlock" */
    },
    /*::[*/
    42: {
      /* n:"BrtIndexBlock" */
    },
    /*::[*/
    43: {
      /* n:"BrtFont", */
      f: parse_BrtFont
    },
    /*::[*/
    44: {
      /* n:"BrtFmt", */
      f: parse_BrtFmt
    },
    /*::[*/
    45: {
      /* n:"BrtFill", */
      f: parse_BrtFill
    },
    /*::[*/
    46: {
      /* n:"BrtBorder", */
      f: parse_BrtBorder
    },
    /*::[*/
    47: {
      /* n:"BrtXF", */
      f: parse_BrtXF
    },
    /*::[*/
    48: {
      /* n:"BrtStyle" */
    },
    /*::[*/
    49: {
      /* n:"BrtCellMeta", */
      f: parse_Int32LE
    },
    /*::[*/
    50: {
      /* n:"BrtValueMeta" */
    },
    /*::[*/
    51: {
      /* n:"BrtMdb" */
      f: parse_BrtMdb
    },
    /*::[*/
    52: {
      /* n:"BrtBeginFmd", */
      T: 1
    },
    /*::[*/
    53: {
      /* n:"BrtEndFmd", */
      T: -1
    },
    /*::[*/
    54: {
      /* n:"BrtBeginMdx", */
      T: 1
    },
    /*::[*/
    55: {
      /* n:"BrtEndMdx", */
      T: -1
    },
    /*::[*/
    56: {
      /* n:"BrtBeginMdxTuple", */
      T: 1
    },
    /*::[*/
    57: {
      /* n:"BrtEndMdxTuple", */
      T: -1
    },
    /*::[*/
    58: {
      /* n:"BrtMdxMbrIstr" */
    },
    /*::[*/
    59: {
      /* n:"BrtStr" */
    },
    /*::[*/
    60: {
      /* n:"BrtColInfo", */
      f: parse_ColInfo
    },
    /*::[*/
    62: {
      /* n:"BrtCellRString", */
      f: parse_BrtCellRString
    },
    /*::[*/
    63: {
      /* n:"BrtCalcChainItem$", */
      f: parse_BrtCalcChainItem$
    },
    /*::[*/
    64: {
      /* n:"BrtDVal", */
      f: parse_BrtDVal
    },
    /*::[*/
    65: {
      /* n:"BrtSxvcellNum" */
    },
    /*::[*/
    66: {
      /* n:"BrtSxvcellStr" */
    },
    /*::[*/
    67: {
      /* n:"BrtSxvcellBool" */
    },
    /*::[*/
    68: {
      /* n:"BrtSxvcellErr" */
    },
    /*::[*/
    69: {
      /* n:"BrtSxvcellDate" */
    },
    /*::[*/
    70: {
      /* n:"BrtSxvcellNil" */
    },
    /*::[*/
    128: {
      /* n:"BrtFileVersion" */
    },
    /*::[*/
    129: {
      /* n:"BrtBeginSheet", */
      T: 1
    },
    /*::[*/
    130: {
      /* n:"BrtEndSheet", */
      T: -1
    },
    /*::[*/
    131: {
      /* n:"BrtBeginBook", */
      T: 1,
      f: parsenoop,
      p: 0
    },
    /*::[*/
    132: {
      /* n:"BrtEndBook", */
      T: -1
    },
    /*::[*/
    133: {
      /* n:"BrtBeginWsViews", */
      T: 1
    },
    /*::[*/
    134: {
      /* n:"BrtEndWsViews", */
      T: -1
    },
    /*::[*/
    135: {
      /* n:"BrtBeginBookViews", */
      T: 1
    },
    /*::[*/
    136: {
      /* n:"BrtEndBookViews", */
      T: -1
    },
    /*::[*/
    137: {
      /* n:"BrtBeginWsView", */
      T: 1,
      f: parse_BrtBeginWsView
    },
    /*::[*/
    138: {
      /* n:"BrtEndWsView", */
      T: -1
    },
    /*::[*/
    139: {
      /* n:"BrtBeginCsViews", */
      T: 1
    },
    /*::[*/
    140: {
      /* n:"BrtEndCsViews", */
      T: -1
    },
    /*::[*/
    141: {
      /* n:"BrtBeginCsView", */
      T: 1
    },
    /*::[*/
    142: {
      /* n:"BrtEndCsView", */
      T: -1
    },
    /*::[*/
    143: {
      /* n:"BrtBeginBundleShs", */
      T: 1
    },
    /*::[*/
    144: {
      /* n:"BrtEndBundleShs", */
      T: -1
    },
    /*::[*/
    145: {
      /* n:"BrtBeginSheetData", */
      T: 1
    },
    /*::[*/
    146: {
      /* n:"BrtEndSheetData", */
      T: -1
    },
    /*::[*/
    147: {
      /* n:"BrtWsProp", */
      f: parse_BrtWsProp
    },
    /*::[*/
    148: {
      /* n:"BrtWsDim", */
      f: parse_BrtWsDim,
      p: 16
    },
    /*::[*/
    151: {
      /* n:"BrtPane", */
      f: parse_BrtPane
    },
    /*::[*/
    152: {
      /* n:"BrtSel" */
    },
    /*::[*/
    153: {
      /* n:"BrtWbProp", */
      f: parse_BrtWbProp
    },
    /*::[*/
    154: {
      /* n:"BrtWbFactoid" */
    },
    /*::[*/
    155: {
      /* n:"BrtFileRecover" */
    },
    /*::[*/
    156: {
      /* n:"BrtBundleSh", */
      f: parse_BrtBundleSh
    },
    /*::[*/
    157: {
      /* n:"BrtCalcProp" */
    },
    /*::[*/
    158: {
      /* n:"BrtBookView" */
    },
    /*::[*/
    159: {
      /* n:"BrtBeginSst", */
      T: 1,
      f: parse_BrtBeginSst
    },
    /*::[*/
    160: {
      /* n:"BrtEndSst", */
      T: -1
    },
    /*::[*/
    161: {
      /* n:"BrtBeginAFilter", */
      T: 1,
      f: parse_UncheckedRfX
    },
    /*::[*/
    162: {
      /* n:"BrtEndAFilter", */
      T: -1
    },
    /*::[*/
    163: {
      /* n:"BrtBeginFilterColumn", */
      T: 1
    },
    /*::[*/
    164: {
      /* n:"BrtEndFilterColumn", */
      T: -1
    },
    /*::[*/
    165: {
      /* n:"BrtBeginFilters", */
      T: 1
    },
    /*::[*/
    166: {
      /* n:"BrtEndFilters", */
      T: -1
    },
    /*::[*/
    167: {
      /* n:"BrtFilter" */
    },
    /*::[*/
    168: {
      /* n:"BrtColorFilter" */
    },
    /*::[*/
    169: {
      /* n:"BrtIconFilter" */
    },
    /*::[*/
    170: {
      /* n:"BrtTop10Filter" */
    },
    /*::[*/
    171: {
      /* n:"BrtDynamicFilter" */
    },
    /*::[*/
    172: {
      /* n:"BrtBeginCustomFilters", */
      T: 1
    },
    /*::[*/
    173: {
      /* n:"BrtEndCustomFilters", */
      T: -1
    },
    /*::[*/
    174: {
      /* n:"BrtCustomFilter" */
    },
    /*::[*/
    175: {
      /* n:"BrtAFilterDateGroupItem" */
    },
    /*::[*/
    176: {
      /* n:"BrtMergeCell", */
      f: parse_BrtMergeCell
    },
    /*::[*/
    177: {
      /* n:"BrtBeginMergeCells", */
      T: 1
    },
    /*::[*/
    178: {
      /* n:"BrtEndMergeCells", */
      T: -1
    },
    /*::[*/
    179: {
      /* n:"BrtBeginPivotCacheDef", */
      T: 1
    },
    /*::[*/
    180: {
      /* n:"BrtEndPivotCacheDef", */
      T: -1
    },
    /*::[*/
    181: {
      /* n:"BrtBeginPCDFields", */
      T: 1
    },
    /*::[*/
    182: {
      /* n:"BrtEndPCDFields", */
      T: -1
    },
    /*::[*/
    183: {
      /* n:"BrtBeginPCDField", */
      T: 1
    },
    /*::[*/
    184: {
      /* n:"BrtEndPCDField", */
      T: -1
    },
    /*::[*/
    185: {
      /* n:"BrtBeginPCDSource", */
      T: 1
    },
    /*::[*/
    186: {
      /* n:"BrtEndPCDSource", */
      T: -1
    },
    /*::[*/
    187: {
      /* n:"BrtBeginPCDSRange", */
      T: 1
    },
    /*::[*/
    188: {
      /* n:"BrtEndPCDSRange", */
      T: -1
    },
    /*::[*/
    189: {
      /* n:"BrtBeginPCDFAtbl", */
      T: 1
    },
    /*::[*/
    190: {
      /* n:"BrtEndPCDFAtbl", */
      T: -1
    },
    /*::[*/
    191: {
      /* n:"BrtBeginPCDIRun", */
      T: 1
    },
    /*::[*/
    192: {
      /* n:"BrtEndPCDIRun", */
      T: -1
    },
    /*::[*/
    193: {
      /* n:"BrtBeginPivotCacheRecords", */
      T: 1
    },
    /*::[*/
    194: {
      /* n:"BrtEndPivotCacheRecords", */
      T: -1
    },
    /*::[*/
    195: {
      /* n:"BrtBeginPCDHierarchies", */
      T: 1
    },
    /*::[*/
    196: {
      /* n:"BrtEndPCDHierarchies", */
      T: -1
    },
    /*::[*/
    197: {
      /* n:"BrtBeginPCDHierarchy", */
      T: 1
    },
    /*::[*/
    198: {
      /* n:"BrtEndPCDHierarchy", */
      T: -1
    },
    /*::[*/
    199: {
      /* n:"BrtBeginPCDHFieldsUsage", */
      T: 1
    },
    /*::[*/
    200: {
      /* n:"BrtEndPCDHFieldsUsage", */
      T: -1
    },
    /*::[*/
    201: {
      /* n:"BrtBeginExtConnection", */
      T: 1
    },
    /*::[*/
    202: {
      /* n:"BrtEndExtConnection", */
      T: -1
    },
    /*::[*/
    203: {
      /* n:"BrtBeginECDbProps", */
      T: 1
    },
    /*::[*/
    204: {
      /* n:"BrtEndECDbProps", */
      T: -1
    },
    /*::[*/
    205: {
      /* n:"BrtBeginECOlapProps", */
      T: 1
    },
    /*::[*/
    206: {
      /* n:"BrtEndECOlapProps", */
      T: -1
    },
    /*::[*/
    207: {
      /* n:"BrtBeginPCDSConsol", */
      T: 1
    },
    /*::[*/
    208: {
      /* n:"BrtEndPCDSConsol", */
      T: -1
    },
    /*::[*/
    209: {
      /* n:"BrtBeginPCDSCPages", */
      T: 1
    },
    /*::[*/
    210: {
      /* n:"BrtEndPCDSCPages", */
      T: -1
    },
    /*::[*/
    211: {
      /* n:"BrtBeginPCDSCPage", */
      T: 1
    },
    /*::[*/
    212: {
      /* n:"BrtEndPCDSCPage", */
      T: -1
    },
    /*::[*/
    213: {
      /* n:"BrtBeginPCDSCPItem", */
      T: 1
    },
    /*::[*/
    214: {
      /* n:"BrtEndPCDSCPItem", */
      T: -1
    },
    /*::[*/
    215: {
      /* n:"BrtBeginPCDSCSets", */
      T: 1
    },
    /*::[*/
    216: {
      /* n:"BrtEndPCDSCSets", */
      T: -1
    },
    /*::[*/
    217: {
      /* n:"BrtBeginPCDSCSet", */
      T: 1
    },
    /*::[*/
    218: {
      /* n:"BrtEndPCDSCSet", */
      T: -1
    },
    /*::[*/
    219: {
      /* n:"BrtBeginPCDFGroup", */
      T: 1
    },
    /*::[*/
    220: {
      /* n:"BrtEndPCDFGroup", */
      T: -1
    },
    /*::[*/
    221: {
      /* n:"BrtBeginPCDFGItems", */
      T: 1
    },
    /*::[*/
    222: {
      /* n:"BrtEndPCDFGItems", */
      T: -1
    },
    /*::[*/
    223: {
      /* n:"BrtBeginPCDFGRange", */
      T: 1
    },
    /*::[*/
    224: {
      /* n:"BrtEndPCDFGRange", */
      T: -1
    },
    /*::[*/
    225: {
      /* n:"BrtBeginPCDFGDiscrete", */
      T: 1
    },
    /*::[*/
    226: {
      /* n:"BrtEndPCDFGDiscrete", */
      T: -1
    },
    /*::[*/
    227: {
      /* n:"BrtBeginPCDSDTupleCache", */
      T: 1
    },
    /*::[*/
    228: {
      /* n:"BrtEndPCDSDTupleCache", */
      T: -1
    },
    /*::[*/
    229: {
      /* n:"BrtBeginPCDSDTCEntries", */
      T: 1
    },
    /*::[*/
    230: {
      /* n:"BrtEndPCDSDTCEntries", */
      T: -1
    },
    /*::[*/
    231: {
      /* n:"BrtBeginPCDSDTCEMembers", */
      T: 1
    },
    /*::[*/
    232: {
      /* n:"BrtEndPCDSDTCEMembers", */
      T: -1
    },
    /*::[*/
    233: {
      /* n:"BrtBeginPCDSDTCEMember", */
      T: 1
    },
    /*::[*/
    234: {
      /* n:"BrtEndPCDSDTCEMember", */
      T: -1
    },
    /*::[*/
    235: {
      /* n:"BrtBeginPCDSDTCQueries", */
      T: 1
    },
    /*::[*/
    236: {
      /* n:"BrtEndPCDSDTCQueries", */
      T: -1
    },
    /*::[*/
    237: {
      /* n:"BrtBeginPCDSDTCQuery", */
      T: 1
    },
    /*::[*/
    238: {
      /* n:"BrtEndPCDSDTCQuery", */
      T: -1
    },
    /*::[*/
    239: {
      /* n:"BrtBeginPCDSDTCSets", */
      T: 1
    },
    /*::[*/
    240: {
      /* n:"BrtEndPCDSDTCSets", */
      T: -1
    },
    /*::[*/
    241: {
      /* n:"BrtBeginPCDSDTCSet", */
      T: 1
    },
    /*::[*/
    242: {
      /* n:"BrtEndPCDSDTCSet", */
      T: -1
    },
    /*::[*/
    243: {
      /* n:"BrtBeginPCDCalcItems", */
      T: 1
    },
    /*::[*/
    244: {
      /* n:"BrtEndPCDCalcItems", */
      T: -1
    },
    /*::[*/
    245: {
      /* n:"BrtBeginPCDCalcItem", */
      T: 1
    },
    /*::[*/
    246: {
      /* n:"BrtEndPCDCalcItem", */
      T: -1
    },
    /*::[*/
    247: {
      /* n:"BrtBeginPRule", */
      T: 1
    },
    /*::[*/
    248: {
      /* n:"BrtEndPRule", */
      T: -1
    },
    /*::[*/
    249: {
      /* n:"BrtBeginPRFilters", */
      T: 1
    },
    /*::[*/
    250: {
      /* n:"BrtEndPRFilters", */
      T: -1
    },
    /*::[*/
    251: {
      /* n:"BrtBeginPRFilter", */
      T: 1
    },
    /*::[*/
    252: {
      /* n:"BrtEndPRFilter", */
      T: -1
    },
    /*::[*/
    253: {
      /* n:"BrtBeginPNames", */
      T: 1
    },
    /*::[*/
    254: {
      /* n:"BrtEndPNames", */
      T: -1
    },
    /*::[*/
    255: {
      /* n:"BrtBeginPName", */
      T: 1
    },
    /*::[*/
    256: {
      /* n:"BrtEndPName", */
      T: -1
    },
    /*::[*/
    257: {
      /* n:"BrtBeginPNPairs", */
      T: 1
    },
    /*::[*/
    258: {
      /* n:"BrtEndPNPairs", */
      T: -1
    },
    /*::[*/
    259: {
      /* n:"BrtBeginPNPair", */
      T: 1
    },
    /*::[*/
    260: {
      /* n:"BrtEndPNPair", */
      T: -1
    },
    /*::[*/
    261: {
      /* n:"BrtBeginECWebProps", */
      T: 1
    },
    /*::[*/
    262: {
      /* n:"BrtEndECWebProps", */
      T: -1
    },
    /*::[*/
    263: {
      /* n:"BrtBeginEcWpTables", */
      T: 1
    },
    /*::[*/
    264: {
      /* n:"BrtEndECWPTables", */
      T: -1
    },
    /*::[*/
    265: {
      /* n:"BrtBeginECParams", */
      T: 1
    },
    /*::[*/
    266: {
      /* n:"BrtEndECParams", */
      T: -1
    },
    /*::[*/
    267: {
      /* n:"BrtBeginECParam", */
      T: 1
    },
    /*::[*/
    268: {
      /* n:"BrtEndECParam", */
      T: -1
    },
    /*::[*/
    269: {
      /* n:"BrtBeginPCDKPIs", */
      T: 1
    },
    /*::[*/
    270: {
      /* n:"BrtEndPCDKPIs", */
      T: -1
    },
    /*::[*/
    271: {
      /* n:"BrtBeginPCDKPI", */
      T: 1
    },
    /*::[*/
    272: {
      /* n:"BrtEndPCDKPI", */
      T: -1
    },
    /*::[*/
    273: {
      /* n:"BrtBeginDims", */
      T: 1
    },
    /*::[*/
    274: {
      /* n:"BrtEndDims", */
      T: -1
    },
    /*::[*/
    275: {
      /* n:"BrtBeginDim", */
      T: 1
    },
    /*::[*/
    276: {
      /* n:"BrtEndDim", */
      T: -1
    },
    /*::[*/
    277: {
      /* n:"BrtIndexPartEnd" */
    },
    /*::[*/
    278: {
      /* n:"BrtBeginStyleSheet", */
      T: 1
    },
    /*::[*/
    279: {
      /* n:"BrtEndStyleSheet", */
      T: -1
    },
    /*::[*/
    280: {
      /* n:"BrtBeginSXView", */
      T: 1
    },
    /*::[*/
    281: {
      /* n:"BrtEndSXVI", */
      T: -1
    },
    /*::[*/
    282: {
      /* n:"BrtBeginSXVI", */
      T: 1
    },
    /*::[*/
    283: {
      /* n:"BrtBeginSXVIs", */
      T: 1
    },
    /*::[*/
    284: {
      /* n:"BrtEndSXVIs", */
      T: -1
    },
    /*::[*/
    285: {
      /* n:"BrtBeginSXVD", */
      T: 1
    },
    /*::[*/
    286: {
      /* n:"BrtEndSXVD", */
      T: -1
    },
    /*::[*/
    287: {
      /* n:"BrtBeginSXVDs", */
      T: 1
    },
    /*::[*/
    288: {
      /* n:"BrtEndSXVDs", */
      T: -1
    },
    /*::[*/
    289: {
      /* n:"BrtBeginSXPI", */
      T: 1
    },
    /*::[*/
    290: {
      /* n:"BrtEndSXPI", */
      T: -1
    },
    /*::[*/
    291: {
      /* n:"BrtBeginSXPIs", */
      T: 1
    },
    /*::[*/
    292: {
      /* n:"BrtEndSXPIs", */
      T: -1
    },
    /*::[*/
    293: {
      /* n:"BrtBeginSXDI", */
      T: 1
    },
    /*::[*/
    294: {
      /* n:"BrtEndSXDI", */
      T: -1
    },
    /*::[*/
    295: {
      /* n:"BrtBeginSXDIs", */
      T: 1
    },
    /*::[*/
    296: {
      /* n:"BrtEndSXDIs", */
      T: -1
    },
    /*::[*/
    297: {
      /* n:"BrtBeginSXLI", */
      T: 1
    },
    /*::[*/
    298: {
      /* n:"BrtEndSXLI", */
      T: -1
    },
    /*::[*/
    299: {
      /* n:"BrtBeginSXLIRws", */
      T: 1
    },
    /*::[*/
    300: {
      /* n:"BrtEndSXLIRws", */
      T: -1
    },
    /*::[*/
    301: {
      /* n:"BrtBeginSXLICols", */
      T: 1
    },
    /*::[*/
    302: {
      /* n:"BrtEndSXLICols", */
      T: -1
    },
    /*::[*/
    303: {
      /* n:"BrtBeginSXFormat", */
      T: 1
    },
    /*::[*/
    304: {
      /* n:"BrtEndSXFormat", */
      T: -1
    },
    /*::[*/
    305: {
      /* n:"BrtBeginSXFormats", */
      T: 1
    },
    /*::[*/
    306: {
      /* n:"BrtEndSxFormats", */
      T: -1
    },
    /*::[*/
    307: {
      /* n:"BrtBeginSxSelect", */
      T: 1
    },
    /*::[*/
    308: {
      /* n:"BrtEndSxSelect", */
      T: -1
    },
    /*::[*/
    309: {
      /* n:"BrtBeginISXVDRws", */
      T: 1
    },
    /*::[*/
    310: {
      /* n:"BrtEndISXVDRws", */
      T: -1
    },
    /*::[*/
    311: {
      /* n:"BrtBeginISXVDCols", */
      T: 1
    },
    /*::[*/
    312: {
      /* n:"BrtEndISXVDCols", */
      T: -1
    },
    /*::[*/
    313: {
      /* n:"BrtEndSXLocation", */
      T: -1
    },
    /*::[*/
    314: {
      /* n:"BrtBeginSXLocation", */
      T: 1
    },
    /*::[*/
    315: {
      /* n:"BrtEndSXView", */
      T: -1
    },
    /*::[*/
    316: {
      /* n:"BrtBeginSXTHs", */
      T: 1
    },
    /*::[*/
    317: {
      /* n:"BrtEndSXTHs", */
      T: -1
    },
    /*::[*/
    318: {
      /* n:"BrtBeginSXTH", */
      T: 1
    },
    /*::[*/
    319: {
      /* n:"BrtEndSXTH", */
      T: -1
    },
    /*::[*/
    320: {
      /* n:"BrtBeginISXTHRws", */
      T: 1
    },
    /*::[*/
    321: {
      /* n:"BrtEndISXTHRws", */
      T: -1
    },
    /*::[*/
    322: {
      /* n:"BrtBeginISXTHCols", */
      T: 1
    },
    /*::[*/
    323: {
      /* n:"BrtEndISXTHCols", */
      T: -1
    },
    /*::[*/
    324: {
      /* n:"BrtBeginSXTDMPS", */
      T: 1
    },
    /*::[*/
    325: {
      /* n:"BrtEndSXTDMPs", */
      T: -1
    },
    /*::[*/
    326: {
      /* n:"BrtBeginSXTDMP", */
      T: 1
    },
    /*::[*/
    327: {
      /* n:"BrtEndSXTDMP", */
      T: -1
    },
    /*::[*/
    328: {
      /* n:"BrtBeginSXTHItems", */
      T: 1
    },
    /*::[*/
    329: {
      /* n:"BrtEndSXTHItems", */
      T: -1
    },
    /*::[*/
    330: {
      /* n:"BrtBeginSXTHItem", */
      T: 1
    },
    /*::[*/
    331: {
      /* n:"BrtEndSXTHItem", */
      T: -1
    },
    /*::[*/
    332: {
      /* n:"BrtBeginMetadata", */
      T: 1
    },
    /*::[*/
    333: {
      /* n:"BrtEndMetadata", */
      T: -1
    },
    /*::[*/
    334: {
      /* n:"BrtBeginEsmdtinfo", */
      T: 1
    },
    /*::[*/
    335: {
      /* n:"BrtMdtinfo", */
      f: parse_BrtMdtinfo
    },
    /*::[*/
    336: {
      /* n:"BrtEndEsmdtinfo", */
      T: -1
    },
    /*::[*/
    337: {
      /* n:"BrtBeginEsmdb", */
      f: parse_BrtBeginEsmdb,
      T: 1
    },
    /*::[*/
    338: {
      /* n:"BrtEndEsmdb", */
      T: -1
    },
    /*::[*/
    339: {
      /* n:"BrtBeginEsfmd", */
      T: 1
    },
    /*::[*/
    340: {
      /* n:"BrtEndEsfmd", */
      T: -1
    },
    /*::[*/
    341: {
      /* n:"BrtBeginSingleCells", */
      T: 1
    },
    /*::[*/
    342: {
      /* n:"BrtEndSingleCells", */
      T: -1
    },
    /*::[*/
    343: {
      /* n:"BrtBeginList", */
      T: 1
    },
    /*::[*/
    344: {
      /* n:"BrtEndList", */
      T: -1
    },
    /*::[*/
    345: {
      /* n:"BrtBeginListCols", */
      T: 1
    },
    /*::[*/
    346: {
      /* n:"BrtEndListCols", */
      T: -1
    },
    /*::[*/
    347: {
      /* n:"BrtBeginListCol", */
      T: 1
    },
    /*::[*/
    348: {
      /* n:"BrtEndListCol", */
      T: -1
    },
    /*::[*/
    349: {
      /* n:"BrtBeginListXmlCPr", */
      T: 1
    },
    /*::[*/
    350: {
      /* n:"BrtEndListXmlCPr", */
      T: -1
    },
    /*::[*/
    351: {
      /* n:"BrtListCCFmla" */
    },
    /*::[*/
    352: {
      /* n:"BrtListTrFmla" */
    },
    /*::[*/
    353: {
      /* n:"BrtBeginExternals", */
      T: 1
    },
    /*::[*/
    354: {
      /* n:"BrtEndExternals", */
      T: -1
    },
    /*::[*/
    355: {
      /* n:"BrtSupBookSrc", */
      f: parse_RelID
    },
    /*::[*/
    357: {
      /* n:"BrtSupSelf" */
    },
    /*::[*/
    358: {
      /* n:"BrtSupSame" */
    },
    /*::[*/
    359: {
      /* n:"BrtSupTabs" */
    },
    /*::[*/
    360: {
      /* n:"BrtBeginSupBook", */
      T: 1
    },
    /*::[*/
    361: {
      /* n:"BrtPlaceholderName" */
    },
    /*::[*/
    362: {
      /* n:"BrtExternSheet", */
      f: parse_ExternSheet
    },
    /*::[*/
    363: {
      /* n:"BrtExternTableStart" */
    },
    /*::[*/
    364: {
      /* n:"BrtExternTableEnd" */
    },
    /*::[*/
    366: {
      /* n:"BrtExternRowHdr" */
    },
    /*::[*/
    367: {
      /* n:"BrtExternCellBlank" */
    },
    /*::[*/
    368: {
      /* n:"BrtExternCellReal" */
    },
    /*::[*/
    369: {
      /* n:"BrtExternCellBool" */
    },
    /*::[*/
    370: {
      /* n:"BrtExternCellError" */
    },
    /*::[*/
    371: {
      /* n:"BrtExternCellString" */
    },
    /*::[*/
    372: {
      /* n:"BrtBeginEsmdx", */
      T: 1
    },
    /*::[*/
    373: {
      /* n:"BrtEndEsmdx", */
      T: -1
    },
    /*::[*/
    374: {
      /* n:"BrtBeginMdxSet", */
      T: 1
    },
    /*::[*/
    375: {
      /* n:"BrtEndMdxSet", */
      T: -1
    },
    /*::[*/
    376: {
      /* n:"BrtBeginMdxMbrProp", */
      T: 1
    },
    /*::[*/
    377: {
      /* n:"BrtEndMdxMbrProp", */
      T: -1
    },
    /*::[*/
    378: {
      /* n:"BrtBeginMdxKPI", */
      T: 1
    },
    /*::[*/
    379: {
      /* n:"BrtEndMdxKPI", */
      T: -1
    },
    /*::[*/
    380: {
      /* n:"BrtBeginEsstr", */
      T: 1
    },
    /*::[*/
    381: {
      /* n:"BrtEndEsstr", */
      T: -1
    },
    /*::[*/
    382: {
      /* n:"BrtBeginPRFItem", */
      T: 1
    },
    /*::[*/
    383: {
      /* n:"BrtEndPRFItem", */
      T: -1
    },
    /*::[*/
    384: {
      /* n:"BrtBeginPivotCacheIDs", */
      T: 1
    },
    /*::[*/
    385: {
      /* n:"BrtEndPivotCacheIDs", */
      T: -1
    },
    /*::[*/
    386: {
      /* n:"BrtBeginPivotCacheID", */
      T: 1
    },
    /*::[*/
    387: {
      /* n:"BrtEndPivotCacheID", */
      T: -1
    },
    /*::[*/
    388: {
      /* n:"BrtBeginISXVIs", */
      T: 1
    },
    /*::[*/
    389: {
      /* n:"BrtEndISXVIs", */
      T: -1
    },
    /*::[*/
    390: {
      /* n:"BrtBeginColInfos", */
      T: 1
    },
    /*::[*/
    391: {
      /* n:"BrtEndColInfos", */
      T: -1
    },
    /*::[*/
    392: {
      /* n:"BrtBeginRwBrk", */
      T: 1
    },
    /*::[*/
    393: {
      /* n:"BrtEndRwBrk", */
      T: -1
    },
    /*::[*/
    394: {
      /* n:"BrtBeginColBrk", */
      T: 1
    },
    /*::[*/
    395: {
      /* n:"BrtEndColBrk", */
      T: -1
    },
    /*::[*/
    396: {
      /* n:"BrtBrk" */
    },
    /*::[*/
    397: {
      /* n:"BrtUserBookView" */
    },
    /*::[*/
    398: {
      /* n:"BrtInfo" */
    },
    /*::[*/
    399: {
      /* n:"BrtCUsr" */
    },
    /*::[*/
    400: {
      /* n:"BrtUsr" */
    },
    /*::[*/
    401: {
      /* n:"BrtBeginUsers", */
      T: 1
    },
    /*::[*/
    403: {
      /* n:"BrtEOF" */
    },
    /*::[*/
    404: {
      /* n:"BrtUCR" */
    },
    /*::[*/
    405: {
      /* n:"BrtRRInsDel" */
    },
    /*::[*/
    406: {
      /* n:"BrtRREndInsDel" */
    },
    /*::[*/
    407: {
      /* n:"BrtRRMove" */
    },
    /*::[*/
    408: {
      /* n:"BrtRREndMove" */
    },
    /*::[*/
    409: {
      /* n:"BrtRRChgCell" */
    },
    /*::[*/
    410: {
      /* n:"BrtRREndChgCell" */
    },
    /*::[*/
    411: {
      /* n:"BrtRRHeader" */
    },
    /*::[*/
    412: {
      /* n:"BrtRRUserView" */
    },
    /*::[*/
    413: {
      /* n:"BrtRRRenSheet" */
    },
    /*::[*/
    414: {
      /* n:"BrtRRInsertSh" */
    },
    /*::[*/
    415: {
      /* n:"BrtRRDefName" */
    },
    /*::[*/
    416: {
      /* n:"BrtRRNote" */
    },
    /*::[*/
    417: {
      /* n:"BrtRRConflict" */
    },
    /*::[*/
    418: {
      /* n:"BrtRRTQSIF" */
    },
    /*::[*/
    419: {
      /* n:"BrtRRFormat" */
    },
    /*::[*/
    420: {
      /* n:"BrtRREndFormat" */
    },
    /*::[*/
    421: {
      /* n:"BrtRRAutoFmt" */
    },
    /*::[*/
    422: {
      /* n:"BrtBeginUserShViews", */
      T: 1
    },
    /*::[*/
    423: {
      /* n:"BrtBeginUserShView", */
      T: 1
    },
    /*::[*/
    424: {
      /* n:"BrtEndUserShView", */
      T: -1
    },
    /*::[*/
    425: {
      /* n:"BrtEndUserShViews", */
      T: -1
    },
    /*::[*/
    426: {
      /* n:"BrtArrFmla", */
      f: parse_BrtArrFmla
    },
    /*::[*/
    427: {
      /* n:"BrtShrFmla", */
      f: parse_BrtShrFmla
    },
    /*::[*/
    428: {
      /* n:"BrtTable" */
    },
    /*::[*/
    429: {
      /* n:"BrtBeginExtConnections", */
      T: 1
    },
    /*::[*/
    430: {
      /* n:"BrtEndExtConnections", */
      T: -1
    },
    /*::[*/
    431: {
      /* n:"BrtBeginPCDCalcMems", */
      T: 1
    },
    /*::[*/
    432: {
      /* n:"BrtEndPCDCalcMems", */
      T: -1
    },
    /*::[*/
    433: {
      /* n:"BrtBeginPCDCalcMem", */
      T: 1
    },
    /*::[*/
    434: {
      /* n:"BrtEndPCDCalcMem", */
      T: -1
    },
    /*::[*/
    435: {
      /* n:"BrtBeginPCDHGLevels", */
      T: 1
    },
    /*::[*/
    436: {
      /* n:"BrtEndPCDHGLevels", */
      T: -1
    },
    /*::[*/
    437: {
      /* n:"BrtBeginPCDHGLevel", */
      T: 1
    },
    /*::[*/
    438: {
      /* n:"BrtEndPCDHGLevel", */
      T: -1
    },
    /*::[*/
    439: {
      /* n:"BrtBeginPCDHGLGroups", */
      T: 1
    },
    /*::[*/
    440: {
      /* n:"BrtEndPCDHGLGroups", */
      T: -1
    },
    /*::[*/
    441: {
      /* n:"BrtBeginPCDHGLGroup", */
      T: 1
    },
    /*::[*/
    442: {
      /* n:"BrtEndPCDHGLGroup", */
      T: -1
    },
    /*::[*/
    443: {
      /* n:"BrtBeginPCDHGLGMembers", */
      T: 1
    },
    /*::[*/
    444: {
      /* n:"BrtEndPCDHGLGMembers", */
      T: -1
    },
    /*::[*/
    445: {
      /* n:"BrtBeginPCDHGLGMember", */
      T: 1
    },
    /*::[*/
    446: {
      /* n:"BrtEndPCDHGLGMember", */
      T: -1
    },
    /*::[*/
    447: {
      /* n:"BrtBeginQSI", */
      T: 1
    },
    /*::[*/
    448: {
      /* n:"BrtEndQSI", */
      T: -1
    },
    /*::[*/
    449: {
      /* n:"BrtBeginQSIR", */
      T: 1
    },
    /*::[*/
    450: {
      /* n:"BrtEndQSIR", */
      T: -1
    },
    /*::[*/
    451: {
      /* n:"BrtBeginDeletedNames", */
      T: 1
    },
    /*::[*/
    452: {
      /* n:"BrtEndDeletedNames", */
      T: -1
    },
    /*::[*/
    453: {
      /* n:"BrtBeginDeletedName", */
      T: 1
    },
    /*::[*/
    454: {
      /* n:"BrtEndDeletedName", */
      T: -1
    },
    /*::[*/
    455: {
      /* n:"BrtBeginQSIFs", */
      T: 1
    },
    /*::[*/
    456: {
      /* n:"BrtEndQSIFs", */
      T: -1
    },
    /*::[*/
    457: {
      /* n:"BrtBeginQSIF", */
      T: 1
    },
    /*::[*/
    458: {
      /* n:"BrtEndQSIF", */
      T: -1
    },
    /*::[*/
    459: {
      /* n:"BrtBeginAutoSortScope", */
      T: 1
    },
    /*::[*/
    460: {
      /* n:"BrtEndAutoSortScope", */
      T: -1
    },
    /*::[*/
    461: {
      /* n:"BrtBeginConditionalFormatting", */
      T: 1
    },
    /*::[*/
    462: {
      /* n:"BrtEndConditionalFormatting", */
      T: -1
    },
    /*::[*/
    463: {
      /* n:"BrtBeginCFRule", */
      T: 1
    },
    /*::[*/
    464: {
      /* n:"BrtEndCFRule", */
      T: -1
    },
    /*::[*/
    465: {
      /* n:"BrtBeginIconSet", */
      T: 1
    },
    /*::[*/
    466: {
      /* n:"BrtEndIconSet", */
      T: -1
    },
    /*::[*/
    467: {
      /* n:"BrtBeginDatabar", */
      T: 1
    },
    /*::[*/
    468: {
      /* n:"BrtEndDatabar", */
      T: -1
    },
    /*::[*/
    469: {
      /* n:"BrtBeginColorScale", */
      T: 1
    },
    /*::[*/
    470: {
      /* n:"BrtEndColorScale", */
      T: -1
    },
    /*::[*/
    471: {
      /* n:"BrtCFVO" */
    },
    /*::[*/
    472: {
      /* n:"BrtExternValueMeta" */
    },
    /*::[*/
    473: {
      /* n:"BrtBeginColorPalette", */
      T: 1
    },
    /*::[*/
    474: {
      /* n:"BrtEndColorPalette", */
      T: -1
    },
    /*::[*/
    475: {
      /* n:"BrtIndexedColor" */
    },
    /*::[*/
    476: {
      /* n:"BrtMargins", */
      f: parse_BrtMargins
    },
    /*::[*/
    477: {
      /* n:"BrtPrintOptions" */
    },
    /*::[*/
    478: {
      /* n:"BrtPageSetup" */
    },
    /*::[*/
    479: {
      /* n:"BrtBeginHeaderFooter", */
      T: 1
    },
    /*::[*/
    480: {
      /* n:"BrtEndHeaderFooter", */
      T: -1
    },
    /*::[*/
    481: {
      /* n:"BrtBeginSXCrtFormat", */
      T: 1
    },
    /*::[*/
    482: {
      /* n:"BrtEndSXCrtFormat", */
      T: -1
    },
    /*::[*/
    483: {
      /* n:"BrtBeginSXCrtFormats", */
      T: 1
    },
    /*::[*/
    484: {
      /* n:"BrtEndSXCrtFormats", */
      T: -1
    },
    /*::[*/
    485: {
      /* n:"BrtWsFmtInfo", */
      f: parse_BrtWsFmtInfo
    },
    /*::[*/
    486: {
      /* n:"BrtBeginMgs", */
      T: 1
    },
    /*::[*/
    487: {
      /* n:"BrtEndMGs", */
      T: -1
    },
    /*::[*/
    488: {
      /* n:"BrtBeginMGMaps", */
      T: 1
    },
    /*::[*/
    489: {
      /* n:"BrtEndMGMaps", */
      T: -1
    },
    /*::[*/
    490: {
      /* n:"BrtBeginMG", */
      T: 1
    },
    /*::[*/
    491: {
      /* n:"BrtEndMG", */
      T: -1
    },
    /*::[*/
    492: {
      /* n:"BrtBeginMap", */
      T: 1
    },
    /*::[*/
    493: {
      /* n:"BrtEndMap", */
      T: -1
    },
    /*::[*/
    494: {
      /* n:"BrtHLink", */
      f: parse_BrtHLink
    },
    /*::[*/
    495: {
      /* n:"BrtBeginDCon", */
      T: 1
    },
    /*::[*/
    496: {
      /* n:"BrtEndDCon", */
      T: -1
    },
    /*::[*/
    497: {
      /* n:"BrtBeginDRefs", */
      T: 1
    },
    /*::[*/
    498: {
      /* n:"BrtEndDRefs", */
      T: -1
    },
    /*::[*/
    499: {
      /* n:"BrtDRef" */
    },
    /*::[*/
    500: {
      /* n:"BrtBeginScenMan", */
      T: 1
    },
    /*::[*/
    501: {
      /* n:"BrtEndScenMan", */
      T: -1
    },
    /*::[*/
    502: {
      /* n:"BrtBeginSct", */
      T: 1
    },
    /*::[*/
    503: {
      /* n:"BrtEndSct", */
      T: -1
    },
    /*::[*/
    504: {
      /* n:"BrtSlc" */
    },
    /*::[*/
    505: {
      /* n:"BrtBeginDXFs", */
      T: 1
    },
    /*::[*/
    506: {
      /* n:"BrtEndDXFs", */
      T: -1
    },
    /*::[*/
    507: {
      /* n:"BrtDXF" */
    },
    /*::[*/
    508: {
      /* n:"BrtBeginTableStyles", */
      T: 1
    },
    /*::[*/
    509: {
      /* n:"BrtEndTableStyles", */
      T: -1
    },
    /*::[*/
    510: {
      /* n:"BrtBeginTableStyle", */
      T: 1
    },
    /*::[*/
    511: {
      /* n:"BrtEndTableStyle", */
      T: -1
    },
    /*::[*/
    512: {
      /* n:"BrtTableStyleElement" */
    },
    /*::[*/
    513: {
      /* n:"BrtTableStyleClient" */
    },
    /*::[*/
    514: {
      /* n:"BrtBeginVolDeps", */
      T: 1
    },
    /*::[*/
    515: {
      /* n:"BrtEndVolDeps", */
      T: -1
    },
    /*::[*/
    516: {
      /* n:"BrtBeginVolType", */
      T: 1
    },
    /*::[*/
    517: {
      /* n:"BrtEndVolType", */
      T: -1
    },
    /*::[*/
    518: {
      /* n:"BrtBeginVolMain", */
      T: 1
    },
    /*::[*/
    519: {
      /* n:"BrtEndVolMain", */
      T: -1
    },
    /*::[*/
    520: {
      /* n:"BrtBeginVolTopic", */
      T: 1
    },
    /*::[*/
    521: {
      /* n:"BrtEndVolTopic", */
      T: -1
    },
    /*::[*/
    522: {
      /* n:"BrtVolSubtopic" */
    },
    /*::[*/
    523: {
      /* n:"BrtVolRef" */
    },
    /*::[*/
    524: {
      /* n:"BrtVolNum" */
    },
    /*::[*/
    525: {
      /* n:"BrtVolErr" */
    },
    /*::[*/
    526: {
      /* n:"BrtVolStr" */
    },
    /*::[*/
    527: {
      /* n:"BrtVolBool" */
    },
    /*::[*/
    528: {
      /* n:"BrtBeginCalcChain$", */
      T: 1
    },
    /*::[*/
    529: {
      /* n:"BrtEndCalcChain$", */
      T: -1
    },
    /*::[*/
    530: {
      /* n:"BrtBeginSortState", */
      T: 1
    },
    /*::[*/
    531: {
      /* n:"BrtEndSortState", */
      T: -1
    },
    /*::[*/
    532: {
      /* n:"BrtBeginSortCond", */
      T: 1
    },
    /*::[*/
    533: {
      /* n:"BrtEndSortCond", */
      T: -1
    },
    /*::[*/
    534: {
      /* n:"BrtBookProtection" */
    },
    /*::[*/
    535: {
      /* n:"BrtSheetProtection" */
    },
    /*::[*/
    536: {
      /* n:"BrtRangeProtection" */
    },
    /*::[*/
    537: {
      /* n:"BrtPhoneticInfo" */
    },
    /*::[*/
    538: {
      /* n:"BrtBeginECTxtWiz", */
      T: 1
    },
    /*::[*/
    539: {
      /* n:"BrtEndECTxtWiz", */
      T: -1
    },
    /*::[*/
    540: {
      /* n:"BrtBeginECTWFldInfoLst", */
      T: 1
    },
    /*::[*/
    541: {
      /* n:"BrtEndECTWFldInfoLst", */
      T: -1
    },
    /*::[*/
    542: {
      /* n:"BrtBeginECTwFldInfo", */
      T: 1
    },
    /*::[*/
    548: {
      /* n:"BrtFileSharing" */
    },
    /*::[*/
    549: {
      /* n:"BrtOleSize" */
    },
    /*::[*/
    550: {
      /* n:"BrtDrawing", */
      f: parse_RelID
    },
    /*::[*/
    551: {
      /* n:"BrtLegacyDrawing" */
    },
    /*::[*/
    552: {
      /* n:"BrtLegacyDrawingHF" */
    },
    /*::[*/
    553: {
      /* n:"BrtWebOpt" */
    },
    /*::[*/
    554: {
      /* n:"BrtBeginWebPubItems", */
      T: 1
    },
    /*::[*/
    555: {
      /* n:"BrtEndWebPubItems", */
      T: -1
    },
    /*::[*/
    556: {
      /* n:"BrtBeginWebPubItem", */
      T: 1
    },
    /*::[*/
    557: {
      /* n:"BrtEndWebPubItem", */
      T: -1
    },
    /*::[*/
    558: {
      /* n:"BrtBeginSXCondFmt", */
      T: 1
    },
    /*::[*/
    559: {
      /* n:"BrtEndSXCondFmt", */
      T: -1
    },
    /*::[*/
    560: {
      /* n:"BrtBeginSXCondFmts", */
      T: 1
    },
    /*::[*/
    561: {
      /* n:"BrtEndSXCondFmts", */
      T: -1
    },
    /*::[*/
    562: {
      /* n:"BrtBkHim" */
    },
    /*::[*/
    564: {
      /* n:"BrtColor" */
    },
    /*::[*/
    565: {
      /* n:"BrtBeginIndexedColors", */
      T: 1
    },
    /*::[*/
    566: {
      /* n:"BrtEndIndexedColors", */
      T: -1
    },
    /*::[*/
    569: {
      /* n:"BrtBeginMRUColors", */
      T: 1
    },
    /*::[*/
    570: {
      /* n:"BrtEndMRUColors", */
      T: -1
    },
    /*::[*/
    572: {
      /* n:"BrtMRUColor" */
    },
    /*::[*/
    573: {
      /* n:"BrtBeginDVals", */
      T: 1
    },
    /*::[*/
    574: {
      /* n:"BrtEndDVals", */
      T: -1
    },
    /*::[*/
    577: {
      /* n:"BrtSupNameStart" */
    },
    /*::[*/
    578: {
      /* n:"BrtSupNameValueStart" */
    },
    /*::[*/
    579: {
      /* n:"BrtSupNameValueEnd" */
    },
    /*::[*/
    580: {
      /* n:"BrtSupNameNum" */
    },
    /*::[*/
    581: {
      /* n:"BrtSupNameErr" */
    },
    /*::[*/
    582: {
      /* n:"BrtSupNameSt" */
    },
    /*::[*/
    583: {
      /* n:"BrtSupNameNil" */
    },
    /*::[*/
    584: {
      /* n:"BrtSupNameBool" */
    },
    /*::[*/
    585: {
      /* n:"BrtSupNameFmla" */
    },
    /*::[*/
    586: {
      /* n:"BrtSupNameBits" */
    },
    /*::[*/
    587: {
      /* n:"BrtSupNameEnd" */
    },
    /*::[*/
    588: {
      /* n:"BrtEndSupBook", */
      T: -1
    },
    /*::[*/
    589: {
      /* n:"BrtCellSmartTagProperty" */
    },
    /*::[*/
    590: {
      /* n:"BrtBeginCellSmartTag", */
      T: 1
    },
    /*::[*/
    591: {
      /* n:"BrtEndCellSmartTag", */
      T: -1
    },
    /*::[*/
    592: {
      /* n:"BrtBeginCellSmartTags", */
      T: 1
    },
    /*::[*/
    593: {
      /* n:"BrtEndCellSmartTags", */
      T: -1
    },
    /*::[*/
    594: {
      /* n:"BrtBeginSmartTags", */
      T: 1
    },
    /*::[*/
    595: {
      /* n:"BrtEndSmartTags", */
      T: -1
    },
    /*::[*/
    596: {
      /* n:"BrtSmartTagType" */
    },
    /*::[*/
    597: {
      /* n:"BrtBeginSmartTagTypes", */
      T: 1
    },
    /*::[*/
    598: {
      /* n:"BrtEndSmartTagTypes", */
      T: -1
    },
    /*::[*/
    599: {
      /* n:"BrtBeginSXFilters", */
      T: 1
    },
    /*::[*/
    600: {
      /* n:"BrtEndSXFilters", */
      T: -1
    },
    /*::[*/
    601: {
      /* n:"BrtBeginSXFILTER", */
      T: 1
    },
    /*::[*/
    602: {
      /* n:"BrtEndSXFilter", */
      T: -1
    },
    /*::[*/
    603: {
      /* n:"BrtBeginFills", */
      T: 1
    },
    /*::[*/
    604: {
      /* n:"BrtEndFills", */
      T: -1
    },
    /*::[*/
    605: {
      /* n:"BrtBeginCellWatches", */
      T: 1
    },
    /*::[*/
    606: {
      /* n:"BrtEndCellWatches", */
      T: -1
    },
    /*::[*/
    607: {
      /* n:"BrtCellWatch" */
    },
    /*::[*/
    608: {
      /* n:"BrtBeginCRErrs", */
      T: 1
    },
    /*::[*/
    609: {
      /* n:"BrtEndCRErrs", */
      T: -1
    },
    /*::[*/
    610: {
      /* n:"BrtCrashRecErr" */
    },
    /*::[*/
    611: {
      /* n:"BrtBeginFonts", */
      T: 1
    },
    /*::[*/
    612: {
      /* n:"BrtEndFonts", */
      T: -1
    },
    /*::[*/
    613: {
      /* n:"BrtBeginBorders", */
      T: 1
    },
    /*::[*/
    614: {
      /* n:"BrtEndBorders", */
      T: -1
    },
    /*::[*/
    615: {
      /* n:"BrtBeginFmts", */
      T: 1
    },
    /*::[*/
    616: {
      /* n:"BrtEndFmts", */
      T: -1
    },
    /*::[*/
    617: {
      /* n:"BrtBeginCellXFs", */
      T: 1
    },
    /*::[*/
    618: {
      /* n:"BrtEndCellXFs", */
      T: -1
    },
    /*::[*/
    619: {
      /* n:"BrtBeginStyles", */
      T: 1
    },
    /*::[*/
    620: {
      /* n:"BrtEndStyles", */
      T: -1
    },
    /*::[*/
    625: {
      /* n:"BrtBigName" */
    },
    /*::[*/
    626: {
      /* n:"BrtBeginCellStyleXFs", */
      T: 1
    },
    /*::[*/
    627: {
      /* n:"BrtEndCellStyleXFs", */
      T: -1
    },
    /*::[*/
    628: {
      /* n:"BrtBeginComments", */
      T: 1
    },
    /*::[*/
    629: {
      /* n:"BrtEndComments", */
      T: -1
    },
    /*::[*/
    630: {
      /* n:"BrtBeginCommentAuthors", */
      T: 1
    },
    /*::[*/
    631: {
      /* n:"BrtEndCommentAuthors", */
      T: -1
    },
    /*::[*/
    632: {
      /* n:"BrtCommentAuthor", */
      f: parse_BrtCommentAuthor
    },
    /*::[*/
    633: {
      /* n:"BrtBeginCommentList", */
      T: 1
    },
    /*::[*/
    634: {
      /* n:"BrtEndCommentList", */
      T: -1
    },
    /*::[*/
    635: {
      /* n:"BrtBeginComment", */
      T: 1,
      f: parse_BrtBeginComment
    },
    /*::[*/
    636: {
      /* n:"BrtEndComment", */
      T: -1
    },
    /*::[*/
    637: {
      /* n:"BrtCommentText", */
      f: parse_BrtCommentText
    },
    /*::[*/
    638: {
      /* n:"BrtBeginOleObjects", */
      T: 1
    },
    /*::[*/
    639: {
      /* n:"BrtOleObject" */
    },
    /*::[*/
    640: {
      /* n:"BrtEndOleObjects", */
      T: -1
    },
    /*::[*/
    641: {
      /* n:"BrtBeginSxrules", */
      T: 1
    },
    /*::[*/
    642: {
      /* n:"BrtEndSxRules", */
      T: -1
    },
    /*::[*/
    643: {
      /* n:"BrtBeginActiveXControls", */
      T: 1
    },
    /*::[*/
    644: {
      /* n:"BrtActiveX" */
    },
    /*::[*/
    645: {
      /* n:"BrtEndActiveXControls", */
      T: -1
    },
    /*::[*/
    646: {
      /* n:"BrtBeginPCDSDTCEMembersSortBy", */
      T: 1
    },
    /*::[*/
    648: {
      /* n:"BrtBeginCellIgnoreECs", */
      T: 1
    },
    /*::[*/
    649: {
      /* n:"BrtCellIgnoreEC" */
    },
    /*::[*/
    650: {
      /* n:"BrtEndCellIgnoreECs", */
      T: -1
    },
    /*::[*/
    651: {
      /* n:"BrtCsProp", */
      f: parse_BrtCsProp
    },
    /*::[*/
    652: {
      /* n:"BrtCsPageSetup" */
    },
    /*::[*/
    653: {
      /* n:"BrtBeginUserCsViews", */
      T: 1
    },
    /*::[*/
    654: {
      /* n:"BrtEndUserCsViews", */
      T: -1
    },
    /*::[*/
    655: {
      /* n:"BrtBeginUserCsView", */
      T: 1
    },
    /*::[*/
    656: {
      /* n:"BrtEndUserCsView", */
      T: -1
    },
    /*::[*/
    657: {
      /* n:"BrtBeginPcdSFCIEntries", */
      T: 1
    },
    /*::[*/
    658: {
      /* n:"BrtEndPCDSFCIEntries", */
      T: -1
    },
    /*::[*/
    659: {
      /* n:"BrtPCDSFCIEntry" */
    },
    /*::[*/
    660: {
      /* n:"BrtBeginListParts", */
      T: 1
    },
    /*::[*/
    661: {
      /* n:"BrtListPart" */
    },
    /*::[*/
    662: {
      /* n:"BrtEndListParts", */
      T: -1
    },
    /*::[*/
    663: {
      /* n:"BrtSheetCalcProp" */
    },
    /*::[*/
    664: {
      /* n:"BrtBeginFnGroup", */
      T: 1
    },
    /*::[*/
    665: {
      /* n:"BrtFnGroup" */
    },
    /*::[*/
    666: {
      /* n:"BrtEndFnGroup", */
      T: -1
    },
    /*::[*/
    667: {
      /* n:"BrtSupAddin" */
    },
    /*::[*/
    668: {
      /* n:"BrtSXTDMPOrder" */
    },
    /*::[*/
    669: {
      /* n:"BrtCsProtection" */
    },
    /*::[*/
    671: {
      /* n:"BrtBeginWsSortMap", */
      T: 1
    },
    /*::[*/
    672: {
      /* n:"BrtEndWsSortMap", */
      T: -1
    },
    /*::[*/
    673: {
      /* n:"BrtBeginRRSort", */
      T: 1
    },
    /*::[*/
    674: {
      /* n:"BrtEndRRSort", */
      T: -1
    },
    /*::[*/
    675: {
      /* n:"BrtRRSortItem" */
    },
    /*::[*/
    676: {
      /* n:"BrtFileSharingIso" */
    },
    /*::[*/
    677: {
      /* n:"BrtBookProtectionIso" */
    },
    /*::[*/
    678: {
      /* n:"BrtSheetProtectionIso" */
    },
    /*::[*/
    679: {
      /* n:"BrtCsProtectionIso" */
    },
    /*::[*/
    680: {
      /* n:"BrtRangeProtectionIso" */
    },
    /*::[*/
    681: {
      /* n:"BrtDValList" */
    },
    /*::[*/
    1024: {
      /* n:"BrtRwDescent" */
    },
    /*::[*/
    1025: {
      /* n:"BrtKnownFonts" */
    },
    /*::[*/
    1026: {
      /* n:"BrtBeginSXTupleSet", */
      T: 1
    },
    /*::[*/
    1027: {
      /* n:"BrtEndSXTupleSet", */
      T: -1
    },
    /*::[*/
    1028: {
      /* n:"BrtBeginSXTupleSetHeader", */
      T: 1
    },
    /*::[*/
    1029: {
      /* n:"BrtEndSXTupleSetHeader", */
      T: -1
    },
    /*::[*/
    1030: {
      /* n:"BrtSXTupleSetHeaderItem" */
    },
    /*::[*/
    1031: {
      /* n:"BrtBeginSXTupleSetData", */
      T: 1
    },
    /*::[*/
    1032: {
      /* n:"BrtEndSXTupleSetData", */
      T: -1
    },
    /*::[*/
    1033: {
      /* n:"BrtBeginSXTupleSetRow", */
      T: 1
    },
    /*::[*/
    1034: {
      /* n:"BrtEndSXTupleSetRow", */
      T: -1
    },
    /*::[*/
    1035: {
      /* n:"BrtSXTupleSetRowItem" */
    },
    /*::[*/
    1036: {
      /* n:"BrtNameExt" */
    },
    /*::[*/
    1037: {
      /* n:"BrtPCDH14" */
    },
    /*::[*/
    1038: {
      /* n:"BrtBeginPCDCalcMem14", */
      T: 1
    },
    /*::[*/
    1039: {
      /* n:"BrtEndPCDCalcMem14", */
      T: -1
    },
    /*::[*/
    1040: {
      /* n:"BrtSXTH14" */
    },
    /*::[*/
    1041: {
      /* n:"BrtBeginSparklineGroup", */
      T: 1
    },
    /*::[*/
    1042: {
      /* n:"BrtEndSparklineGroup", */
      T: -1
    },
    /*::[*/
    1043: {
      /* n:"BrtSparkline" */
    },
    /*::[*/
    1044: {
      /* n:"BrtSXDI14" */
    },
    /*::[*/
    1045: {
      /* n:"BrtWsFmtInfoEx14" */
    },
    /*::[*/
    1046: {
      /* n:"BrtBeginConditionalFormatting14", */
      T: 1
    },
    /*::[*/
    1047: {
      /* n:"BrtEndConditionalFormatting14", */
      T: -1
    },
    /*::[*/
    1048: {
      /* n:"BrtBeginCFRule14", */
      T: 1
    },
    /*::[*/
    1049: {
      /* n:"BrtEndCFRule14", */
      T: -1
    },
    /*::[*/
    1050: {
      /* n:"BrtCFVO14" */
    },
    /*::[*/
    1051: {
      /* n:"BrtBeginDatabar14", */
      T: 1
    },
    /*::[*/
    1052: {
      /* n:"BrtBeginIconSet14", */
      T: 1
    },
    /*::[*/
    1053: {
      /* n:"BrtDVal14", */
      f: parse_BrtDVal14
    },
    /*::[*/
    1054: {
      /* n:"BrtBeginDVals14", */
      T: 1
    },
    /*::[*/
    1055: {
      /* n:"BrtColor14" */
    },
    /*::[*/
    1056: {
      /* n:"BrtBeginSparklines", */
      T: 1
    },
    /*::[*/
    1057: {
      /* n:"BrtEndSparklines", */
      T: -1
    },
    /*::[*/
    1058: {
      /* n:"BrtBeginSparklineGroups", */
      T: 1
    },
    /*::[*/
    1059: {
      /* n:"BrtEndSparklineGroups", */
      T: -1
    },
    /*::[*/
    1061: {
      /* n:"BrtSXVD14" */
    },
    /*::[*/
    1062: {
      /* n:"BrtBeginSXView14", */
      T: 1
    },
    /*::[*/
    1063: {
      /* n:"BrtEndSXView14", */
      T: -1
    },
    /*::[*/
    1064: {
      /* n:"BrtBeginSXView16", */
      T: 1
    },
    /*::[*/
    1065: {
      /* n:"BrtEndSXView16", */
      T: -1
    },
    /*::[*/
    1066: {
      /* n:"BrtBeginPCD14", */
      T: 1
    },
    /*::[*/
    1067: {
      /* n:"BrtEndPCD14", */
      T: -1
    },
    /*::[*/
    1068: {
      /* n:"BrtBeginExtConn14", */
      T: 1
    },
    /*::[*/
    1069: {
      /* n:"BrtEndExtConn14", */
      T: -1
    },
    /*::[*/
    1070: {
      /* n:"BrtBeginSlicerCacheIDs", */
      T: 1
    },
    /*::[*/
    1071: {
      /* n:"BrtEndSlicerCacheIDs", */
      T: -1
    },
    /*::[*/
    1072: {
      /* n:"BrtBeginSlicerCacheID", */
      T: 1
    },
    /*::[*/
    1073: {
      /* n:"BrtEndSlicerCacheID", */
      T: -1
    },
    /*::[*/
    1075: {
      /* n:"BrtBeginSlicerCache", */
      T: 1
    },
    /*::[*/
    1076: {
      /* n:"BrtEndSlicerCache", */
      T: -1
    },
    /*::[*/
    1077: {
      /* n:"BrtBeginSlicerCacheDef", */
      T: 1
    },
    /*::[*/
    1078: {
      /* n:"BrtEndSlicerCacheDef", */
      T: -1
    },
    /*::[*/
    1079: {
      /* n:"BrtBeginSlicersEx", */
      T: 1
    },
    /*::[*/
    1080: {
      /* n:"BrtEndSlicersEx", */
      T: -1
    },
    /*::[*/
    1081: {
      /* n:"BrtBeginSlicerEx", */
      T: 1
    },
    /*::[*/
    1082: {
      /* n:"BrtEndSlicerEx", */
      T: -1
    },
    /*::[*/
    1083: {
      /* n:"BrtBeginSlicer", */
      T: 1
    },
    /*::[*/
    1084: {
      /* n:"BrtEndSlicer", */
      T: -1
    },
    /*::[*/
    1085: {
      /* n:"BrtSlicerCachePivotTables" */
    },
    /*::[*/
    1086: {
      /* n:"BrtBeginSlicerCacheOlapImpl", */
      T: 1
    },
    /*::[*/
    1087: {
      /* n:"BrtEndSlicerCacheOlapImpl", */
      T: -1
    },
    /*::[*/
    1088: {
      /* n:"BrtBeginSlicerCacheLevelsData", */
      T: 1
    },
    /*::[*/
    1089: {
      /* n:"BrtEndSlicerCacheLevelsData", */
      T: -1
    },
    /*::[*/
    1090: {
      /* n:"BrtBeginSlicerCacheLevelData", */
      T: 1
    },
    /*::[*/
    1091: {
      /* n:"BrtEndSlicerCacheLevelData", */
      T: -1
    },
    /*::[*/
    1092: {
      /* n:"BrtBeginSlicerCacheSiRanges", */
      T: 1
    },
    /*::[*/
    1093: {
      /* n:"BrtEndSlicerCacheSiRanges", */
      T: -1
    },
    /*::[*/
    1094: {
      /* n:"BrtBeginSlicerCacheSiRange", */
      T: 1
    },
    /*::[*/
    1095: {
      /* n:"BrtEndSlicerCacheSiRange", */
      T: -1
    },
    /*::[*/
    1096: {
      /* n:"BrtSlicerCacheOlapItem" */
    },
    /*::[*/
    1097: {
      /* n:"BrtBeginSlicerCacheSelections", */
      T: 1
    },
    /*::[*/
    1098: {
      /* n:"BrtSlicerCacheSelection" */
    },
    /*::[*/
    1099: {
      /* n:"BrtEndSlicerCacheSelections", */
      T: -1
    },
    /*::[*/
    1100: {
      /* n:"BrtBeginSlicerCacheNative", */
      T: 1
    },
    /*::[*/
    1101: {
      /* n:"BrtEndSlicerCacheNative", */
      T: -1
    },
    /*::[*/
    1102: {
      /* n:"BrtSlicerCacheNativeItem" */
    },
    /*::[*/
    1103: {
      /* n:"BrtRangeProtection14" */
    },
    /*::[*/
    1104: {
      /* n:"BrtRangeProtectionIso14" */
    },
    /*::[*/
    1105: {
      /* n:"BrtCellIgnoreEC14" */
    },
    /*::[*/
    1111: {
      /* n:"BrtList14" */
    },
    /*::[*/
    1112: {
      /* n:"BrtCFIcon" */
    },
    /*::[*/
    1113: {
      /* n:"BrtBeginSlicerCachesPivotCacheIDs", */
      T: 1
    },
    /*::[*/
    1114: {
      /* n:"BrtEndSlicerCachesPivotCacheIDs", */
      T: -1
    },
    /*::[*/
    1115: {
      /* n:"BrtBeginSlicers", */
      T: 1
    },
    /*::[*/
    1116: {
      /* n:"BrtEndSlicers", */
      T: -1
    },
    /*::[*/
    1117: {
      /* n:"BrtWbProp14" */
    },
    /*::[*/
    1118: {
      /* n:"BrtBeginSXEdit", */
      T: 1
    },
    /*::[*/
    1119: {
      /* n:"BrtEndSXEdit", */
      T: -1
    },
    /*::[*/
    1120: {
      /* n:"BrtBeginSXEdits", */
      T: 1
    },
    /*::[*/
    1121: {
      /* n:"BrtEndSXEdits", */
      T: -1
    },
    /*::[*/
    1122: {
      /* n:"BrtBeginSXChange", */
      T: 1
    },
    /*::[*/
    1123: {
      /* n:"BrtEndSXChange", */
      T: -1
    },
    /*::[*/
    1124: {
      /* n:"BrtBeginSXChanges", */
      T: 1
    },
    /*::[*/
    1125: {
      /* n:"BrtEndSXChanges", */
      T: -1
    },
    /*::[*/
    1126: {
      /* n:"BrtSXTupleItems" */
    },
    /*::[*/
    1128: {
      /* n:"BrtBeginSlicerStyle", */
      T: 1
    },
    /*::[*/
    1129: {
      /* n:"BrtEndSlicerStyle", */
      T: -1
    },
    /*::[*/
    1130: {
      /* n:"BrtSlicerStyleElement" */
    },
    /*::[*/
    1131: {
      /* n:"BrtBeginStyleSheetExt14", */
      T: 1
    },
    /*::[*/
    1132: {
      /* n:"BrtEndStyleSheetExt14", */
      T: -1
    },
    /*::[*/
    1133: {
      /* n:"BrtBeginSlicerCachesPivotCacheID", */
      T: 1
    },
    /*::[*/
    1134: {
      /* n:"BrtEndSlicerCachesPivotCacheID", */
      T: -1
    },
    /*::[*/
    1135: {
      /* n:"BrtBeginConditionalFormattings", */
      T: 1
    },
    /*::[*/
    1136: {
      /* n:"BrtEndConditionalFormattings", */
      T: -1
    },
    /*::[*/
    1137: {
      /* n:"BrtBeginPCDCalcMemExt", */
      T: 1
    },
    /*::[*/
    1138: {
      /* n:"BrtEndPCDCalcMemExt", */
      T: -1
    },
    /*::[*/
    1139: {
      /* n:"BrtBeginPCDCalcMemsExt", */
      T: 1
    },
    /*::[*/
    1140: {
      /* n:"BrtEndPCDCalcMemsExt", */
      T: -1
    },
    /*::[*/
    1141: {
      /* n:"BrtPCDField14" */
    },
    /*::[*/
    1142: {
      /* n:"BrtBeginSlicerStyles", */
      T: 1
    },
    /*::[*/
    1143: {
      /* n:"BrtEndSlicerStyles", */
      T: -1
    },
    /*::[*/
    1144: {
      /* n:"BrtBeginSlicerStyleElements", */
      T: 1
    },
    /*::[*/
    1145: {
      /* n:"BrtEndSlicerStyleElements", */
      T: -1
    },
    /*::[*/
    1146: {
      /* n:"BrtCFRuleExt" */
    },
    /*::[*/
    1147: {
      /* n:"BrtBeginSXCondFmt14", */
      T: 1
    },
    /*::[*/
    1148: {
      /* n:"BrtEndSXCondFmt14", */
      T: -1
    },
    /*::[*/
    1149: {
      /* n:"BrtBeginSXCondFmts14", */
      T: 1
    },
    /*::[*/
    1150: {
      /* n:"BrtEndSXCondFmts14", */
      T: -1
    },
    /*::[*/
    1152: {
      /* n:"BrtBeginSortCond14", */
      T: 1
    },
    /*::[*/
    1153: {
      /* n:"BrtEndSortCond14", */
      T: -1
    },
    /*::[*/
    1154: {
      /* n:"BrtEndDVals14", */
      T: -1
    },
    /*::[*/
    1155: {
      /* n:"BrtEndIconSet14", */
      T: -1
    },
    /*::[*/
    1156: {
      /* n:"BrtEndDatabar14", */
      T: -1
    },
    /*::[*/
    1157: {
      /* n:"BrtBeginColorScale14", */
      T: 1
    },
    /*::[*/
    1158: {
      /* n:"BrtEndColorScale14", */
      T: -1
    },
    /*::[*/
    1159: {
      /* n:"BrtBeginSxrules14", */
      T: 1
    },
    /*::[*/
    1160: {
      /* n:"BrtEndSxrules14", */
      T: -1
    },
    /*::[*/
    1161: {
      /* n:"BrtBeginPRule14", */
      T: 1
    },
    /*::[*/
    1162: {
      /* n:"BrtEndPRule14", */
      T: -1
    },
    /*::[*/
    1163: {
      /* n:"BrtBeginPRFilters14", */
      T: 1
    },
    /*::[*/
    1164: {
      /* n:"BrtEndPRFilters14", */
      T: -1
    },
    /*::[*/
    1165: {
      /* n:"BrtBeginPRFilter14", */
      T: 1
    },
    /*::[*/
    1166: {
      /* n:"BrtEndPRFilter14", */
      T: -1
    },
    /*::[*/
    1167: {
      /* n:"BrtBeginPRFItem14", */
      T: 1
    },
    /*::[*/
    1168: {
      /* n:"BrtEndPRFItem14", */
      T: -1
    },
    /*::[*/
    1169: {
      /* n:"BrtBeginCellIgnoreECs14", */
      T: 1
    },
    /*::[*/
    1170: {
      /* n:"BrtEndCellIgnoreECs14", */
      T: -1
    },
    /*::[*/
    1171: {
      /* n:"BrtDxf14" */
    },
    /*::[*/
    1172: {
      /* n:"BrtBeginDxF14s", */
      T: 1
    },
    /*::[*/
    1173: {
      /* n:"BrtEndDxf14s", */
      T: -1
    },
    /*::[*/
    1177: {
      /* n:"BrtFilter14" */
    },
    /*::[*/
    1178: {
      /* n:"BrtBeginCustomFilters14", */
      T: 1
    },
    /*::[*/
    1180: {
      /* n:"BrtCustomFilter14" */
    },
    /*::[*/
    1181: {
      /* n:"BrtIconFilter14" */
    },
    /*::[*/
    1182: {
      /* n:"BrtPivotCacheConnectionName" */
    },
    /*::[*/
    2048: {
      /* n:"BrtBeginDecoupledPivotCacheIDs", */
      T: 1
    },
    /*::[*/
    2049: {
      /* n:"BrtEndDecoupledPivotCacheIDs", */
      T: -1
    },
    /*::[*/
    2050: {
      /* n:"BrtDecoupledPivotCacheID" */
    },
    /*::[*/
    2051: {
      /* n:"BrtBeginPivotTableRefs", */
      T: 1
    },
    /*::[*/
    2052: {
      /* n:"BrtEndPivotTableRefs", */
      T: -1
    },
    /*::[*/
    2053: {
      /* n:"BrtPivotTableRef" */
    },
    /*::[*/
    2054: {
      /* n:"BrtSlicerCacheBookPivotTables" */
    },
    /*::[*/
    2055: {
      /* n:"BrtBeginSxvcells", */
      T: 1
    },
    /*::[*/
    2056: {
      /* n:"BrtEndSxvcells", */
      T: -1
    },
    /*::[*/
    2057: {
      /* n:"BrtBeginSxRow", */
      T: 1
    },
    /*::[*/
    2058: {
      /* n:"BrtEndSxRow", */
      T: -1
    },
    /*::[*/
    2060: {
      /* n:"BrtPcdCalcMem15" */
    },
    /*::[*/
    2067: {
      /* n:"BrtQsi15" */
    },
    /*::[*/
    2068: {
      /* n:"BrtBeginWebExtensions", */
      T: 1
    },
    /*::[*/
    2069: {
      /* n:"BrtEndWebExtensions", */
      T: -1
    },
    /*::[*/
    2070: {
      /* n:"BrtWebExtension" */
    },
    /*::[*/
    2071: {
      /* n:"BrtAbsPath15" */
    },
    /*::[*/
    2072: {
      /* n:"BrtBeginPivotTableUISettings", */
      T: 1
    },
    /*::[*/
    2073: {
      /* n:"BrtEndPivotTableUISettings", */
      T: -1
    },
    /*::[*/
    2075: {
      /* n:"BrtTableSlicerCacheIDs" */
    },
    /*::[*/
    2076: {
      /* n:"BrtTableSlicerCacheID" */
    },
    /*::[*/
    2077: {
      /* n:"BrtBeginTableSlicerCache", */
      T: 1
    },
    /*::[*/
    2078: {
      /* n:"BrtEndTableSlicerCache", */
      T: -1
    },
    /*::[*/
    2079: {
      /* n:"BrtSxFilter15" */
    },
    /*::[*/
    2080: {
      /* n:"BrtBeginTimelineCachePivotCacheIDs", */
      T: 1
    },
    /*::[*/
    2081: {
      /* n:"BrtEndTimelineCachePivotCacheIDs", */
      T: -1
    },
    /*::[*/
    2082: {
      /* n:"BrtTimelineCachePivotCacheID" */
    },
    /*::[*/
    2083: {
      /* n:"BrtBeginTimelineCacheIDs", */
      T: 1
    },
    /*::[*/
    2084: {
      /* n:"BrtEndTimelineCacheIDs", */
      T: -1
    },
    /*::[*/
    2085: {
      /* n:"BrtBeginTimelineCacheID", */
      T: 1
    },
    /*::[*/
    2086: {
      /* n:"BrtEndTimelineCacheID", */
      T: -1
    },
    /*::[*/
    2087: {
      /* n:"BrtBeginTimelinesEx", */
      T: 1
    },
    /*::[*/
    2088: {
      /* n:"BrtEndTimelinesEx", */
      T: -1
    },
    /*::[*/
    2089: {
      /* n:"BrtBeginTimelineEx", */
      T: 1
    },
    /*::[*/
    2090: {
      /* n:"BrtEndTimelineEx", */
      T: -1
    },
    /*::[*/
    2091: {
      /* n:"BrtWorkBookPr15" */
    },
    /*::[*/
    2092: {
      /* n:"BrtPCDH15" */
    },
    /*::[*/
    2093: {
      /* n:"BrtBeginTimelineStyle", */
      T: 1
    },
    /*::[*/
    2094: {
      /* n:"BrtEndTimelineStyle", */
      T: -1
    },
    /*::[*/
    2095: {
      /* n:"BrtTimelineStyleElement" */
    },
    /*::[*/
    2096: {
      /* n:"BrtBeginTimelineStylesheetExt15", */
      T: 1
    },
    /*::[*/
    2097: {
      /* n:"BrtEndTimelineStylesheetExt15", */
      T: -1
    },
    /*::[*/
    2098: {
      /* n:"BrtBeginTimelineStyles", */
      T: 1
    },
    /*::[*/
    2099: {
      /* n:"BrtEndTimelineStyles", */
      T: -1
    },
    /*::[*/
    2100: {
      /* n:"BrtBeginTimelineStyleElements", */
      T: 1
    },
    /*::[*/
    2101: {
      /* n:"BrtEndTimelineStyleElements", */
      T: -1
    },
    /*::[*/
    2102: {
      /* n:"BrtDxf15" */
    },
    /*::[*/
    2103: {
      /* n:"BrtBeginDxfs15", */
      T: 1
    },
    /*::[*/
    2104: {
      /* n:"BrtEndDxfs15", */
      T: -1
    },
    /*::[*/
    2105: {
      /* n:"BrtSlicerCacheHideItemsWithNoData" */
    },
    /*::[*/
    2106: {
      /* n:"BrtBeginItemUniqueNames", */
      T: 1
    },
    /*::[*/
    2107: {
      /* n:"BrtEndItemUniqueNames", */
      T: -1
    },
    /*::[*/
    2108: {
      /* n:"BrtItemUniqueName" */
    },
    /*::[*/
    2109: {
      /* n:"BrtBeginExtConn15", */
      T: 1
    },
    /*::[*/
    2110: {
      /* n:"BrtEndExtConn15", */
      T: -1
    },
    /*::[*/
    2111: {
      /* n:"BrtBeginOledbPr15", */
      T: 1
    },
    /*::[*/
    2112: {
      /* n:"BrtEndOledbPr15", */
      T: -1
    },
    /*::[*/
    2113: {
      /* n:"BrtBeginDataFeedPr15", */
      T: 1
    },
    /*::[*/
    2114: {
      /* n:"BrtEndDataFeedPr15", */
      T: -1
    },
    /*::[*/
    2115: {
      /* n:"BrtTextPr15" */
    },
    /*::[*/
    2116: {
      /* n:"BrtRangePr15" */
    },
    /*::[*/
    2117: {
      /* n:"BrtDbCommand15" */
    },
    /*::[*/
    2118: {
      /* n:"BrtBeginDbTables15", */
      T: 1
    },
    /*::[*/
    2119: {
      /* n:"BrtEndDbTables15", */
      T: -1
    },
    /*::[*/
    2120: {
      /* n:"BrtDbTable15" */
    },
    /*::[*/
    2121: {
      /* n:"BrtBeginDataModel", */
      T: 1
    },
    /*::[*/
    2122: {
      /* n:"BrtEndDataModel", */
      T: -1
    },
    /*::[*/
    2123: {
      /* n:"BrtBeginModelTables", */
      T: 1
    },
    /*::[*/
    2124: {
      /* n:"BrtEndModelTables", */
      T: -1
    },
    /*::[*/
    2125: {
      /* n:"BrtModelTable" */
    },
    /*::[*/
    2126: {
      /* n:"BrtBeginModelRelationships", */
      T: 1
    },
    /*::[*/
    2127: {
      /* n:"BrtEndModelRelationships", */
      T: -1
    },
    /*::[*/
    2128: {
      /* n:"BrtModelRelationship" */
    },
    /*::[*/
    2129: {
      /* n:"BrtBeginECTxtWiz15", */
      T: 1
    },
    /*::[*/
    2130: {
      /* n:"BrtEndECTxtWiz15", */
      T: -1
    },
    /*::[*/
    2131: {
      /* n:"BrtBeginECTWFldInfoLst15", */
      T: 1
    },
    /*::[*/
    2132: {
      /* n:"BrtEndECTWFldInfoLst15", */
      T: -1
    },
    /*::[*/
    2133: {
      /* n:"BrtBeginECTWFldInfo15", */
      T: 1
    },
    /*::[*/
    2134: {
      /* n:"BrtFieldListActiveItem" */
    },
    /*::[*/
    2135: {
      /* n:"BrtPivotCacheIdVersion" */
    },
    /*::[*/
    2136: {
      /* n:"BrtSXDI15" */
    },
    /*::[*/
    2137: {
      /* n:"BrtBeginModelTimeGroupings", */
      T: 1
    },
    /*::[*/
    2138: {
      /* n:"BrtEndModelTimeGroupings", */
      T: -1
    },
    /*::[*/
    2139: {
      /* n:"BrtBeginModelTimeGrouping", */
      T: 1
    },
    /*::[*/
    2140: {
      /* n:"BrtEndModelTimeGrouping", */
      T: -1
    },
    /*::[*/
    2141: {
      /* n:"BrtModelTimeGroupingCalcCol" */
    },
    /*::[*/
    3072: {
      /* n:"BrtUid" */
    },
    /*::[*/
    3073: {
      /* n:"BrtRevisionPtr" */
    },
    /*::[*/
    4096: {
      /* n:"BrtBeginDynamicArrayPr", */
      T: 1
    },
    /*::[*/
    4097: {
      /* n:"BrtEndDynamicArrayPr", */
      T: -1
    },
    /*::[*/
    5002: {
      /* n:"BrtBeginRichValueBlock", */
      T: 1
    },
    /*::[*/
    5003: {
      /* n:"BrtEndRichValueBlock", */
      T: -1
    },
    /*::[*/
    5081: {
      /* n:"BrtBeginRichFilters", */
      T: 1
    },
    /*::[*/
    5082: {
      /* n:"BrtEndRichFilters", */
      T: -1
    },
    /*::[*/
    5083: {
      /* n:"BrtRichFilter" */
    },
    /*::[*/
    5084: {
      /* n:"BrtBeginRichFilterColumn", */
      T: 1
    },
    /*::[*/
    5085: {
      /* n:"BrtEndRichFilterColumn", */
      T: -1
    },
    /*::[*/
    5086: {
      /* n:"BrtBeginCustomRichFilters", */
      T: 1
    },
    /*::[*/
    5087: {
      /* n:"BrtEndCustomRichFilters", */
      T: -1
    },
    /*::[*/
    5088: {
      /* n:"BrtCustomRichFilter" */
    },
    /*::[*/
    5089: {
      /* n:"BrtTop10RichFilter" */
    },
    /*::[*/
    5090: {
      /* n:"BrtDynamicRichFilter" */
    },
    /*::[*/
    5092: {
      /* n:"BrtBeginRichSortCondition", */
      T: 1
    },
    /*::[*/
    5093: {
      /* n:"BrtEndRichSortCondition", */
      T: -1
    },
    /*::[*/
    5094: {
      /* n:"BrtRichFilterDateGroupItem" */
    },
    /*::[*/
    5095: {
      /* n:"BrtBeginCalcFeatures", */
      T: 1
    },
    /*::[*/
    5096: {
      /* n:"BrtEndCalcFeatures", */
      T: -1
    },
    /*::[*/
    5097: {
      /* n:"BrtCalcFeature" */
    },
    /*::[*/
    5099: {
      /* n:"BrtExternalLinksPr" */
    },
    /*::[*/
    65535: { n: "" }
  };
  function write_biff_rec(ba, type2, payload, length2) {
    var t2 = type2;
    if (isNaN(t2))
      return;
    var len = length2 || (payload || []).length || 0;
    var o = ba.next(4);
    o.write_shift(2, t2);
    o.write_shift(2, len);
    if (
      /*:: len != null &&*/
      len > 0 && is_buf(payload)
    )
      ba.push(payload);
  }
  function write_biff_continue(ba, type2, payload, length2) {
    var len = length2 || (payload || []).length || 0;
    if (len <= 8224)
      return write_biff_rec(ba, type2, payload, len);
    var t2 = type2;
    if (isNaN(t2))
      return;
    var parts = payload.parts || [], sidx = 0;
    var i = 0, w2 = 0;
    while (w2 + (parts[sidx] || 8224) <= 8224) {
      w2 += parts[sidx] || 8224;
      sidx++;
    }
    var o = ba.next(4);
    o.write_shift(2, t2);
    o.write_shift(2, w2);
    ba.push(payload.slice(i, i + w2));
    i += w2;
    while (i < len) {
      o = ba.next(4);
      o.write_shift(2, 60);
      w2 = 0;
      while (w2 + (parts[sidx] || 8224) <= 8224) {
        w2 += parts[sidx] || 8224;
        sidx++;
      }
      o.write_shift(2, w2);
      ba.push(payload.slice(i, i + w2));
      i += w2;
    }
  }
  function write_BIFF2Cell(out, r2, c2) {
    if (!out)
      out = new_buf(7);
    out.write_shift(2, r2);
    out.write_shift(2, c2);
    out.write_shift(2, 0);
    out.write_shift(1, 0);
    return out;
  }
  function write_BIFF2BERR(r2, c2, val, t2) {
    var out = new_buf(9);
    write_BIFF2Cell(out, r2, c2);
    write_Bes(val, t2 || "b", out);
    return out;
  }
  function write_BIFF2LABEL(r2, c2, val) {
    var out = new_buf(8 + 2 * val.length);
    write_BIFF2Cell(out, r2, c2);
    out.write_shift(1, val.length);
    out.write_shift(val.length, val, "sbcs");
    return out.l < out.length ? out.slice(0, out.l) : out;
  }
  function write_ws_biff2_cell(ba, cell5, R, C) {
    if (cell5.v != null)
      switch (cell5.t) {
        case "d":
        case "n":
          var v2 = cell5.t == "d" ? datenum(parseDate(cell5.v)) : cell5.v;
          if (v2 == (v2 | 0) && v2 >= 0 && v2 < 65536)
            write_biff_rec(ba, 2, write_BIFF2INT(R, C, v2));
          else
            write_biff_rec(ba, 3, write_BIFF2NUM(R, C, v2));
          return;
        case "b":
        case "e":
          write_biff_rec(ba, 5, write_BIFF2BERR(R, C, cell5.v, cell5.t));
          return;
        case "s":
        case "str":
          write_biff_rec(ba, 4, write_BIFF2LABEL(R, C, (cell5.v || "").slice(0, 255)));
          return;
      }
    write_biff_rec(ba, 1, write_BIFF2Cell(null, R, C));
  }
  function write_ws_biff2(ba, ws, idx, opts) {
    var dense = Array.isArray(ws);
    var range = safe_decode_range(ws["!ref"] || "A1"), ref, rr = "", cols = [];
    if (range.e.c > 255 || range.e.r > 16383) {
      if (opts.WTF)
        throw new Error("Range " + (ws["!ref"] || "A1") + " exceeds format limit A1:IV16384");
      range.e.c = Math.min(range.e.c, 255);
      range.e.r = Math.min(range.e.c, 16383);
      ref = encode_range(range);
    }
    for (var R = range.s.r; R <= range.e.r; ++R) {
      rr = encode_row(R);
      for (var C = range.s.c; C <= range.e.c; ++C) {
        if (R === range.s.r)
          cols[C] = encode_col(C);
        ref = cols[C] + rr;
        var cell5 = dense ? (ws[R] || [])[C] : ws[ref];
        if (!cell5)
          continue;
        write_ws_biff2_cell(ba, cell5, R, C);
      }
    }
  }
  function write_biff2_buf(wb, opts) {
    var o = opts || {};
    var ba = buf_array();
    var idx = 0;
    for (var i = 0; i < wb.SheetNames.length; ++i)
      if (wb.SheetNames[i] == o.sheet)
        idx = i;
    if (idx == 0 && !!o.sheet && wb.SheetNames[0] != o.sheet)
      throw new Error("Sheet not found: " + o.sheet);
    write_biff_rec(ba, o.biff == 4 ? 1033 : o.biff == 3 ? 521 : 9, write_BOF(wb, 16, o));
    write_ws_biff2(ba, wb.Sheets[wb.SheetNames[idx]], idx, o);
    write_biff_rec(ba, 10);
    return ba.end();
  }
  function write_FONTS_biff8(ba, data, opts) {
    write_biff_rec(ba, 49, write_Font({
      sz: 12,
      color: { theme: 1 },
      name: "Arial",
      family: 2,
      scheme: "minor"
    }, opts));
  }
  function write_FMTS_biff8(ba, NF, opts) {
    if (!NF)
      return;
    [[5, 8], [23, 26], [41, 44], [
      /*63*/
      50,
      /*66],[164,*/
      392
    ]].forEach(function(r2) {
      for (var i = r2[0]; i <= r2[1]; ++i)
        if (NF[i] != null)
          write_biff_rec(ba, 1054, write_Format(i, NF[i], opts));
    });
  }
  function write_FEAT(ba, ws) {
    var o = new_buf(19);
    o.write_shift(4, 2151);
    o.write_shift(4, 0);
    o.write_shift(4, 0);
    o.write_shift(2, 3);
    o.write_shift(1, 1);
    o.write_shift(4, 0);
    write_biff_rec(ba, 2151, o);
    o = new_buf(39);
    o.write_shift(4, 2152);
    o.write_shift(4, 0);
    o.write_shift(4, 0);
    o.write_shift(2, 3);
    o.write_shift(1, 0);
    o.write_shift(4, 0);
    o.write_shift(2, 1);
    o.write_shift(4, 4);
    o.write_shift(2, 0);
    write_Ref8U(safe_decode_range(ws["!ref"] || "A1"), o);
    o.write_shift(4, 4);
    write_biff_rec(ba, 2152, o);
  }
  function write_CELLXFS_biff8(ba, opts) {
    for (var i = 0; i < 16; ++i)
      write_biff_rec(ba, 224, write_XF({ numFmtId: 0, style: true }, 0, opts));
    opts.cellXfs.forEach(function(c2) {
      write_biff_rec(ba, 224, write_XF(c2, 0, opts));
    });
  }
  function write_ws_biff8_hlinks(ba, ws) {
    for (var R = 0; R < ws["!links"].length; ++R) {
      var HL = ws["!links"][R];
      write_biff_rec(ba, 440, write_HLink(HL));
      if (HL[1].Tooltip)
        write_biff_rec(ba, 2048, write_HLinkTooltip(HL));
    }
    delete ws["!links"];
  }
  function write_ws_cols_biff8(ba, cols) {
    if (!cols)
      return;
    var cnt = 0;
    cols.forEach(function(col, idx) {
      if (++cnt <= 256 && col) {
        write_biff_rec(ba, 125, write_ColInfo(col_obj_w(idx, col), idx));
      }
    });
  }
  function write_ws_biff8_cell(ba, cell5, R, C, opts) {
    var os = 16 + get_cell_style(opts.cellXfs, cell5, opts);
    if (cell5.v == null && !cell5.bf) {
      write_biff_rec(ba, 513, write_XLSCell(R, C, os));
      return;
    }
    if (cell5.bf)
      write_biff_rec(ba, 6, write_Formula(cell5, R, C, opts, os));
    else
      switch (cell5.t) {
        case "d":
        case "n":
          var v2 = cell5.t == "d" ? datenum(parseDate(cell5.v)) : cell5.v;
          write_biff_rec(ba, 515, write_Number(R, C, v2, os));
          break;
        case "b":
        case "e":
          write_biff_rec(ba, 517, write_BoolErr(R, C, cell5.v, os, opts, cell5.t));
          break;
        case "s":
        case "str":
          if (opts.bookSST) {
            var isst = get_sst_id(opts.Strings, cell5.v, opts.revStrings);
            write_biff_rec(ba, 253, write_LabelSst(R, C, isst, os));
          } else
            write_biff_rec(ba, 516, write_Label(R, C, (cell5.v || "").slice(0, 255), os, opts));
          break;
        default:
          write_biff_rec(ba, 513, write_XLSCell(R, C, os));
      }
  }
  function write_ws_biff8(idx, opts, wb) {
    var ba = buf_array();
    var s = wb.SheetNames[idx], ws = wb.Sheets[s] || {};
    var _WB = (wb || {}).Workbook || {};
    var _sheet = (_WB.Sheets || [])[idx] || {};
    var dense = Array.isArray(ws);
    var b8 = opts.biff == 8;
    var ref, rr = "", cols = [];
    var range = safe_decode_range(ws["!ref"] || "A1");
    var MAX_ROWS = b8 ? 65536 : 16384;
    if (range.e.c > 255 || range.e.r >= MAX_ROWS) {
      if (opts.WTF)
        throw new Error("Range " + (ws["!ref"] || "A1") + " exceeds format limit A1:IV16384");
      range.e.c = Math.min(range.e.c, 255);
      range.e.r = Math.min(range.e.c, MAX_ROWS - 1);
    }
    write_biff_rec(ba, 2057, write_BOF(wb, 16, opts));
    write_biff_rec(ba, 13, writeuint16(1));
    write_biff_rec(ba, 12, writeuint16(100));
    write_biff_rec(ba, 15, writebool(true));
    write_biff_rec(ba, 17, writebool(false));
    write_biff_rec(ba, 16, write_Xnum(1e-3));
    write_biff_rec(ba, 95, writebool(true));
    write_biff_rec(ba, 42, writebool(false));
    write_biff_rec(ba, 43, writebool(false));
    write_biff_rec(ba, 130, writeuint16(1));
    write_biff_rec(ba, 128, write_Guts([0, 0]));
    write_biff_rec(ba, 131, writebool(false));
    write_biff_rec(ba, 132, writebool(false));
    if (b8)
      write_ws_cols_biff8(ba, ws["!cols"]);
    write_biff_rec(ba, 512, write_Dimensions(range, opts));
    if (b8)
      ws["!links"] = [];
    for (var R = range.s.r; R <= range.e.r; ++R) {
      rr = encode_row(R);
      for (var C = range.s.c; C <= range.e.c; ++C) {
        if (R === range.s.r)
          cols[C] = encode_col(C);
        ref = cols[C] + rr;
        var cell5 = dense ? (ws[R] || [])[C] : ws[ref];
        if (!cell5)
          continue;
        write_ws_biff8_cell(ba, cell5, R, C, opts);
        if (b8 && cell5.l)
          ws["!links"].push([ref, cell5.l]);
      }
    }
    var cname = _sheet.CodeName || _sheet.name || s;
    if (b8)
      write_biff_rec(ba, 574, write_Window2((_WB.Views || [])[0]));
    if (b8 && (ws["!merges"] || []).length)
      write_biff_rec(ba, 229, write_MergeCells(ws["!merges"]));
    if (b8)
      write_ws_biff8_hlinks(ba, ws);
    write_biff_rec(ba, 442, write_XLUnicodeString(cname));
    if (b8)
      write_FEAT(ba, ws);
    write_biff_rec(
      ba,
      10
      /* EOF */
    );
    return ba.end();
  }
  function write_biff8_global(wb, bufs, opts) {
    var A2 = buf_array();
    var _WB = (wb || {}).Workbook || {};
    var _sheets = _WB.Sheets || [];
    var _wb = (
      /*::((*/
      _WB.WBProps || {
        /*::CodeName:"ThisWorkbook"*/
      }
    );
    var b8 = opts.biff == 8, b5 = opts.biff == 5;
    write_biff_rec(A2, 2057, write_BOF(wb, 5, opts));
    if (opts.bookType == "xla")
      write_biff_rec(
        A2,
        135
        /* Addin */
      );
    write_biff_rec(A2, 225, b8 ? writeuint16(1200) : null);
    write_biff_rec(A2, 193, writezeroes(2));
    if (b5)
      write_biff_rec(
        A2,
        191
        /* ToolbarHdr */
      );
    if (b5)
      write_biff_rec(
        A2,
        192
        /* ToolbarEnd */
      );
    write_biff_rec(
      A2,
      226
      /* InterfaceEnd */
    );
    write_biff_rec(A2, 92, write_WriteAccess("SheetJS", opts));
    write_biff_rec(A2, 66, writeuint16(b8 ? 1200 : 1252));
    if (b8)
      write_biff_rec(A2, 353, writeuint16(0));
    if (b8)
      write_biff_rec(
        A2,
        448
        /* Excel9File */
      );
    write_biff_rec(A2, 317, write_RRTabId(wb.SheetNames.length));
    if (b8 && wb.vbaraw)
      write_biff_rec(
        A2,
        211
        /* ObProj */
      );
    if (b8 && wb.vbaraw) {
      var cname = _wb.CodeName || "ThisWorkbook";
      write_biff_rec(A2, 442, write_XLUnicodeString(cname));
    }
    write_biff_rec(A2, 156, writeuint16(17));
    write_biff_rec(A2, 25, writebool(false));
    write_biff_rec(A2, 18, writebool(false));
    write_biff_rec(A2, 19, writeuint16(0));
    if (b8)
      write_biff_rec(A2, 431, writebool(false));
    if (b8)
      write_biff_rec(A2, 444, writeuint16(0));
    write_biff_rec(A2, 61, write_Window1());
    write_biff_rec(A2, 64, writebool(false));
    write_biff_rec(A2, 141, writeuint16(0));
    write_biff_rec(A2, 34, writebool(safe1904(wb) == "true"));
    write_biff_rec(A2, 14, writebool(true));
    if (b8)
      write_biff_rec(A2, 439, writebool(false));
    write_biff_rec(A2, 218, writeuint16(0));
    write_FONTS_biff8(A2, wb, opts);
    write_FMTS_biff8(A2, wb.SSF, opts);
    write_CELLXFS_biff8(A2, opts);
    if (b8)
      write_biff_rec(A2, 352, writebool(false));
    var a = A2.end();
    var C = buf_array();
    if (b8)
      write_biff_rec(C, 140, write_Country());
    if (b8 && opts.Strings)
      write_biff_continue(C, 252, write_SST(opts.Strings));
    write_biff_rec(
      C,
      10
      /* EOF */
    );
    var c2 = C.end();
    var B = buf_array();
    var blen = 0, j = 0;
    for (j = 0; j < wb.SheetNames.length; ++j)
      blen += (b8 ? 12 : 11) + (b8 ? 2 : 1) * wb.SheetNames[j].length;
    var start = a.length + blen + c2.length;
    for (j = 0; j < wb.SheetNames.length; ++j) {
      var _sheet = _sheets[j] || {};
      write_biff_rec(B, 133, write_BoundSheet8({ pos: start, hs: _sheet.Hidden || 0, dt: 0, name: wb.SheetNames[j] }, opts));
      start += bufs[j].length;
    }
    var b2 = B.end();
    if (blen != b2.length)
      throw new Error("BS8 " + blen + " != " + b2.length);
    var out = [];
    if (a.length)
      out.push(a);
    if (b2.length)
      out.push(b2);
    if (c2.length)
      out.push(c2);
    return bconcat(out);
  }
  function write_biff8_buf(wb, opts) {
    var o = opts || {};
    var bufs = [];
    if (wb && !wb.SSF) {
      wb.SSF = dup(table_fmt);
    }
    if (wb && wb.SSF) {
      make_ssf();
      SSF_load_table(wb.SSF);
      o.revssf = evert_num(wb.SSF);
      o.revssf[wb.SSF[65535]] = 0;
      o.ssf = wb.SSF;
    }
    o.Strings = /*::((*/
    [];
    o.Strings.Count = 0;
    o.Strings.Unique = 0;
    fix_write_opts(o);
    o.cellXfs = [];
    get_cell_style(o.cellXfs, {}, { revssf: { "General": 0 } });
    if (!wb.Props)
      wb.Props = {};
    for (var i = 0; i < wb.SheetNames.length; ++i)
      bufs[bufs.length] = write_ws_biff8(i, o, wb);
    bufs.unshift(write_biff8_global(wb, bufs, o));
    return bconcat(bufs);
  }
  function write_biff_buf(wb, opts) {
    for (var i = 0; i <= wb.SheetNames.length; ++i) {
      var ws = wb.Sheets[wb.SheetNames[i]];
      if (!ws || !ws["!ref"])
        continue;
      var range = decode_range(ws["!ref"]);
      if (range.e.c > 255) {
        if (typeof console != "undefined" && console.error)
          console.error("Worksheet '" + wb.SheetNames[i] + "' extends beyond column IV (255).  Data may be lost.");
      }
    }
    var o = opts || {};
    switch (o.biff || 2) {
      case 8:
      case 5:
        return write_biff8_buf(wb, opts);
      case 4:
      case 3:
      case 2:
        return write_biff2_buf(wb, opts);
    }
    throw new Error("invalid type " + o.bookType + " for BIFF");
  }
  function make_html_row(ws, r2, R, o) {
    var M = ws["!merges"] || [];
    var oo = [];
    for (var C = r2.s.c; C <= r2.e.c; ++C) {
      var RS = 0, CS = 0;
      for (var j = 0; j < M.length; ++j) {
        if (M[j].s.r > R || M[j].s.c > C)
          continue;
        if (M[j].e.r < R || M[j].e.c < C)
          continue;
        if (M[j].s.r < R || M[j].s.c < C) {
          RS = -1;
          break;
        }
        RS = M[j].e.r - M[j].s.r + 1;
        CS = M[j].e.c - M[j].s.c + 1;
        break;
      }
      if (RS < 0)
        continue;
      var coord = encode_cell({ r: R, c: C });
      var cell5 = o.dense ? (ws[R] || [])[C] : ws[coord];
      var w2 = cell5 && cell5.v != null && (cell5.h || escapehtml(cell5.w || (format_cell(cell5), cell5.w) || "")) || "";
      var sp = {};
      if (RS > 1)
        sp.rowspan = RS;
      if (CS > 1)
        sp.colspan = CS;
      if (o.editable)
        w2 = '<span contenteditable="true">' + w2 + "</span>";
      else if (cell5) {
        sp["data-t"] = cell5 && cell5.t || "z";
        if (cell5.v != null)
          sp["data-v"] = cell5.v;
        if (cell5.z != null)
          sp["data-z"] = cell5.z;
        if (cell5.l && (cell5.l.Target || "#").charAt(0) != "#")
          w2 = '<a href="' + cell5.l.Target + '">' + w2 + "</a>";
      }
      sp.id = (o.id || "sjs") + "-" + coord;
      oo.push(writextag("td", w2, sp));
    }
    var preamble = "<tr>";
    return preamble + oo.join("") + "</tr>";
  }
  var HTML_BEGIN = '<html><head><meta charset="utf-8"/><title>SheetJS Table Export</title></head><body>';
  var HTML_END = "</body></html>";
  function make_html_preamble(ws, R, o) {
    var out = [];
    return out.join("") + "<table" + (o && o.id ? ' id="' + o.id + '"' : "") + ">";
  }
  function sheet_to_html(ws, opts) {
    var o = opts || {};
    var header = o.header != null ? o.header : HTML_BEGIN;
    var footer = o.footer != null ? o.footer : HTML_END;
    var out = [header];
    var r2 = decode_range(ws["!ref"]);
    o.dense = Array.isArray(ws);
    out.push(make_html_preamble(ws, r2, o));
    for (var R = r2.s.r; R <= r2.e.r; ++R)
      out.push(make_html_row(ws, r2, R, o));
    out.push("</table>" + footer);
    return out.join("");
  }
  function sheet_add_dom(ws, table, _opts) {
    var opts = _opts || {};
    var or_R = 0, or_C = 0;
    if (opts.origin != null) {
      if (typeof opts.origin == "number")
        or_R = opts.origin;
      else {
        var _origin = typeof opts.origin == "string" ? decode_cell(opts.origin) : opts.origin;
        or_R = _origin.r;
        or_C = _origin.c;
      }
    }
    var rows = table.getElementsByTagName("tr");
    var sheetRows = Math.min(opts.sheetRows || 1e7, rows.length);
    var range = { s: { r: 0, c: 0 }, e: { r: or_R, c: or_C } };
    if (ws["!ref"]) {
      var _range = decode_range(ws["!ref"]);
      range.s.r = Math.min(range.s.r, _range.s.r);
      range.s.c = Math.min(range.s.c, _range.s.c);
      range.e.r = Math.max(range.e.r, _range.e.r);
      range.e.c = Math.max(range.e.c, _range.e.c);
      if (or_R == -1)
        range.e.r = or_R = _range.e.r + 1;
    }
    var merges = [], midx = 0;
    var rowinfo = ws["!rows"] || (ws["!rows"] = []);
    var _R = 0, R = 0, _C = 0, C = 0, RS = 0, CS = 0;
    if (!ws["!cols"])
      ws["!cols"] = [];
    for (; _R < rows.length && R < sheetRows; ++_R) {
      var row = rows[_R];
      if (is_dom_element_hidden(row)) {
        if (opts.display)
          continue;
        rowinfo[R] = { hidden: true };
      }
      var elts = row.children;
      for (_C = C = 0; _C < elts.length; ++_C) {
        var elt = elts[_C];
        if (opts.display && is_dom_element_hidden(elt))
          continue;
        var v2 = elt.hasAttribute("data-v") ? elt.getAttribute("data-v") : elt.hasAttribute("v") ? elt.getAttribute("v") : htmldecode(elt.innerHTML);
        var z2 = elt.getAttribute("data-z") || elt.getAttribute("z");
        for (midx = 0; midx < merges.length; ++midx) {
          var m2 = merges[midx];
          if (m2.s.c == C + or_C && m2.s.r < R + or_R && R + or_R <= m2.e.r) {
            C = m2.e.c + 1 - or_C;
            midx = -1;
          }
        }
        CS = +elt.getAttribute("colspan") || 1;
        if ((RS = +elt.getAttribute("rowspan") || 1) > 1 || CS > 1)
          merges.push({ s: { r: R + or_R, c: C + or_C }, e: { r: R + or_R + (RS || 1) - 1, c: C + or_C + (CS || 1) - 1 } });
        var o = { t: "s", v: v2 };
        var _t = elt.getAttribute("data-t") || elt.getAttribute("t") || "";
        if (v2 != null) {
          if (v2.length == 0)
            o.t = _t || "z";
          else if (opts.raw || v2.trim().length == 0 || _t == "s")
            ;
          else if (v2 === "TRUE")
            o = { t: "b", v: true };
          else if (v2 === "FALSE")
            o = { t: "b", v: false };
          else if (!isNaN(fuzzynum(v2)))
            o = { t: "n", v: fuzzynum(v2) };
          else if (!isNaN(fuzzydate(v2).getDate())) {
            o = { t: "d", v: parseDate(v2) };
            if (!opts.cellDates)
              o = { t: "n", v: datenum(o.v) };
            o.z = opts.dateNF || table_fmt[14];
          }
        }
        if (o.z === void 0 && z2 != null)
          o.z = z2;
        var l2 = "", Aelts = elt.getElementsByTagName("A");
        if (Aelts && Aelts.length) {
          for (var Aelti = 0; Aelti < Aelts.length; ++Aelti)
            if (Aelts[Aelti].hasAttribute("href")) {
              l2 = Aelts[Aelti].getAttribute("href");
              if (l2.charAt(0) != "#")
                break;
            }
        }
        if (l2 && l2.charAt(0) != "#")
          o.l = { Target: l2 };
        if (opts.dense) {
          if (!ws[R + or_R])
            ws[R + or_R] = [];
          ws[R + or_R][C + or_C] = o;
        } else
          ws[encode_cell({ c: C + or_C, r: R + or_R })] = o;
        if (range.e.c < C + or_C)
          range.e.c = C + or_C;
        C += CS;
      }
      ++R;
    }
    if (merges.length)
      ws["!merges"] = (ws["!merges"] || []).concat(merges);
    range.e.r = Math.max(range.e.r, R - 1 + or_R);
    ws["!ref"] = encode_range(range);
    if (R >= sheetRows)
      ws["!fullref"] = encode_range((range.e.r = rows.length - _R + R - 1 + or_R, range));
    return ws;
  }
  function parse_dom_table(table, _opts) {
    var opts = _opts || {};
    var ws = opts.dense ? [] : {};
    return sheet_add_dom(ws, table, _opts);
  }
  function table_to_book(table, opts) {
    return sheet_to_workbook(parse_dom_table(table, opts), opts);
  }
  function is_dom_element_hidden(element) {
    var display = "";
    var get_computed_style = get_get_computed_style_function(element);
    if (get_computed_style)
      display = get_computed_style(element).getPropertyValue("display");
    if (!display)
      display = element.style && element.style.display;
    return display === "none";
  }
  function get_get_computed_style_function(element) {
    if (element.ownerDocument.defaultView && typeof element.ownerDocument.defaultView.getComputedStyle === "function")
      return element.ownerDocument.defaultView.getComputedStyle;
    if (typeof getComputedStyle === "function")
      return getComputedStyle;
    return null;
  }
  var write_styles_ods = /* @__PURE__ */ function() {
    var master_styles = [
      "<office:master-styles>",
      '<style:master-page style:name="mp1" style:page-layout-name="mp1">',
      "<style:header/>",
      '<style:header-left style:display="false"/>',
      "<style:footer/>",
      '<style:footer-left style:display="false"/>',
      "</style:master-page>",
      "</office:master-styles>"
    ].join("");
    var payload = "<office:document-styles " + wxt_helper({
      "xmlns:office": "urn:oasis:names:tc:opendocument:xmlns:office:1.0",
      "xmlns:table": "urn:oasis:names:tc:opendocument:xmlns:table:1.0",
      "xmlns:style": "urn:oasis:names:tc:opendocument:xmlns:style:1.0",
      "xmlns:text": "urn:oasis:names:tc:opendocument:xmlns:text:1.0",
      "xmlns:draw": "urn:oasis:names:tc:opendocument:xmlns:drawing:1.0",
      "xmlns:fo": "urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0",
      "xmlns:xlink": "http://www.w3.org/1999/xlink",
      "xmlns:dc": "http://purl.org/dc/elements/1.1/",
      "xmlns:number": "urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0",
      "xmlns:svg": "urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0",
      "xmlns:of": "urn:oasis:names:tc:opendocument:xmlns:of:1.2",
      "office:version": "1.2"
    }) + ">" + master_styles + "</office:document-styles>";
    return function wso() {
      return XML_HEADER + payload;
    };
  }();
  var write_content_ods = /* @__PURE__ */ function() {
    var write_text_p = function(text) {
      return escapexml(text).replace(/  +/g, function($$) {
        return '<text:s text:c="' + $$.length + '"/>';
      }).replace(/\t/g, "<text:tab/>").replace(/\n/g, "</text:p><text:p>").replace(/^ /, "<text:s/>").replace(/ $/, "<text:s/>");
    };
    var null_cell_xml = "          <table:table-cell />\n";
    var covered_cell_xml = "          <table:covered-table-cell/>\n";
    var write_ws2 = function(ws, wb, i) {
      var o = [];
      o.push('      <table:table table:name="' + escapexml(wb.SheetNames[i]) + '" table:style-name="ta1">\n');
      var R = 0, C = 0, range = decode_range(ws["!ref"] || "A1");
      var marr = ws["!merges"] || [], mi = 0;
      var dense = Array.isArray(ws);
      if (ws["!cols"]) {
        for (C = 0; C <= range.e.c; ++C)
          o.push("        <table:table-column" + (ws["!cols"][C] ? ' table:style-name="co' + ws["!cols"][C].ods + '"' : "") + "></table:table-column>\n");
      }
      var H = "", ROWS = ws["!rows"] || [];
      for (R = 0; R < range.s.r; ++R) {
        H = ROWS[R] ? ' table:style-name="ro' + ROWS[R].ods + '"' : "";
        o.push("        <table:table-row" + H + "></table:table-row>\n");
      }
      for (; R <= range.e.r; ++R) {
        H = ROWS[R] ? ' table:style-name="ro' + ROWS[R].ods + '"' : "";
        o.push("        <table:table-row" + H + ">\n");
        for (C = 0; C < range.s.c; ++C)
          o.push(null_cell_xml);
        for (; C <= range.e.c; ++C) {
          var skip = false, ct = {}, textp = "";
          for (mi = 0; mi != marr.length; ++mi) {
            if (marr[mi].s.c > C)
              continue;
            if (marr[mi].s.r > R)
              continue;
            if (marr[mi].e.c < C)
              continue;
            if (marr[mi].e.r < R)
              continue;
            if (marr[mi].s.c != C || marr[mi].s.r != R)
              skip = true;
            ct["table:number-columns-spanned"] = marr[mi].e.c - marr[mi].s.c + 1;
            ct["table:number-rows-spanned"] = marr[mi].e.r - marr[mi].s.r + 1;
            break;
          }
          if (skip) {
            o.push(covered_cell_xml);
            continue;
          }
          var ref = encode_cell({ r: R, c: C }), cell5 = dense ? (ws[R] || [])[C] : ws[ref];
          if (cell5 && cell5.f) {
            ct["table:formula"] = escapexml(csf_to_ods_formula(cell5.f));
            if (cell5.F) {
              if (cell5.F.slice(0, ref.length) == ref) {
                var _Fref = decode_range(cell5.F);
                ct["table:number-matrix-columns-spanned"] = _Fref.e.c - _Fref.s.c + 1;
                ct["table:number-matrix-rows-spanned"] = _Fref.e.r - _Fref.s.r + 1;
              }
            }
          }
          if (!cell5) {
            o.push(null_cell_xml);
            continue;
          }
          switch (cell5.t) {
            case "b":
              textp = cell5.v ? "TRUE" : "FALSE";
              ct["office:value-type"] = "boolean";
              ct["office:boolean-value"] = cell5.v ? "true" : "false";
              break;
            case "n":
              textp = cell5.w || String(cell5.v || 0);
              ct["office:value-type"] = "float";
              ct["office:value"] = cell5.v || 0;
              break;
            case "s":
            case "str":
              textp = cell5.v == null ? "" : cell5.v;
              ct["office:value-type"] = "string";
              break;
            case "d":
              textp = cell5.w || parseDate(cell5.v).toISOString();
              ct["office:value-type"] = "date";
              ct["office:date-value"] = parseDate(cell5.v).toISOString();
              ct["table:style-name"] = "ce1";
              break;
            default:
              o.push(null_cell_xml);
              continue;
          }
          var text_p = write_text_p(textp);
          if (cell5.l && cell5.l.Target) {
            var _tgt = cell5.l.Target;
            _tgt = _tgt.charAt(0) == "#" ? "#" + csf_to_ods_3D(_tgt.slice(1)) : _tgt;
            if (_tgt.charAt(0) != "#" && !_tgt.match(/^\w+:/))
              _tgt = "../" + _tgt;
            text_p = writextag("text:a", text_p, { "xlink:href": _tgt.replace(/&/g, "&amp;") });
          }
          o.push("          " + writextag("table:table-cell", writextag("text:p", text_p, {}), ct) + "\n");
        }
        o.push("        </table:table-row>\n");
      }
      o.push("      </table:table>\n");
      return o.join("");
    };
    var write_automatic_styles_ods = function(o, wb) {
      o.push(" <office:automatic-styles>\n");
      o.push('  <number:date-style style:name="N37" number:automatic-order="true">\n');
      o.push('   <number:month number:style="long"/>\n');
      o.push("   <number:text>/</number:text>\n");
      o.push('   <number:day number:style="long"/>\n');
      o.push("   <number:text>/</number:text>\n");
      o.push("   <number:year/>\n");
      o.push("  </number:date-style>\n");
      var cidx = 0;
      wb.SheetNames.map(function(n2) {
        return wb.Sheets[n2];
      }).forEach(function(ws) {
        if (!ws)
          return;
        if (ws["!cols"]) {
          for (var C = 0; C < ws["!cols"].length; ++C)
            if (ws["!cols"][C]) {
              var colobj = ws["!cols"][C];
              if (colobj.width == null && colobj.wpx == null && colobj.wch == null)
                continue;
              process_col(colobj);
              colobj.ods = cidx;
              var w2 = ws["!cols"][C].wpx + "px";
              o.push('  <style:style style:name="co' + cidx + '" style:family="table-column">\n');
              o.push('   <style:table-column-properties fo:break-before="auto" style:column-width="' + w2 + '"/>\n');
              o.push("  </style:style>\n");
              ++cidx;
            }
        }
      });
      var ridx = 0;
      wb.SheetNames.map(function(n2) {
        return wb.Sheets[n2];
      }).forEach(function(ws) {
        if (!ws)
          return;
        if (ws["!rows"]) {
          for (var R = 0; R < ws["!rows"].length; ++R)
            if (ws["!rows"][R]) {
              ws["!rows"][R].ods = ridx;
              var h2 = ws["!rows"][R].hpx + "px";
              o.push('  <style:style style:name="ro' + ridx + '" style:family="table-row">\n');
              o.push('   <style:table-row-properties fo:break-before="auto" style:row-height="' + h2 + '"/>\n');
              o.push("  </style:style>\n");
              ++ridx;
            }
        }
      });
      o.push('  <style:style style:name="ta1" style:family="table" style:master-page-name="mp1">\n');
      o.push('   <style:table-properties table:display="true" style:writing-mode="lr-tb"/>\n');
      o.push("  </style:style>\n");
      o.push('  <style:style style:name="ce1" style:family="table-cell" style:parent-style-name="Default" style:data-style-name="N37"/>\n');
      o.push(" </office:automatic-styles>\n");
    };
    return function wcx(wb, opts) {
      var o = [XML_HEADER];
      var attr = wxt_helper({
        "xmlns:office": "urn:oasis:names:tc:opendocument:xmlns:office:1.0",
        "xmlns:table": "urn:oasis:names:tc:opendocument:xmlns:table:1.0",
        "xmlns:style": "urn:oasis:names:tc:opendocument:xmlns:style:1.0",
        "xmlns:text": "urn:oasis:names:tc:opendocument:xmlns:text:1.0",
        "xmlns:draw": "urn:oasis:names:tc:opendocument:xmlns:drawing:1.0",
        "xmlns:fo": "urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0",
        "xmlns:xlink": "http://www.w3.org/1999/xlink",
        "xmlns:dc": "http://purl.org/dc/elements/1.1/",
        "xmlns:meta": "urn:oasis:names:tc:opendocument:xmlns:meta:1.0",
        "xmlns:number": "urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0",
        "xmlns:presentation": "urn:oasis:names:tc:opendocument:xmlns:presentation:1.0",
        "xmlns:svg": "urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0",
        "xmlns:chart": "urn:oasis:names:tc:opendocument:xmlns:chart:1.0",
        "xmlns:dr3d": "urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0",
        "xmlns:math": "http://www.w3.org/1998/Math/MathML",
        "xmlns:form": "urn:oasis:names:tc:opendocument:xmlns:form:1.0",
        "xmlns:script": "urn:oasis:names:tc:opendocument:xmlns:script:1.0",
        "xmlns:ooo": "http://openoffice.org/2004/office",
        "xmlns:ooow": "http://openoffice.org/2004/writer",
        "xmlns:oooc": "http://openoffice.org/2004/calc",
        "xmlns:dom": "http://www.w3.org/2001/xml-events",
        "xmlns:xforms": "http://www.w3.org/2002/xforms",
        "xmlns:xsd": "http://www.w3.org/2001/XMLSchema",
        "xmlns:xsi": "http://www.w3.org/2001/XMLSchema-instance",
        "xmlns:sheet": "urn:oasis:names:tc:opendocument:sh33tjs:1.0",
        "xmlns:rpt": "http://openoffice.org/2005/report",
        "xmlns:of": "urn:oasis:names:tc:opendocument:xmlns:of:1.2",
        "xmlns:xhtml": "http://www.w3.org/1999/xhtml",
        "xmlns:grddl": "http://www.w3.org/2003/g/data-view#",
        "xmlns:tableooo": "http://openoffice.org/2009/table",
        "xmlns:drawooo": "http://openoffice.org/2010/draw",
        "xmlns:calcext": "urn:org:documentfoundation:names:experimental:calc:xmlns:calcext:1.0",
        "xmlns:loext": "urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0",
        "xmlns:field": "urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0",
        "xmlns:formx": "urn:openoffice:names:experimental:ooxml-odf-interop:xmlns:form:1.0",
        "xmlns:css3t": "http://www.w3.org/TR/css3-text/",
        "office:version": "1.2"
      });
      var fods = wxt_helper({
        "xmlns:config": "urn:oasis:names:tc:opendocument:xmlns:config:1.0",
        "office:mimetype": "application/vnd.oasis.opendocument.spreadsheet"
      });
      if (opts.bookType == "fods") {
        o.push("<office:document" + attr + fods + ">\n");
        o.push(write_meta_ods().replace(/office:document-meta/g, "office:meta"));
      } else
        o.push("<office:document-content" + attr + ">\n");
      write_automatic_styles_ods(o, wb);
      o.push("  <office:body>\n");
      o.push("    <office:spreadsheet>\n");
      for (var i = 0; i != wb.SheetNames.length; ++i)
        o.push(write_ws2(wb.Sheets[wb.SheetNames[i]], wb, i));
      o.push("    </office:spreadsheet>\n");
      o.push("  </office:body>\n");
      if (opts.bookType == "fods")
        o.push("</office:document>");
      else
        o.push("</office:document-content>");
      return o.join("");
    };
  }();
  function write_ods(wb, opts) {
    if (opts.bookType == "fods")
      return write_content_ods(wb, opts);
    var zip = zip_new();
    var f2 = "";
    var manifest = [];
    var rdf = [];
    f2 = "mimetype";
    zip_add_file(zip, f2, "application/vnd.oasis.opendocument.spreadsheet");
    f2 = "content.xml";
    zip_add_file(zip, f2, write_content_ods(wb, opts));
    manifest.push([f2, "text/xml"]);
    rdf.push([f2, "ContentFile"]);
    f2 = "styles.xml";
    zip_add_file(zip, f2, write_styles_ods(wb, opts));
    manifest.push([f2, "text/xml"]);
    rdf.push([f2, "StylesFile"]);
    f2 = "meta.xml";
    zip_add_file(zip, f2, XML_HEADER + write_meta_ods(
      /*::wb, opts*/
    ));
    manifest.push([f2, "text/xml"]);
    rdf.push([f2, "MetadataFile"]);
    f2 = "manifest.rdf";
    zip_add_file(zip, f2, write_rdf(
      rdf
      /*, opts*/
    ));
    manifest.push([f2, "application/rdf+xml"]);
    f2 = "META-INF/manifest.xml";
    zip_add_file(zip, f2, write_manifest(
      manifest
      /*, opts*/
    ));
    return zip;
  }
  /*! sheetjs (C) 2013-present SheetJS -- http://sheetjs.com */
  function u8_to_dataview(array) {
    return new DataView(array.buffer, array.byteOffset, array.byteLength);
  }
  function stru8(str) {
    return typeof TextEncoder != "undefined" ? new TextEncoder().encode(str) : s2a(utf8write(str));
  }
  function u8contains(body, search) {
    outer:
      for (var L = 0; L <= body.length - search.length; ++L) {
        for (var j = 0; j < search.length; ++j)
          if (body[L + j] != search[j])
            continue outer;
        return true;
      }
    return false;
  }
  function u8concat(u8a) {
    var len = u8a.reduce(function(acc, x2) {
      return acc + x2.length;
    }, 0);
    var out = new Uint8Array(len);
    var off2 = 0;
    u8a.forEach(function(u8) {
      out.set(u8, off2);
      off2 += u8.length;
    });
    return out;
  }
  function writeDecimal128LE(buf, offset, value) {
    var exp = Math.floor(value == 0 ? 0 : Math.LOG10E * Math.log(Math.abs(value))) + 6176 - 20;
    var mantissa = value / Math.pow(10, exp - 6176);
    buf[offset + 15] |= exp >> 7;
    buf[offset + 14] |= (exp & 127) << 1;
    for (var i = 0; mantissa >= 1; ++i, mantissa /= 256)
      buf[offset + i] = mantissa & 255;
    buf[offset + 15] |= value >= 0 ? 0 : 128;
  }
  function parse_varint49(buf, ptr) {
    var l2 = ptr ? ptr[0] : 0;
    var usz = buf[l2] & 127;
    varint:
      if (buf[l2++] >= 128) {
        usz |= (buf[l2] & 127) << 7;
        if (buf[l2++] < 128)
          break varint;
        usz |= (buf[l2] & 127) << 14;
        if (buf[l2++] < 128)
          break varint;
        usz |= (buf[l2] & 127) << 21;
        if (buf[l2++] < 128)
          break varint;
        usz += (buf[l2] & 127) * Math.pow(2, 28);
        ++l2;
        if (buf[l2++] < 128)
          break varint;
        usz += (buf[l2] & 127) * Math.pow(2, 35);
        ++l2;
        if (buf[l2++] < 128)
          break varint;
        usz += (buf[l2] & 127) * Math.pow(2, 42);
        ++l2;
        if (buf[l2++] < 128)
          break varint;
      }
    if (ptr)
      ptr[0] = l2;
    return usz;
  }
  function write_varint49(v2) {
    var usz = new Uint8Array(7);
    usz[0] = v2 & 127;
    var L = 1;
    sz:
      if (v2 > 127) {
        usz[L - 1] |= 128;
        usz[L] = v2 >> 7 & 127;
        ++L;
        if (v2 <= 16383)
          break sz;
        usz[L - 1] |= 128;
        usz[L] = v2 >> 14 & 127;
        ++L;
        if (v2 <= 2097151)
          break sz;
        usz[L - 1] |= 128;
        usz[L] = v2 >> 21 & 127;
        ++L;
        if (v2 <= 268435455)
          break sz;
        usz[L - 1] |= 128;
        usz[L] = v2 / 256 >>> 21 & 127;
        ++L;
        if (v2 <= 34359738367)
          break sz;
        usz[L - 1] |= 128;
        usz[L] = v2 / 65536 >>> 21 & 127;
        ++L;
        if (v2 <= 4398046511103)
          break sz;
        usz[L - 1] |= 128;
        usz[L] = v2 / 16777216 >>> 21 & 127;
        ++L;
      }
    return usz.slice(0, L);
  }
  function varint_to_i32(buf) {
    var l2 = 0, i32 = buf[l2] & 127;
    varint:
      if (buf[l2++] >= 128) {
        i32 |= (buf[l2] & 127) << 7;
        if (buf[l2++] < 128)
          break varint;
        i32 |= (buf[l2] & 127) << 14;
        if (buf[l2++] < 128)
          break varint;
        i32 |= (buf[l2] & 127) << 21;
        if (buf[l2++] < 128)
          break varint;
        i32 |= (buf[l2] & 127) << 28;
      }
    return i32;
  }
  function parse_shallow(buf) {
    var out = [], ptr = [0];
    while (ptr[0] < buf.length) {
      var off2 = ptr[0];
      var num = parse_varint49(buf, ptr);
      var type2 = num & 7;
      num = Math.floor(num / 8);
      var len = 0;
      var res;
      if (num == 0)
        break;
      switch (type2) {
        case 0:
          {
            var l2 = ptr[0];
            while (buf[ptr[0]++] >= 128)
              ;
            res = buf.slice(l2, ptr[0]);
          }
          break;
        case 5:
          len = 4;
          res = buf.slice(ptr[0], ptr[0] + len);
          ptr[0] += len;
          break;
        case 1:
          len = 8;
          res = buf.slice(ptr[0], ptr[0] + len);
          ptr[0] += len;
          break;
        case 2:
          len = parse_varint49(buf, ptr);
          res = buf.slice(ptr[0], ptr[0] + len);
          ptr[0] += len;
          break;
        case 3:
        case 4:
        default:
          throw new Error("PB Type ".concat(type2, " for Field ").concat(num, " at offset ").concat(off2));
      }
      var v2 = { data: res, type: type2 };
      if (out[num] == null)
        out[num] = [v2];
      else
        out[num].push(v2);
    }
    return out;
  }
  function write_shallow(proto) {
    var out = [];
    proto.forEach(function(field, idx) {
      field.forEach(function(item) {
        if (!item.data)
          return;
        out.push(write_varint49(idx * 8 + item.type));
        if (item.type == 2)
          out.push(write_varint49(item.data.length));
        out.push(item.data);
      });
    });
    return u8concat(out);
  }
  function parse_iwa_file(buf) {
    var _a;
    var out = [], ptr = [0];
    while (ptr[0] < buf.length) {
      var len = parse_varint49(buf, ptr);
      var ai = parse_shallow(buf.slice(ptr[0], ptr[0] + len));
      ptr[0] += len;
      var res = {
        id: varint_to_i32(ai[1][0].data),
        messages: []
      };
      ai[2].forEach(function(b2) {
        var mi = parse_shallow(b2.data);
        var fl = varint_to_i32(mi[3][0].data);
        res.messages.push({
          meta: mi,
          data: buf.slice(ptr[0], ptr[0] + fl)
        });
        ptr[0] += fl;
      });
      if ((_a = ai[3]) == null ? void 0 : _a[0])
        res.merge = varint_to_i32(ai[3][0].data) >>> 0 > 0;
      out.push(res);
    }
    return out;
  }
  function write_iwa_file(ias) {
    var bufs = [];
    ias.forEach(function(ia) {
      var ai = [];
      ai[1] = [{ data: write_varint49(ia.id), type: 0 }];
      ai[2] = [];
      if (ia.merge != null)
        ai[3] = [{ data: write_varint49(+!!ia.merge), type: 0 }];
      var midata = [];
      ia.messages.forEach(function(mi) {
        midata.push(mi.data);
        mi.meta[3] = [{ type: 0, data: write_varint49(mi.data.length) }];
        ai[2].push({ data: write_shallow(mi.meta), type: 2 });
      });
      var aipayload = write_shallow(ai);
      bufs.push(write_varint49(aipayload.length));
      bufs.push(aipayload);
      midata.forEach(function(mid) {
        return bufs.push(mid);
      });
    });
    return u8concat(bufs);
  }
  function parse_snappy_chunk(type2, buf) {
    if (type2 != 0)
      throw new Error("Unexpected Snappy chunk type ".concat(type2));
    var ptr = [0];
    var usz = parse_varint49(buf, ptr);
    var chunks = [];
    while (ptr[0] < buf.length) {
      var tag = buf[ptr[0]] & 3;
      if (tag == 0) {
        var len = buf[ptr[0]++] >> 2;
        if (len < 60)
          ++len;
        else {
          var c2 = len - 59;
          len = buf[ptr[0]];
          if (c2 > 1)
            len |= buf[ptr[0] + 1] << 8;
          if (c2 > 2)
            len |= buf[ptr[0] + 2] << 16;
          if (c2 > 3)
            len |= buf[ptr[0] + 3] << 24;
          len >>>= 0;
          len++;
          ptr[0] += c2;
        }
        chunks.push(buf.slice(ptr[0], ptr[0] + len));
        ptr[0] += len;
        continue;
      } else {
        var offset = 0, length2 = 0;
        if (tag == 1) {
          length2 = (buf[ptr[0]] >> 2 & 7) + 4;
          offset = (buf[ptr[0]++] & 224) << 3;
          offset |= buf[ptr[0]++];
        } else {
          length2 = (buf[ptr[0]++] >> 2) + 1;
          if (tag == 2) {
            offset = buf[ptr[0]] | buf[ptr[0] + 1] << 8;
            ptr[0] += 2;
          } else {
            offset = (buf[ptr[0]] | buf[ptr[0] + 1] << 8 | buf[ptr[0] + 2] << 16 | buf[ptr[0] + 3] << 24) >>> 0;
            ptr[0] += 4;
          }
        }
        chunks = [u8concat(chunks)];
        if (offset == 0)
          throw new Error("Invalid offset 0");
        if (offset > chunks[0].length)
          throw new Error("Invalid offset beyond length");
        if (length2 >= offset) {
          chunks.push(chunks[0].slice(-offset));
          length2 -= offset;
          while (length2 >= chunks[chunks.length - 1].length) {
            chunks.push(chunks[chunks.length - 1]);
            length2 -= chunks[chunks.length - 1].length;
          }
        }
        chunks.push(chunks[0].slice(-offset, -offset + length2));
      }
    }
    var o = u8concat(chunks);
    if (o.length != usz)
      throw new Error("Unexpected length: ".concat(o.length, " != ").concat(usz));
    return o;
  }
  function decompress_iwa_file(buf) {
    var out = [];
    var l2 = 0;
    while (l2 < buf.length) {
      var t2 = buf[l2++];
      var len = buf[l2] | buf[l2 + 1] << 8 | buf[l2 + 2] << 16;
      l2 += 3;
      out.push(parse_snappy_chunk(t2, buf.slice(l2, l2 + len)));
      l2 += len;
    }
    if (l2 !== buf.length)
      throw new Error("data is not a valid framed stream!");
    return u8concat(out);
  }
  function compress_iwa_file(buf) {
    var out = [];
    var l2 = 0;
    while (l2 < buf.length) {
      var c2 = Math.min(buf.length - l2, 268435455);
      var frame = new Uint8Array(4);
      out.push(frame);
      var usz = write_varint49(c2);
      var L = usz.length;
      out.push(usz);
      if (c2 <= 60) {
        L++;
        out.push(new Uint8Array([c2 - 1 << 2]));
      } else if (c2 <= 256) {
        L += 2;
        out.push(new Uint8Array([240, c2 - 1 & 255]));
      } else if (c2 <= 65536) {
        L += 3;
        out.push(new Uint8Array([244, c2 - 1 & 255, c2 - 1 >> 8 & 255]));
      } else if (c2 <= 16777216) {
        L += 4;
        out.push(new Uint8Array([248, c2 - 1 & 255, c2 - 1 >> 8 & 255, c2 - 1 >> 16 & 255]));
      } else if (c2 <= 4294967296) {
        L += 5;
        out.push(new Uint8Array([252, c2 - 1 & 255, c2 - 1 >> 8 & 255, c2 - 1 >> 16 & 255, c2 - 1 >>> 24 & 255]));
      }
      out.push(buf.slice(l2, l2 + c2));
      L += c2;
      frame[0] = 0;
      frame[1] = L & 255;
      frame[2] = L >> 8 & 255;
      frame[3] = L >> 16 & 255;
      l2 += c2;
    }
    return u8concat(out);
  }
  function write_new_storage(cell5, sst) {
    var out = new Uint8Array(32), dv = u8_to_dataview(out), l2 = 12, flags = 0;
    out[0] = 5;
    switch (cell5.t) {
      case "n":
        out[1] = 2;
        writeDecimal128LE(out, l2, cell5.v);
        flags |= 1;
        l2 += 16;
        break;
      case "b":
        out[1] = 6;
        dv.setFloat64(l2, cell5.v ? 1 : 0, true);
        flags |= 2;
        l2 += 8;
        break;
      case "s":
        if (sst.indexOf(cell5.v) == -1)
          throw new Error("Value ".concat(cell5.v, " missing from SST!"));
        out[1] = 3;
        dv.setUint32(l2, sst.indexOf(cell5.v), true);
        flags |= 8;
        l2 += 4;
        break;
      default:
        throw "unsupported cell type " + cell5.t;
    }
    dv.setUint32(8, flags, true);
    return out.slice(0, l2);
  }
  function write_old_storage(cell5, sst) {
    var out = new Uint8Array(32), dv = u8_to_dataview(out), l2 = 12, flags = 0;
    out[0] = 3;
    switch (cell5.t) {
      case "n":
        out[2] = 2;
        dv.setFloat64(l2, cell5.v, true);
        flags |= 32;
        l2 += 8;
        break;
      case "b":
        out[2] = 6;
        dv.setFloat64(l2, cell5.v ? 1 : 0, true);
        flags |= 32;
        l2 += 8;
        break;
      case "s":
        if (sst.indexOf(cell5.v) == -1)
          throw new Error("Value ".concat(cell5.v, " missing from SST!"));
        out[2] = 3;
        dv.setUint32(l2, sst.indexOf(cell5.v), true);
        flags |= 16;
        l2 += 4;
        break;
      default:
        throw "unsupported cell type " + cell5.t;
    }
    dv.setUint32(4, flags, true);
    return out.slice(0, l2);
  }
  function parse_TSP_Reference(buf) {
    var pb = parse_shallow(buf);
    return parse_varint49(pb[1][0].data);
  }
  function write_tile_row(tri, data, SST) {
    var _a, _b, _c, _d;
    if (!((_a = tri[6]) == null ? void 0 : _a[0]) || !((_b = tri[7]) == null ? void 0 : _b[0]))
      throw "Mutation only works on post-BNC storages!";
    var wide_offsets = ((_d = (_c = tri[8]) == null ? void 0 : _c[0]) == null ? void 0 : _d.data) && varint_to_i32(tri[8][0].data) > 0 || false;
    if (wide_offsets)
      throw "Math only works with normal offsets";
    var cnt = 0;
    var dv = u8_to_dataview(tri[7][0].data), last_offset = 0, cell_storage = [];
    var _dv = u8_to_dataview(tri[4][0].data), _last_offset = 0, _cell_storage = [];
    for (var C = 0; C < data.length; ++C) {
      if (data[C] == null) {
        dv.setUint16(C * 2, 65535, true);
        _dv.setUint16(C * 2, 65535);
        continue;
      }
      dv.setUint16(C * 2, last_offset, true);
      _dv.setUint16(C * 2, _last_offset, true);
      var celload, _celload;
      switch (typeof data[C]) {
        case "string":
          celload = write_new_storage({ t: "s", v: data[C] }, SST);
          _celload = write_old_storage({ t: "s", v: data[C] }, SST);
          break;
        case "number":
          celload = write_new_storage({ t: "n", v: data[C] }, SST);
          _celload = write_old_storage({ t: "n", v: data[C] }, SST);
          break;
        case "boolean":
          celload = write_new_storage({ t: "b", v: data[C] }, SST);
          _celload = write_old_storage({ t: "b", v: data[C] }, SST);
          break;
        default:
          throw new Error("Unsupported value " + data[C]);
      }
      cell_storage.push(celload);
      last_offset += celload.length;
      _cell_storage.push(_celload);
      _last_offset += _celload.length;
      ++cnt;
    }
    tri[2][0].data = write_varint49(cnt);
    for (; C < tri[7][0].data.length / 2; ++C) {
      dv.setUint16(C * 2, 65535, true);
      _dv.setUint16(C * 2, 65535, true);
    }
    tri[6][0].data = u8concat(cell_storage);
    tri[3][0].data = u8concat(_cell_storage);
    return cnt;
  }
  function write_numbers_iwa(wb, opts) {
    if (!opts || !opts.numbers)
      throw new Error("Must pass a `numbers` option -- check the README");
    var ws = wb.Sheets[wb.SheetNames[0]];
    if (wb.SheetNames.length > 1)
      console.error("The Numbers writer currently writes only the first table");
    var range = decode_range(ws["!ref"]);
    range.s.r = range.s.c = 0;
    var trunc = false;
    if (range.e.c > 9) {
      trunc = true;
      range.e.c = 9;
    }
    if (range.e.r > 49) {
      trunc = true;
      range.e.r = 49;
    }
    if (trunc)
      console.error("The Numbers writer is currently limited to ".concat(encode_range(range)));
    var data = sheet_to_json(ws, { range, header: 1 });
    var SST = ["~Sh33tJ5~"];
    data.forEach(function(row) {
      return row.forEach(function(cell5) {
        if (typeof cell5 == "string")
          SST.push(cell5);
      });
    });
    var dependents = {};
    var indices = [];
    var cfb = CFB.read(opts.numbers, { type: "base64" });
    cfb.FileIndex.map(function(fi, idx) {
      return [fi, cfb.FullPaths[idx]];
    }).forEach(function(row) {
      var fi = row[0], fp = row[1];
      if (fi.type != 2)
        return;
      if (!fi.name.match(/\.iwa/))
        return;
      var old_content = fi.content;
      var raw1 = decompress_iwa_file(old_content);
      var x22 = parse_iwa_file(raw1);
      x22.forEach(function(packet2) {
        indices.push(packet2.id);
        dependents[packet2.id] = { deps: [], location: fp, type: varint_to_i32(packet2.messages[0].meta[1][0].data) };
      });
    });
    indices.sort(function(x22, y22) {
      return x22 - y22;
    });
    var indices_varint = indices.filter(function(x22) {
      return x22 > 1;
    }).map(function(x22) {
      return [x22, write_varint49(x22)];
    });
    cfb.FileIndex.map(function(fi, idx) {
      return [fi, cfb.FullPaths[idx]];
    }).forEach(function(row) {
      var fi = row[0];
      row[1];
      if (!fi.name.match(/\.iwa/))
        return;
      var x22 = parse_iwa_file(decompress_iwa_file(fi.content));
      x22.forEach(function(ia) {
        ia.messages.forEach(function(m2) {
          indices_varint.forEach(function(ivi) {
            if (ia.messages.some(function(mess) {
              return varint_to_i32(mess.meta[1][0].data) != 11006 && u8contains(mess.data, ivi[1]);
            })) {
              dependents[ivi[0]].deps.push(ia.id);
            }
          });
        });
      });
    });
    var entry = CFB.find(cfb, dependents[1].location);
    var x2 = parse_iwa_file(decompress_iwa_file(entry.content));
    var docroot;
    for (var xi = 0; xi < x2.length; ++xi) {
      var packet = x2[xi];
      if (packet.id == 1)
        docroot = packet;
    }
    var sheetrootref = parse_TSP_Reference(parse_shallow(docroot.messages[0].data)[1][0].data);
    entry = CFB.find(cfb, dependents[sheetrootref].location);
    x2 = parse_iwa_file(decompress_iwa_file(entry.content));
    for (xi = 0; xi < x2.length; ++xi) {
      packet = x2[xi];
      if (packet.id == sheetrootref)
        docroot = packet;
    }
    sheetrootref = parse_TSP_Reference(parse_shallow(docroot.messages[0].data)[2][0].data);
    entry = CFB.find(cfb, dependents[sheetrootref].location);
    x2 = parse_iwa_file(decompress_iwa_file(entry.content));
    for (xi = 0; xi < x2.length; ++xi) {
      packet = x2[xi];
      if (packet.id == sheetrootref)
        docroot = packet;
    }
    sheetrootref = parse_TSP_Reference(parse_shallow(docroot.messages[0].data)[2][0].data);
    entry = CFB.find(cfb, dependents[sheetrootref].location);
    x2 = parse_iwa_file(decompress_iwa_file(entry.content));
    for (xi = 0; xi < x2.length; ++xi) {
      packet = x2[xi];
      if (packet.id == sheetrootref)
        docroot = packet;
    }
    var pb = parse_shallow(docroot.messages[0].data);
    {
      pb[6][0].data = write_varint49(range.e.r + 1);
      pb[7][0].data = write_varint49(range.e.c + 1);
      var cruidsref = parse_TSP_Reference(pb[46][0].data);
      var oldbucket = CFB.find(cfb, dependents[cruidsref].location);
      var _x = parse_iwa_file(decompress_iwa_file(oldbucket.content));
      {
        for (var j = 0; j < _x.length; ++j) {
          if (_x[j].id == cruidsref)
            break;
        }
        if (_x[j].id != cruidsref)
          throw "Bad ColumnRowUIDMapArchive";
        var cruids = parse_shallow(_x[j].messages[0].data);
        cruids[1] = [];
        cruids[2] = [], cruids[3] = [];
        for (var C = 0; C <= range.e.c; ++C) {
          var uuid2 = [];
          uuid2[1] = uuid2[2] = [{ type: 0, data: write_varint49(C + 420690) }];
          cruids[1].push({ type: 2, data: write_shallow(uuid2) });
          cruids[2].push({ type: 0, data: write_varint49(C) });
          cruids[3].push({ type: 0, data: write_varint49(C) });
        }
        cruids[4] = [];
        cruids[5] = [], cruids[6] = [];
        for (var R = 0; R <= range.e.r; ++R) {
          uuid2 = [];
          uuid2[1] = uuid2[2] = [{ type: 0, data: write_varint49(R + 726270) }];
          cruids[4].push({ type: 2, data: write_shallow(uuid2) });
          cruids[5].push({ type: 0, data: write_varint49(R) });
          cruids[6].push({ type: 0, data: write_varint49(R) });
        }
        _x[j].messages[0].data = write_shallow(cruids);
      }
      oldbucket.content = compress_iwa_file(write_iwa_file(_x));
      oldbucket.size = oldbucket.content.length;
      delete pb[46];
      var store2 = parse_shallow(pb[4][0].data);
      {
        store2[7][0].data = write_varint49(range.e.r + 1);
        var row_headers = parse_shallow(store2[1][0].data);
        var row_header_ref = parse_TSP_Reference(row_headers[2][0].data);
        oldbucket = CFB.find(cfb, dependents[row_header_ref].location);
        _x = parse_iwa_file(decompress_iwa_file(oldbucket.content));
        {
          if (_x[0].id != row_header_ref)
            throw "Bad HeaderStorageBucket";
          var base_bucket = parse_shallow(_x[0].messages[0].data);
          for (R = 0; R < data.length; ++R) {
            var _bucket = parse_shallow(base_bucket[2][0].data);
            _bucket[1][0].data = write_varint49(R);
            _bucket[4][0].data = write_varint49(data[R].length);
            base_bucket[2][R] = { type: base_bucket[2][0].type, data: write_shallow(_bucket) };
          }
          _x[0].messages[0].data = write_shallow(base_bucket);
        }
        oldbucket.content = compress_iwa_file(write_iwa_file(_x));
        oldbucket.size = oldbucket.content.length;
        var col_header_ref = parse_TSP_Reference(store2[2][0].data);
        oldbucket = CFB.find(cfb, dependents[col_header_ref].location);
        _x = parse_iwa_file(decompress_iwa_file(oldbucket.content));
        {
          if (_x[0].id != col_header_ref)
            throw "Bad HeaderStorageBucket";
          base_bucket = parse_shallow(_x[0].messages[0].data);
          for (C = 0; C <= range.e.c; ++C) {
            _bucket = parse_shallow(base_bucket[2][0].data);
            _bucket[1][0].data = write_varint49(C);
            _bucket[4][0].data = write_varint49(range.e.r + 1);
            base_bucket[2][C] = { type: base_bucket[2][0].type, data: write_shallow(_bucket) };
          }
          _x[0].messages[0].data = write_shallow(base_bucket);
        }
        oldbucket.content = compress_iwa_file(write_iwa_file(_x));
        oldbucket.size = oldbucket.content.length;
        var sstref = parse_TSP_Reference(store2[4][0].data);
        (function() {
          var sentry = CFB.find(cfb, dependents[sstref].location);
          var sx = parse_iwa_file(decompress_iwa_file(sentry.content));
          var sstroot;
          for (var sxi = 0; sxi < sx.length; ++sxi) {
            var packet2 = sx[sxi];
            if (packet2.id == sstref)
              sstroot = packet2;
          }
          var sstdata = parse_shallow(sstroot.messages[0].data);
          {
            sstdata[3] = [];
            var newsst = [];
            SST.forEach(function(str, i) {
              newsst[1] = [{ type: 0, data: write_varint49(i) }];
              newsst[2] = [{ type: 0, data: write_varint49(1) }];
              newsst[3] = [{ type: 2, data: stru8(str) }];
              sstdata[3].push({ type: 2, data: write_shallow(newsst) });
            });
          }
          sstroot.messages[0].data = write_shallow(sstdata);
          var sy = write_iwa_file(sx);
          var raw32 = compress_iwa_file(sy);
          sentry.content = raw32;
          sentry.size = sentry.content.length;
        })();
        var tile = parse_shallow(store2[3][0].data);
        {
          var t2 = tile[1][0];
          delete tile[2];
          var tl = parse_shallow(t2.data);
          {
            var tileref = parse_TSP_Reference(tl[2][0].data);
            (function() {
              var tentry = CFB.find(cfb, dependents[tileref].location);
              var tx = parse_iwa_file(decompress_iwa_file(tentry.content));
              var tileroot;
              for (var sxi = 0; sxi < tx.length; ++sxi) {
                var packet2 = tx[sxi];
                if (packet2.id == tileref)
                  tileroot = packet2;
              }
              var tiledata = parse_shallow(tileroot.messages[0].data);
              {
                delete tiledata[6];
                delete tile[7];
                var rowload = new Uint8Array(tiledata[5][0].data);
                tiledata[5] = [];
                var cnt = 0;
                for (var R2 = 0; R2 <= range.e.r; ++R2) {
                  var tilerow = parse_shallow(rowload);
                  cnt += write_tile_row(tilerow, data[R2], SST);
                  tilerow[1][0].data = write_varint49(R2);
                  tiledata[5].push({ data: write_shallow(tilerow), type: 2 });
                }
                tiledata[1] = [{ type: 0, data: write_varint49(range.e.c + 1) }];
                tiledata[2] = [{ type: 0, data: write_varint49(range.e.r + 1) }];
                tiledata[3] = [{ type: 0, data: write_varint49(cnt) }];
                tiledata[4] = [{ type: 0, data: write_varint49(range.e.r + 1) }];
              }
              tileroot.messages[0].data = write_shallow(tiledata);
              var ty = write_iwa_file(tx);
              var raw32 = compress_iwa_file(ty);
              tentry.content = raw32;
              tentry.size = tentry.content.length;
            })();
          }
          t2.data = write_shallow(tl);
        }
        store2[3][0].data = write_shallow(tile);
      }
      pb[4][0].data = write_shallow(store2);
    }
    docroot.messages[0].data = write_shallow(pb);
    var y2 = write_iwa_file(x2);
    var raw3 = compress_iwa_file(y2);
    entry.content = raw3;
    entry.size = entry.content.length;
    return cfb;
  }
  function fix_opts_func(defaults) {
    return function fix_opts(opts) {
      for (var i = 0; i != defaults.length; ++i) {
        var d2 = defaults[i];
        if (opts[d2[0]] === void 0)
          opts[d2[0]] = d2[1];
        if (d2[2] === "n")
          opts[d2[0]] = Number(opts[d2[0]]);
      }
    };
  }
  function fix_write_opts(opts) {
    fix_opts_func([
      ["cellDates", false],
      /* write date cells with type `d` */
      ["bookSST", false],
      /* Generate Shared String Table */
      ["bookType", "xlsx"],
      /* Type of workbook (xlsx/m/b) */
      ["compression", false],
      /* Use file compression */
      ["WTF", false]
      /* WTF mode (throws errors) */
    ])(opts);
  }
  function write_zip(wb, opts) {
    if (opts.bookType == "ods")
      return write_ods(wb, opts);
    if (opts.bookType == "numbers")
      return write_numbers_iwa(wb, opts);
    if (opts.bookType == "xlsb")
      return write_zip_xlsxb(wb, opts);
    return write_zip_xlsx(wb, opts);
  }
  function write_zip_xlsxb(wb, opts) {
    _shapeid = 1024;
    if (wb && !wb.SSF) {
      wb.SSF = dup(table_fmt);
    }
    if (wb && wb.SSF) {
      make_ssf();
      SSF_load_table(wb.SSF);
      opts.revssf = evert_num(wb.SSF);
      opts.revssf[wb.SSF[65535]] = 0;
      opts.ssf = wb.SSF;
    }
    opts.rels = {};
    opts.wbrels = {};
    opts.Strings = /*::((*/
    [];
    opts.Strings.Count = 0;
    opts.Strings.Unique = 0;
    if (browser_has_Map)
      opts.revStrings = /* @__PURE__ */ new Map();
    else {
      opts.revStrings = {};
      opts.revStrings.foo = [];
      delete opts.revStrings.foo;
    }
    var wbext = opts.bookType == "xlsb" ? "bin" : "xml";
    var vbafmt = VBAFMTS.indexOf(opts.bookType) > -1;
    var ct = new_ct();
    fix_write_opts(opts = opts || {});
    var zip = zip_new();
    var f2 = "", rId = 0;
    opts.cellXfs = [];
    get_cell_style(opts.cellXfs, {}, { revssf: { "General": 0 } });
    if (!wb.Props)
      wb.Props = {};
    f2 = "docProps/core.xml";
    zip_add_file(zip, f2, write_core_props(wb.Props, opts));
    ct.coreprops.push(f2);
    add_rels(opts.rels, 2, f2, RELS.CORE_PROPS);
    f2 = "docProps/app.xml";
    if (wb.Props && wb.Props.SheetNames)
      ;
    else if (!wb.Workbook || !wb.Workbook.Sheets)
      wb.Props.SheetNames = wb.SheetNames;
    else {
      var _sn = [];
      for (var _i = 0; _i < wb.SheetNames.length; ++_i)
        if ((wb.Workbook.Sheets[_i] || {}).Hidden != 2)
          _sn.push(wb.SheetNames[_i]);
      wb.Props.SheetNames = _sn;
    }
    wb.Props.Worksheets = wb.Props.SheetNames.length;
    zip_add_file(zip, f2, write_ext_props(wb.Props));
    ct.extprops.push(f2);
    add_rels(opts.rels, 3, f2, RELS.EXT_PROPS);
    if (wb.Custprops !== wb.Props && keys2(wb.Custprops || {}).length > 0) {
      f2 = "docProps/custom.xml";
      zip_add_file(zip, f2, write_cust_props(wb.Custprops));
      ct.custprops.push(f2);
      add_rels(opts.rels, 4, f2, RELS.CUST_PROPS);
    }
    for (rId = 1; rId <= wb.SheetNames.length; ++rId) {
      var wsrels = { "!id": {} };
      var ws = wb.Sheets[wb.SheetNames[rId - 1]];
      var _type = (ws || {})["!type"] || "sheet";
      switch (_type) {
        case "chart":
        default:
          f2 = "xl/worksheets/sheet" + rId + "." + wbext;
          zip_add_file(zip, f2, write_ws(rId - 1, f2, opts, wb, wsrels));
          ct.sheets.push(f2);
          add_rels(opts.wbrels, -1, "worksheets/sheet" + rId + "." + wbext, RELS.WS[0]);
      }
      if (ws) {
        var comments = ws["!comments"];
        var need_vml = false;
        var cf = "";
        if (comments && comments.length > 0) {
          cf = "xl/comments" + rId + "." + wbext;
          zip_add_file(zip, cf, write_cmnt(comments, cf));
          ct.comments.push(cf);
          add_rels(wsrels, -1, "../comments" + rId + "." + wbext, RELS.CMNT);
          need_vml = true;
        }
        if (ws["!legacy"]) {
          if (need_vml)
            zip_add_file(zip, "xl/drawings/vmlDrawing" + rId + ".vml", write_comments_vml(rId, ws["!comments"]));
        }
        delete ws["!comments"];
        delete ws["!legacy"];
      }
      if (wsrels["!id"].rId1)
        zip_add_file(zip, get_rels_path(f2), write_rels(wsrels));
    }
    if (opts.Strings != null && opts.Strings.length > 0) {
      f2 = "xl/sharedStrings." + wbext;
      zip_add_file(zip, f2, write_sst(opts.Strings, f2, opts));
      ct.strs.push(f2);
      add_rels(opts.wbrels, -1, "sharedStrings." + wbext, RELS.SST);
    }
    f2 = "xl/workbook." + wbext;
    zip_add_file(zip, f2, write_wb(wb, f2));
    ct.workbooks.push(f2);
    add_rels(opts.rels, 1, f2, RELS.WB);
    f2 = "xl/theme/theme1.xml";
    zip_add_file(zip, f2, write_theme(wb.Themes, opts));
    ct.themes.push(f2);
    add_rels(opts.wbrels, -1, "theme/theme1.xml", RELS.THEME);
    f2 = "xl/styles." + wbext;
    zip_add_file(zip, f2, write_sty(wb, f2, opts));
    ct.styles.push(f2);
    add_rels(opts.wbrels, -1, "styles." + wbext, RELS.STY);
    if (wb.vbaraw && vbafmt) {
      f2 = "xl/vbaProject.bin";
      zip_add_file(zip, f2, wb.vbaraw);
      ct.vba.push(f2);
      add_rels(opts.wbrels, -1, "vbaProject.bin", RELS.VBA);
    }
    f2 = "xl/metadata." + wbext;
    zip_add_file(zip, f2, write_xlmeta(f2));
    ct.metadata.push(f2);
    add_rels(opts.wbrels, -1, "metadata." + wbext, RELS.XLMETA);
    zip_add_file(zip, "[Content_Types].xml", write_ct(ct, opts));
    zip_add_file(zip, "_rels/.rels", write_rels(opts.rels));
    zip_add_file(zip, "xl/_rels/workbook." + wbext + ".rels", write_rels(opts.wbrels));
    delete opts.revssf;
    delete opts.ssf;
    return zip;
  }
  function write_zip_xlsx(wb, opts) {
    _shapeid = 1024;
    if (wb && !wb.SSF) {
      wb.SSF = dup(table_fmt);
    }
    if (wb && wb.SSF) {
      make_ssf();
      SSF_load_table(wb.SSF);
      opts.revssf = evert_num(wb.SSF);
      opts.revssf[wb.SSF[65535]] = 0;
      opts.ssf = wb.SSF;
    }
    opts.rels = {};
    opts.wbrels = {};
    opts.Strings = /*::((*/
    [];
    opts.Strings.Count = 0;
    opts.Strings.Unique = 0;
    if (browser_has_Map)
      opts.revStrings = /* @__PURE__ */ new Map();
    else {
      opts.revStrings = {};
      opts.revStrings.foo = [];
      delete opts.revStrings.foo;
    }
    var wbext = "xml";
    var vbafmt = VBAFMTS.indexOf(opts.bookType) > -1;
    var ct = new_ct();
    fix_write_opts(opts = opts || {});
    var zip = zip_new();
    var f2 = "", rId = 0;
    opts.cellXfs = [];
    get_cell_style(opts.cellXfs, {}, { revssf: { "General": 0 } });
    if (!wb.Props)
      wb.Props = {};
    f2 = "docProps/core.xml";
    zip_add_file(zip, f2, write_core_props(wb.Props, opts));
    ct.coreprops.push(f2);
    add_rels(opts.rels, 2, f2, RELS.CORE_PROPS);
    f2 = "docProps/app.xml";
    if (wb.Props && wb.Props.SheetNames)
      ;
    else if (!wb.Workbook || !wb.Workbook.Sheets)
      wb.Props.SheetNames = wb.SheetNames;
    else {
      var _sn = [];
      for (var _i = 0; _i < wb.SheetNames.length; ++_i)
        if ((wb.Workbook.Sheets[_i] || {}).Hidden != 2)
          _sn.push(wb.SheetNames[_i]);
      wb.Props.SheetNames = _sn;
    }
    wb.Props.Worksheets = wb.Props.SheetNames.length;
    zip_add_file(zip, f2, write_ext_props(wb.Props));
    ct.extprops.push(f2);
    add_rels(opts.rels, 3, f2, RELS.EXT_PROPS);
    if (wb.Custprops !== wb.Props && keys2(wb.Custprops || {}).length > 0) {
      f2 = "docProps/custom.xml";
      zip_add_file(zip, f2, write_cust_props(wb.Custprops));
      ct.custprops.push(f2);
      add_rels(opts.rels, 4, f2, RELS.CUST_PROPS);
    }
    var people = ["SheetJ5"];
    opts.tcid = 0;
    for (rId = 1; rId <= wb.SheetNames.length; ++rId) {
      var wsrels = { "!id": {} };
      var ws = wb.Sheets[wb.SheetNames[rId - 1]];
      var _type = (ws || {})["!type"] || "sheet";
      switch (_type) {
        case "chart":
        default:
          f2 = "xl/worksheets/sheet" + rId + "." + wbext;
          zip_add_file(zip, f2, write_ws_xml(rId - 1, opts, wb, wsrels));
          ct.sheets.push(f2);
          add_rels(opts.wbrels, -1, "worksheets/sheet" + rId + "." + wbext, RELS.WS[0]);
      }
      if (ws) {
        var comments = ws["!comments"];
        var need_vml = false;
        var cf = "";
        if (comments && comments.length > 0) {
          var needtc = false;
          comments.forEach(function(carr) {
            carr[1].forEach(function(c2) {
              if (c2.T == true)
                needtc = true;
            });
          });
          if (needtc) {
            cf = "xl/threadedComments/threadedComment" + rId + "." + wbext;
            zip_add_file(zip, cf, write_tcmnt_xml(comments, people, opts));
            ct.threadedcomments.push(cf);
            add_rels(wsrels, -1, "../threadedComments/threadedComment" + rId + "." + wbext, RELS.TCMNT);
          }
          cf = "xl/comments" + rId + "." + wbext;
          zip_add_file(zip, cf, write_comments_xml(comments));
          ct.comments.push(cf);
          add_rels(wsrels, -1, "../comments" + rId + "." + wbext, RELS.CMNT);
          need_vml = true;
        }
        if (ws["!legacy"]) {
          if (need_vml)
            zip_add_file(zip, "xl/drawings/vmlDrawing" + rId + ".vml", write_comments_vml(rId, ws["!comments"]));
        }
        delete ws["!comments"];
        delete ws["!legacy"];
      }
      if (wsrels["!id"].rId1)
        zip_add_file(zip, get_rels_path(f2), write_rels(wsrels));
    }
    if (opts.Strings != null && opts.Strings.length > 0) {
      f2 = "xl/sharedStrings." + wbext;
      zip_add_file(zip, f2, write_sst_xml(opts.Strings, opts));
      ct.strs.push(f2);
      add_rels(opts.wbrels, -1, "sharedStrings." + wbext, RELS.SST);
    }
    f2 = "xl/workbook." + wbext;
    zip_add_file(zip, f2, write_wb_xml(wb));
    ct.workbooks.push(f2);
    add_rels(opts.rels, 1, f2, RELS.WB);
    f2 = "xl/theme/theme1.xml";
    zip_add_file(zip, f2, write_theme(wb.Themes, opts));
    ct.themes.push(f2);
    add_rels(opts.wbrels, -1, "theme/theme1.xml", RELS.THEME);
    f2 = "xl/styles." + wbext;
    zip_add_file(zip, f2, write_sty_xml(wb, opts));
    ct.styles.push(f2);
    add_rels(opts.wbrels, -1, "styles." + wbext, RELS.STY);
    if (wb.vbaraw && vbafmt) {
      f2 = "xl/vbaProject.bin";
      zip_add_file(zip, f2, wb.vbaraw);
      ct.vba.push(f2);
      add_rels(opts.wbrels, -1, "vbaProject.bin", RELS.VBA);
    }
    f2 = "xl/metadata." + wbext;
    zip_add_file(zip, f2, write_xlmeta_xml());
    ct.metadata.push(f2);
    add_rels(opts.wbrels, -1, "metadata." + wbext, RELS.XLMETA);
    if (people.length > 1) {
      f2 = "xl/persons/person.xml";
      zip_add_file(zip, f2, write_people_xml(people));
      ct.people.push(f2);
      add_rels(opts.wbrels, -1, "persons/person.xml", RELS.PEOPLE);
    }
    zip_add_file(zip, "[Content_Types].xml", write_ct(ct, opts));
    zip_add_file(zip, "_rels/.rels", write_rels(opts.rels));
    zip_add_file(zip, "xl/_rels/workbook." + wbext + ".rels", write_rels(opts.wbrels));
    delete opts.revssf;
    delete opts.ssf;
    return zip;
  }
  function firstbyte(f2, o) {
    var x2 = "";
    switch ((o || {}).type || "base64") {
      case "buffer":
        return [f2[0], f2[1], f2[2], f2[3], f2[4], f2[5], f2[6], f2[7]];
      case "base64":
        x2 = Base64_decode(f2.slice(0, 12));
        break;
      case "binary":
        x2 = f2;
        break;
      case "array":
        return [f2[0], f2[1], f2[2], f2[3], f2[4], f2[5], f2[6], f2[7]];
      default:
        throw new Error("Unrecognized type " + (o && o.type || "undefined"));
    }
    return [x2.charCodeAt(0), x2.charCodeAt(1), x2.charCodeAt(2), x2.charCodeAt(3), x2.charCodeAt(4), x2.charCodeAt(5), x2.charCodeAt(6), x2.charCodeAt(7)];
  }
  function write_cfb_ctr(cfb, o) {
    switch (o.type) {
      case "base64":
      case "binary":
        break;
      case "buffer":
      case "array":
        o.type = "";
        break;
      case "file":
        return write_dl(o.file, CFB.write(cfb, { type: has_buf ? "buffer" : "" }));
      case "string":
        throw new Error("'string' output type invalid for '" + o.bookType + "' files");
      default:
        throw new Error("Unrecognized type " + o.type);
    }
    return CFB.write(cfb, o);
  }
  function write_zip_type(wb, opts) {
    var o = dup(opts || {});
    var z2 = write_zip(wb, o);
    return write_zip_denouement(z2, o);
  }
  function write_zip_denouement(z2, o) {
    var oopts = {};
    var ftype = has_buf ? "nodebuffer" : typeof Uint8Array !== "undefined" ? "array" : "string";
    if (o.compression)
      oopts.compression = "DEFLATE";
    if (o.password)
      oopts.type = ftype;
    else
      switch (o.type) {
        case "base64":
          oopts.type = "base64";
          break;
        case "binary":
          oopts.type = "string";
          break;
        case "string":
          throw new Error("'string' output type invalid for '" + o.bookType + "' files");
        case "buffer":
        case "file":
          oopts.type = ftype;
          break;
        default:
          throw new Error("Unrecognized type " + o.type);
      }
    var out = z2.FullPaths ? CFB.write(z2, { fileType: "zip", type: (
      /*::(*/
      { "nodebuffer": "buffer", "string": "binary" }[oopts.type] || oopts.type
    ), compression: !!o.compression }) : z2.generate(oopts);
    if (typeof Deno !== "undefined") {
      if (typeof out == "string") {
        if (o.type == "binary" || o.type == "base64")
          return out;
        out = new Uint8Array(s2ab(out));
      }
    }
    if (o.password && typeof encrypt_agile !== "undefined")
      return write_cfb_ctr(encrypt_agile(out, o.password), o);
    if (o.type === "file")
      return write_dl(o.file, out);
    return o.type == "string" ? utf8read(
      /*::(*/
      out
      /*:: :any)*/
    ) : out;
  }
  function write_cfb_type(wb, opts) {
    var o = opts || {};
    var cfb = write_xlscfb(wb, o);
    return write_cfb_ctr(cfb, o);
  }
  function write_string_type(out, opts, bom) {
    if (!bom)
      bom = "";
    var o = bom + out;
    switch (opts.type) {
      case "base64":
        return Base64_encode(utf8write(o));
      case "binary":
        return utf8write(o);
      case "string":
        return out;
      case "file":
        return write_dl(opts.file, o, "utf8");
      case "buffer": {
        if (has_buf)
          return Buffer_from(o, "utf8");
        else if (typeof TextEncoder !== "undefined")
          return new TextEncoder().encode(o);
        else
          return write_string_type(o, { type: "binary" }).split("").map(function(c2) {
            return c2.charCodeAt(0);
          });
      }
    }
    throw new Error("Unrecognized type " + opts.type);
  }
  function write_stxt_type(out, opts) {
    switch (opts.type) {
      case "base64":
        return Base64_encode(out);
      case "binary":
        return out;
      case "string":
        return out;
      case "file":
        return write_dl(opts.file, out, "binary");
      case "buffer": {
        if (has_buf)
          return Buffer_from(out, "binary");
        else
          return out.split("").map(function(c2) {
            return c2.charCodeAt(0);
          });
      }
    }
    throw new Error("Unrecognized type " + opts.type);
  }
  function write_binary_type(out, opts) {
    switch (opts.type) {
      case "string":
      case "base64":
      case "binary":
        var bstr = "";
        for (var i = 0; i < out.length; ++i)
          bstr += String.fromCharCode(out[i]);
        return opts.type == "base64" ? Base64_encode(bstr) : opts.type == "string" ? utf8read(bstr) : bstr;
      case "file":
        return write_dl(opts.file, out);
      case "buffer":
        return out;
      default:
        throw new Error("Unrecognized type " + opts.type);
    }
  }
  function writeSync(wb, opts) {
    reset_cp();
    check_wb(wb);
    var o = dup(opts || {});
    if (o.cellStyles) {
      o.cellNF = true;
      o.sheetStubs = true;
    }
    if (o.type == "array") {
      o.type = "binary";
      var out = writeSync(wb, o);
      o.type = "array";
      return s2ab(out);
    }
    var idx = 0;
    if (o.sheet) {
      if (typeof o.sheet == "number")
        idx = o.sheet;
      else
        idx = wb.SheetNames.indexOf(o.sheet);
      if (!wb.SheetNames[idx])
        throw new Error("Sheet not found: " + o.sheet + " : " + typeof o.sheet);
    }
    switch (o.bookType || "xlsb") {
      case "xml":
      case "xlml":
        return write_string_type(write_xlml(wb, o), o);
      case "slk":
      case "sylk":
        return write_string_type(SYLK.from_sheet(wb.Sheets[wb.SheetNames[idx]], o), o);
      case "htm":
      case "html":
        return write_string_type(sheet_to_html(wb.Sheets[wb.SheetNames[idx]], o), o);
      case "txt":
        return write_stxt_type(sheet_to_txt(wb.Sheets[wb.SheetNames[idx]], o), o);
      case "csv":
        return write_string_type(sheet_to_csv(wb.Sheets[wb.SheetNames[idx]], o), o, "\uFEFF");
      case "dif":
        return write_string_type(DIF.from_sheet(wb.Sheets[wb.SheetNames[idx]], o), o);
      case "dbf":
        return write_binary_type(DBF.from_sheet(wb.Sheets[wb.SheetNames[idx]], o), o);
      case "prn":
        return write_string_type(PRN.from_sheet(wb.Sheets[wb.SheetNames[idx]], o), o);
      case "rtf":
        return write_string_type(RTF.from_sheet(wb.Sheets[wb.SheetNames[idx]], o), o);
      case "eth":
        return write_string_type(ETH.from_sheet(wb.Sheets[wb.SheetNames[idx]], o), o);
      case "fods":
        return write_string_type(write_ods(wb, o), o);
      case "wk1":
        return write_binary_type(WK_.sheet_to_wk1(wb.Sheets[wb.SheetNames[idx]], o), o);
      case "wk3":
        return write_binary_type(WK_.book_to_wk3(wb, o), o);
      case "biff2":
        if (!o.biff)
          o.biff = 2;
      case "biff3":
        if (!o.biff)
          o.biff = 3;
      case "biff4":
        if (!o.biff)
          o.biff = 4;
        return write_binary_type(write_biff_buf(wb, o), o);
      case "biff5":
        if (!o.biff)
          o.biff = 5;
      case "biff8":
      case "xla":
      case "xls":
        if (!o.biff)
          o.biff = 8;
        return write_cfb_type(wb, o);
      case "xlsx":
      case "xlsm":
      case "xlam":
      case "xlsb":
      case "numbers":
      case "ods":
        return write_zip_type(wb, o);
      default:
        throw new Error("Unrecognized bookType |" + o.bookType + "|");
    }
  }
  function make_json_row(sheet, r2, R, cols, header, hdr, dense, o) {
    var rr = encode_row(R);
    var defval = o.defval, raw = o.raw || !Object.prototype.hasOwnProperty.call(o, "raw");
    var isempty = true;
    var row = header === 1 ? [] : {};
    if (header !== 1) {
      if (Object.defineProperty)
        try {
          Object.defineProperty(row, "__rowNum__", { value: R, enumerable: false });
        } catch (e2) {
          row.__rowNum__ = R;
        }
      else
        row.__rowNum__ = R;
    }
    if (!dense || sheet[R])
      for (var C = r2.s.c; C <= r2.e.c; ++C) {
        var val = dense ? sheet[R][C] : sheet[cols[C] + rr];
        if (val === void 0 || val.t === void 0) {
          if (defval === void 0)
            continue;
          if (hdr[C] != null) {
            row[hdr[C]] = defval;
          }
          continue;
        }
        var v2 = val.v;
        switch (val.t) {
          case "z":
            if (v2 == null)
              break;
            continue;
          case "e":
            v2 = v2 == 0 ? null : void 0;
            break;
          case "s":
          case "d":
          case "b":
          case "n":
            break;
          default:
            throw new Error("unrecognized type " + val.t);
        }
        if (hdr[C] != null) {
          if (v2 == null) {
            if (val.t == "e" && v2 === null)
              row[hdr[C]] = null;
            else if (defval !== void 0)
              row[hdr[C]] = defval;
            else if (raw && v2 === null)
              row[hdr[C]] = null;
            else
              continue;
          } else {
            row[hdr[C]] = raw && (val.t !== "n" || val.t === "n" && o.rawNumbers !== false) ? v2 : format_cell(val, v2, o);
          }
          if (v2 != null)
            isempty = false;
        }
      }
    return { row, isempty };
  }
  function sheet_to_json(sheet, opts) {
    if (sheet == null || sheet["!ref"] == null)
      return [];
    var val = { t: "n", v: 0 }, header = 0, offset = 1, hdr = [], v2 = 0, vv = "";
    var r2 = { s: { r: 0, c: 0 }, e: { r: 0, c: 0 } };
    var o = opts || {};
    var range = o.range != null ? o.range : sheet["!ref"];
    if (o.header === 1)
      header = 1;
    else if (o.header === "A")
      header = 2;
    else if (Array.isArray(o.header))
      header = 3;
    else if (o.header == null)
      header = 0;
    switch (typeof range) {
      case "string":
        r2 = safe_decode_range(range);
        break;
      case "number":
        r2 = safe_decode_range(sheet["!ref"]);
        r2.s.r = range;
        break;
      default:
        r2 = range;
    }
    if (header > 0)
      offset = 0;
    var rr = encode_row(r2.s.r);
    var cols = [];
    var out = [];
    var outi = 0, counter = 0;
    var dense = Array.isArray(sheet);
    var R = r2.s.r, C = 0;
    var header_cnt = {};
    if (dense && !sheet[R])
      sheet[R] = [];
    var colinfo = o.skipHidden && sheet["!cols"] || [];
    var rowinfo = o.skipHidden && sheet["!rows"] || [];
    for (C = r2.s.c; C <= r2.e.c; ++C) {
      if ((colinfo[C] || {}).hidden)
        continue;
      cols[C] = encode_col(C);
      val = dense ? sheet[R][C] : sheet[cols[C] + rr];
      switch (header) {
        case 1:
          hdr[C] = C - r2.s.c;
          break;
        case 2:
          hdr[C] = cols[C];
          break;
        case 3:
          hdr[C] = o.header[C - r2.s.c];
          break;
        default:
          if (val == null)
            val = { w: "__EMPTY", t: "s" };
          vv = v2 = format_cell(val, null, o);
          counter = header_cnt[v2] || 0;
          if (!counter)
            header_cnt[v2] = 1;
          else {
            do {
              vv = v2 + "_" + counter++;
            } while (header_cnt[vv]);
            header_cnt[v2] = counter;
            header_cnt[vv] = 1;
          }
          hdr[C] = vv;
      }
    }
    for (R = r2.s.r + offset; R <= r2.e.r; ++R) {
      if ((rowinfo[R] || {}).hidden)
        continue;
      var row = make_json_row(sheet, r2, R, cols, header, hdr, dense, o);
      if (row.isempty === false || (header === 1 ? o.blankrows !== false : !!o.blankrows))
        out[outi++] = row.row;
    }
    out.length = outi;
    return out;
  }
  var qreg = /"/g;
  function make_csv_row(sheet, r2, R, cols, fs, rs, FS, o) {
    var isempty = true;
    var row = [], txt = "", rr = encode_row(R);
    for (var C = r2.s.c; C <= r2.e.c; ++C) {
      if (!cols[C])
        continue;
      var val = o.dense ? (sheet[R] || [])[C] : sheet[cols[C] + rr];
      if (val == null)
        txt = "";
      else if (val.v != null) {
        isempty = false;
        txt = "" + (o.rawNumbers && val.t == "n" ? val.v : format_cell(val, null, o));
        for (var i = 0, cc = 0; i !== txt.length; ++i)
          if ((cc = txt.charCodeAt(i)) === fs || cc === rs || cc === 34 || o.forceQuotes) {
            txt = '"' + txt.replace(qreg, '""') + '"';
            break;
          }
        if (txt == "ID")
          txt = '"ID"';
      } else if (val.f != null && !val.F) {
        isempty = false;
        txt = "=" + val.f;
        if (txt.indexOf(",") >= 0)
          txt = '"' + txt.replace(qreg, '""') + '"';
      } else
        txt = "";
      row.push(txt);
    }
    if (o.blankrows === false && isempty)
      return null;
    return row.join(FS);
  }
  function sheet_to_csv(sheet, opts) {
    var out = [];
    var o = opts == null ? {} : opts;
    if (sheet == null || sheet["!ref"] == null)
      return "";
    var r2 = safe_decode_range(sheet["!ref"]);
    var FS = o.FS !== void 0 ? o.FS : ",", fs = FS.charCodeAt(0);
    var RS = o.RS !== void 0 ? o.RS : "\n", rs = RS.charCodeAt(0);
    var endregex = new RegExp((FS == "|" ? "\\|" : FS) + "+$");
    var row = "", cols = [];
    o.dense = Array.isArray(sheet);
    var colinfo = o.skipHidden && sheet["!cols"] || [];
    var rowinfo = o.skipHidden && sheet["!rows"] || [];
    for (var C = r2.s.c; C <= r2.e.c; ++C)
      if (!(colinfo[C] || {}).hidden)
        cols[C] = encode_col(C);
    var w2 = 0;
    for (var R = r2.s.r; R <= r2.e.r; ++R) {
      if ((rowinfo[R] || {}).hidden)
        continue;
      row = make_csv_row(sheet, r2, R, cols, fs, rs, FS, o);
      if (row == null) {
        continue;
      }
      if (o.strip)
        row = row.replace(endregex, "");
      if (row || o.blankrows !== false)
        out.push((w2++ ? RS : "") + row);
    }
    delete o.dense;
    return out.join("");
  }
  function sheet_to_txt(sheet, opts) {
    if (!opts)
      opts = {};
    opts.FS = "	";
    opts.RS = "\n";
    var s = sheet_to_csv(sheet, opts);
    return s;
  }
  function sheet_to_formulae(sheet) {
    var y2 = "", x2, val = "";
    if (sheet == null || sheet["!ref"] == null)
      return [];
    var r2 = safe_decode_range(sheet["!ref"]), rr = "", cols = [], C;
    var cmds = [];
    var dense = Array.isArray(sheet);
    for (C = r2.s.c; C <= r2.e.c; ++C)
      cols[C] = encode_col(C);
    for (var R = r2.s.r; R <= r2.e.r; ++R) {
      rr = encode_row(R);
      for (C = r2.s.c; C <= r2.e.c; ++C) {
        y2 = cols[C] + rr;
        x2 = dense ? (sheet[R] || [])[C] : sheet[y2];
        val = "";
        if (x2 === void 0)
          continue;
        else if (x2.F != null) {
          y2 = x2.F;
          if (!x2.f)
            continue;
          val = x2.f;
          if (y2.indexOf(":") == -1)
            y2 = y2 + ":" + y2;
        }
        if (x2.f != null)
          val = x2.f;
        else if (x2.t == "z")
          continue;
        else if (x2.t == "n" && x2.v != null)
          val = "" + x2.v;
        else if (x2.t == "b")
          val = x2.v ? "TRUE" : "FALSE";
        else if (x2.w !== void 0)
          val = "'" + x2.w;
        else if (x2.v === void 0)
          continue;
        else if (x2.t == "s")
          val = "'" + x2.v;
        else
          val = "" + x2.v;
        cmds[cmds.length] = y2 + "=" + val;
      }
    }
    return cmds;
  }
  function sheet_add_json(_ws, js, opts) {
    var o = opts || {};
    var offset = +!o.skipHeader;
    var ws = _ws || {};
    var _R = 0, _C = 0;
    if (ws && o.origin != null) {
      if (typeof o.origin == "number")
        _R = o.origin;
      else {
        var _origin = typeof o.origin == "string" ? decode_cell(o.origin) : o.origin;
        _R = _origin.r;
        _C = _origin.c;
      }
    }
    var cell5;
    var range = { s: { c: 0, r: 0 }, e: { c: _C, r: _R + js.length - 1 + offset } };
    if (ws["!ref"]) {
      var _range = safe_decode_range(ws["!ref"]);
      range.e.c = Math.max(range.e.c, _range.e.c);
      range.e.r = Math.max(range.e.r, _range.e.r);
      if (_R == -1) {
        _R = _range.e.r + 1;
        range.e.r = _R + js.length - 1 + offset;
      }
    } else {
      if (_R == -1) {
        _R = 0;
        range.e.r = js.length - 1 + offset;
      }
    }
    var hdr = o.header || [], C = 0;
    js.forEach(function(JS, R) {
      keys2(JS).forEach(function(k2) {
        if ((C = hdr.indexOf(k2)) == -1)
          hdr[C = hdr.length] = k2;
        var v2 = JS[k2];
        var t2 = "z";
        var z2 = "";
        var ref = encode_cell({ c: _C + C, r: _R + R + offset });
        cell5 = ws_get_cell_stub(ws, ref);
        if (v2 && typeof v2 === "object" && !(v2 instanceof Date)) {
          ws[ref] = v2;
        } else {
          if (typeof v2 == "number")
            t2 = "n";
          else if (typeof v2 == "boolean")
            t2 = "b";
          else if (typeof v2 == "string")
            t2 = "s";
          else if (v2 instanceof Date) {
            t2 = "d";
            if (!o.cellDates) {
              t2 = "n";
              v2 = datenum(v2);
            }
            z2 = o.dateNF || table_fmt[14];
          } else if (v2 === null && o.nullError) {
            t2 = "e";
            v2 = 0;
          }
          if (!cell5)
            ws[ref] = cell5 = { t: t2, v: v2 };
          else {
            cell5.t = t2;
            cell5.v = v2;
            delete cell5.w;
            delete cell5.R;
            if (z2)
              cell5.z = z2;
          }
          if (z2)
            cell5.z = z2;
        }
      });
    });
    range.e.c = Math.max(range.e.c, _C + hdr.length - 1);
    var __R = encode_row(_R);
    if (offset)
      for (C = 0; C < hdr.length; ++C)
        ws[encode_col(C + _C) + __R] = { t: "s", v: hdr[C] };
    ws["!ref"] = encode_range(range);
    return ws;
  }
  function json_to_sheet(js, opts) {
    return sheet_add_json(null, js, opts);
  }
  function ws_get_cell_stub(ws, R, C) {
    if (typeof R == "string") {
      if (Array.isArray(ws)) {
        var RC = decode_cell(R);
        if (!ws[RC.r])
          ws[RC.r] = [];
        return ws[RC.r][RC.c] || (ws[RC.r][RC.c] = { t: "z" });
      }
      return ws[R] || (ws[R] = { t: "z" });
    }
    if (typeof R != "number")
      return ws_get_cell_stub(ws, encode_cell(R));
    return ws_get_cell_stub(ws, encode_cell({ r: R, c: C || 0 }));
  }
  function wb_sheet_idx(wb, sh) {
    if (typeof sh == "number") {
      if (sh >= 0 && wb.SheetNames.length > sh)
        return sh;
      throw new Error("Cannot find sheet # " + sh);
    } else if (typeof sh == "string") {
      var idx = wb.SheetNames.indexOf(sh);
      if (idx > -1)
        return idx;
      throw new Error("Cannot find sheet name |" + sh + "|");
    } else
      throw new Error("Cannot find sheet |" + sh + "|");
  }
  function book_new() {
    return { SheetNames: [], Sheets: {} };
  }
  function book_append_sheet(wb, ws, name, roll) {
    var i = 1;
    if (!name) {
      for (; i <= 65535; ++i, name = void 0)
        if (wb.SheetNames.indexOf(name = "Sheet" + i) == -1)
          break;
    }
    if (!name || wb.SheetNames.length >= 65535)
      throw new Error("Too many worksheets");
    if (roll && wb.SheetNames.indexOf(name) >= 0) {
      var m2 = name.match(/(^.*?)(\d+)$/);
      i = m2 && +m2[2] || 0;
      var root = m2 && m2[1] || name;
      for (++i; i <= 65535; ++i)
        if (wb.SheetNames.indexOf(name = root + i) == -1)
          break;
    }
    check_ws_name(name);
    if (wb.SheetNames.indexOf(name) >= 0)
      throw new Error("Worksheet with name |" + name + "| already exists!");
    wb.SheetNames.push(name);
    wb.Sheets[name] = ws;
    return name;
  }
  function book_set_sheet_visibility(wb, sh, vis) {
    if (!wb.Workbook)
      wb.Workbook = {};
    if (!wb.Workbook.Sheets)
      wb.Workbook.Sheets = [];
    var idx = wb_sheet_idx(wb, sh);
    if (!wb.Workbook.Sheets[idx])
      wb.Workbook.Sheets[idx] = {};
    switch (vis) {
      case 0:
      case 1:
      case 2:
        break;
      default:
        throw new Error("Bad sheet visibility setting " + vis);
    }
    wb.Workbook.Sheets[idx].Hidden = vis;
  }
  function cell_set_number_format(cell5, fmt) {
    cell5.z = fmt;
    return cell5;
  }
  function cell_set_hyperlink(cell5, target, tooltip) {
    if (!target) {
      delete cell5.l;
    } else {
      cell5.l = { Target: target };
      if (tooltip)
        cell5.l.Tooltip = tooltip;
    }
    return cell5;
  }
  function cell_set_internal_link(cell5, range, tooltip) {
    return cell_set_hyperlink(cell5, "#" + range, tooltip);
  }
  function cell_add_comment(cell5, text, author) {
    if (!cell5.c)
      cell5.c = [];
    cell5.c.push({ t: text, a: author || "SheetJS" });
  }
  function sheet_set_array_formula(ws, range, formula, dynamic) {
    var rng = typeof range != "string" ? range : safe_decode_range(range);
    var rngstr = typeof range == "string" ? range : encode_range(range);
    for (var R = rng.s.r; R <= rng.e.r; ++R)
      for (var C = rng.s.c; C <= rng.e.c; ++C) {
        var cell5 = ws_get_cell_stub(ws, R, C);
        cell5.t = "n";
        cell5.F = rngstr;
        delete cell5.v;
        if (R == rng.s.r && C == rng.s.c) {
          cell5.f = formula;
          if (dynamic)
            cell5.D = true;
        }
      }
    return ws;
  }
  var utils = {
    encode_col,
    encode_row,
    encode_cell,
    encode_range,
    decode_col,
    decode_row,
    split_cell,
    decode_cell,
    decode_range,
    format_cell,
    sheet_add_aoa,
    sheet_add_json,
    sheet_add_dom,
    aoa_to_sheet,
    json_to_sheet,
    table_to_sheet: parse_dom_table,
    table_to_book,
    sheet_to_csv,
    sheet_to_txt,
    sheet_to_json,
    sheet_to_html,
    sheet_to_formulae,
    sheet_to_row_object_array: sheet_to_json,
    sheet_get_cell: ws_get_cell_stub,
    book_new,
    book_append_sheet,
    book_set_sheet_visibility,
    cell_set_number_format,
    cell_set_hyperlink,
    cell_set_internal_link,
    cell_add_comment,
    sheet_set_array_formula,
    consts: {
      SHEET_VISIBLE: 0,
      SHEET_HIDDEN: 1,
      SHEET_VERY_HIDDEN: 2
    }
  };
  class SelectFormBox extends React.Component {
    constructor() {
      super(...arguments);
      __publicField(this, "state", {
        tableObj: []
      });
      __publicField(this, "field", new Field(this));
      __publicField(this, "openDownloadDialog", (blob, fileName) => {
        if (typeof blob == "object" && blob instanceof Blob) {
          blob = URL.createObjectURL(blob);
        }
        const aLink = document.createElement("a");
        aLink.href = blob;
        aLink.download = fileName || "";
        let event;
        event = document.createEvent("MouseEvents");
        event.initMouseEvent(
          "click",
          true,
          false,
          _unsafeWindow,
          0,
          0,
          0,
          0,
          0,
          false,
          false,
          false,
          false,
          0,
          null
        );
        aLink.dispatchEvent(event);
      });
      __publicField(this, "workbook2blob", (workbook) => {
        const wopts = {
          // 要生成的文件类型
          bookType: "xlsx",
          bookSST: false,
          type: "binary"
        };
        const wbout = writeSync(workbook, wopts);
        function s2ab2(s) {
          const buf = new ArrayBuffer(s.length);
          const view = new Uint8Array(buf);
          for (let i = 0; i != s.length; ++i)
            view[i] = s.charCodeAt(i) & 255;
          return buf;
        }
        const blob = new Blob([s2ab2(wbout)], {
          type: "application/octet-stream"
        });
        return blob;
      });
    }
    render() {
      const { init, validate } = this.field;
      return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx("h6", { style: { margin: "8px 0" }, children: "生成表格" }),
        /* @__PURE__ */ jsxRuntimeExports.jsxs(Form, { size: "small", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsxs(Form.Item, { children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx(
              Input,
              {
                label: "AppKey",
                className: "input-style",
                ...init("appKey", {
                  initValue: _unsafeWindow.pageConfig.appType || _unsafeWindow.g_config.appKey,
                  rules: [{
                    required: true,
                    message: "AppKey 不能为空!"
                  }]
                })
              }
            ),
            this.field.getError("appKey") ? /* @__PURE__ */ jsxRuntimeExports.jsx("span", { style: {
              color: "red"
            }, children: this.field.getError("appKey").join(",") }) : ""
          ] }),
          /* @__PURE__ */ jsxRuntimeExports.jsxs(Form.Item, { children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx(Input, { label: "FormUuid", className: "input-style", ...init("formUuid", {
              rules: [{
                required: true,
                message: "FormUuid 不能为空!"
              }]
            }) }),
            this.field.getError("formUuid") ? /* @__PURE__ */ jsxRuntimeExports.jsx("span", { style: {
              color: "red"
            }, children: this.field.getError("formUuid").join(",") }) : ""
          ] }),
          /* @__PURE__ */ jsxRuntimeExports.jsx(Form.Item, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(Checkbox$1, { ...init("process", { valueName: "checked" }), children: "流程" }) }),
          /* @__PURE__ */ jsxRuntimeExports.jsx(Form.Submit, { style: { width: "100%" }, onClick: () => {
            validate();
            let tableObj = [];
            fetch(`/${this.field.getValue("appKey")}/query/formdesign/getLatestFormWithNavNew.json?formUuid=${this.field.getValue("formUuid")}`).then((res) => res.json()).then(({ content: { pages } }) => {
              const allComponent = pages[0].componentsTree[0].children[1].children[0].children;
              const formComponentList = ["TextField", "TextareaField", "NumberField", "RateField", "RadioField", "CheckboxField", "DateField", "CascadeDateField", "AttachmentField", "EmployeeField", "ImageField", "SelectField", "MultiSelectField", "CascadeSelectField", "PageSection", "CountrySelectField", "DepartmentSelectField", "AddressField", "LocationField", "AssociationFormField", "DigitalSignatureField", "SerialNumberField", "CompanyField"];
              const recursiveSearch = (obj2) => {
                if (typeof obj2 === "object") {
                  if (obj2.hasOwnProperty("componentName")) {
                    if (formComponentList.includes(obj2.componentName)) {
                      try {
                        tableObj.push({
                          "dataKey": obj2.props.fieldId,
                          "title": obj2.props.label.zh_CN
                        });
                      } catch (e2) {
                      }
                    }
                    if (obj2.componentName === "TableField")
                      return;
                  }
                  for (let key in obj2) {
                    if (obj2.hasOwnProperty(key)) {
                      recursiveSearch(obj2[key]);
                    }
                  }
                }
              };
              recursiveSearch(allComponent);
              this.setState({
                tableObj
              });
            });
          }, children: "查询" })
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("hr", { style: { margin: "12px 0" } }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: { display: "flex", alignItems: "center", flexDirection: "row-reverse" }, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Button, { type: "primary", text: true, onClick: () => {
          const sheetHeader = [
            {
              title: "名称",
              value: "title"
            },
            {
              title: "唯一标识",
              value: "dataKey"
            }
          ];
          const result = [];
          for (let i = 0; i < this.state.tableObj.length; i++) {
            let item = {};
            for (let j = 0; j < sheetHeader.length; j++) {
              item[sheetHeader[j].title] = this.state.tableObj[i][sheetHeader[j].value];
            }
            result.push(item);
          }
          const ws = utils.json_to_sheet(result);
          ws["!cols"] = [{ wch: 40 }, { wch: 40 }];
          const wb = utils.book_new();
          utils.book_append_sheet(wb, ws, "【表单数据】");
          const workbookBlob = this.workbook2blob(wb);
          const today = /* @__PURE__ */ new Date();
          const year = today.getFullYear();
          const month = String(today.getMonth() + 1).padStart(2, "0");
          const day = String(today.getDate()).padStart(2, "0");
          this.openDownloadDialog(
            workbookBlob,
            `表单数据-${year}-${month}-${day}.xlsx`
          );
        }, children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx(Icon, { type: "download" }),
          "下载"
        ] }) }),
        /* @__PURE__ */ jsxRuntimeExports.jsxs(Table$1, { dataSource: this.state.tableObj, children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx(Table$1.Column, { title: "名称", dataIndex: "title" }),
          /* @__PURE__ */ jsxRuntimeExports.jsx(Table$1.Column, { title: "唯一标识", dataIndex: "dataKey" }),
          /* @__PURE__ */ jsxRuntimeExports.jsx(Table$1.Column, { title: "操作", cell: (record) => {
            return /* @__PURE__ */ jsxRuntimeExports.jsx(Button, { text: true, type: "primary", onClick: () => {
              _GM_setClipboard(record.dataKey);
              Message.success("复制成功!");
            }, children: "复制" });
          } })
        ] })
      ] });
    }
  }
  const YidaToolSkeleton = () => {
    _GM_addStyle(`
    .next-tabs-tabpane {
        display: none;
        min-height: 50px;
        outline: none !important;
        outline-offset: 0 !important;
        -webkit-box-shadow: none;
        box-shadow: none;
        padding: 0 12px;
    }`);
    return /* @__PURE__ */ jsxRuntimeExports.jsxs(_unsafeWindow.Deep.Tab, { shape: "text", size: "small", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx(_unsafeWindow.Deep.Tab.Item, { title: "组件", children: ComponentsBox() }, "1"),
      /* @__PURE__ */ jsxRuntimeExports.jsx(_unsafeWindow.Deep.Tab.Item, { title: "JS-API", children: JsApiBox() }, "2"),
      /* @__PURE__ */ jsxRuntimeExports.jsx(_unsafeWindow.Deep.Tab.Item, { title: "跨应用数据源API", children: DataSourceApiBox() }, "3"),
      /* @__PURE__ */ jsxRuntimeExports.jsx(_unsafeWindow.Deep.Tab.Item, { title: "常用代码", children: CommonCodeBox() }, "4"),
      /* @__PURE__ */ jsxRuntimeExports.jsx(_unsafeWindow.Deep.Tab.Item, { title: "查询表单", children: /* @__PURE__ */ jsxRuntimeExports.jsx(SelectFormBox, {}) }, "5"),
      /* @__PURE__ */ jsxRuntimeExports.jsx(_unsafeWindow.Deep.Tab.Item, { title: "关于我们", children: About() }, "6")
    ] });
  };
  const YidaToolIcon = (hexColor) => {
    return /* @__PURE__ */ jsxRuntimeExports.jsxs(
      "svg",
      {
        t: "1699167994750",
        className: "icon",
        viewBox: "0 0 1024 1024",
        version: "1.1",
        xmlns: "http://www.w3.org/2000/svg",
        "p-id": "6200",
        width: "20",
        height: "20",
        children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            "path",
            {
              d: "M960.7 513.4c0-249.5-199.6-449.2-449.2-449.2C262 64.2 62.3 263.8 62.3 513.4c0 249.5 199.6 449.2 449.2 449.2 104.8 0 199.6-34.9 279.5-99.8 10-10 10-20 5-29.9-10-10-20-10-29.9-5-69.9 54.9-159.7 89.8-254.5 89.8-224.6 0-404.3-179.7-404.3-404.3 0-224.6 179.7-404.3 404.3-404.3 224.6 0 404.3 179.7 404.3 404.3 0 74.9-20 149.7-59.9 214.6-5 10-5 25 5 29.9 10 5 25 5 29.9-5 44.8-74.8 69.8-154.7 69.8-239.5z m0 0",
              "p-id": "6201",
              fill: hexColor
            }
          ),
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            "path",
            {
              d: "M802 346.6L680.4 225c-9.5-9.9-22.5-15.6-36.2-15.6-13.7-0.1-26.8 5.4-36.4 15.3L214 618.4c-15.6 16.2-15.5 42 0.3 58l137.4 137.4c15.8 15.8 41.2 14.7 56.9-0.9l393.7-393.8c9.8-9.5 15.3-22.7 15.3-36.4-0.1-13.6-5.7-26.7-15.6-36.1zM383.2 774.9L252.9 644.7c-2.3-2.3-2.3-6.9 0-9.2l108.5-108.6 69.9 69.9c6.9 6.9 16.1 7 23 0.1 6.8-6.8 6.8-16-0.1-23L384.3 504l68.5-68.5 69.9 69.9c6.9 6.9 16.1 7 23 0.1 6.8-6.8 6.8-16-0.1-23l-69.9-69.9 68.5-68.5 69.9 69.9c6.9 6.9 16.1 7 23 0.1 6.8-6.8 6.8-16-0.2-23L567 321.2l59.2-59.2c6.8-6.8 16-6.8 23 0.1l116.4 116.4c6.9 6.9 7 16.1 0.1 23L392.3 774.9c-2.3 2.3-6.9 2.3-9.1 0z m0 0",
              "p-id": "6202",
              fill: hexColor
            }
          )
        ]
      }
    );
  };
  const YidaTools = () => {
    AliLowCodeEngine.skeleton.add({
      area: "leftArea",
      type: "PanelDock",
      name: "yidaTool",
      content: YidaToolSkeleton(),
      props: {
        align: "left",
        icon: YidaToolIcon(),
        description: "Yida+"
      },
      panelProps: {
        floatable: true,
        hideTitleBar: false,
        title: "YidaTools",
        width: 400,
        enableDrag: true
      }
    });
    AliLowCodeEngine.designerCabin.addBuiltinComponentAction({
      name: "Copy",
      content: {
        icon: YidaToolIcon("#ffffff"),
        title: "复制唯一标识",
        action(node) {
          const fieldId = ((node == null ? void 0 : node.propsData) == null ? void 0 : node.propsData.fieldId) || node.id;
          _GM_setClipboard(fieldId);
          Message.success(`唯一标识:${fieldId}`);
        }
      },
      important: true,
      condition: true
    });
    document.getElementsByClassName("lc-left-area-bottom")[0].children[0].style.display = "block";
    console.log("Yida+加载完成!");
  };
  const App = () => {
    let count = 0;
    const interval = setInterval(() => {
      if (_unsafeWindow.LeGao && _unsafeWindow.AliLowCodeEngine && _unsafeWindow.__VcDeepYidaUtils__) {
        count++;
        YidaTools();
      }
      if (count) {
        clearInterval(interval);
      }
    }, 100);
  };
  client.createRoot(
    (() => {
      const app = document.createElement("div");
      document.body.append(app);
      return app;
    })()
  ).render(
    /* @__PURE__ */ jsxRuntimeExports.jsx(React.StrictMode, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(App, {}) })
  );

})(React, ReactDOM);