Greasy Fork is available in English.

宜搭+

宜搭插件升级工具,需配合钉钉宜搭平台使用

// ==UserScript==
// @name         宜搭+
// @namespace    npm/vite-plugin-monkey
// @version      3.0.1
// @author       Navcoo.Li whale 翰林
// @description  宜搭插件升级工具,需配合钉钉宜搭平台使用
// @license      MIT
// @icon         https://www.google.com/s2/favicons?sz=64&domain=aliwork.com
// @match        https://*.aliwork.com/alibaba/web/*/design/pageDesigner?*
// @match        https://*.aliwork.com/dingtalk/web/*/design/pageDesigner?*
// @match        https://*.aliwork.com/component/designer/*
// @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
// ==/UserScript==

(e=>{if(typeof GM_addStyle=="function"){GM_addStyle(e);return}const o=document.createElement("style");o.textContent=e,document.head.append(o)})(' ._skeleton_uz8qw_1{width:100%;padding:0 16px}._next-tabs-tabpane_152zh_8{display:none;min-height:50px;outline:none!important;outline-offset:0!important;-webkit-box-shadow:none;box-shadow:none;padding:0 12px}._box_grid_1_152zh_17{display:grid;grid-template-columns:repeat(1,minmax(0,1fr));gap:4px}._box_grid_2_152zh_22{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:4px}._data_source_api_content_152zh_31{width:600px;max-height:350px;overflow-y:auto;background:#fff;border:1px solid #edeff3;border-radius:8px;padding:16px}._data_source_api_title_152zh_47{display:flex;align-items:center;gap:4px}._data_source_api_content_api_name_152zh_52{font-size:16px;font-weight:600;line-height:2em}._data_source_api_content_request_type_152zh_57{border-style:solid;border-width:1px;border-radius:4px;padding:1px 4px;display:inline;background-color:#1f38581a;border-color:#1f38580f}._data_source_api_content_interface_path_152zh_31{font-size:14px;margin-bottom:4px;display:flex;align-items:center;gap:4px}._js_api_icon_box_152zh_27{cursor:pointer;height:14px}._next-tabs-tabpane_1bxo6_8{display:none;min-height:50px;outline:none!important;outline-offset:0!important;-webkit-box-shadow:none;box-shadow:none;padding:0 12px}._box_grid_1_1bxo6_17{display:grid;grid-template-columns:repeat(1,minmax(0,1fr));gap:4px}._box_grid_2_1bxo6_22{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:4px}._yida_tool_skeleton_box_1bxo6_27{max-height:calc(100vh - 120px);overflow-y:auto}._item_box_1bxo6_31{border-radius:4px;padding:6px}._item_box_1bxo6_31:hover{background-color:#f5f5f5}._item_title_box_1bxo6_38{display:flex;align-items:center;gap:8px}._item_title_1bxo6_38{font-size:14px;line-height:1.5}._item_description_1bxo6_47{font-size:12px;color:#1f385866;white-space:pre-wrap}._icon_box_1bxo6_52{cursor:pointer;height:18px}._yida_tool_skeleton_box_gsj87_1{max-height:calc(100vh - 120px);overflow-y:auto}._next-tabs-tabpane_gsj87_12{display:none;min-height:50px;outline:none!important;outline-offset:0!important;-webkit-box-shadow:none;box-shadow:none;padding:0 12px}._box_grid_1_gsj87_21{display:grid;grid-template-columns:repeat(1,minmax(0,1fr));gap:4px}._box_grid_2_gsj87_26{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:4px}._yida_tool_skeleton_box_1ijbx_1{max-height:calc(100vh - 120px);overflow-y:auto}._next-tabs-tabpane_1ijbx_12{display:none;min-height:50px;outline:none!important;outline-offset:0!important;-webkit-box-shadow:none;box-shadow:none;padding:0 12px}._box_grid_1_1ijbx_21{display:grid;grid-template-columns:repeat(1,minmax(0,1fr));gap:4px}._box_grid_2_1ijbx_26{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:4px}._item_box_1ijbx_31{border-radius:4px;padding:6px}._item_box_1ijbx_31:hover{background-color:#f5f5f5}._item_title_box_1ijbx_38{display:flex;align-items:center;gap:8px}._item_title_1ijbx_38{font-size:14px;line-height:1.5}._item_description_1ijbx_47{font-size:12px;color:#1f385866;white-space:pre-wrap}._icon_box_1ijbx_52{cursor:pointer;height:18px}._yida_tool_skeleton_box_zka8q_1{max-height:calc(100vh - 120px);overflow-y:auto}._about_box_zka8q_5{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}html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,main,menu,nav,output,ruby,section,summary,time,mark,audio,video{margin:0;padding:0;border:0;font-size:100%;font:inherit;vertical-align:baseline}article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,section{display:block}*[hidden]{display:none}body{line-height:1}menu,ol,ul{list-style:none}blockquote,q{quotes:none}blockquote:before,blockquote:after,q:before,q:after{content:"";content:none}table{border-collapse:collapse;border-spacing:0}body{background-color:#fff;-webkit-user-select:none;user-select:none}img{-webkit-user-drag:none}.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}.box_grid_1{display:grid;grid-template-columns:repeat(1,minmax(0,1fr));gap:4px}.box_grid_2{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:4px} ');

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

  function _interopNamespaceDefault(e) {
    const n = Object.create(null, { [Symbol.toStringTag]: { value: 'Module' } });
    if (e) {
      for (const k in e) {
        if (k !== 'default') {
          const d = Object.getOwnPropertyDescriptor(e, k);
          Object.defineProperty(n, k, d.get ? d : {
            enumerable: true,
            get: () => e[k]
          });
        }
      }
    }
    n.default = e;
    return Object.freeze(n);
  }

  const React__default__namespace = /*#__PURE__*/_interopNamespaceDefault(React__default);

  var __defProp = Object.defineProperty;
  var __getOwnPropNames = Object.getOwnPropertyNames;
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
  var __commonJS = (cb, mod) => function __require() {
    return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
  };
  var __publicField = (obj, key, value) => {
    __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
    return value;
  };
  var require_main_001 = __commonJS({
    "main-P8StjNFP.js"(exports, module) {
      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__default, 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)();
      const YidaToolsIcon = (hexColor, size2) => {
        return /* @__PURE__ */ jsxRuntimeExports.jsxs(
          "svg",
          {
            className: "icon",
            viewBox: "0 0 1024 1024",
            version: "1.1",
            xmlns: "http://www.w3.org/2000/svg",
            width: size2 || "20",
            height: size2 || "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",
                  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",
                  fill: hexColor
                }
              )
            ]
          }
        );
      };
      const skeleton = "_skeleton_uz8qw_1";
      const Style$6 = {
        skeleton
      };
      let url = "https://yida-tools.navcoo.cn";
      function request(method, path, data) {
        let ikun = {
          method,
          headers: {
            "Content-Type": "application/json",
            "api-token": "yida-tools-pro"
          }
        };
        switch (true) {
          case method === "GET":
            const queryString = new URLSearchParams(data).toString();
            let url_g = url + path + "?" + queryString;
            return fetchData(url_g, ikun);
          case method === "POST":
            let url_p = url + path;
            ikun.body = JSON.stringify(data);
            return fetchData(url_p, ikun);
        }
      }
      function fetchData(url2, datas) {
        return new Promise((resolve, reject) => {
          fetch(url2, datas).then((data) => {
            return data.json();
          }).then((responseText) => {
            resolve(responseText);
          }).catch((error) => {
            reject(error);
          });
        });
      }
      const getDataSourceAPI = () => request("GET", "/yida_tools/api/data_source/get");
      const box_grid_1$4 = "_box_grid_1_152zh_17";
      const box_grid_2$4 = "_box_grid_2_152zh_22";
      const js_api_icon_box = "_js_api_icon_box_152zh_27";
      const data_source_api_content_interface_path = "_data_source_api_content_interface_path_152zh_31";
      const data_source_api_content = "_data_source_api_content_152zh_31";
      const data_source_api_title = "_data_source_api_title_152zh_47";
      const data_source_api_content_api_name = "_data_source_api_content_api_name_152zh_52";
      const data_source_api_content_request_type = "_data_source_api_content_request_type_152zh_57";
      const Style$5 = {
        "next-tabs-tabpane": "_next-tabs-tabpane_152zh_8",
        box_grid_1: box_grid_1$4,
        box_grid_2: box_grid_2$4,
        js_api_icon_box,
        data_source_api_content_interface_path,
        data_source_api_content,
        data_source_api_title,
        data_source_api_content_api_name,
        data_source_api_content_request_type
      };
      var extendStatics = function(d2, b2) {
        extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d3, b3) {
          d3.__proto__ = b3;
        } || function(d3, b3) {
          for (var p2 in b3)
            if (Object.prototype.hasOwnProperty.call(b3, p2))
              d3[p2] = b3[p2];
        };
        return extendStatics(d2, b2);
      };
      function __extends(d2, b2) {
        if (typeof b2 !== "function" && b2 !== null)
          throw new TypeError("Class extends value " + String(b2) + " is not a constructor or null");
        extendStatics(d2, b2);
        function __() {
          this.constructor = d2;
        }
        d2.prototype = b2 === null ? Object.create(b2) : (__.prototype = b2.prototype, new __());
      }
      var __assign = function() {
        __assign = Object.assign || function __assign2(t2) {
          for (var s, i2 = 1, n2 = arguments.length; i2 < n2; i2++) {
            s = arguments[i2];
            for (var p2 in s)
              if (Object.prototype.hasOwnProperty.call(s, p2))
                t2[p2] = s[p2];
          }
          return t2;
        };
        return __assign.apply(this, arguments);
      };
      function __rest(s, e2) {
        var t2 = {};
        for (var p2 in s)
          if (Object.prototype.hasOwnProperty.call(s, p2) && e2.indexOf(p2) < 0)
            t2[p2] = s[p2];
        if (s != null && typeof Object.getOwnPropertySymbols === "function")
          for (var i2 = 0, p2 = Object.getOwnPropertySymbols(s); i2 < p2.length; i2++) {
            if (e2.indexOf(p2[i2]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p2[i2]))
              t2[p2[i2]] = s[p2[i2]];
          }
        return t2;
      }
      function __awaiter(thisArg, _arguments, P, generator) {
        function adopt(value) {
          return value instanceof P ? value : new P(function(resolve) {
            resolve(value);
          });
        }
        return new (P || (P = Promise))(function(resolve, reject) {
          function fulfilled(value) {
            try {
              step2(generator.next(value));
            } catch (e2) {
              reject(e2);
            }
          }
          function rejected(value) {
            try {
              step2(generator["throw"](value));
            } catch (e2) {
              reject(e2);
            }
          }
          function step2(result) {
            result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
          }
          step2((generator = generator.apply(thisArg, _arguments || [])).next());
        });
      }
      function __generator(thisArg, body) {
        var _ = { label: 0, sent: function() {
          if (t2[0] & 1)
            throw t2[1];
          return t2[1];
        }, trys: [], ops: [] }, f2, y2, t2, g2;
        return g2 = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g2[Symbol.iterator] = function() {
          return this;
        }), g2;
        function verb(n2) {
          return function(v2) {
            return step2([n2, v2]);
          };
        }
        function step2(op) {
          if (f2)
            throw new TypeError("Generator is already executing.");
          while (g2 && (g2 = 0, op[0] && (_ = 0)), _)
            try {
              if (f2 = 1, y2 && (t2 = op[0] & 2 ? y2["return"] : op[0] ? y2["throw"] || ((t2 = y2["return"]) && t2.call(y2), 0) : y2.next) && !(t2 = t2.call(y2, op[1])).done)
                return t2;
              if (y2 = 0, t2)
                op = [op[0] & 2, t2.value];
              switch (op[0]) {
                case 0:
                case 1:
                  t2 = op;
                  break;
                case 4:
                  _.label++;
                  return { value: op[1], done: false };
                case 5:
                  _.label++;
                  y2 = op[1];
                  op = [0];
                  continue;
                case 7:
                  op = _.ops.pop();
                  _.trys.pop();
                  continue;
                default:
                  if (!(t2 = _.trys, t2 = t2.length > 0 && t2[t2.length - 1]) && (op[0] === 6 || op[0] === 2)) {
                    _ = 0;
                    continue;
                  }
                  if (op[0] === 3 && (!t2 || op[1] > t2[0] && op[1] < t2[3])) {
                    _.label = op[1];
                    break;
                  }
                  if (op[0] === 6 && _.label < t2[1]) {
                    _.label = t2[1];
                    t2 = op;
                    break;
                  }
                  if (t2 && _.label < t2[2]) {
                    _.label = t2[2];
                    _.ops.push(op);
                    break;
                  }
                  if (t2[2])
                    _.ops.pop();
                  _.trys.pop();
                  continue;
              }
              op = body.call(thisArg, _);
            } catch (e2) {
              op = [6, e2];
              y2 = 0;
            } finally {
              f2 = t2 = 0;
            }
          if (op[0] & 5)
            throw op[1];
          return { value: op[0] ? op[1] : void 0, done: true };
        }
      }
      function __values(o) {
        var s = typeof Symbol === "function" && Symbol.iterator, m2 = s && o[s], i2 = 0;
        if (m2)
          return m2.call(o);
        if (o && typeof o.length === "number")
          return {
            next: function() {
              if (o && i2 >= o.length)
                o = void 0;
              return { value: o && o[i2++], done: !o };
            }
          };
        throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
      }
      function __read(o, n2) {
        var m2 = typeof Symbol === "function" && o[Symbol.iterator];
        if (!m2)
          return o;
        var i2 = m2.call(o), r2, ar = [], e2;
        try {
          while ((n2 === void 0 || n2-- > 0) && !(r2 = i2.next()).done)
            ar.push(r2.value);
        } catch (error) {
          e2 = { error };
        } finally {
          try {
            if (r2 && !r2.done && (m2 = i2["return"]))
              m2.call(i2);
          } finally {
            if (e2)
              throw e2.error;
          }
        }
        return ar;
      }
      function __spreadArray(to2, from2, pack) {
        if (pack || arguments.length === 2)
          for (var i2 = 0, l2 = from2.length, ar; i2 < l2; i2++) {
            if (ar || !(i2 in from2)) {
              if (!ar)
                ar = Array.prototype.slice.call(from2, 0, i2);
              ar[i2] = from2[i2];
            }
          }
        return to2.concat(ar || Array.prototype.slice.call(from2));
      }
      typeof SuppressedError === "function" ? SuppressedError : function(error, suppressed, message2) {
        var e2 = new Error(message2);
        return e2.name = "SuppressedError", e2.error = error, e2.suppressed = suppressed, e2;
      };
      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 PT = /* @__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(module2) {
        (function() {
          var hasOwn = {}.hasOwnProperty;
          function classNames() {
            var classes = "";
            for (var i2 = 0; i2 < arguments.length; i2++) {
              var arg = arguments[i2];
              if (arg) {
                classes = appendClass(classes, parseValue(arg));
              }
            }
            return classes;
          }
          function parseValue(arg) {
            if (typeof arg === "string" || typeof arg === "number") {
              return arg;
            }
            if (typeof arg !== "object") {
              return "";
            }
            if (Array.isArray(arg)) {
              return classNames.apply(null, arg);
            }
            if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes("[native code]")) {
              return arg.toString();
            }
            var classes = "";
            for (var key in arg) {
              if (hasOwn.call(arg, key) && arg[key]) {
                classes = appendClass(classes, key);
              }
            }
            return classes;
          }
          function appendClass(value, newClass) {
            if (!newClass) {
              return value;
            }
            if (value) {
              return value + " " + newClass;
            }
            return value + newClass;
          }
          if (module2.exports) {
            classNames.default = classNames;
            module2.exports = classNames;
          } else {
            window.classNames = classNames;
          }
        })();
      })(classnames$1);
      var classnamesExports = classnames$1.exports;
      const classnames = /* @__PURE__ */ getDefaultExportFromCjs(classnamesExports);
      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$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$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$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 */
        /* @__PURE__ */ 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 _this = this;
            this.clearActive();
            this.observations_.forEach(function(observation) {
              if (observation.isActive()) {
                _this.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 */
        /* @__PURE__ */ 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 = function() {
        if (typeof global$1$1.ResizeObserver !== "undefined") {
          return global$1$1.ResizeObserver;
        }
        return ResizeObserver;
      }();
      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 ieVersion$4 = typeof document !== "undefined" ? document.documentMode : void 0;
      var isProduction = function() {
        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: [ ".concat(props, " ] is deprecated at [ ").concat(component, " ], use [ ").concat(instead, " ] instead of it."));
        }
      }
      function warning$1(msg) {
        if (!isProduction() && typeof console !== "undefined" && console.error) {
          return console.error("Warning: ".concat(msg));
        }
      }
      const _log = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
        __proto__: null,
        deprecated,
        warning: warning$1
      }, Symbol.toStringTag, { value: "Module" }));
      function typeOf(obj2) {
        return Object.prototype.toString.call(obj2).replace(/\[object\s|]/g, "");
      }
      function isArrayLike(obj2) {
        if (!obj2 || typeof obj2 !== "object") {
          return false;
        }
        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 === "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 + typeof 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 i2 = 0; i2 < len; i2++) {
          var key = keyA[i2];
          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;
        if (isArrayLike(obj2)) {
          var length_1 = obj2.length;
          for (var i2 = reversed ? length_1 - 1 : 0; i2 < length_1 && i2 >= 0; reversed ? i2-- : i2++) {
            var shouldContinue = callback.call(obj2[i2], obj2[i2], i2);
            if (shouldContinue === false) {
              break;
            }
          }
        } else {
          for (var key in obj2) {
            if (obj2.hasOwnProperty(key)) {
              var shouldContinue = callback.call(obj2[key], obj2[key], key);
              if (shouldContinue === false) {
                break;
              }
            }
          }
        }
        return obj2;
      }
      var _isInObj = function(key, obj2, isArray2) {
        return isArray2 ? obj2.indexOf(key) > -1 : key in obj2;
      };
      function pickOthers$9(holdProps, props) {
        var others = {};
        var isArray2 = typeOf(holdProps) === "Array";
        for (var key in props) {
          if (!_isInObj(key, holdProps, isArray2)) {
            others[key] = props[key];
          }
        }
        return others;
      }
      function pickProps(holdProps, props) {
        var others = {};
        var isArray2 = typeOf(holdProps) === "Array";
        for (var key in props) {
          if (_isInObj(key, holdProps, isArray2)) {
            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) {
        var _a, _b;
        var sources = [];
        for (var _i = 1; _i < arguments.length; _i++) {
          sources[_i - 1] = arguments[_i];
        }
        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__default.isValidElement(source[key])) {
              if (!target[key])
                Object.assign(target, (_a = {}, _a[key] = {}, _a));
              if (!isPlainObject$1(target[key])) {
                target[key] = source[key];
              }
              deepMerge(target[key], source[key]);
            } else {
              Object.assign(target, (_b = {}, _b[key] = source[key], _b));
            }
          }
        }
        return deepMerge.apply(void 0, __spreadArray([target], __read(sources), false));
      }
      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 isForwardRefComponent(component) {
        if (!component || typeof component !== "object") {
          return false;
        }
        var $$typeof = component.$$typeof;
        return !!$$typeof && $$typeof.toString().includes("react.forward_ref") || $$typeof === 60112;
      }
      function isReactFragment$1(component) {
        if (isNil$2(component)) {
          return false;
        }
        if (component.type) {
          return component.type === React__default.Fragment;
        }
        return component === React__default.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,
        isForwardRefComponent,
        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$1("[ hyphenate(str: string): string ] " + "Expected arguments[0] to be a string but get a ".concat(strType, ".") + "It will return an empty string without any processing.");
          return "";
        }
        return str.replace(/([A-Z])/g, function($0) {
          return "-".concat($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 (_force === void 0) {
          _force = false;
        }
        if (!hasDOM || !node) {
          return;
        }
        if (node.classList) {
          node.classList.add(className);
        } else if (_force === true || !hasClass$1(node, className)) {
          node.className += " ".concat(className);
        }
      }
      function removeClass$2(node, className, _force) {
        if (_force === void 0) {
          _force = false;
        }
        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 getStyle$5(node, name) {
        if (!hasDOM || !node) {
          return null;
        }
        var style = _getComputedStyle(node);
        if (!name) {
          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 === "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 = "".concat(value, "px");
          }
          node.style[camelcase(name)] = value;
        }
      }
      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;
      }
      var isScrollDisplay$1 = function(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 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 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 saveRef$1(ref) {
        if (!ref) {
          return null;
        }
        return function(element) {
          if (typeof ref === "string") {
            throw new Error("can not set ref string for ".concat(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$1(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() {
            return off$1(node, eventName, callback, useCapture);
          }
        };
      }
      function once(node, eventName, callback, useCapture) {
        return on$1(node, eventName, function __fn() {
          var args = [];
          for (var _i = 0; _i < arguments.length; _i++) {
            args[_i] = arguments[_i];
          }
          callback.apply(this, args);
          off$1(node, eventName, __fn, useCapture);
        }, useCapture);
      }
      const _events = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
        __proto__: null,
        off: off$1,
        on: on$1,
        once
      }, Symbol.toStringTag, { value: "Module" }));
      var dayjs_min = { exports: {} };
      (function(module2, exports2) {
        !function(t2, e2) {
          module2.exports = e2();
        }(commonjsGlobal, function() {
          var t2 = 1e3, e2 = 6e4, n2 = 36e5, r2 = "millisecond", i2 = "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), i3 = n3 % 60;
            return (e3 <= 0 ? "+" : "-") + m2(r3, 2, "0") + ":" + m2(i3, 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()), i3 = e3.clone().add(r3, c2), s2 = n3 - i3 < 0, u2 = e3.clone().add(r3 + (s2 ? -1 : 1), c2);
            return +(-(r3 + (n3 - i3) / (s2 ? i3 - u2 : u2 - i3)) || 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: i2, 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 i3;
            if (!e3)
              return g2;
            if ("string" == typeof e3) {
              var s2 = e3.toLowerCase();
              D[s2] && (i3 = s2), n3 && (D[s2] = n3, i3 = s2);
              var u2 = e3.split("-");
              if (!i3 && u2.length > 1)
                return t3(u2[0]);
            } else {
              var a2 = e3.name;
              D[a2] = e3, i3 = a2;
            }
            return !r3 && i3 && (g2 = i3), i3 || !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 i3 = r3[2] - 1 || 0, s2 = (r3[7] || "0").substring(0, 3);
                    return n3 ? new Date(Date.UTC(r3[1], i3, r3[3] || 1, r3[4] || 0, r3[5] || 0, r3[6] || 0, s2)) : new Date(r3[1], i3, 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 i3 = b2.w(n3.$u ? Date.UTC(n3.$y, e4, t4) : new Date(n3.$y, e4, t4), n3);
                return r3 ? i3 : i3.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 i2:
                  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[i2] = 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[i2] = 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", i3 = 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, i4, s3) {
                return t4 && (t4[n4] || t4(e3, r3)) || i4[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 i3;
                  }
                  return null;
                }(t4) || i3.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 i2:
                  $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", i2], ["$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(module2, exports2) {
        !function(e2, t2) {
          module2.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?/, i2 = /\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 i3 = 1; i3 <= 24; i3 += 1)
                if (e3.indexOf(r3(i3, 0, t3)) > -1) {
                  n3 = i3 > 12;
                  break;
                }
            } else
              n3 = e3 === (t3 ? "pm" : "PM");
            return n3;
          }, d2 = { A: [i2, function(e3) {
            this.afternoon = u(e3, false);
          }], a: [i2, 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: [i2, 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: [i2, 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: [i2, 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, i3;
            r3 = n3, i3 = 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 || i3[r4] || e2[r4] || i3[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 i4 = s2[n4];
                if ("string" == typeof i4)
                  r4 += i4.length;
                else {
                  var o2 = i4.regex, f4 = i4.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, i3 = 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), i4 = 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 || (i4 || o2 ? 1 : l3.getDate()), M2 = i4 || l3.getFullYear(), Y = 0;
                    i4 && !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
                i3.call(this, e4);
            };
          };
        });
      })(customParseFormat$1);
      var customParseFormatExports = customParseFormat$1.exports;
      const customParseFormat = /* @__PURE__ */ getDefaultExportFromCjs(customParseFormatExports);
      var updateLocale$2 = { exports: {} };
      (function(module2, exports2) {
        !function(e2, n2) {
          module2.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$2);
      var updateLocaleExports = updateLocale$2.exports;
      const updateLocale$1 = /* @__PURE__ */ getDefaultExportFromCjs(updateLocaleExports);
      var localeData$2 = { exports: {} };
      (function(module2, exports2) {
        !function(n2, e2) {
          module2.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 i3 = n3.name ? n3 : n3.$locale(), a2 = o(i3[e3]), s2 = o(i3[t3]), f2 = a2 || s2.map(function(n4) {
                return n4.slice(0, r3);
              });
              if (!u2)
                return f2;
              var d2 = i3.weekStart;
              return f2.map(function(n4, e4) {
                return f2[(e4 + (d2 || 0)) % 7];
              });
            }, i2 = 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 = i2();
              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(i2(), "months");
            }, t2.monthsShort = function() {
              return u(i2(), "monthsShort", "months", 3);
            }, t2.weekdays = function(n3) {
              return u(i2(), "weekdays", null, null, n3);
            }, t2.weekdaysShort = function(n3) {
              return u(i2(), "weekdaysShort", "weekdays", 3, n3);
            }, t2.weekdaysMin = function(n3) {
              return u(i2(), "weekdaysMin", "weekdays", 2, n3);
            };
          };
        });
      })(localeData$2);
      var localeDataExports = localeData$2.exports;
      const localeData$1 = /* @__PURE__ */ getDefaultExportFromCjs(localeDataExports);
      var quarterOfYear$1 = { exports: {} };
      (function(module2, exports2) {
        !function(t2, n2) {
          module2.exports = n2();
        }(commonjsGlobal, function() {
          var t2 = "month", n2 = "quarter";
          return function(e2, i2) {
            var r2 = i2.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, i3) {
              return e3 = Number(e3), this.$utils().p(i3) === n2 ? this.add(3 * e3, t2) : s.bind(this)(e3, i3);
            };
            var u = r2.startOf;
            r2.startOf = function(e3, i3) {
              var r3 = this.$utils(), s2 = !!r3.u(i3) || i3;
              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, i3);
            };
          };
        });
      })(quarterOfYear$1);
      var quarterOfYearExports = quarterOfYear$1.exports;
      const quarterOfYear = /* @__PURE__ */ getDefaultExportFromCjs(quarterOfYearExports);
      var advancedFormat$1 = { exports: {} };
      (function(module2, exports2) {
        !function(e2, t2) {
          module2.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$2 = { exports: {} };
      (function(module2, exports2) {
        !function(e2, t2) {
          module2.exports = t2();
        }(commonjsGlobal, function() {
          var e2 = "week", t2 = "year";
          return function(i2, n2, r2) {
            var f2 = n2.prototype;
            f2.week = function(i3) {
              if (void 0 === i3 && (i3 = null), null !== i3)
                return this.add(7 * (i3 - 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$2);
      var weekOfYearExports = weekOfYear$2.exports;
      const weekOfYear$1 = /* @__PURE__ */ getDefaultExportFromCjs(weekOfYearExports);
      var weekYear$1 = { exports: {} };
      (function(module2, exports2) {
        !function(e2, t2) {
          module2.exports = t2();
        }(commonjsGlobal, function() {
          return function(e2, t2) {
            t2.prototype.weekYear = function() {
              var e3 = this.month(), t3 = this.week(), n2 = this.year();
              return 1 === t3 && 11 === e3 ? n2 + 1 : 0 === e3 && t3 >= 52 ? n2 - 1 : n2;
            };
          };
        });
      })(weekYear$1);
      var weekYearExports = weekYear$1.exports;
      const weekYear = /* @__PURE__ */ getDefaultExportFromCjs(weekYearExports);
      var zhCn = { exports: {} };
      (function(module2, exports2) {
        !function(e2, _) {
          module2.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$1);
      dayjs.extend(localeData$1);
      dayjs.extend(weekOfYear$1);
      dayjs.extend(weekYear);
      dayjs.locale("zh-cn");
      var datejs = dayjs;
      datejs.isSelf = dayjs.isDayjs;
      dayjs.localeData();
      const datejs$1 = datejs;
      var noop$n = function() {
      };
      var prevent = function() {
        return false;
      };
      function makeChain$9() {
        var fns = [];
        for (var _i = 0; _i < arguments.length; _i++) {
          fns[_i] = arguments[_i];
        }
        if (fns.length === 1) {
          return fns[0];
        }
        return function chainedFunction() {
          var args = [];
          for (var _i2 = 0; _i2 < arguments.length; _i2++) {
            args[_i2] = arguments[_i2];
          }
          for (var i2 = 0, j2 = fns.length; i2 < j2; i2++) {
            var fn = fns[i2];
            if (fn && fn.apply) {
              fn.apply(this, args);
            }
          }
        };
      }
      function bindCtx$d(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, failure) {
        if (failure === void 0) {
          failure = noop$n;
        }
        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, __spreadArray([], __read(args || []), false));
      }
      function renderNode(render2, defaultRender, renderProps) {
        if (renderProps === void 0) {
          renderProps = [];
        }
        var r2 = render2 !== void 0 ? render2 : defaultRender;
        if (renderProps && !Array.isArray(renderProps)) {
          renderProps = [renderProps];
        }
        return typeof r2 === "function" ? r2.apply(void 0, __spreadArray([], __read(renderProps), false)) : r2;
      }
      function checkDate(value, format2) {
        if (value === void 0) {
          value = null;
        }
        var date = format2 ? datejs$1(value, format2) : datejs$1(value);
        return date.isValid() ? date : null;
      }
      function checkRangeDate(value, inputType, disabled, strictly, format2) {
        if (strictly === void 0) {
          strictly = true;
        }
        var _a = __read(Array.isArray(value) ? [0, 1].map(function(i2) {
          return checkDate(value[i2], format2);
        }) : [null, null], 2), begin = _a[0], end = _a[1];
        var _b = __read(Array.isArray(disabled) ? disabled : [disabled, disabled], 2), disabledBegin = _b[0], disabledEnd = _b[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$d,
        checkDate,
        checkRangeDate,
        invoke,
        makeChain: makeChain$9,
        noop: noop$n,
        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 nodeName = node.nodeName;
          if (nodeName === "BODY" || nodeName === "HTML") {
            break;
          }
          var style = node.style;
          if (style.display === "none" || 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) {
        var args = [];
        for (var _i = 1; _i < arguments.length; _i++) {
          args[_i - 1] = arguments[_i];
        }
        if (ref && ref.focus && typeof ref.focus === "function") {
          ref.focus.apply(ref, __spreadArray([], __read(args), false));
        }
      }
      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 escapeForId(text) {
        if (!text) {
          return "";
        }
        if (typeof text === "object") {
          text = JSON.stringify(text);
        } else if (typeof text !== "string") {
          text = String(text);
        }
        return text.replace(/['"]/gm, "").replace(/[\s'"]/gm, "-");
      }
      function randomId(prefix, max2) {
        if (max2 === void 0) {
          max2 = 1e6;
        }
        var rand = Math.ceil(Math.random() * max2);
        return prefix ? "".concat(escapeForId(prefix), "-").concat(rand) : rand.toString(10);
      }
      const _htmlId = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
        __proto__: null,
        escapeForId,
        randomId
      }, Symbol.toStringTag, { value: "Module" }));
      var timestamp = Date.now();
      function guid$1(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_1 = function(key2) {
          if (attributes.indexOf(key2) > -1 || eventsName.indexOf(key2) > -1) {
            attrs[key2] = props[key2];
          } else if (attrsPrefix.map(function(prefix) {
            return new RegExp("^".concat(prefix));
          }).some(function(reg) {
            return key2.replace(reg, "") !== key2;
          })) {
            attrs[key2] = props[key2];
          }
        };
        for (var key in props) {
          _loop_1(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 = guid$1;
      var KEYCODE = _KEYCODE;
      var htmlId = _htmlId;
      var pickAttrs = _pickAttrs;
      const scriptRel = function detectScriptRel() {
        const relList = typeof document !== "undefined" && document.createElement("link").relList;
        return relList && relList.supports && relList.supports("modulepreload") ? "modulepreload" : "preload";
      }();
      const assetsURL = function(dep) {
        return "/" + dep;
      };
      const seen = {};
      const __vitePreload = function preload(baseModule, deps, importerUrl) {
        let promise = Promise.resolve();
        if (deps && deps.length > 0) {
          const links = document.getElementsByTagName("link");
          const cspNonceMeta = document.querySelector("meta[property=csp-nonce]");
          const cspNonce = (cspNonceMeta == null ? void 0 : cspNonceMeta.nonce) || (cspNonceMeta == null ? void 0 : cspNonceMeta.getAttribute("nonce"));
          promise = Promise.all(deps.map((dep) => {
            dep = assetsURL(dep);
            if (dep in seen)
              return;
            seen[dep] = true;
            const isCss = dep.endsWith(".css");
            const cssSelector = isCss ? '[rel="stylesheet"]' : "";
            const isBaseRelative = !!importerUrl;
            if (isBaseRelative) {
              for (let i2 = links.length - 1; i2 >= 0; i2--) {
                const link2 = links[i2];
                if (link2.href === dep && (!isCss || link2.rel === "stylesheet")) {
                  return;
                }
              }
            } else if (document.querySelector(`link[href="${dep}"]${cssSelector}`)) {
              return;
            }
            const link = document.createElement("link");
            link.rel = isCss ? "stylesheet" : scriptRel;
            if (!isCss) {
              link.as = "script";
              link.crossOrigin = "";
            }
            link.href = dep;
            if (cspNonce) {
              link.setAttribute("nonce", cspNonce);
            }
            document.head.appendChild(link);
            if (isCss) {
              return new Promise((res, rej) => {
                link.addEventListener("load", res);
                link.addEventListener("error", () => rej(new Error(`Unable to preload CSS for ${dep}`)));
              });
            }
          }));
        }
        return promise.then(() => baseModule()).catch((err) => {
          const e2 = new Event("vite:preloadError", { cancelable: true });
          e2.payload = err;
          window.dispatchEvent(e2);
          if (!e2.defaultPrevented) {
            throw err;
          }
        });
      };
      var locale$1 = {
        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: "清除"
        },
        TextArea: {
          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"
          }
        }
      };
      function parseBoundary(input) {
        var obj2;
        if (input === void 0 || input === null) {
          return {};
        } else if (typeof input === "boolean") {
          obj2 = { open: input };
        } else {
          obj2 = __assign({ open: true }, input);
        }
        return obj2;
      }
      function getContextProps$1(props, context, displayName) {
        var prefix = props.prefix, locale2 = props.locale, 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;
        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;
        if (locale2) {
          newLocale = obj.deepMerge({}, locale$1[newDisplayName], localeFromContext, locale2);
        } else if (localeFromContext) {
          newLocale = obj.deepMerge({}, locale$1[newDisplayName], localeFromContext);
        }
        var newPure = typeof pure === "boolean" ? pure : nextPure;
        var newRtl = typeof rtl === "boolean" ? rtl : nextRtl;
        var newErrorBoundary = __assign(__assign({}, 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 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$1 = 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$1:
                    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$1;
      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$1;
      };
      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$1 || 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$1 = Object.defineProperty;
      var getOwnPropertyNames = Object.getOwnPropertyNames;
      var getOwnPropertySymbols = Object.getOwnPropertySymbols;
      var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
      var getPrototypeOf$1 = Object.getPrototypeOf;
      var objectPrototype = Object.prototype;
      function hoistNonReactStatics(targetComponent, sourceComponent, blacklist) {
        if (typeof sourceComponent !== "string") {
          if (objectPrototype) {
            var inheritedComponent = getPrototypeOf$1(sourceComponent);
            if (inheritedComponent && inheritedComponent !== objectPrototype) {
              hoistNonReactStatics(targetComponent, inheritedComponent, blacklist);
            }
          }
          var keys2 = getOwnPropertyNames(sourceComponent);
          if (getOwnPropertySymbols) {
            keys2 = keys2.concat(getOwnPropertySymbols(sourceComponent));
          }
          var targetStatics = getStatics(targetComponent);
          var sourceStatics = getStatics(sourceComponent);
          for (var i2 = 0; i2 < keys2.length; ++i2) {
            var key = keys2[i2];
            if (!KNOWN_STATICS[key] && !(blacklist && blacklist[key]) && !(sourceStatics && sourceStatics[key]) && !(targetStatics && targetStatics[key])) {
              var descriptor2 = getOwnPropertyDescriptor(sourceComponent, key);
              try {
                defineProperty$1(targetComponent, key, descriptor2);
              } catch (e2) {
              }
            }
          }
        }
        return targetComponent;
      }
      var hoistNonReactStatics_cjs = hoistNonReactStatics;
      const hoistNonReactStatic = /* @__PURE__ */ getDefaultExportFromCjs(hoistNonReactStatics_cjs);
      function DefaultUI() {
        return "";
      }
      DefaultUI.propTypes = {
        error: PT.object,
        errorInfo: PT.object
      };
      var ErrorBoundary = (
        /** @class */
        function(_super) {
          __extends(ErrorBoundary2, _super);
          function ErrorBoundary2(props) {
            var _this = _super.call(this, props) || this;
            _this.state = { error: null, errorInfo: null };
            return _this;
          }
          ErrorBoundary2.prototype.componentDidCatch = function(error, errorInfo) {
            this.setState({
              error,
              errorInfo
            });
            var afterCatch = this.props.afterCatch;
            if (typeof afterCatch === "function") {
              afterCatch(error, errorInfo);
            }
          };
          ErrorBoundary2.prototype.render = function() {
            var _a = this.props.fallbackUI, FallbackUI = _a === void 0 ? DefaultUI : _a;
            if (this.state.errorInfo) {
              return React__default.createElement(FallbackUI, { error: this.state.error, errorInfo: this.state.errorInfo });
            }
            return this.props.children;
          };
          ErrorBoundary2.propTypes = {
            children: PT.element,
            afterCatch: PT.func,
            fallbackUI: PT.func
          };
          return ErrorBoundary2;
        }(React__default.Component)
      );
      const ErrorBoundary$1 = ErrorBoundary;
      var shallowEqual = obj.shallowEqual;
      function getDisplayName(Component2) {
        return Component2.displayName || Component2.name || "Component";
      }
      var globalLocales;
      var currentGlobalLanguage = "zh-cn";
      var currentGlobalLocale = {};
      var currentGlobalRtl;
      function initLocales(locales2) {
        globalLocales = locales2;
        if (locales2) {
          currentGlobalLocale = locales2[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(locale2) {
        currentGlobalLocale = __assign(__assign({}, globalLocales ? globalLocales[currentGlobalLanguage] : {}), locale2);
        if (typeof currentGlobalRtl !== "boolean") {
          currentGlobalRtl = currentGlobalLocale && currentGlobalLocale.rtl;
        }
      }
      function setDirection(dir) {
        currentGlobalRtl = dir === "rtl";
      }
      function getLocale$1() {
        return currentGlobalLocale;
      }
      function getLanguage() {
        return currentGlobalLanguage;
      }
      function getDirection() {
        return currentGlobalRtl;
      }
      function isCanPassRefComponent(component) {
        return obj.isClassComponent(component) || obj.isForwardRefComponent(component);
      }
      function config$1(Component2, options) {
        if (options === void 0) {
          options = {};
        }
        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 = (
          /** @class */
          function(_super) {
            __extends(ConfigedComponent2, _super);
            function ConfigedComponent2(props, context) {
              var _this = _super.call(this, props, context) || this;
              _this._getInstance = _this._getInstance.bind(_this);
              _this._deprecated = _this._deprecated.bind(_this);
              return _this;
            }
            ConfigedComponent2.prototype._getInstance = function(ref) {
              var _this = this;
              this._instance = ref;
              if (this._instance && options.exportNames) {
                options.exportNames.forEach(function(name) {
                  var field = _this._instance[name];
                  if (typeof field === "function") {
                    _this[name] = field.bind(_this._instance);
                  } else {
                    _this[name] = field;
                  }
                });
              }
            };
            ConfigedComponent2.prototype._deprecated = function() {
              var args = [];
              for (var _i = 0; _i < arguments.length; _i++) {
                args[_i] = arguments[_i];
              }
              if (this.context.nextWarning !== false) {
                log.deprecated.apply(log, __spreadArray([], __read(args), false));
              }
            };
            ConfigedComponent2.prototype.getInstance = function() {
              return this._instance;
            };
            ConfigedComponent2.prototype.render = function() {
              var _a = this.props, prefix = _a.prefix, locale2 = _a.locale, defaultPropsConfig = _a.defaultPropsConfig, pure = _a.pure, rtl = _a.rtl, device = _a.device, popupContainer = _a.popupContainer, errorBoundary = _a.errorBoundary, others = __rest(_a, ["prefix", "locale", "defaultPropsConfig", "pure", "rtl", "device", "popupContainer", "errorBoundary"]);
              var _b = this.context, nextPrefix = _b.nextPrefix, _c = _b.nextLocale, nextLocale = _c === void 0 ? {} : _c, _d = _b.nextDefaultPropsConfig, nextDefaultPropsConfig = _d === void 0 ? {} : _d, nextPure = _b.nextPure, nextRtl = _b.nextRtl, nextDevice = _b.nextDevice, nextPopupContainer = _b.nextPopupContainer, nextErrorBoundary = _b.nextErrorBoundary;
              var displayName = options.componentName || getDisplayName(Component2);
              var contextProps = getContextProps$1({
                prefix,
                locale: locale2,
                defaultPropsConfig,
                pure,
                device,
                popupContainer,
                rtl,
                errorBoundary
              }, {
                nextPrefix,
                nextLocale: __assign(__assign({}, 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 newProps = __assign(__assign(__assign({}, contextProps.defaultPropsConfig[displayName]), newOthers), newContextProps);
              if (isCanPassRefComponent(Component2)) {
                newProps.ref = this._getInstance;
              }
              var content = React__default.createElement(Component2, __assign({}, newProps));
              var _e = contextProps.errorBoundary, open2 = _e.open, othersBoundary = __rest(_e, ["open"]);
              return open2 ? React__default.createElement(ErrorBoundary$1, __assign({}, othersBoundary), content) : content;
            };
            ConfigedComponent2.displayName = "Config(".concat(getDisplayName(Component2), ")");
            ConfigedComponent2.propTypes = __assign(__assign({}, Component2.propTypes || {}), { prefix: PT.string, locale: PT.object, defaultPropsConfig: PT.object, pure: PT.bool, rtl: PT.bool, device: PT.oneOf(["tablet", "desktop", "phone"]), popupContainer: PT.any, errorBoundary: PT.oneOfType([PT.bool, PT.object]) });
            ConfigedComponent2.contextTypes = __assign(__assign({}, Component2.contextTypes || {}), { nextPrefix: PT.string, nextLocale: PT.object, nextDefaultPropsConfig: PT.object, nextPure: PT.bool, nextRtl: PT.bool, nextWarning: PT.bool, nextDevice: PT.oneOf(["tablet", "desktop", "phone"]), nextPopupContainer: PT.any, nextErrorBoundary: PT.oneOfType([PT.bool, PT.object]) });
            return ConfigedComponent2;
          }(React__default.Component)
        );
        hoistNonReactStatic(ConfigedComponent, Component2);
        return ConfigedComponent;
      }
      var mapKeys = function(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(key) {
        return key.replace(/^(next)([A-Z])/, function(match, p1, p2) {
          return p2.toLowerCase();
        });
      };
      var transformContext = function(source) {
        return mapKeys(source, replaceKey);
      };
      var Consumer = function(_a, context) {
        var children = _a.children;
        return typeof children === "function" ? children(transformContext(context)) : null;
      };
      Consumer.propTypes = {
        // Render context as function
        // Function(context: object): ReactElement
        children: PT.func
      };
      Consumer.contextTypes = {
        nextPrefix: PT.string,
        nextLocale: PT.object,
        nextPure: PT.bool,
        newRtl: PT.bool,
        nextWarning: PT.bool,
        nextDevice: PT.oneOf(["tablet", "desktop", "phone"]),
        nextPopupContainer: PT.any
      };
      const Consumer$1 = Consumer;
      var Cache = (
        /** @class */
        function() {
          function Cache2() {
            this._root = null;
            this._store = /* @__PURE__ */ new Map();
          }
          Cache2.prototype.empty = function() {
            return this._store.size === 0;
          };
          Cache2.prototype.has = function(key) {
            return this._store.has(key);
          };
          Cache2.prototype.get = function(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(key, value) {
            if (this.empty()) {
              this._root = key;
            }
            this._store.set(key, value);
          };
          Cache2.prototype.update = function(key, value) {
            if (this.has(key)) {
              this._store.set(key, value);
            }
          };
          Cache2.prototype.remove = function(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() {
            this._store.clear();
          };
          Cache2.prototype.root = function() {
            return this._store.get(this._root);
          };
          return Cache2;
        }()
      );
      var childContextCache = new Cache();
      var setMomentLocale = function(locale2) {
        return __awaiter(void 0, void 0, void 0, function() {
          var moment$1;
          return __generator(this, function(_a) {
            switch (_a.label) {
              case 0:
                _a.trys.push([0, 2, , 3]);
                return [4, __vitePreload(() => Promise.resolve().then(() => moment), void 0 )];
              case 1:
                moment$1 = _a.sent();
                if (moment$1 && moment$1.default && moment$1.default.isMoment)
                  moment$1 = moment$1.default;
                return [3, 3];
              case 2:
                _a.sent();
                return [3, 3];
              case 3:
                if (moment$1 && moment$1.locale && locale2) {
                  moment$1.locale(locale2.momentLocale);
                }
                return [
                  2
                  /*return*/
                ];
            }
          });
        });
      };
      var setDateLocale = function(locale2) {
        if (locale2) {
          datejs$1.locale(locale2.dateLocale || locale2.momentLocale);
        }
      };
      var ConfigProvider = (
        /** @class */
        function(_super) {
          __extends(ConfigProvider2, _super);
          function ConfigProvider2(props, context) {
            var _this = _super.call(this, props, context) || this;
            childContextCache.add(_this, Object.assign({}, childContextCache.get(_this, {}), _this.getChildContext()));
            setMomentLocale(_this.props.locale);
            setDateLocale(_this.props.locale);
            _this.state = {
              locale: _this.props.locale
            };
            return _this;
          }
          ConfigProvider2.prototype.getChildContext = function() {
            var _a = this.props, prefix = _a.prefix, locale2 = _a.locale, defaultPropsConfig = _a.defaultPropsConfig, pure = _a.pure, warning2 = _a.warning, rtl = _a.rtl, device = _a.device, popupContainer = _a.popupContainer, errorBoundary = _a.errorBoundary;
            var _b = this.context, nextPrefix = _b.nextPrefix, nextDefaultPropsConfig = _b.nextDefaultPropsConfig, nextLocale = _b.nextLocale, nextPure = _b.nextPure, nextRtl = _b.nextRtl, nextWarning = _b.nextWarning, nextDevice = _b.nextDevice, nextPopupContainer = _b.nextPopupContainer, nextErrorBoundary = _b.nextErrorBoundary;
            return {
              nextPrefix: prefix || nextPrefix,
              nextDefaultPropsConfig: defaultPropsConfig || nextDefaultPropsConfig,
              nextLocale: locale2 || 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(nextProps, prevState) {
            if (nextProps.locale !== prevState.locale) {
              setMomentLocale(nextProps.locale);
              setDateLocale(nextProps.locale);
              return {
                locale: nextProps.locale
              };
            }
            return null;
          };
          ConfigProvider2.prototype.componentDidUpdate = function() {
            childContextCache.add(this, Object.assign({}, childContextCache.get(this, {}), this.getChildContext()));
          };
          ConfigProvider2.prototype.componentWillUnmount = function() {
            childContextCache.remove(this);
          };
          ConfigProvider2.prototype.render = function() {
            return React__default.Children.only(this.props.children);
          };
          ConfigProvider2.propTypes = {
            /**
             * 样式类名的品牌前缀
             */
            prefix: PT.string,
            /**
             * 国际化文案对象,属性为组件的 displayName
             */
            locale: PT.object,
            /**
             * 组件 API 的默认配置
             */
            defaultPropsConfig: PT.object,
            /**
             * 是否开启错误捕捉 errorBoundary
             * 如需自定义参数,请传入对象 对象接受参数列表如下:
             *
             * fallbackUI `Function(error?: {}, errorInfo?: {}) => Element` 捕获错误后的展示
             * afterCatch `Function(error?: {}, errorInfo?: {})` 捕获错误后的行为,比如埋点上传
             */
            errorBoundary: PT.oneOfType([PT.bool, PT.object]),
            /**
             * 是否开启 Pure Render 模式,会提高性能,但是也会带来副作用
             */
            pure: PT.bool,
            /**
             * 是否在开发模式下显示组件属性被废弃的 warning 提示
             */
            warning: PT.bool,
            /**
             * 是否开启 rtl 模式
             */
            rtl: PT.bool,
            /**
             * 设备类型,针对不同的设备类型组件做出对应的响应式变化
             */
            device: PT.oneOf(["tablet", "desktop", "phone"]),
            /**
             * 组件树
             */
            children: PT.any,
            /**
             * 指定浮层渲染的父节点,可以为节点 id 的字符串,也可以返回节点的函数
             */
            popupContainer: PT.any
          };
          ConfigProvider2.defaultProps = {
            warning: true,
            errorBoundary: false
          };
          ConfigProvider2.contextTypes = {
            nextPrefix: PT.string,
            nextLocale: PT.object,
            nextDefaultPropsConfig: PT.object,
            nextPure: PT.bool,
            nextRtl: PT.bool,
            nextWarning: PT.bool,
            nextDevice: PT.oneOf(["tablet", "desktop", "phone"]),
            nextPopupContainer: PT.any,
            nextErrorBoundary: PT.oneOfType([PT.bool, PT.object])
          };
          ConfigProvider2.childContextTypes = {
            nextPrefix: PT.string,
            nextLocale: PT.object,
            nextDefaultPropsConfig: PT.object,
            nextPure: PT.bool,
            nextRtl: PT.bool,
            nextWarning: PT.bool,
            nextDevice: PT.oneOf(["tablet", "desktop", "phone"]),
            nextPopupContainer: PT.any,
            nextErrorBoundary: PT.oneOfType([PT.bool, PT.object])
          };
          ConfigProvider2.config = config$1;
          ConfigProvider2.initLocales = initLocales;
          ConfigProvider2.setLanguage = setLanguage;
          ConfigProvider2.setLocale = setLocale;
          ConfigProvider2.setDirection = setDirection;
          ConfigProvider2.getLanguage = getLanguage;
          ConfigProvider2.getLocale = getLocale$1;
          ConfigProvider2.getDirection = getDirection;
          ConfigProvider2.Consumer = Consumer$1;
          ConfigProvider2.ErrorBoundary = ErrorBoundary$1;
          ConfigProvider2.getContextProps = function(props, displayName) {
            return getContextProps$1(props, childContextCache.root() || {}, displayName);
          };
          ConfigProvider2.clearCache = function() {
            childContextCache.clear();
          };
          ConfigProvider2.getContext = function() {
            var _a = childContextCache.root() || {}, nextPrefix = _a.nextPrefix, nextLocale = _a.nextLocale, nextDefaultPropsConfig = _a.nextDefaultPropsConfig, nextPure = _a.nextPure, nextRtl = _a.nextRtl, nextWarning = _a.nextWarning, nextDevice = _a.nextDevice, nextPopupContainer = _a.nextPopupContainer, nextErrorBoundary = _a.nextErrorBoundary;
            return {
              prefix: nextPrefix,
              locale: nextLocale,
              defaultPropsConfig: nextDefaultPropsConfig,
              pure: nextPure,
              rtl: nextRtl,
              warning: nextWarning,
              device: nextDevice,
              popupContainer: nextPopupContainer,
              errorBoundary: nextErrorBoundary
            };
          };
          return ConfigProvider2;
        }(React__default.Component)
      );
      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$1(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 Affix = (
        /** @class */
        function(_super) {
          __extends(Affix2, _super);
          function Affix2(props, context) {
            var _this = _super.call(this, props, context) || this;
            _this._clearContainerEvent = function() {
              if (_this.timeout) {
                clearTimeout(_this.timeout);
                _this.timeout = null;
              }
              var container = _this.props.container;
              _this._removeEventHandlerForContainer(container);
            };
            _this.updatePosition = function() {
              _this._updateNodePosition();
            };
            _this._updateNodePosition = function() {
              var affixMode = _this.state.affixMode;
              var _a = _this.props, container = _a.container, useAbsolute = _a.useAbsolute;
              var affixContainer = container();
              if (!affixContainer || !_this.affixNode) {
                return false;
              }
              var containerScrollTop = getScroll(affixContainer, true);
              var affixOffset = _this._getOffset(_this.affixNode, affixContainer);
              var containerHeight = getNodeHeight(affixContainer);
              var affixHeight = _this.affixNode.offsetHeight;
              var containerRect = getRect$1(affixContainer);
              var affixChildHeight = _this.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;
                }
                _this._setAffixStyle(affixStyle, true);
                _this._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;
                }
                _this._setAffixStyle(affixStyle, true);
                _this._setContainerStyle(containerStyle);
              } else {
                _this._setAffixStyle(null);
                _this._setContainerStyle(null);
              }
              if (_this.state.positionStyle !== positionStyle) {
                _this.setState({ positionStyle });
              }
            };
            _this._affixNodeRefHandler = function(ref) {
              _this.affixNode = ref;
            };
            _this._affixChildNodeRefHandler = function(ref) {
              _this.affixChildNode = ref;
            };
            _this.state = {
              style: null,
              containerStyle: null,
              positionStyle: null,
              affixMode: Affix2._getAffixMode(props)
            };
            _this.resizeObserver = new index(_this._updateNodePosition);
            return _this;
          }
          Affix2._getAffixMode = function(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;
          };
          Affix2.getDerivedStateFromProps = function(nextProps) {
            if ("offsetTop" in nextProps || "offsetBottom" in nextProps) {
              return {
                affixMode: Affix2._getAffixMode(nextProps)
              };
            }
            return null;
          };
          Affix2.prototype.componentDidMount = function() {
            var _this = this;
            var container = this.props.container;
            this.timeout = setTimeout(function() {
              _this._updateNodePosition();
              _this._setEventHandlerForContainer(container);
            });
          };
          Affix2.prototype.componentDidUpdate = function(prevProps) {
            var _this = this;
            if (prevProps.container() !== this.props.container()) {
              this._clearContainerEvent();
              this.timeout = setTimeout(function() {
                _this._setEventHandlerForContainer(_this.props.container);
              });
            }
            setTimeout(this._updateNodePosition);
          };
          Affix2.prototype.componentWillUnmount = function() {
            this._clearContainerEvent();
          };
          Affix2.prototype._setEventHandlerForContainer = function(getContainer2) {
            var container = getContainer2();
            if (!container) {
              return;
            }
            events.on(container, "scroll", this._updateNodePosition, false);
            this.resizeObserver.observe(this.affixNode);
          };
          Affix2.prototype._removeEventHandlerForContainer = function(getContainer2) {
            var container = getContainer2();
            if (container) {
              events.off(container, "scroll", this._updateNodePosition);
              this.resizeObserver.disconnect();
            }
          };
          Affix2.prototype._setAffixStyle = function(affixStyle, affixed) {
            if (affixed === void 0) {
              affixed = 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(containerStyle) {
            if (obj.shallowEqual(containerStyle, this.state.containerStyle)) {
              return;
            }
            this.setState({ containerStyle });
          };
          Affix2.prototype._getOffset = function(affixNode, affixContainer) {
            var affixRect = affixNode.getBoundingClientRect();
            var containerRect = getRect$1(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() {
            var _a;
            var _b = this.state, affixMode = _b.affixMode, positionStyle = _b.positionStyle;
            var _c = this.props, prefix = _c.prefix, className = _c.className, style = _c.style, children = _c.children;
            var state = this.state;
            var classNames = classnames((_a = {}, _a["".concat(prefix, "affix")] = state.style, _a["".concat(prefix, "affix-top")] = !state.style && affixMode.top, _a["".concat(prefix, "affix-bottom")] = !state.style && affixMode.bottom, _a[className] = className, _a));
            var wrapperStyle = __assign(__assign({}, style), { position: positionStyle || void 0 });
            return React__default.createElement(
              "div",
              { ref: this._affixNodeRefHandler, style: wrapperStyle },
              state.style && React__default.createElement("div", { style: state.containerStyle, "aria-hidden": "true" }),
              React__default.createElement("div", { ref: this._affixChildNodeRefHandler, className: classNames, style: state.style }, children)
            );
          };
          Affix2.propTypes = {
            prefix: PT.string,
            container: PT.func,
            offsetTop: PT.number,
            offsetBottom: PT.number,
            onAffix: PT.func,
            useAbsolute: PT.bool,
            className: PT.string,
            style: PT.object,
            children: PT.any
          };
          Affix2.defaultProps = {
            prefix: "next-",
            container: function() {
              return window;
            },
            onAffix: func.noop
          };
          return Affix2;
        }(React__default.Component)
      );
      const Affix$1 = ConfigProvider$1.config(polyfill(Affix));
      function assignSubComponent(Component2, SubComponents) {
        for (var key in SubComponents) {
          if (Object.prototype.hasOwnProperty.call(SubComponents, key)) {
            Component2[key] = SubComponents[key];
          }
        }
        return Component2;
      }
      var CSSTransition = { exports: {} };
      var addClass$1 = { exports: {} };
      var interopRequireDefault = { exports: {} };
      (function(module2) {
        function _interopRequireDefault2(obj2) {
          return obj2 && obj2.__esModule ? obj2 : {
            "default": obj2
          };
        }
        module2.exports = _interopRequireDefault2, module2.exports.__esModule = true, module2.exports["default"] = module2.exports;
      })(interopRequireDefault);
      var interopRequireDefaultExports = interopRequireDefault.exports;
      var hasClass = { exports: {} };
      var hasRequiredHasClass;
      function requireHasClass() {
        if (hasRequiredHasClass)
          return hasClass.exports;
        hasRequiredHasClass = 1;
        (function(module2, exports2) {
          exports2.__esModule = true;
          exports2.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;
          }
          module2.exports = exports2["default"];
        })(hasClass, hasClass.exports);
        return hasClass.exports;
      }
      (function(module2, exports2) {
        var _interopRequireDefault2 = interopRequireDefaultExports;
        exports2.__esModule = true;
        exports2.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);
        }
        module2.exports = exports2["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 removeClass2(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$5(React__default);
      var _reactDom = _interopRequireDefault$5(ReactDOM);
      var _reactLifecyclesCompat = require$$2;
      function _interopRequireDefault$5(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, i2;
        for (i2 = 0; i2 < sourceKeys.length; i2++) {
          key = sourceKeys[i2];
          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 _this;
          _this = _React$Component.call(this, props, context) || this;
          var parentGroup = context.transitionGroup;
          var appear = parentGroup && !parentGroup.isMounting ? props.enter : props.appear;
          var initialStatus;
          _this.appearStatus = null;
          if (props.in) {
            if (appear) {
              initialStatus = EXITED;
              _this.appearStatus = ENTERING;
            } else {
              initialStatus = ENTERED;
            }
          } else {
            if (props.unmountOnExit || props.mountOnEnter) {
              initialStatus = UNMOUNTED;
            } else {
              initialStatus = EXITED;
            }
          }
          _this.state = {
            status: initialStatus
          };
          _this.nextCallback = null;
          return _this;
        }
        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 timeout2 = this.props.timeout;
          var exit, enter, appear;
          exit = enter = appear = timeout2;
          if (timeout2 != null && typeof timeout2 !== "number") {
            exit = timeout2.exit;
            enter = timeout2.enter;
            appear = timeout2.appear !== void 0 ? timeout2.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, timeout2, handler) {
          this.setNextCallback(handler);
          var doesNotHaveTimeoutOrListener = timeout2 == null && !this.props.addEndListener;
          if (!node || doesNotHaveTimeoutOrListener) {
            setTimeout(this.nextCallback, 0);
            return;
          }
          if (this.props.addEndListener) {
            this.props.addEndListener(node, this.nextCallback);
          }
          if (timeout2 != null) {
            setTimeout(this.nextCallback, timeout2);
          }
        };
        _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$m() {
      }
      Transition.defaultProps = {
        in: false,
        mountOnEnter: false,
        unmountOnExit: false,
        appear: false,
        enter: true,
        exit: true,
        onEnter: noop$m,
        onEntering: noop$m,
        onEntered: noop$m,
        onExit: noop$m,
        onExiting: noop$m,
        onExited: noop$m
      };
      Transition.UNMOUNTED = 0;
      Transition.EXITED = 1;
      Transition.ENTERING = 2;
      Transition.ENTERED = 3;
      Transition.EXITING = 4;
      var _default$6 = (0, _reactLifecyclesCompat.polyfill)(Transition);
      Transition$1.default = _default$6;
      (function(module2, exports2) {
        exports2.__esModule = true;
        exports2.default = void 0;
        _interopRequireWildcard2(propTypesExports);
        var _addClass = _interopRequireDefault2(addClassExports);
        var _removeClass = _interopRequireDefault2(removeClass$1);
        var _react2 = _interopRequireDefault2(React__default);
        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 i2 = 1; i2 < arguments.length; i2++) {
              var source = arguments[i2];
              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 addClass22(node, classes) {
          return node && classes && classes.split(" ").forEach(function(c2) {
            return (0, _addClass.default)(node, c2);
          });
        };
        var removeClass2 = function removeClass22(node, classes) {
          return node && classes && classes.split(" ").forEach(function(c2) {
            return (0, _removeClass.default)(node, c2);
          });
        };
        var CSSTransition2 = /* @__PURE__ */ function(_React$Component) {
          _inheritsLoose2(CSSTransition22, _React$Component);
          function CSSTransition22() {
            var _this;
            for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
              args[_key] = arguments[_key];
            }
            _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;
            _this.onEnter = function(node, appearing) {
              var _this$getClassNames = _this.getClassNames(appearing ? "appear" : "enter"), className = _this$getClassNames.className;
              _this.removeClasses(node, "exit");
              addClass2(node, className);
              if (_this.props.onEnter) {
                _this.props.onEnter(node, appearing);
              }
            };
            _this.onEntering = function(node, appearing) {
              var _this$getClassNames2 = _this.getClassNames(appearing ? "appear" : "enter"), activeClassName = _this$getClassNames2.activeClassName;
              _this.reflowAndAddClass(node, activeClassName);
              if (_this.props.onEntering) {
                _this.props.onEntering(node, appearing);
              }
            };
            _this.onEntered = function(node, appearing) {
              var appearClassName = _this.getClassNames("appear").doneClassName;
              var enterClassName = _this.getClassNames("enter").doneClassName;
              var doneClassName = appearing ? appearClassName + " " + enterClassName : enterClassName;
              _this.removeClasses(node, appearing ? "appear" : "enter");
              addClass2(node, doneClassName);
              if (_this.props.onEntered) {
                _this.props.onEntered(node, appearing);
              }
            };
            _this.onExit = function(node) {
              var _this$getClassNames3 = _this.getClassNames("exit"), className = _this$getClassNames3.className;
              _this.removeClasses(node, "appear");
              _this.removeClasses(node, "enter");
              addClass2(node, className);
              if (_this.props.onExit) {
                _this.props.onExit(node);
              }
            };
            _this.onExiting = function(node) {
              var _this$getClassNames4 = _this.getClassNames("exit"), activeClassName = _this$getClassNames4.activeClassName;
              _this.reflowAndAddClass(node, activeClassName);
              if (_this.props.onExiting) {
                _this.props.onExiting(node);
              }
            };
            _this.onExited = function(node) {
              var _this$getClassNames5 = _this.getClassNames("exit"), doneClassName = _this$getClassNames5.doneClassName;
              _this.removeClasses(node, "exit");
              addClass2(node, doneClassName);
              if (_this.props.onExited) {
                _this.props.onExited(node);
              }
            };
            _this.getClassNames = function(type2) {
              var classNames = _this.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 _this;
          }
          var _proto = CSSTransition22.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 && removeClass2(node, className);
            activeClassName && removeClass2(node, activeClassName);
            doneClassName && removeClass2(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 CSSTransition22;
        }(_react2.default.Component);
        CSSTransition2.defaultProps = {
          classNames: ""
        };
        CSSTransition2.propTypes = {};
        var _default2 = CSSTransition2;
        exports2.default = _default2;
        module2.exports = exports2["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__default;
      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 i2;
        var childMapping = {};
        for (var nextKey in next) {
          if (nextKeysPending[nextKey]) {
            for (i2 = 0; i2 < nextKeysPending[nextKey].length; i2++) {
              var pendingNextKey = nextKeysPending[nextKey][i2];
              childMapping[nextKeysPending[nextKey][i2]] = getValueForKey(pendingNextKey);
            }
          }
          childMapping[nextKey] = getValueForKey(nextKey);
        }
        for (i2 = 0; i2 < pendingKeys.length; i2++) {
          childMapping[pendingKeys[i2]] = getValueForKey(pendingKeys[i2]);
        }
        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(module2, exports2) {
        exports2.__esModule = true;
        exports2.default = void 0;
        var _propTypes = _interopRequireDefault2(propTypesExports);
        var _react2 = _interopRequireDefault2(React__default);
        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, i2;
          for (i2 = 0; i2 < sourceKeys.length; i2++) {
            key = sourceKeys[i2];
            if (excluded.indexOf(key) >= 0)
              continue;
            target[key] = source[key];
          }
          return target;
        }
        function _extends2() {
          _extends2 = Object.assign || function(target) {
            for (var i2 = 1; i2 < arguments.length; i2++) {
              var source = arguments[i2];
              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(TransitionGroup22, _React$Component);
          function TransitionGroup22(props, context) {
            var _this;
            _this = _React$Component.call(this, props, context) || this;
            var handleExited = _this.handleExited.bind(_assertThisInitialized(_assertThisInitialized(_this)));
            _this.state = {
              handleExited,
              firstRender: true
            };
            return _this;
          }
          var _proto = TransitionGroup22.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;
          };
          TransitionGroup22.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, childFactory2 = _this$props.childFactory, props = _objectWithoutPropertiesLoose2(_this$props, ["component", "childFactory"]);
            var children = values2(this.state.children).map(childFactory2);
            delete props.appear;
            delete props.enter;
            delete props.exit;
            if (Component2 === null) {
              return children;
            }
            return _react2.default.createElement(Component2, props, children);
          };
          return TransitionGroup22;
        }(_react2.default.Component);
        TransitionGroup2.childContextTypes = {
          transitionGroup: _propTypes.default.object.isRequired
        };
        TransitionGroup2.propTypes = {};
        TransitionGroup2.defaultProps = defaultProps;
        var _default2 = (0, _reactLifecyclesCompat2.polyfill)(TransitionGroup2);
        exports2.default = _default2;
        module2.exports = exports2["default"];
      })(TransitionGroup, TransitionGroup.exports);
      var TransitionGroupExports = TransitionGroup.exports;
      (function(module2, exports2) {
        exports2.__esModule = true;
        exports2.default = void 0;
        _interopRequireDefault2(propTypesExports);
        var _react2 = _interopRequireDefault2(React__default);
        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, i2;
          for (i2 = 0; i2 < sourceKeys.length; i2++) {
            key = sourceKeys[i2];
            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(ReplaceTransition22, _React$Component);
          function ReplaceTransition22() {
            var _this;
            for (var _len = arguments.length, _args = new Array(_len), _key = 0; _key < _len; _key++) {
              _args[_key] = arguments[_key];
            }
            _this = _React$Component.call.apply(_React$Component, [this].concat(_args)) || this;
            _this.handleEnter = function() {
              for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
                args[_key2] = arguments[_key2];
              }
              return _this.handleLifecycle("onEnter", 0, args);
            };
            _this.handleEntering = function() {
              for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
                args[_key3] = arguments[_key3];
              }
              return _this.handleLifecycle("onEntering", 0, args);
            };
            _this.handleEntered = function() {
              for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
                args[_key4] = arguments[_key4];
              }
              return _this.handleLifecycle("onEntered", 0, args);
            };
            _this.handleExit = function() {
              for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
                args[_key5] = arguments[_key5];
              }
              return _this.handleLifecycle("onExit", 1, args);
            };
            _this.handleExiting = function() {
              for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {
                args[_key6] = arguments[_key6];
              }
              return _this.handleLifecycle("onExiting", 1, args);
            };
            _this.handleExited = function() {
              for (var _len7 = arguments.length, args = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {
                args[_key7] = arguments[_key7];
              }
              return _this.handleLifecycle("onExited", 1, args);
            };
            return _this;
          }
          var _proto = ReplaceTransition22.prototype;
          _proto.handleLifecycle = function handleLifecycle(handler, idx, originalArgs) {
            var _child$props;
            var children2 = this.props.children;
            var child = _react2.default.Children.toArray(children2)[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, children2 = _this$props.children, inProp = _this$props.in, props = _objectWithoutPropertiesLoose2(_this$props, ["children", "in"]);
            var _React$Children$toArr = _react2.default.Children.toArray(children2), 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 ReplaceTransition22;
        }(_react2.default.Component);
        ReplaceTransition2.propTypes = {};
        var _default2 = ReplaceTransition2;
        exports2.default = _default2;
        module2.exports = exports2["default"];
      })(ReplaceTransition, ReplaceTransition.exports);
      var ReplaceTransitionExports = ReplaceTransition.exports;
      var _CSSTransition = _interopRequireDefault$4(CSSTransitionExports);
      var _ReplaceTransition = _interopRequireDefault$4(ReplaceTransitionExports);
      var _TransitionGroup = _interopRequireDefault$4(TransitionGroupExports);
      var _Transition = _interopRequireDefault$4(Transition$1);
      function _interopRequireDefault$4(obj2) {
        return obj2 && obj2.__esModule ? obj2 : { default: obj2 };
      }
      var reactTransitionGroup = {
        Transition: _Transition.default,
        TransitionGroup: _TransitionGroup.default,
        ReplaceTransition: _ReplaceTransition.default,
        CSSTransition: _CSSTransition.default
      };
      var noop$l = function() {
      };
      var on = events.on, off = events.off;
      var addClass = dom.addClass, removeClass = dom.removeClass;
      var prefixes$1 = ["-webkit-", "-moz-", "-o-", "ms-", ""];
      function getStyleProperty$1(node, name) {
        var style = window.getComputedStyle(node);
        var ret = "";
        for (var i2 = 0; i2 < prefixes$1.length; i2++) {
          ret = style.getPropertyValue(prefixes$1[i2] + name);
          if (ret) {
            break;
          }
        }
        return ret;
      }
      var AnimateChild = (
        /** @class */
        function(_super) {
          __extends(AnimateChild2, _super);
          function AnimateChild2(props) {
            var _this_1 = _super.call(this, props) || this;
            func.bindCtx(_this_1, [
              "handleEnter",
              "handleEntering",
              "handleEntered",
              "handleExit",
              "handleExiting",
              "handleExited",
              "addEndListener"
            ]);
            _this_1.endListeners = {
              transitionend: [],
              animationend: []
            };
            _this_1.timeoutMap = {};
            return _this_1;
          }
          AnimateChild2.prototype.componentWillUnmount = function() {
            var _this_1 = this;
            Object.keys(this.endListeners).forEach(function(eventName) {
              _this_1.endListeners[eventName].forEach(function(listener) {
                off(_this_1.node, eventName, listener);
              });
            });
            this.endListeners = {
              transitionend: [],
              animationend: []
            };
          };
          AnimateChild2.prototype.generateEndListener = function(node, done, eventName, id2) {
            var _this = this;
            return function endListener(e2) {
              if (e2 && e2.target === node) {
                if (_this.timeoutMap[id2]) {
                  clearTimeout(_this.timeoutMap[id2]);
                  delete _this.timeoutMap[id2];
                }
                done();
                off(node, eventName, endListener);
                var listeners = _this.endListeners[eventName];
                var index2 = listeners.indexOf(endListener);
                index2 > -1 && listeners.splice(index2, 1);
              }
            };
          };
          AnimateChild2.prototype.addEndListener = function(node, done) {
            var _this_1 = this;
            if (support.transition || support.animation) {
              var id_1 = guid();
              this.node = node;
              if (support.transition) {
                var transitionEndListener = this.generateEndListener(node, done, "transitionend", id_1);
                on(node, "transitionend", transitionEndListener);
                this.endListeners.transitionend.push(transitionEndListener);
              }
              if (support.animation) {
                var animationEndListener = this.generateEndListener(node, done, "animationend", id_1);
                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) {
                  _this_1.timeoutMap[id_1] = window.setTimeout(function() {
                    done();
                  }, time * 1e3 + 200);
                }
              }, 15);
            } else {
              done();
            }
          };
          AnimateChild2.prototype.removeEndtListener = function() {
            this.transitionOff && this.transitionOff();
            this.animationOff && this.animationOff();
          };
          AnimateChild2.prototype.removeClassNames = function(node, names) {
            Object.keys(names).forEach(function(key) {
              removeClass(node, names[key]);
            });
          };
          AnimateChild2.prototype.handleEnter = function(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(node, isAppearing) {
            var _this_1 = this;
            setTimeout(function() {
              var names = _this_1.props.names;
              if (names) {
                var className = isAppearing ? "appearActive" : "enterActive";
                addClass(node, names[className]);
              }
              var hook = isAppearing ? _this_1.props.onAppearing : _this_1.props.onEntering;
              hook(node);
            }, 10);
          };
          AnimateChild2.prototype.handleEntered = function(node, isAppearing) {
            var names = this.props.names;
            if (names) {
              var classNames = isAppearing ? [names.appear, names.appearActive] : [names.enter, names.enterActive];
              classNames.forEach(function(className) {
                removeClass(node, className);
              });
            }
            var hook = isAppearing ? this.props.onAppeared : this.props.onEntered;
            hook(node);
          };
          AnimateChild2.prototype.handleExit = function(node) {
            var names = this.props.names;
            if (names) {
              this.removeClassNames(node, names);
              addClass(node, names.leave);
            }
            this.props.onExit(node);
          };
          AnimateChild2.prototype.handleExiting = function(node) {
            var _this_1 = this;
            setTimeout(function() {
              var names = _this_1.props.names;
              if (names) {
                addClass(node, names.leaveActive);
              }
              _this_1.props.onExiting(node);
            }, 10);
          };
          AnimateChild2.prototype.handleExited = function(node) {
            var names = this.props.names;
            if (names) {
              [names.leave, names.leaveActive].forEach(function(className) {
                removeClass(node, className);
              });
            }
            this.props.onExited(node);
          };
          AnimateChild2.prototype.render = function() {
            var _a = this.props;
            _a.names;
            _a.onAppear;
            _a.onAppeared;
            _a.onAppearing;
            _a.onEnter;
            _a.onEntering;
            _a.onEntered;
            _a.onExit;
            _a.onExiting;
            _a.onExited;
            var others = __rest(_a, ["names", "onAppear", "onAppeared", "onAppearing", "onEnter", "onEntering", "onEntered", "onExit", "onExiting", "onExited"]);
            return React__default.createElement(reactTransitionGroup.Transition, __assign({}, others, { onEnter: this.handleEnter, onEntering: this.handleEntering, onEntered: this.handleEntered, onExit: this.handleExit, onExiting: this.handleExiting, onExited: this.handleExited, addEndListener: this.addEndListener }));
          };
          AnimateChild2.displayName = "AnimateChild";
          AnimateChild2.propTypes = {
            names: PT.oneOfType([PT.string, PT.object]),
            onAppear: PT.func,
            onAppearing: PT.func,
            onAppeared: PT.func,
            onEnter: PT.func,
            onEntering: PT.func,
            onEntered: PT.func,
            onExit: PT.func,
            onExiting: PT.func,
            onExited: PT.func
          };
          AnimateChild2.defaultProps = {
            onAppear: noop$l,
            onAppearing: noop$l,
            onAppeared: noop$l,
            onEnter: noop$l,
            onEntering: noop$l,
            onEntered: noop$l,
            onExit: noop$l,
            onExiting: noop$l,
            onExited: noop$l
          };
          return AnimateChild2;
        }(React__default.Component)
      );
      const AnimateChild$1 = AnimateChild;
      var noop$k = function() {
      };
      var FirstChild = function(props) {
        var childrenArray = React__default.Children.toArray(props.children);
        return childrenArray[0] || null;
      };
      var Animate$1 = (
        /** @class */
        function(_super) {
          __extends(Animate2, _super);
          function Animate2() {
            return _super !== null && _super.apply(this, arguments) || this;
          }
          Animate2.prototype.normalizeNames = function(names) {
            if (typeof names === "string") {
              return {
                appear: "".concat(names, "-appear"),
                appearActive: "".concat(names, "-appear-active"),
                enter: "".concat(names, "-enter"),
                enterActive: "".concat(names, "-enter-active"),
                leave: "".concat(names, "-leave"),
                leaveActive: "".concat(names, "-leave-active")
              };
            }
            if (typeof names === "object") {
              return {
                appear: names.appear,
                appearActive: "".concat(names.appear, "-active"),
                enter: "".concat(names.enter),
                enterActive: "".concat(names.enter, "-active"),
                leave: "".concat(names.leave),
                leaveActive: "".concat(names.leave, "-active")
              };
            }
          };
          Animate2.prototype.render = function() {
            var _this = this;
            var _a = this.props, animation2 = _a.animation, children = _a.children, animationAppear = _a.animationAppear, singleMode = _a.singleMode, component = _a.component, beforeAppear = _a.beforeAppear, onAppear = _a.onAppear, afterAppear = _a.afterAppear, beforeEnter = _a.beforeEnter, onEnter = _a.onEnter, afterEnter = _a.afterEnter, beforeLeave = _a.beforeLeave, onLeave = _a.onLeave, afterLeave = _a.afterLeave, others = __rest(_a, ["animation", "children", "animationAppear", "singleMode", "component", "beforeAppear", "onAppear", "afterAppear", "beforeEnter", "onEnter", "afterEnter", "beforeLeave", "onLeave", "afterLeave"]);
            var animateChildren = React__default.Children.map(children, function(child) {
              return React__default.createElement(AnimateChild$1, { key: child === null || child === void 0 ? void 0 : child.key, names: _this.normalizeNames(animation2), onAppear: beforeAppear, onAppearing: onAppear, onAppeared: afterAppear, onEnter: beforeEnter, onEntering: onEnter, onEntered: afterEnter, onExit: beforeLeave, onExiting: onLeave, onExited: afterLeave }, child);
            });
            return React__default.createElement(reactTransitionGroup.TransitionGroup, __assign({ appear: animationAppear, component: singleMode ? FirstChild : component }, others), animateChildren);
          };
          Animate2.displayName = "Animate";
          Animate2.propTypes = {
            animation: PT.oneOfType([PT.string, PT.object]),
            animationAppear: PT.bool,
            component: PT.any,
            singleMode: PT.bool,
            children: PT.oneOfType([PT.element, PT.arrayOf(PT.element)]),
            beforeAppear: PT.func,
            onAppear: PT.func,
            afterAppear: PT.func,
            beforeEnter: PT.func,
            onEnter: PT.func,
            afterEnter: PT.func,
            beforeLeave: PT.func,
            onLeave: PT.func,
            afterLeave: PT.func
          };
          Animate2.defaultProps = {
            animationAppear: true,
            component: "div",
            singleMode: true,
            beforeAppear: noop$k,
            onAppear: noop$k,
            afterAppear: noop$k,
            beforeEnter: noop$k,
            onEnter: noop$k,
            afterEnter: noop$k,
            beforeLeave: noop$k,
            onLeave: noop$k,
            afterLeave: noop$k
          };
          return Animate2;
        }(React__default.Component)
      );
      const Animate$2 = Animate$1;
      var noop$j = function() {
      };
      var getStyle$4 = dom.getStyle;
      var Expand$1 = (
        /** @class */
        function(_super) {
          __extends(Expand2, _super);
          function Expand2(props) {
            var _this = _super.call(this, props) || this;
            func.bindCtx(_this, [
              "beforeEnter",
              "onEnter",
              "afterEnter",
              "beforeLeave",
              "onLeave",
              "afterLeave"
            ]);
            return _this;
          }
          Expand2.prototype.beforeEnter = function(node) {
            if (this.leaving) {
              this.afterLeave(node);
            }
            this.cacheCurrentStyle(node);
            this.cacheComputedStyle(node);
            this.setCurrentStyleToZero(node);
            this.props.beforeEnter(node);
          };
          Expand2.prototype.onEnter = function(node) {
            this.setCurrentStyleToComputedStyle(node);
            this.props.onEnter(node);
          };
          Expand2.prototype.afterEnter = function(node) {
            this.restoreCurrentStyle(node);
            this.props.afterEnter(node);
          };
          Expand2.prototype.beforeLeave = function(node) {
            this.leaving = true;
            this.cacheCurrentStyle(node);
            this.cacheComputedStyle(node);
            this.setCurrentStyleToComputedStyle(node);
            this.props.beforeLeave(node);
          };
          Expand2.prototype.onLeave = function(node) {
            this.setCurrentStyleToZero(node);
            this.props.onLeave(node);
          };
          Expand2.prototype.afterLeave = function(node) {
            this.leaving = false;
            this.restoreCurrentStyle(node);
            this.props.afterLeave(node);
          };
          Expand2.prototype.cacheCurrentStyle = function(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(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(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(node) {
            node.style.borderTopWidth = "".concat(this.borderTopWidth, "px");
            node.style.paddingTop = "".concat(this.paddingTop, "px");
            node.style.height = "".concat(this.height, "px");
            node.style.paddingBottom = "".concat(this.paddingBottom, "px");
            node.style.borderBottomWidth = "".concat(this.borderBottomWidth, "px");
          };
          Expand2.prototype.restoreCurrentStyle = function(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() {
            var _a = this.props, animation2 = _a.animation, others = __rest(_a, ["animation"]);
            var newAnimation = animation2 || "expand";
            return React__default.createElement(Animate$2, __assign({}, others, { animation: newAnimation, beforeEnter: this.beforeEnter, onEnter: this.onEnter, afterEnter: this.afterEnter, beforeLeave: this.beforeLeave, onLeave: this.onLeave, afterLeave: this.afterLeave }));
          };
          Expand2.displayName = "Expand";
          Expand2.propTypes = {
            animation: PT.oneOfType([PT.string, PT.object]),
            beforeEnter: PT.func,
            onEnter: PT.func,
            afterEnter: PT.func,
            beforeLeave: PT.func,
            onLeave: PT.func,
            afterLeave: PT.func
          };
          Expand2.defaultProps = {
            beforeEnter: noop$j,
            onEnter: noop$j,
            afterEnter: noop$j,
            beforeLeave: noop$j,
            onLeave: noop$j,
            afterLeave: noop$j
          };
          return Expand2;
        }(React__default.Component)
      );
      const Expand$2 = Expand$1;
      var OverlayAnimate = function(props) {
        var animation2 = props.animation, visible = props.visible, children = props.children, _a = props.timeout, timeout = _a === void 0 ? 300 : _a, 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 = __rest(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 = animationMap ? {
          entering: animationMap.in,
          exiting: animationMap.out
        } : {};
        if (animation2 === false) {
          animateClsMap.entering = "";
          animateClsMap.exiting = "";
        }
        return React__default.createElement(reactTransitionGroup.Transition, __assign({}, animateProps, { in: visible, timeout: animation2 ? timeout : 0, appear: true }), function(state) {
          var _a2;
          var cls = classnames((_a2 = {}, _a2[children.props.className] = !!children.props.className, _a2[animateClsMap[state]] = state in animateClsMap && animateClsMap[state], _a2));
          var childProps = __assign(__assign({}, others), { className: cls });
          if (style && children.props && children.props.style) {
            childProps.style = Object.assign({}, children.props.style, style);
          }
          return React__default.cloneElement(children, childProps);
        });
      };
      const OverlayAnimate$1 = OverlayAnimate;
      var AnimateWithSubComponent = assignSubComponent(Animate$2, { Expand: Expand$2, OverlayAnimate: OverlayAnimate$1 });
      const Animate = AnimateWithSubComponent;
      var _global = { exports: {} };
      var global$5 = _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$5;
      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$5 = _isObject;
      var _anObject = function(it) {
        if (!isObject$5(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$4 = _isObject;
      var _toPrimitive = function(it, S) {
        if (!isObject$4(it))
          return it;
        var fn, val;
        if (S && typeof (fn = it.toString) == "function" && !isObject$4(val = fn.call(it)))
          return val;
        if (typeof (fn = it.valueOf) == "function" && !isObject$4(val = fn.call(it)))
          return val;
        if (!S && typeof (fn = it.toString) == "function" && !isObject$4(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$2 = _toPrimitive;
      var dP$3 = Object.defineProperty;
      _objectDp.f = _descriptors ? Object.defineProperty : function defineProperty2(O, P, Attributes) {
        anObject$3(O);
        P = toPrimitive$2(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$4 = _globalExports;
      var core$2 = _coreExports;
      var ctx = _ctx;
      var hide$3 = _hide;
      var has$6 = _has;
      var PROTOTYPE$2 = "prototype";
      var $export$5 = function(type2, name, source) {
        var IS_FORCED = type2 & $export$5.F;
        var IS_GLOBAL = type2 & $export$5.G;
        var IS_STATIC = type2 & $export$5.S;
        var IS_PROTO = type2 & $export$5.P;
        var IS_BIND = type2 & $export$5.B;
        var IS_WRAP = type2 & $export$5.W;
        var exports2 = IS_GLOBAL ? core$2 : core$2[name] || (core$2[name] = {});
        var expProto = exports2[PROTOTYPE$2];
        var target = IS_GLOBAL ? global$4 : IS_STATIC ? global$4[name] : (global$4[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(exports2, key))
            continue;
          out = own ? target[key] : source[key];
          exports2[key] = IS_GLOBAL && typeof target[key] != "function" ? source[key] : IS_BIND && own ? ctx(out, global$4) : 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) {
            (exports2.virtual || (exports2.virtual = {}))[key] = out;
            if (type2 & $export$5.R && expProto && !expProto[key])
              hide$3(expProto, key, out);
          }
        }
      };
      $export$5.F = 1;
      $export$5.G = 2;
      $export$5.S = 4;
      $export$5.P = 8;
      $export$5.B = 16;
      $export$5.W = 32;
      $export$5.U = 64;
      $export$5.R = 128;
      var _export = $export$5;
      var toString$2 = {}.toString;
      var _cof = function(it) {
        return toString$2.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$2 = Math.min;
      var _toLength = function(it) {
        return it > 0 ? min$2(toInteger$2(it), 9007199254740991) : 0;
      };
      var toInteger$1 = _toInteger;
      var max$1 = Math.max;
      var min$1 = Math.min;
      var _toAbsoluteIndex = function(index2, length2) {
        index2 = toInteger$1(index2);
        return index2 < 0 ? max$1(index2 + length2, 0) : min$1(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$3 = _globalExports;
      var SHARED = "__core-js_shared__";
      var store$1 = global$3[SHARED] || (global$3[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 i2 = 0;
        var result = [];
        var key;
        for (key in O)
          if (key != IE_PROTO$2)
            has$5(O, key) && result.push(key);
        while (names.length > i2)
          if (has$5(O, key = names[i2++])) {
            ~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 keys2(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 keys2 = getSymbols ? getKeys2(S).concat(getSymbols(S)) : getKeys2(S);
            var length2 = keys2.length;
            var j2 = 0;
            var key;
            while (length2 > j2) {
              key = keys2[j2++];
              if (!DESCRIPTORS2 || isEnum2.call(S, key))
                T[key] = S[key];
            }
          }
          return T;
        } : $assign;
        return _objectAssign;
      }
      var $export$4 = _export;
      $export$4($export$4.S + $export$4.F, "Object", { assign: require_objectAssign() });
      var assign$1 = _coreExports.Object.assign;
      var assign = { "default": assign$1, __esModule: true };
      var _assign = assign;
      var _assign2 = _interopRequireDefault$3(_assign);
      function _interopRequireDefault$3(obj2) {
        return obj2 && obj2.__esModule ? obj2 : { default: obj2 };
      }
      var _default$5 = _assign2.default || function(target) {
        for (var i2 = 1; i2 < arguments.length; i2++) {
          var source = arguments[i2];
          for (var key in source) {
            if (Object.prototype.hasOwnProperty.call(source, key)) {
              target[key] = source[key];
            }
          }
        }
        return target;
      };
      var _default$4 = function(obj2, keys2) {
        var target = {};
        for (var i2 in obj2) {
          if (keys2.indexOf(i2) >= 0)
            continue;
          if (!Object.prototype.hasOwnProperty.call(obj2, i2))
            continue;
          target[i2] = obj2[i2];
        }
        return target;
      };
      var _default$3 = function(instance2, Constructor) {
        if (!(instance2 instanceof Constructor)) {
          throw new TypeError("Cannot call a class as a function");
        }
      };
      var _typeof$1 = {};
      var toInteger = _toInteger;
      var defined = _defined;
      var _stringAt = function(TO_STRING) {
        return function(that, pos) {
          var s = String(defined(that));
          var i2 = toInteger(pos);
          var l2 = s.length;
          var a, b2;
          if (i2 < 0 || i2 >= l2)
            return TO_STRING ? "" : void 0;
          a = s.charCodeAt(i2);
          return a < 55296 || a > 56319 || i2 + 1 === l2 || (b2 = s.charCodeAt(i2 + 1)) < 56320 || b2 > 57343 ? TO_STRING ? s.charAt(i2) : a : TO_STRING ? s.slice(i2, i2 + 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 keys2 = getKeys$1(Properties);
        var length2 = keys2.length;
        var i2 = 0;
        var P;
        while (length2 > i2)
          dP$1.f(O, P = keys2[i2++], 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 i2 = 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 (i2--)
          delete createDict[PROTOTYPE$1][enumBugKeys[i2]];
        return createDict();
      };
      var _objectCreate = Object.create || function create2(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, NAME2, next) {
        Constructor.prototype = create$4(IteratorPrototype, { next: descriptor(1, next) });
        setToStringTag$2(Constructor, NAME2 + " Iterator");
      };
      var has$3 = _has;
      var toObject$2 = _toObject;
      var IE_PROTO = _sharedKey("IE_PROTO");
      var ObjectProto$1 = Object.prototype;
      var _objectGpo = Object.getPrototypeOf || function(O) {
        O = toObject$2(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$3 = _export;
      var redefine$1 = _redefine;
      var hide$2 = _hide;
      var Iterators$2 = _iterators;
      var $iterCreate = _iterCreate;
      var setToStringTag$1 = _setToStringTag;
      var getPrototypeOf = _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, NAME2, Constructor, next, DEFAULT, IS_SET, FORCED) {
        $iterCreate(Constructor, NAME2, next);
        var getMethod = function(kind) {
          if (!BUGGY && kind in proto2)
            return proto2[kind];
          switch (kind) {
            case KEYS:
              return function keys2() {
                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 = NAME2 + " Iterator";
        var DEF_VALUES = DEFAULT == VALUES;
        var VALUES_BUG = false;
        var proto2 = Base2.prototype;
        var $native = proto2[ITERATOR] || proto2[FF_ITERATOR] || DEFAULT && proto2[DEFAULT];
        var $default = $native || getMethod(DEFAULT);
        var $entries = DEFAULT ? !DEF_VALUES ? $default : getMethod("entries") : void 0;
        var $anyNative = NAME2 == "Array" ? proto2.entries || $native : $native;
        var methods, key, IteratorPrototype2;
        if ($anyNative) {
          IteratorPrototype2 = getPrototypeOf($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 || !proto2[ITERATOR])) {
          hide$2(proto2, ITERATOR, $default);
        }
        Iterators$2[NAME2] = $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 proto2))
                redefine$1(proto2, key, methods[key]);
            }
          else
            $export$3($export$3.P + $export$3.F * (BUGGY || VALUES_BUG), NAME2, 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$2 = _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$2[NAME];
        var proto$3 = Collection && Collection.prototype;
        if (proto$3 && !proto$3[TO_STRING_TAG])
          hide$1(proto$3, 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$3 = _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, create2) {
        if (!isObject$3(it))
          return typeof it == "symbol" ? it : (typeof it == "string" ? "S" : "P") + it;
        if (!has$2(it, META$1)) {
          if (!isExtensible(it))
            return "F";
          if (!create2)
            return "E";
          setMeta(it);
        }
        return it[META$1].i;
      };
      var getWeak = function(it, create2) {
        if (!has$2(it, META$1)) {
          if (!isExtensible(it))
            return true;
          if (!create2)
            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 = _objectDp.f;
      var _wksDefine = function(name) {
        var $Symbol2 = core.Symbol || (core.Symbol = {});
        if (name.charAt(0) != "_" && !(name in $Symbol2))
          defineProperty($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 i2 = 0;
          var key;
          while (symbols.length > i2)
            if (isEnum2.call(it, key = symbols[i2++]))
              result.push(key);
        }
        return result;
      };
      var cof = _cof;
      var _isArray = Array.isArray || function isArray2(arg) {
        return cof(arg) == "Array";
      };
      var _objectGopnExt = {};
      var _objectGopn = {};
      var $keys$1 = _objectKeysInternal;
      var hiddenKeys = _enumBugKeys.concat("length", "prototype");
      _objectGopn.f = Object.getOwnPropertyNames || function getOwnPropertyNames2(O) {
        return $keys$1(O, hiddenKeys);
      };
      var toIObject$2 = _toIobject;
      var gOPN$1 = _objectGopn.f;
      var toString$1 = {}.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$1.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$1 = _toPrimitive;
      var has$1 = _has;
      var IE8_DOM_DEFINE = _ie8DomDefine;
      var gOPD$1 = Object.getOwnPropertyDescriptor;
      _objectGopd.f = _descriptors ? gOPD$1 : function getOwnPropertyDescriptor2(O, P) {
        O = toIObject$1(O);
        P = toPrimitive$1(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$1 = _globalExports;
      var has = _has;
      var DESCRIPTORS = _descriptors;
      var $export$2 = _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 isArray$1 = _isArray;
      var anObject = _anObject;
      var isObject$2 = _isObject;
      var toObject$1 = _toObject;
      var toIObject = _toIobject;
      var toPrimitive = _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$1.Symbol;
      var $JSON = global$1.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$1.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(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 defineProperties(it, P) {
        anObject(it);
        var keys2 = enumKeys(P = toIObject(P));
        var i2 = 0;
        var l2 = keys2.length;
        var key;
        while (l2 > i2)
          $defineProperty(it, key = keys2[i2++], 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(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(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 getOwnPropertyNames2(it) {
        var names = gOPN(toIObject(it));
        var result = [];
        var i2 = 0;
        var key;
        while (names.length > i2) {
          if (!has(AllSymbols, key = names[i2++]) && key != HIDDEN && key != META)
            result.push(key);
        }
        return result;
      };
      var $getOwnPropertySymbols = function getOwnPropertySymbols2(it) {
        var IS_OP = it === ObjectProto;
        var names = gOPN(IS_OP ? OPSymbols : toIObject(it));
        var result = [];
        var i2 = 0;
        var key;
        while (names.length > i2) {
          if (has(AllSymbols, key = names[i2++]) && (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$2($export$2.G + $export$2.W + $export$2.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 = 0; wellKnownSymbols.length > k; )
        wksDefine(wellKnownSymbols[k++]);
      $export$2($export$2.S + $export$2.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$2($export$2.S + $export$2.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$2($export$2.S + $export$2.F * FAILS_ON_PRIMITIVES, "Object", {
        getOwnPropertySymbols: function getOwnPropertySymbols2(it) {
          return $GOPS.f(toObject$1(it));
        }
      });
      $JSON && $export$2($export$2.S + $export$2.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 i2 = 1;
          var replacer, $replacer;
          while (arguments.length > i2)
            args.push(arguments[i2++]);
          $replacer = replacer = args[1];
          if (!isObject$2(replacer) && it === void 0 || isSymbol(it))
            return;
          if (!isArray$1(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$1.JSON, "JSON", true);
      _wksDefine("asyncIterator");
      _wksDefine("observable");
      var symbol$1 = _coreExports.Symbol;
      var symbol = { "default": symbol$1, __esModule: true };
      _typeof$1.__esModule = true;
      var _iterator = iterator;
      var _iterator2 = _interopRequireDefault$2(_iterator);
      var _symbol = symbol;
      var _symbol2 = _interopRequireDefault$2(_symbol);
      var _typeof = 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$2(obj2) {
        return obj2 && obj2.__esModule ? obj2 : { default: obj2 };
      }
      var _default$2 = _typeof$1.default = typeof _symbol2.default === "function" && _typeof(_iterator2.default) === "symbol" ? function(obj2) {
        return typeof obj2 === "undefined" ? "undefined" : _typeof(obj2);
      } : function(obj2) {
        return obj2 && typeof _symbol2.default === "function" && obj2.constructor === _symbol2.default && obj2 !== _symbol2.default.prototype ? "symbol" : typeof obj2 === "undefined" ? "undefined" : _typeof(obj2);
      };
      var _typeof2$1 = _typeof$1;
      var _typeof3$1 = _interopRequireDefault$1(_typeof2$1);
      function _interopRequireDefault$1(obj2) {
        return obj2 && obj2.__esModule ? obj2 : { default: obj2 };
      }
      var _default$1 = 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, proto2) {
          anObject2(O);
          if (!isObject2(proto2) && proto2 !== null)
            throw TypeError(proto2 + ": can't set as prototype!");
        };
        _setProto = {
          set: Object.setPrototypeOf || ("__proto__" in {} ? (
            // eslint-disable-line
            function(test, buggy, set2) {
              try {
                set2 = _ctx(Function.call, _objectGopd.f(Object.prototype, "__proto__").set, 2);
                set2(test, []);
                buggy = !(test instanceof Array);
              } catch (e2) {
                buggy = true;
              }
              return function setPrototypeOf2(O, proto2) {
                check(O, proto2);
                if (buggy)
                  O.__proto__ = proto2;
                else
                  set2(O, proto2);
                return O;
              };
            }({}, false)
          ) : void 0),
          check
        };
        return _setProto;
      }
      var $export$1 = _export;
      $export$1($export$1.S, "Object", { setPrototypeOf: require_setProto().set });
      var setPrototypeOf$1 = _coreExports.Object.setPrototypeOf;
      var setPrototypeOf = { "default": setPrototypeOf$1, __esModule: true };
      var $export = _export;
      $export($export.S, "Object", { create: _objectCreate });
      var $Object = _coreExports.Object;
      var create$3 = function create2(P, D) {
        return $Object.create(P, D);
      };
      var create$2 = { "default": create$3, __esModule: true };
      var _setPrototypeOf$1 = setPrototypeOf;
      var _setPrototypeOf2 = _interopRequireDefault(_setPrototypeOf$1);
      var _create = create$2;
      var _create2 = _interopRequireDefault(_create);
      var _typeof2 = _typeof$1;
      var _typeof3 = _interopRequireDefault(_typeof2);
      function _interopRequireDefault(obj2) {
        return obj2 && obj2.__esModule ? obj2 : { default: obj2 };
      }
      var _default = 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 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 i2 = this.allOverlays.indexOf(overlay);
          if (i2 > -1) {
            this.allOverlays.splice(i2, 1);
          }
        }
      };
      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$W, _temp$E;
      var makeChain$8 = func.makeChain;
      var getContainerNode$1 = function getContainerNode2(props) {
        var targetNode = findNode(props.target);
        return findNode(props.container, targetNode);
      };
      var Gateway = (_temp$E = _class$W = function(_Component) {
        _default(Gateway2, _Component);
        function Gateway2(props) {
          _default$3(this, Gateway2);
          var _this = _default$1(this, _Component.call(this, props));
          _this.updateContainer = function() {
            var containerNode = getContainerNode$1(_this.props);
            if (containerNode !== _this.state.containerNode) {
              _this.setState({
                containerNode
              });
            }
          };
          _this.saveChildRef = function(ref) {
            _this.child = ref;
          };
          _this.state = {
            containerNode: null
          };
          return _this;
        }
        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__default.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__default.cloneElement(child, {
            ref: makeChain$8(this.saveChildRef, child.ref)
          });
          return ReactDOM.createPortal(child, containerNode);
        };
        return Gateway2;
      }(React__default.Component), _class$W.propTypes = {
        children: PT.node,
        container: PT.any,
        target: PT.any
      }, _class$W.defaultProps = {
        container: function container() {
          return document.body;
        }
      }, _temp$E);
      Gateway.displayName = "Gateway";
      const Gateway$1 = polyfill(Gateway);
      var _class$V, _temp$D, _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, container) {
        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 !== container);
        var treatAsWindow = !container || container === 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(container) {
        if (!container || container === document.body) {
          return {
            width: document.documentElement.clientWidth,
            height: document.documentElement.clientHeight
          };
        }
        var _container$getBoundin = container.getBoundingClientRect(), width = _container$getBoundin.width, height = _container$getBoundin.height;
        return {
          width,
          height
        };
      }
      var getContainer = function getContainer2(_ref) {
        var container = _ref.container, baseElement = _ref.baseElement;
        if (typeof document === "undefined") {
          return container;
        }
        var calcContainer = findNode(container, 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$D = _class$V = function() {
        function Position2(props) {
          _default$3(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 i2 = 0; i2 < expectedAlign.length; i2++) {
            var align = expectedAlign[i2];
            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;
            var xOffset = Math.round(left + this.offset[0] - dom.getStyle(pinElement, "left"));
            var yOffset = Math.round(top + this.offset[1] - dom.getStyle(pinElement, "top"));
            if (this._isInViewport(pinElement, align, [xOffset, yOffset])) {
              this._setPinElementPostion(pinElement, { left, top }, this.offset);
              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 offset2 = void 0;
          if (parent === document.body && dom.getStyle(parent, "position") === "static") {
            offset2 = {
              top: 0,
              left: 0
            };
          } else {
            offset2 = this._getElementOffset(parent);
          }
          offset2.top += parseFloat(dom.getStyle(parent, "border-top-width"), 10);
          offset2.left += parseFloat(dom.getStyle(parent, "border-left-width"), 10);
          offset2.offsetParent = parent;
          return offset2;
        };
        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 _this = 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 _this._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, map2) {
          return align.replace(regExp, function(res) {
            return map2[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 adjustOffset = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : [];
          var viewportSize = _getViewportSize(this.container);
          var elementRect = _getElementRect(element, this.container);
          var _adjustOffset$ = adjustOffset[0], xOffset = _adjustOffset$ === void 0 ? 0 : _adjustOffset$, _adjustOffset$2 = adjustOffset[1], yOffset = _adjustOffset$2 === void 0 ? 0 : _adjustOffset$2;
          var left = elementRect.left + xOffset;
          var top = elementRect.top + yOffset;
          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 top >= 0 && top + element.offsetHeight <= viewportHeight;
          }
          return left >= 0 && left + elementSize.width <= viewportWidth && top >= 0 && 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 offset2 = 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 + offset2[0] + "px",
              top: top + offset2[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 + offset2[0] + "px",
            top: top + offset2[1] + "px"
          });
        };
        return Position2;
      }(), _class$V.VIEWPORT = VIEWPORT, _class$V.place = function(props) {
        return new Position$1(props).setPosition();
      }, _initialiseProps$2 = function _initialiseProps2() {
        var _this2 = this;
        this._calPinOffset = function(align) {
          var offset2 = [].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) {
              offset2[1] = -baseElementRect.top - (y2 === "t" ? baseElementRect.height : 0);
            }
          }
          return offset2;
        };
        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$D);
      var _class$U, _temp$C;
      var noop$i = func.noop, bindCtx$c = func.bindCtx;
      var getStyle$3 = dom.getStyle;
      var place = Position$1.place;
      var MAX_UPDATE_COUNT = 50;
      var Position = (_temp$C = _class$U = function(_Component) {
        _default(Position2, _Component);
        function Position2(props) {
          _default$3(this, Position2);
          var _this = _default$1(this, _Component.call(this, props));
          _this.updateCount = 0;
          _this.observe = function() {
            var contentNode = _this.getContentNode();
            contentNode && _this.resizeObserver.observe(contentNode);
          };
          _this.unobserve = function() {
            _this.resizeObserver.disconnect();
          };
          _this.shouldIgnorePosition = function() {
            var node = _this.getContentNode();
            if (!node) {
              return true;
            }
            if (!node.parentNode) {
              return true;
            }
            var _getComputedStyle2 = getComputedStyle(node), position = _getComputedStyle2.position, display = _getComputedStyle2.display, visibility = _getComputedStyle2.visibility;
            if (!node.offsetParent && position !== "fixed") {
              return true;
            }
            if (display === "none" || visibility === "hidden") {
              return true;
            }
            _this.updateCount++;
            Promise.resolve().then(function() {
              _this.updateCount = 0;
            });
            if (_this.updateCount > MAX_UPDATE_COUNT - 10) {
              warning$1("Over maximum times to adjust position at one task, it is recommended to use v2.");
              return true;
            }
            return false;
          };
          bindCtx$c(_this, ["handleResize"]);
          _this.resizeObserver = new index(_this.handleResize);
          return _this;
        }
        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, offset2 = _props.offset, beforePosition = _props.beforePosition, onPosition = _props.onPosition, needAdjust = _props.needAdjust, container = _props.container, rtl = _props.rtl, pinFollowBaseElementWhenFixed = _props.pinFollowBaseElementWhenFixed, autoFit = _props.autoFit;
          if (this.shouldIgnorePosition()) {
            return;
          }
          beforePosition();
          var contentNode = this.getContentNode();
          var targetNode = this.getTargetNode();
          if (contentNode && targetNode) {
            var resultAlign = place({
              pinElement: contentNode,
              baseElement: targetNode,
              pinFollowBaseElementWhenFixed,
              align,
              offset: offset2,
              autoFit,
              container,
              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__default.Children.only(this.props.children);
        };
        return Position2;
      }(React__default.Component), _class$U.VIEWPORT = Position$1.VIEWPORT, _class$U.propTypes = {
        children: PT.node,
        target: PT.any,
        container: PT.any,
        align: PT.oneOfType([PT.string, PT.bool]),
        offset: PT.array,
        beforePosition: PT.func,
        onPosition: PT.func,
        needAdjust: PT.bool,
        autoFit: PT.bool,
        needListenResize: PT.bool,
        shouldUpdatePosition: PT.bool,
        rtl: PT.bool,
        pinFollowBaseElementWhenFixed: PT.bool
      }, _class$U.defaultProps = {
        align: "tl bl",
        offset: [0, 0],
        beforePosition: noop$i,
        onPosition: noop$i,
        needAdjust: true,
        autoFit: false,
        needListenResize: true,
        shouldUpdatePosition: false,
        rtl: false
      }, _temp$C);
      Position.displayName = "Position";
      var _class$T, _temp$B;
      var saveLastFocusNode = focus.saveLastFocusNode, getFocusNodeList$1 = focus.getFocusNodeList, backLastFocusNode = focus.backLastFocusNode;
      var makeChain$7 = func.makeChain, noop$h = func.noop, bindCtx$b = func.bindCtx;
      var getContainerNode = function getContainerNode2(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 i2 = 0; i2 < prefixes.length; i2++) {
          ret = style.getPropertyValue(prefixes[i2] + name);
          if (ret) {
            break;
          }
        }
        return ret;
      };
      var containerNodeList = [];
      var Overlay$4 = (_temp$B = _class$T = function(_Component) {
        _default(Overlay3, _Component);
        function Overlay3(props) {
          _default$3(this, Overlay3);
          var _this = _default$1(this, _Component.call(this, props));
          _this.saveContentRef = function(ref) {
            _this.contentRef = ref;
          };
          _this.saveGatewayRef = function(ref) {
            _this.gatewayRef = ref;
          };
          _this.lastAlign = props.align;
          bindCtx$b(_this, ["handlePosition", "handleAnimateEnd", "handleDocumentKeyDown", "handleDocumentClick", "handleMaskClick", "beforeOpen", "beforeClose"]);
          _this.state = {
            visible: false,
            status: "none",
            animation: _this.getAnimation(props),
            willOpen: false,
            willClose: false
          };
          _this.timeoutMap = {};
          return _this;
        }
        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.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.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.addOverlay(_this2);
                _this2.props.afterOpen();
              });
            } else if (close2) {
              this.props.onClose();
              dom.removeClass(this.getWrapperNode(), "opened");
              overlayManager.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(config2) {
          var align = config2.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.addOverlay(this);
          this.setFocusNode();
          this.props.afterOpen();
        };
        Overlay3.prototype.onLeaved = function onLeaved() {
          overlayManager.removeOverlay(this);
          this.setFocusNode();
          this.props.afterClose();
        };
        Overlay3.prototype.beforeOpen = function beforeOpen() {
          if (this.props.disableScroll) {
            var containerNode = getContainerNode(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.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 i2 = 0; i2 < safeNodes.length; i2++) {
              var node = findNode(safeNodes[i2], 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, offset2 = _props.offset, container = _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__default.Children.only(children);
            if (typeof child.type === "function" && !(child.type.prototype instanceof React__default.Component)) {
              child = React__default.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__default.cloneElement(child, {
              className: childClazz,
              style: _default$5({}, 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" && propShouldUpdatePosition;
              children = React__default.createElement(Position, {
                children,
                target,
                align,
                offset: offset2,
                autoFit,
                container,
                needAdjust,
                pinFollowBaseElementWhenFixed,
                beforePosition,
                onPosition: makeChain$7(this.handlePosition, onPosition),
                shouldUpdatePosition,
                rtl
              });
            }
            var wrapperClazz = classnames([prefix + "overlay-wrapper", wrapperClassName]);
            var newWrapperStyle = _default$5({}, {
              display: stateVisible ? "" : "none"
            }, wrapperStyle);
            var maskClazz = classnames((_classnames2 = {}, _classnames2[prefix + "overlay-backdrop"] = true, _classnames2[maskClass] = !!maskClass, _classnames2));
            children = React__default.createElement(
              "div",
              { className: wrapperClazz, style: newWrapperStyle, dir: rtl ? "rtl" : void 0 },
              hasMask ? React__default.createElement(
                "div",
                {
                  className: maskClazz,
                  onClick: this.handleMaskClick,
                  onMouseEnter: onMaskMouseEnter,
                  onMouseLeave: onMaskMouseLeave,
                  dir: rtl ? "rtl" : void 0
                },
                isChildrenInMask && children
              ) : null,
              !isChildrenInMask && children
            );
          }
          return React__default.createElement(Gateway$1, _default$5({ container, target, children }, { ref: this.saveGatewayRef }));
        };
        return Overlay3;
      }(React__default.Component), _class$T.propTypes = {
        prefix: PT.string,
        pure: PT.bool,
        rtl: PT.bool,
        className: PT.string,
        style: PT.object,
        /**
         * 弹层内容
         */
        children: PT.any,
        /**
         * 是否显示弹层
         */
        visible: PT.bool,
        /**
         * 弹层请求关闭时触发事件的回调函数
         * @param {String} type 弹层关闭的来源
         * @param {Object} e DOM 事件
         */
        onRequestClose: PT.func,
        /**
         * 弹层定位的参照元素
         */
        target: PT.any,
        /**
         * 弹层相对于参照元素的定位, 详见开发指南的[定位部分](#定位)
         */
        align: PT.string,
        /**
         * 弹层相对于trigger的定位的微调, 接收数组[hoz, ver], 表示弹层在 left / top 上的增量
         * e.g. [100, 100] 表示往右(RTL 模式下是往左) 、下分布偏移100px
         */
        offset: PT.array,
        /**
         * 渲染组件的容器,如果是函数需要返回 ref,如果是字符串则是该 DOM 的 id,也可以直接传入 DOM 节点
         */
        container: PT.any,
        /**
         * 是否显示遮罩
         */
        hasMask: PT.bool,
        /**
         * 是否支持 esc 按键关闭弹层
         */
        canCloseByEsc: PT.bool,
        /**
         * 点击弹层外的区域是否关闭弹层,不显示遮罩时生效
         */
        canCloseByOutSideClick: PT.bool,
        /**
         * 点击遮罩区域是否关闭弹层,显示遮罩时生效
         */
        canCloseByMask: PT.bool,
        /**
         * 弹层打开前触发事件的回调函数
         */
        beforeOpen: PT.func,
        /**
         * 弹层打开时触发事件的回调函数
         */
        onOpen: PT.func,
        /**
         * 弹层打开后触发事件的回调函数, 如果有动画,则在动画结束后触发
         */
        afterOpen: PT.func,
        /**
         * 弹层关闭前触发事件的回调函数
         */
        beforeClose: PT.func,
        /**
         * 弹层关闭时触发事件的回调函数
         */
        onClose: PT.func,
        /**
         * 弹层关闭后触发事件的回调函数, 如果有动画,则在动画结束后触发
         */
        afterClose: PT.func,
        /**
         * 弹层定位完成前触发的事件
         */
        beforePosition: PT.func,
        /**
         * 弹层定位完成时触发的事件
         * @param {Object} config 定位的参数
         * @param {Array} config.align 对齐方式,如 ['cc', 'cc'](如果开启 autoAdjust,可能和预先设置的 align 不同)
         * @param {Number} config.top 距离视口顶部距离
         * @param {Number} config.left 距离视口左侧距离
         * @param {Object} node 定位参照的容器节点
         */
        onPosition: PT.func,
        shouldUpdatePosition: PT.bool,
        /**
         * 弹层打开时是否让其中的元素自动获取焦点
         */
        autoFocus: PT.bool,
        needAdjust: PT.bool,
        /**
         * 是否禁用页面滚动
         */
        disableScroll: PT.bool,
        /**
         * 是否在捕获阶段监听,适配 react 17 事件模型变更
         * @version 1.25
         */
        useCapture: PT.bool,
        /**
         * 隐藏时是否保留子节点
         */
        cache: PT.bool,
        /**
         * 安全节点,当点击 document 的时候,如果包含该节点则不会关闭弹层,如果是函数需要返回 ref,如果是字符串则是该 DOM 的 id,也可以直接传入 DOM 节点,或者以上值组成的数组
         */
        safeNode: PT.any,
        /**
         * 弹层的根节点的样式类
         */
        wrapperClassName: PT.string,
        /**
         * 弹层的根节点的内联样式
         */
        wrapperStyle: PT.object,
        /**
         * 配置动画的播放方式,支持 { in: 'enter-class', out: 'leave-class' } 的对象参数,如果设置为 false,则不播放动画。 请参考 Animate 组件的文档获取可用的动画名
         * @default { in: 'expandInDown', out: 'expandOutUp' }
         */
        animation: PT.oneOfType([PT.object, PT.bool]),
        onMaskMouseEnter: PT.func,
        onMaskMouseLeave: PT.func,
        onClick: PT.func,
        maskClass: PT.string,
        isChildrenInMask: PT.bool,
        // 当 pin 元素(一般是弹层)是 fixed 布局的时候,pin 元素是否要跟随 base 元素(一般是trigger)
        // 举例来说,dialog/drawer 这类组件弹层是不跟随trigger的,而 fixed 布局下的subNav是跟随trigger的
        pinFollowBaseElementWhenFixed: PT.bool,
        /**
         * 开启 v2 版本
         * @version 1.25
         */
        v2: PT.bool,
        /**
         * [v2] align 的数组形式,不能和 align 同时使用
         * @version 1.25
         */
        points: PT.array
      }, _class$T.defaultProps = {
        prefix: "next-",
        pure: false,
        visible: false,
        onRequestClose: noop$h,
        target: Position.VIEWPORT,
        align: "tl bl",
        offset: [0, 0],
        hasMask: false,
        canCloseByEsc: true,
        canCloseByOutSideClick: true,
        canCloseByMask: true,
        beforeOpen: noop$h,
        onOpen: noop$h,
        afterOpen: noop$h,
        beforeClose: noop$h,
        onClose: noop$h,
        afterClose: noop$h,
        beforePosition: noop$h,
        onPosition: noop$h,
        onMaskMouseEnter: noop$h,
        onMaskMouseLeave: noop$h,
        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$B);
      Overlay$4.displayName = "Overlay";
      const Overlay1 = polyfill(Overlay$4);
      function _extends() {
        _extends = Object.assign ? Object.assign.bind() : function(target) {
          for (var i2 = 1; i2 < arguments.length; i2++) {
            var source = arguments[i2];
            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, i2;
        for (i2 = 0; i2 < sourceKeys.length; i2++) {
          key = sourceKeys[i2];
          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__default.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 i2 = 0, j2 = fns.length; i2 < j2; i2++) {
            if (fns[i2] && fns[i2].apply) {
              fns[i2].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(container) {
        if (typeof document === "undefined") {
          return container;
        }
        var calcContainer = container;
        while (getStyle$2(calcContainer, "position") === "static") {
          if (!calcContainer || calcContainer === document.documentElement) {
            return document.documentElement;
          }
          calcContainer = calcContainer.parentNode;
        }
        return calcContainer;
      };
      var getOverflowNodes = function getOverflowNodes2(targetNode, container) {
        if (typeof document === "undefined") {
          return [];
        }
        var overflowNodes = [];
        var overflowNode = getViewPortExcludeSelf(targetNode);
        while (overflowNode && container.contains(overflowNode) && container !== overflowNode) {
          overflowNodes.push(overflowNode);
          overflowNode = getViewPortExcludeSelf(overflowNode);
        }
        if (isScrollableElement(container)) {
          overflowNodes.push(container);
        }
        return overflowNodes;
      };
      function isWebKit() {
        if (typeof CSS === "undefined" || !CSS.supports) {
          return false;
        }
        return CSS.supports("-webkit-backdrop-filter", "none");
      }
      function isContainingBlock(ele) {
        var webkit = isWebKit();
        var css = getComputedStyle(ele);
        return Boolean(css.transform && css.transform !== "none" || css.perspective && css.perspective !== "none" || css.containerType && css.containerType !== "normal" || !webkit && css.backdropFilter && css.backdropFilter !== "none" || !webkit && css.filter && css.filter !== "none" || ["transform", "perspective", "filter"].some(function(value) {
          return (css.willChange || "").includes(value);
        }) || ["paint", "layout", "strict", "content"].some(function(value) {
          return (css.contain || "").includes(value);
        }));
      }
      function isLastTraversableElement(ele) {
        return ["html", "body"].includes(ele.tagName.toLowerCase());
      }
      function getContainingBlock(element) {
        var currentElement = element.parentElement;
        while (currentElement && !isLastTraversableElement(currentElement)) {
          if (isContainingBlock(currentElement)) {
            return currentElement;
          } else {
            currentElement = currentElement.parentElement;
          }
        }
        return null;
      }
      var isContentClippedElement = function isContentClippedElement2(element) {
        var overflow = getStyle$2(element, "overflow");
        return overflow && overflow !== "visible" || element === document.documentElement;
      };
      function isScrollableElement(element) {
        var overflow = getStyle$2(element, "overflow");
        if (element === document.documentElement || overflow && overflow.match(/auto|scroll/)) {
          var clientWidth = element.clientWidth, clientHeight = element.clientHeight, scrollWidth = element.scrollWidth, scrollHeight = element.scrollHeight;
          return clientHeight !== scrollHeight || clientWidth !== scrollWidth;
        }
        return false;
      }
      function getRect(target) {
        if (target === document.documentElement || target === document.body) {
          var _document$documentEle = document.documentElement, _width = _document$documentEle.clientWidth, _height = _document$documentEle.clientHeight;
          return {
            left: 0,
            top: 0,
            width: _width,
            height: _height
          };
        }
        var _target$getBoundingCl = target.getBoundingClientRect(), left = _target$getBoundingCl.left, top = _target$getBoundingCl.top, width = _target$getBoundingCl.width, height = _target$getBoundingCl.height;
        return {
          left,
          top,
          width,
          height
        };
      }
      function getOffsetParent(element) {
        var offsetParent = element.offsetParent;
        while (offsetParent && ["table", "th", "td"].includes(offsetParent.tagName.toLowerCase())) {
          offsetParent = offsetParent.offsetParent;
        }
        return offsetParent;
      }
      function getViewPortExcludeSelf(target) {
        var fallbackViewportElement = document.documentElement;
        if (!target) {
          return fallbackViewportElement;
        }
        var parent = ["fixed", "absolute"].includes(getStyle$2(target, "position")) ? getOffsetParent(target) || getContainingBlock(target) : target.parentElement;
        if (!parent) {
          return fallbackViewportElement;
        }
        if (isContentClippedElement(parent)) {
          return parent;
        }
        return getViewPortExcludeSelf(parent);
      }
      function getViewPort(container) {
        var fallbackViewportElement = document.documentElement;
        if (!container) {
          return fallbackViewportElement;
        }
        if (["fixed", "absolute"].includes(getStyle$2(container, "position"))) {
          if (isContentClippedElement(container)) {
            return container;
          }
          var offsetParent = getOffsetParent(container) || getContainingBlock(container);
          if (offsetParent) {
            return getViewPort(offsetParent);
          } else {
            return fallbackViewportElement;
          }
        }
        if (isContentClippedElement(container)) {
          return container;
        }
        if (container.parentElement) {
          return getViewPort(container.parentElement) || fallbackViewportElement;
        }
        return fallbackViewportElement;
      }
      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 now2 = Date.now();
          var args = arguments;
          if (now2 - previous > wait) {
            var _this = this;
            window.requestAnimationFrame(function() {
              func2.apply(_this, args);
            });
            previous = now2;
          }
        };
      }
      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 _getBoundingClientRec = element.getBoundingClientRect(), width = _getBoundingClientRec.width, height = _getBoundingClientRec.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 i2 = 0; i2 <= o1keys.length - 1; i2++) {
          var _key3 = o1keys[i2];
          if (!o2keys.includes(_key3))
            return false;
          if (object2[_key3] !== object1[_key3])
            return false;
        }
        return true;
      }
      var useEvent = function useEvent2(handler) {
        var handleRef = React__default.useRef(handler);
        React__default.useLayoutEffect(function() {
          handleRef.current = handler;
        });
        return React__default.useCallback(function() {
          var fn = handleRef.current;
          return fn.apply(void 0, arguments);
        }, []);
      };
      function _createForOfIteratorHelperLoose$1(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$1(o)) || allowArrayLike && o && typeof o.length === "number") {
          if (it)
            o = it;
          var i2 = 0;
          return function() {
            if (i2 >= o.length)
              return { done: true };
            return { done: false, value: o[i2++] };
          };
        }
        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$1(o, minLen) {
        if (!o)
          return;
        if (typeof o === "string")
          return _arrayLikeToArray$1(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$1(o, minLen);
      }
      function _arrayLikeToArray$1(arr, len) {
        if (len == null || len > arr.length)
          len = arr.length;
        for (var i2 = 0, arr2 = new Array(len); i2 < len; i2++)
          arr2[i2] = arr[i2];
        return arr2;
      }
      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, offset2 = 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 + offset2[0],
          top: basey + offset2[1]
        };
      }
      function shouldResizePlacement(l2, t2, viewport, staticInfo) {
        var container = staticInfo.container, containerInfo = staticInfo.containerInfo, overlayInfo = staticInfo.overlayInfo;
        if (viewport !== container) {
          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 getNewPlacements(l2, t2, p2, staticInfo) {
        var overlayInfo = staticInfo.overlayInfo, viewportInfo = staticInfo.viewportInfo;
        var _p$split = p2.split(""), direction = _p$split[0], _p$split$ = _p$split[1], align = _p$split$ === void 0 ? "" : _p$split$;
        var topOut = t2 < 0;
        var leftOut = l2 < 0;
        var rightOut = l2 + overlayInfo.width > viewportInfo.width;
        var bottomOut = t2 + overlayInfo.height > viewportInfo.height;
        var forbiddenSet = /* @__PURE__ */ new Set();
        var forbid = function forbid2() {
          for (var _len = arguments.length, ps = new Array(_len), _key = 0; _key < _len; _key++) {
            ps[_key] = arguments[_key];
          }
          return ps.forEach(function(t3) {
            return forbiddenSet.add(t3);
          });
        };
        if (topOut) {
          forbid("t", "tl", "tr");
        }
        if (rightOut) {
          forbid("r", "rt", "rb");
        }
        if (bottomOut) {
          forbid("b", "bl", "br");
        }
        if (leftOut) {
          forbid("l", "lt", "lb");
        }
        var allPlacements = Object.keys(placementMap);
        var canTryPlacements = allPlacements.filter(function(t3) {
          return !forbiddenSet.has(t3);
        });
        if (!canTryPlacements.length) {
          return null;
        }
        var reverseMap = {
          l: "r",
          r: "l",
          t: "b",
          b: "t",
          "": ""
        };
        var directionOrderWeights = {
          t: 10,
          b: 6,
          l: 10,
          r: 6
        };
        directionOrderWeights[direction] = 12;
        directionOrderWeights[reverseMap[direction]] = 11;
        var alignOrderWeights = {
          "": 2,
          l: 1,
          r: 0,
          t: 1,
          b: 0
        };
        alignOrderWeights[align] = 3;
        canTryPlacements.sort(function(after, before) {
          var _after$split = after.split(""), afterDirection = _after$split[0], _after$split$ = _after$split[1], afterAlign = _after$split$ === void 0 ? "" : _after$split$;
          var _before$split = before.split(""), beforeDirection = _before$split[0], _before$split$ = _before$split[1], beforeAlign = _before$split$ === void 0 ? "" : _before$split$;
          var afterDirectionWeight = directionOrderWeights[afterDirection];
          var afterAlignWeight = alignOrderWeights[afterAlign];
          var beforeDirectionWeight = directionOrderWeights[beforeDirection];
          var beforeAlighWeight = alignOrderWeights[beforeAlign];
          if (afterDirection === beforeDirection) {
            return afterAlignWeight > beforeAlighWeight ? -1 : 1;
          }
          if (afterAlign === beforeAlign) {
            return afterDirectionWeight > beforeDirectionWeight ? -1 : 1;
          }
          if ([afterDirection, beforeDirection].includes(direction)) {
            return afterDirection === direction ? -1 : 1;
          }
          var reverseDirection = reverseMap[direction];
          if ([afterDirection, beforeDirection].includes(reverseDirection)) {
            return afterDirection === reverseDirection ? -1 : 1;
          }
          if ([afterAlign, beforeAlign].includes(align)) {
            return afterAlign === align ? -1 : 1;
          }
          return afterDirectionWeight + afterAlignWeight > beforeDirectionWeight + beforeAlighWeight ? -1 : 1;
        });
        return canTryPlacements;
      }
      function getBackupPlacement(l2, t2, p2, staticInfo) {
        var overlayInfo = staticInfo.overlayInfo, viewportInfo = staticInfo.viewportInfo;
        var _p$split2 = p2.split(""), direction = _p$split2[0];
        _p$split2[1];
        var topOut = t2 < 0;
        var leftOut = l2 < 0;
        var rightOut = l2 + overlayInfo.width > viewportInfo.width;
        var bottomOut = t2 + overlayInfo.height > viewportInfo.height;
        var outNumber = [topOut, leftOut, rightOut, bottomOut].filter(Boolean).length;
        if (outNumber === 3) {
          var _maps$find;
          var maps = [{
            direction: "t",
            value: topOut
          }, {
            direction: "r",
            value: rightOut
          }, {
            direction: "b",
            value: bottomOut
          }, {
            direction: "l",
            value: leftOut
          }];
          var backDirection = (_maps$find = maps.find(function(t3) {
            return !t3.value;
          })) === null || _maps$find === void 0 ? void 0 : _maps$find.direction;
          if (backDirection && backDirection !== direction) {
            return backDirection;
          }
        }
        return null;
      }
      function adjustXY(left, top, placement, staticInfo) {
        var viewport = staticInfo.viewport, viewportInfo = staticInfo.viewportInfo, container = staticInfo.container, containerInfo = staticInfo.containerInfo, overlayInfo = staticInfo.overlayInfo, rtl = staticInfo.rtl;
        if (!shouldResizePlacement(left, top, viewport, staticInfo)) {
          return null;
        }
        var x2 = left;
        var y2 = top;
        var xAdjust = 0;
        var yAdjust = 0;
        if (viewport !== container) {
          var cLeft = containerInfo.left, cTop = containerInfo.top, scrollLeft = containerInfo.scrollLeft, scrollTop = containerInfo.scrollTop;
          xAdjust = cLeft - scrollLeft;
          yAdjust = cTop - scrollTop;
          x2 += xAdjust;
          y2 += yAdjust;
        }
        var oWidth = overlayInfo.width, oHeight = overlayInfo.height;
        var vWidth = viewportInfo.width, vHeight = viewportInfo.height;
        var leftOut = x2 < 0;
        var topOut = y2 < 0;
        var rightOut = x2 + oWidth > vWidth;
        var bottomOut = y2 + oHeight > vHeight;
        if (oWidth > vWidth || oHeight > vHeight) {
          if (oWidth > vWidth) {
            if (rtl) {
              x2 = vWidth - oWidth;
            } else {
              x2 = 0;
            }
          }
          if (oHeight > vHeight) {
            y2 = 0;
          }
        } else {
          if (leftOut) {
            x2 = 0;
          }
          if (topOut) {
            y2 = 0;
          }
          if (rightOut) {
            x2 = vWidth - oWidth;
          }
          if (bottomOut) {
            y2 = vHeight - oHeight;
          }
        }
        return {
          left: x2 - xAdjust,
          top: y2 - yAdjust,
          placement
        };
      }
      function autoAdjustPosition(l2, t2, p2, staticInfo) {
        var left = l2;
        var top = t2;
        var viewport = staticInfo.viewport, container = staticInfo.container, containerInfo = staticInfo.containerInfo;
        var cLeft = containerInfo.left, cTop = containerInfo.top, scrollLeft = containerInfo.scrollLeft, scrollTop = containerInfo.scrollTop;
        if (viewport !== container) {
          left += cLeft - scrollLeft;
          top += cTop - scrollTop;
        }
        var placements = getNewPlacements(left, top, p2, staticInfo);
        for (var _iterator3 = _createForOfIteratorHelperLoose$1(placements), _step; !(_step = _iterator3()).done; ) {
          var placement = _step.value;
          var _getXY2 = getXY(placement, staticInfo), _nLeft = _getXY2.left, _nTop = _getXY2.top;
          if (!shouldResizePlacement(_nLeft, _nTop, viewport, staticInfo)) {
            return {
              left: _nLeft,
              top: _nTop,
              placement
            };
          }
        }
        var backupPlacement = getBackupPlacement(left, top, p2, staticInfo);
        if (backupPlacement) {
          var _getXY = getXY(backupPlacement, staticInfo), nLeft = _getXY.left, nTop = _getXY.top;
          return {
            left: nLeft,
            top: nTop,
            placement: backupPlacement
          };
        }
        return null;
      }
      function getScrollerRect(scroller) {
        var _getViewTopLeft2 = getViewTopLeft(scroller), left = _getViewTopLeft2.left, top = _getViewTopLeft2.top;
        var width = scroller.scrollWidth, height = scroller.scrollHeight, scrollTop = scroller.scrollTop, scrollLeft = scroller.scrollLeft;
        return {
          left,
          top,
          width,
          height,
          scrollLeft,
          scrollTop
        };
      }
      function getPlacements(config2) {
        var target = config2.target, overlay = config2.overlay, container = config2.container, scrollNode = config2.scrollNode, oplacement = config2.placement, _config$placementOffs = config2.placementOffset, placementOffset = _config$placementOffs === void 0 ? 0 : _config$placementOffs, _config$points = config2.points, opoints = _config$points === void 0 ? ["tl", "bl"] : _config$points, _config$offset = config2.offset, offset2 = _config$offset === void 0 ? [0, 0] : _config$offset, _config$position = config2.position, position = _config$position === void 0 ? "absolute" : _config$position, beforePosition = config2.beforePosition, _config$autoAdjust = config2.autoAdjust, autoAdjust = _config$autoAdjust === void 0 ? true : _config$autoAdjust, _config$autoHideScrol = config2.autoHideScrollOverflow, autoHideScrollOverflow = _config$autoHideScrol === void 0 ? true : _config$autoHideScrol, rtl = config2.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: offset2[0],
              top: offset2[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 containerInfo = getScrollerRect(container);
        var viewport = getViewPort(container);
        var viewportInfo = containerInfo;
        if (viewport !== container) {
          viewportInfo = getScrollerRect(viewport);
        }
        var staticInfo = {
          targetInfo: {
            width: twidth,
            height: theight,
            left: tleft,
            top: ttop
          },
          containerInfo,
          overlay,
          overlayInfo: {
            width: owidth,
            height: oheight
          },
          points: opoints,
          placementOffset,
          offset: offset2,
          container,
          rtl,
          viewport,
          viewportInfo
        };
        var _getXY3 = getXY(placement, staticInfo), left = _getXY3.left, top = _getXY3.top, points = _getXY3.points;
        if (autoAdjust && placement && shouldResizePlacement(left, top, viewport, staticInfo)) {
          var adjustResult = autoAdjustPosition(left, top, placement, staticInfo);
          if (adjustResult) {
            left = adjustResult.left;
            top = adjustResult.top;
            placement = adjustResult.placement;
          }
          var adjustXYResult = adjustXY(left, top, placement, staticInfo);
          if (adjustXYResult) {
            left = adjustXYResult.left;
            top = adjustXYResult.top;
            placement = adjustXYResult.placement;
          }
        }
        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) {
          for (var _iterator22 = _createForOfIteratorHelperLoose$1(scrollNode), _step2; !(_step2 = _iterator22()).done; ) {
            var node = _step2.value;
            var _getRect = getRect(node), _top = _getRect.top, _left = _getRect.left, width = _getRect.width, height = _getRect.height;
            if (ttop + theight < _top || ttop > _top + height || tleft + twidth < _left || tleft > _left + width) {
              result.style.display = "none";
              break;
            } 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__default.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"];
      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 i2 = 0;
          return function() {
            if (i2 >= o.length)
              return { done: true };
            return { done: false, value: o[i2++] };
          };
        }
        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 i2 = 0, arr2 = new Array(len); i2 < len; i2++)
          arr2[i2] = arr[i2];
        return arr2;
      }
      var isScrollDisplay = function isScrollDisplay2(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 && isScrollDisplay(parentNode) && isScrollDisplay(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__default.Component);
      var Overlay$3 = /* @__PURE__ */ React__default.forwardRef(function(props, ref) {
        var _overflowRef$current, _overflowRef$current2;
        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, offset2 = 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__default.useState(visible), firstVisible = _useState[0], setFirst = _useState[1];
        var _useState2 = React__default.useState(null), forceUpdate = _useState2[1];
        var positionStyleRef = React__default.useRef({
          position
        });
        var getContainer2 = typeof popupContainer === "string" ? function() {
          return document.getElementById(popupContainer);
        } : typeof popupContainer !== "function" ? function() {
          return popupContainer;
        } : popupContainer;
        var _useState3 = React__default.useState(null), container = _useState3[0], setContainer = _useState3[1];
        var targetRef = React__default.useRef(null);
        var preTarget = React__default.useRef(target);
        var overlayRef = React__default.useRef(null);
        var containerRef = React__default.useRef(null);
        var maskRef = React__default.useRef(null);
        var overflowRef = React__default.useRef([]);
        var lastFocus = React__default.useRef(null);
        var ro = React__default.useRef(null);
        var _useState4 = React__default.useState(Date.now().toString(36)), uuid = _useState4[0];
        var _useContext = React__default.useContext(OverlayContext), setVisibleOverlayToParent = _useContext.setVisibleOverlayToParent, otherContext = _objectWithoutPropertiesLoose(_useContext, _excluded2);
        var childIDMap = React__default.useRef(/* @__PURE__ */ new Map());
        var handleOpen = function handleOpen2(node) {
          setVisibleOverlayToParent(uuid, node);
          onOpen === null || onOpen === void 0 ? void 0 : onOpen(node);
        };
        var handleClose = function handleClose2() {
          positionStyleRef.current = null;
          setVisibleOverlayToParent(uuid, 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);
          }
          setVisibleOverlayToParent(id2, node);
        };
        var child = React__default.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: offset2,
            position,
            placement,
            placementOffset,
            beforePosition,
            autoAdjust,
            rtl,
            autoHideScrollOverflow: others.autoHideScrollOverflow
          });
          if (!isSameObject(positionStyleRef.current, placements.style)) {
            positionStyleRef.current = placements.style;
            setStyle$1(overlayNode2, placements.style);
            typeof onPosition === "function" && onPosition(placements);
          }
        });
        var overlayRefCallback = React__default.useCallback(function(nodeRef) {
          var node = ReactDOM.findDOMNode(nodeRef);
          overlayRef.current = node;
          callRef(ref, node);
          if (node !== null && container) {
            var containerNode = getRelativeContainer(getHTMLElement(container));
            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;
            var throttledUpdatePosition = throttle(updatePosition, waitTime);
            ro.current = new index(throttledUpdatePosition);
            ro.current.observe(containerNode);
            ro.current.observe(node);
            throttledUpdatePosition();
            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;
            }
          }
        }, [container]);
        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 i2 = 0; i2 < safeNodeList.length; i2++) {
            var _safeNode = getTargetNode(safeNodeList[i2]);
            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 = overflowRef.current) === null || _overflowRef$current === void 0 ? void 0 : _overflowRef$current.map(function(t2) {
          return t2 === document.documentElement ? document : t2;
        }), "scroll", scrollEvent, false, !!(visible && overlayRef.current && (_overflowRef$current2 = overflowRef.current) !== null && _overflowRef$current2 !== void 0 && _overflowRef$current2.length));
        React__default.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__default.useEffect(function() {
          if (!firstVisible && visible) {
            setFirst(true);
          }
        }, [visible]);
        var overlayNode = overlayRef.current;
        React__default.useEffect(function() {
          if (cache && overlayNode) {
            if (visible) {
              updatePosition();
              handleOpen(overlayNode);
            } else {
              handleClose();
            }
          }
        }, [visible, cache && overlayNode]);
        React__default.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__default.useEffect(function() {
          if (visible && overlayNode) {
            updatePosition();
          }
        }, [offset2, placement, placementOffset, points, autoAdjust, rtl]);
        React__default.useEffect(function() {
          if (!visible && autoFocus && lastFocus.current) {
            lastFocus.current.focus();
            lastFocus.current = null;
          }
        }, [!visible && autoFocus && lastFocus.current]);
        React__default.useEffect(function() {
          if (visible) {
            if (!container) {
              setContainer(getContainer2());
            } else if (getContainer2() !== container) {
              setContainer(getContainer2());
            }
          }
        }, [visible, popupContainer]);
        if (firstVisible === false || !container) {
          return null;
        }
        if (!visible && !cache && isAnimationEnd) {
          return null;
        }
        var newChildren = child ? /* @__PURE__ */ React__default.createElement(RefWrapper, {
          ref: overlayRefCallback
        }, /* @__PURE__ */ React__default.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__default.createElement("div", {
          className: maskClassName,
          style: maskStyle,
          ref: maskRef
        });
        var content = /* @__PURE__ */ React__default.createElement("div", {
          className: wrapperClassName,
          style: wrapperStyle
        }, hasMask ? maskRender ? maskRender(maskNode) : maskNode : null, newChildren);
        return /* @__PURE__ */ React__default.createElement(OverlayContext.Provider, {
          value: _extends({}, otherContext, {
            setVisibleOverlayToParent: getVisibleOverlayFromChild
          })
        }, /* @__PURE__ */ ReactDOM.createPortal(content, container));
      });
      var _excluded = ["overlay", "triggerType", "triggerClickKeyCode", "children", "defaultVisible", "className", "onVisibleChange", "container", "style", "placement", "canCloseByTrigger", "delay", "overlayProps", "safeNode", "followTrigger", "target", "disabled"];
      var Popup$5 = /* @__PURE__ */ React__default.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, container = _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__default.useState(defaultVisible || props.visible), visible = _useState[0], setVisible = _useState[1];
        var triggerRef = React__default.useRef(null);
        var overlayRef = React__default.useRef(null);
        var mouseLeaveTimer = React__default.useRef(null);
        var mouseEnterTimer = React__default.useRef(null);
        var overlayClick = React__default.useRef(false);
        var child = children && React__default.Children.only(children);
        var overlayChild = React__default.Children.only(overlay);
        React__default.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 || (child ? function() {
          return ReactDOM.findDOMNode(triggerRef.current);
        } : body);
        var getContainer2 = typeof container === "string" ? function() {
          return document.getElementById(container);
        } : typeof container !== "function" ? function() {
          return container;
        } : function() {
          return container(ReactDOM.findDOMNode(triggerRef.current));
        };
        var overlayContainer = followTrigger ? function() {
          var _findDOMNode;
          return (_findDOMNode = ReactDOM.findDOMNode(triggerRef.current)) === null || _findDOMNode === void 0 ? void 0 : _findDOMNode.parentNode;
        } : getContainer2;
        var refWrapperRef = React__default.useCallback(function(ref2) {
          triggerRef.current = ref2;
        }, []);
        return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, child && /* @__PURE__ */ React__default.createElement(RefWrapper, {
          ref: refWrapperRef
        }, /* @__PURE__ */ React__default.cloneElement(child, triggerProps)), /* @__PURE__ */ React__default.createElement(Overlay$3, _extends({}, others, overlayOtherProps, {
          placement,
          container: overlayContainer,
          safeNode: safeNodes,
          visible,
          target,
          onRequestClose: handleRequestClose,
          ref: React__default.useCallback(makeChain$6(saveRef(overlayRef), saveRef(ref)), [])
        }), overlayChild));
      });
      var Overlay$2 = Overlay$3;
      Overlay$2.Popup = Popup$5;
      Overlay$2.OverlayContext = OverlayContext;
      var Overlay2 = function Overlay22(props) {
        var _classNames;
        if (!React__default.useState || !React__default.useRef || !React__default.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$4(props, ["prefix", "animation", "visible", "hasMask", "align", "points", "onPosition", "children", "className", "style", "wrapperClassName", "beforeOpen", "onOpen", "afterOpen", "beforeClose", "onClose", "afterClose"]);
        var _useState = React__default.useState(true), isAnimationEnd = _useState[0], markAnimationEnd = _useState[1];
        var overlayRef = React__default.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__default.createElement(
          Animate.OverlayAnimate,
          {
            visible,
            animation: animation2,
            onEnter: handleEnter,
            onEntering: handleEntering,
            onEntered: handleEntered,
            onExit: handleExit,
            onExiting: handleExiting,
            onExited: handleExited,
            timeout: 300,
            style
          },
          children ? React__default.cloneElement(children, {
            className: classnames([prefix + "overlay-inner", className, children && children.props && children.props.className])
          }) : React__default.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$5(result, { align: result.config.points });
          typeof onPosition === "function" && onPosition(result);
        };
        var maskRender = function maskRender2(node) {
          return React__default.createElement(
            Animate.OverlayAnimate,
            {
              visible,
              animation: animation2 ? { in: "fadeIn", out: "fadeOut" } : false,
              timeout: 300,
              unmountOnExit: true
            },
            node
          );
        };
        return React__default.createElement(
          Overlay$2,
          _default$5({}, others, {
            visible,
            isAnimationEnd,
            hasMask,
            wrapperClassName: wraperCls,
            maskClassName: prefix + "overlay-backdrop",
            maskRender,
            points,
            onPosition: handlePosition,
            ref: overlayRef
          }),
          childrenNode
        );
      };
      const Overlay2$1 = Overlay2;
      var _class$S, _temp$A;
      var noop$g = func.noop, makeChain$5 = func.makeChain, bindCtx$a = func.bindCtx;
      var Popup$4 = (_temp$A = _class$S = function(_Component) {
        _default(Popup3, _Component);
        function Popup3(props) {
          _default$3(this, Popup3);
          var _this = _default$1(this, _Component.call(this, props));
          _this.state = {
            visible: typeof props.visible === "undefined" ? props.defaultVisible : props.visible
          };
          bindCtx$a(_this, ["handleTriggerClick", "handleTriggerKeyDown", "handleTriggerMouseEnter", "handleTriggerMouseLeave", "handleTriggerFocus", "handleTriggerBlur", "handleContentMouseEnter", "handleContentMouseLeave", "handleContentMouseDown", "handleRequestClose", "handleMaskMouseEnter", "handleMaskMouseLeave"]);
          return _this;
        }
        Popup3.getDerivedStateFromProps = function getDerivedStateFromProps(nextProps, prevState) {
          if ("visible" in nextProps) {
            return _default$5({}, prevState, {
              visible: nextProps.visible
            });
          }
          return null;
        };
        Popup3.prototype.componentWillUnmount = function componentWillUnmount() {
          var _this2 = this;
          ["_timer", "_hideTimer", "_showTimer"].forEach(function(time) {
            _this2[time] && clearTimeout(_this2[time]);
          });
        };
        Popup3.prototype.handleVisibleChange = function handleVisibleChange(visible, type2, e2) {
          if (!("visible" in this.props)) {
            this.setState({
              visible
            });
          }
          this.props.onVisibleChange(visible, type2, e2);
        };
        Popup3.prototype.handleTriggerClick = function handleTriggerClick(e2) {
          if (this.state.visible && !this.props.canCloseByTrigger) {
            return;
          }
          this.handleVisibleChange(!this.state.visible, "fromTrigger", e2);
        };
        Popup3.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);
          }
        };
        Popup3.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);
          }
        };
        Popup3.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);
          }
        };
        Popup3.prototype.handleTriggerFocus = function handleTriggerFocus(e2) {
          this.handleVisibleChange(true, "fromTrigger", e2);
        };
        Popup3.prototype.handleTriggerBlur = function handleTriggerBlur(e2) {
          if (!this._isForwardContent) {
            this.handleVisibleChange(false, "fromTrigger", e2);
          }
          this._isForwardContent = false;
        };
        Popup3.prototype.handleContentMouseDown = function handleContentMouseDown() {
          this._isForwardContent = true;
        };
        Popup3.prototype.handleContentMouseEnter = function handleContentMouseEnter() {
          clearTimeout(this._hideTimer);
        };
        Popup3.prototype.handleContentMouseLeave = function handleContentMouseLeave(e2) {
          this.handleTriggerMouseLeave(e2, "fromContent");
        };
        Popup3.prototype.handleMaskMouseEnter = function handleMaskMouseEnter() {
          if (!this._mouseNotFirstOnMask) {
            clearTimeout(this._hideTimer);
            this._hideTimer = null;
            this._mouseNotFirstOnMask = false;
          }
        };
        Popup3.prototype.handleMaskMouseLeave = function handleMaskMouseLeave() {
          this._mouseNotFirstOnMask = true;
        };
        Popup3.prototype.handleRequestClose = function handleRequestClose(type2, e2) {
          this.handleVisibleChange(false, type2, e2);
        };
        Popup3.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 || {}, onClick = _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, onClick);
                  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__default.cloneElement(trigger, props);
        };
        Popup3.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__default.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__default.cloneElement(content, props);
        };
        Popup3.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$4(_props3, ["target", "safeNode", "followTrigger", "triggerType", "hasMask", "wrapperStyle"]);
          var container = 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) {
            container = function container2(trigger) {
              return trigger && trigger.parentNode || trigger;
            };
            newWrapperStyle.position = "relative";
          }
          if (triggerType === "hover" && hasMask) {
            others.onMaskMouseEnter = this.handleMaskMouseEnter;
            others.onMaskMouseLeave = this.handleMaskMouseLeave;
          }
          return React__default.createElement(
            Overlay1,
            _default$5({}, others, {
              key: "overlay",
              ref: function ref(overlay) {
                return _this7.overlay = overlay;
              },
              visible: this.state.visible,
              target: target || findTriggerNode,
              container,
              safeNode: safeNodes,
              wrapperStyle: newWrapperStyle,
              triggerType,
              hasMask,
              onRequestClose: this.handleRequestClose
            }),
            this.props.children && this.renderContent()
          );
        };
        Popup3.prototype.render = function render2() {
          return [this.renderTrigger(), this.renderPortal()];
        };
        return Popup3;
      }(React__default.Component), _class$S.propTypes = {
        /**
         * 弹层内容
         */
        children: PT.node,
        /**
         * 触发弹层显示或隐藏的元素
         */
        trigger: PT.element,
        /**
         * 触发弹层显示或隐藏的操作类型,可以是 'click','hover','focus',或者它们组成的数组,如 ['hover', 'focus']
         */
        triggerType: PT.oneOfType([PT.string, PT.array]),
        /**
         * 当 triggerType 为 click 时才生效,可自定义触发弹层显示的键盘码
         */
        triggerClickKeycode: PT.oneOfType([PT.number, PT.array]),
        /**
         * 弹层当前是否显示
         */
        visible: PT.bool,
        /**
         * 弹层默认是否显示
         */
        defaultVisible: PT.bool,
        /**
         * 弹层显示或隐藏时触发的回调函数
         * @param {Boolean} visible 弹层是否显示
         * @param {String} type 触发弹层显示或隐藏的来源 fromTrigger 表示由trigger的点击触发; docClick 表示由document的点击触发
         * @param {Object} e DOM事件
         */
        onVisibleChange: PT.func,
        /**
         * 设置此属性,弹层无法显示或隐藏
         */
        disabled: PT.bool,
        autoFit: PT.bool,
        /**
         * 弹层显示或隐藏的延时时间(以毫秒为单位),在 triggerType 被设置为 hover 时生效
         */
        delay: PT.number,
        /**
         * trigger 是否可以关闭弹层
         */
        canCloseByTrigger: PT.bool,
        /**
         * 弹层定位的参照元素
         * @default target 属性,即触发元素
         */
        target: PT.any,
        safeNode: PT.any,
        /**
         * 是否跟随trigger滚动
         */
        followTrigger: PT.bool,
        container: PT.any,
        hasMask: PT.bool,
        wrapperStyle: PT.object,
        rtl: PT.bool,
        /**
         * 开启 v2 版本
         */
        v2: PT.bool,
        /**
         * [v2] 快捷位置,包含 'tl' | 't' | 'tr' | 'rt' | 'r' | 'rb' | 'bl' | 'b' | 'br' | 'lt' | 'l' | 'lb'
         */
        placement: PT.string,
        /**
         * [v2] 弹层偏离触发元素的像素值
         */
        placementOffset: PT.number,
        /**
         * [v2] 浮窗被遮挡时是否自动调整位置
         */
        autoAdjust: PT.bool
      }, _class$S.defaultProps = {
        triggerType: "hover",
        triggerClickKeycode: [KEYCODE.SPACE, KEYCODE.ENTER],
        defaultVisible: false,
        onVisibleChange: noop$g,
        disabled: false,
        autoFit: false,
        delay: 200,
        canCloseByTrigger: true,
        followTrigger: false,
        container: function container() {
          return document.body;
        },
        rtl: false
      }, _temp$A);
      Popup$4.displayName = "Popup";
      const Popup1 = polyfill(Popup$4);
      var Popup$3 = function Popup3(props) {
        var _classNames;
        if (!React__default.useState || !React__default.useRef || !React__default.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$4(props, ["prefix", "animation", "defaultVisible", "onVisibleChange", "trigger", "triggerType", "overlay", "onPosition", "children", "className", "style", "wrapperClassName", "triggerClickKeycode", "align", "beforeOpen", "onOpen", "afterOpen", "beforeClose", "onClose", "afterClose"]);
        var _useState = React__default.useState(defaultVisible), visible = _useState[0], setVisible = _useState[1];
        var _useState2 = React__default.useState(panimation), animation2 = _useState2[0], setAnimation = _useState2[1];
        var _useState3 = React__default.useState(true), isAnimationEnd = _useState3[0], markAnimationEnd = _useState3[1];
        var overlayRef = React__default.useRef(null);
        React__default.useEffect(function() {
          if ("visible" in props) {
            setVisible(props.visible);
          }
        }, [props.visible]);
        React__default.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__default.createElement(
          Animate.OverlayAnimate,
          {
            visible,
            animation: animation2,
            timeout: 200,
            onEnter: handleEnter,
            onEntering: handleEntering,
            onEntered: handleEntered,
            onExit: handleExit,
            onExiting: handleExiting,
            onExited: handleExited,
            style
          },
          overlayNode ? React__default.cloneElement(overlayNode, {
            className: classnames([prefix + "overlay-inner", className, overlayNode && overlayNode.props && overlayNode.props.className])
          }) : React__default.createElement("span", null)
        );
        var handlePosition = function handlePosition2(result) {
          _default$5(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__default.createElement(
            Animate.OverlayAnimate,
            {
              visible,
              animation: animation2 ? { in: "fadeIn", out: "fadeOut" } : false,
              timeout: 200,
              unmountOnExit: true
            },
            node
          );
        };
        return React__default.createElement(
          Overlay$2.Popup,
          _default$5({}, others, v1Props, {
            wrapperClassName: wraperCls,
            overlay: overlayNode,
            visible,
            isAnimationEnd,
            triggerType,
            onVisibleChange: handleVisibleChange,
            onPosition: handlePosition,
            triggerClickKeyCode: triggerClickKeycode,
            maskRender,
            ref: overlayRef
          }),
          triggerNode
        );
      };
      const Popup2 = Popup$3;
      var Overlay = function(_React$Component) {
        _default(Overlay3, _React$Component);
        function Overlay3(props) {
          _default$3(this, Overlay3);
          var _this = _default$1(this, _React$Component.call(this, props));
          _this.overlayRef = null;
          _this.saveRef = _this.saveRef.bind(_this);
          return _this;
        }
        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$4(_props, ["v2"]);
          if (v2) {
            if ("needAdjust" in others) {
              log.deprecated("needAdjust", "autoAdjust", "Overlay v2");
              others.autoAdjust = others.needAdjust;
              delete others.needAdjust;
            }
            return React__default.createElement(Overlay2$1, others);
          } else {
            return React__default.createElement(Overlay1, _default$5({}, others, { ref: this.saveRef }));
          }
        };
        return Overlay3;
      }(React__default.Component);
      Overlay.displayName = "Overlay";
      var Popup$2 = function(_React$Component2) {
        _default(Popup3, _React$Component2);
        function Popup3(props) {
          _default$3(this, Popup3);
          var _this2 = _default$1(this, _React$Component2.call(this, props));
          _this2.overlay = null;
          _this2.saveRef = _this2.saveRef.bind(_this2);
          return _this2;
        }
        Popup3.prototype.saveRef = function saveRef2(ref) {
          if (ref) {
            this.overlay = ref.overlay;
          }
        };
        Popup3.prototype.render = function render2() {
          var _props2 = this.props, v2 = _props2.v2, others = _default$4(_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__default.createElement(Popup2, others);
          } else {
            return React__default.createElement(Popup1, _default$5({}, others, { ref: this.saveRef }));
          }
        };
        return Popup3;
      }(React__default.Component);
      Popup$2.displayName = "Popup";
      Overlay.Gateway = Gateway$1;
      Overlay.Position = Position;
      Overlay.Popup = ConfigProvider$1.config(Popup$2, {
        exportNames: ["overlay"]
      });
      const Overlay$1 = ConfigProvider$1.config(Overlay, {
        exportNames: ["getContent", "getContentNode"]
      });
      var _class$R, _temp$z;
      var Icon$1 = (_temp$z = _class$R = function(_Component) {
        _default(Icon2, _Component);
        function Icon2() {
          _default$3(this, Icon2);
          return _default$1(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$5({}, 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__default.createElement(
            "i",
            _default$5({}, others, { style: _default$5({}, sizeStyle, style), className: classes }),
            children
          );
        };
        return Icon2;
      }(React__default.Component), _class$R.propTypes = _default$5({}, ConfigProvider$1.propTypes, {
        /**
         * 指定显示哪种图标
         */
        type: PT.string,
        children: PT.node,
        /**
         * 指定图标大小
         * <br/>**可选值**<br/> xxs, xs, small, medium, large, xl, xxl, xxxl, inherit
         */
        size: PT.oneOfType([PT.oneOf(["xxs", "xs", "small", "medium", "large", "xl", "xxl", "xxxl", "inherit"]), PT.number]),
        className: PT.string,
        style: PT.object
      }), _class$R.defaultProps = {
        prefix: "next-",
        size: "medium"
      }, _class$R._typeMark = "icon", _temp$z);
      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$4(props, ["type", "size", "children", "className", "prefix"]);
          var content = null;
          if (props.type) {
            content = React__default.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__default.createElement(
              ConfigIcon,
              { size: size2 },
              React__default.createElement(
                "svg",
                _default$5({ 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 _class$Q, _temp$y;
      var noop$f = func.noop, makeChain$4 = func.makeChain, bindCtx$9 = func.bindCtx;
      var Popup$1 = Overlay$1.Popup;
      var Dropdown$1 = (_temp$y = _class$Q = function(_Component) {
        _default(Dropdown2, _Component);
        function Dropdown2(props) {
          _default$3(this, Dropdown2);
          var _this = _default$1(this, _Component.call(this, props));
          _this.state = {
            visible: "visible" in props ? props.visible : props.defaultVisible || false,
            autoFocus: "autoFocus" in props ? props.autoFocus : false
          };
          bindCtx$9(_this, ["onTriggerKeyDown", "onMenuClick", "onVisibleChange"]);
          return _this;
        }
        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, from2) {
          this.setState({ visible });
          this.props.onVisibleChange(visible, from2);
        };
        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__default.Children.only(this.props.children);
          var content = child;
          if (typeof child.type === "function" && child.type.isNextMenu) {
            content = React__default.cloneElement(child, {
              onItemClick: makeChain$4(this.onMenuClick, child.props.onItemClick)
            });
          } else if (autoClose) {
            content = React__default.cloneElement(child, {
              onClick: makeChain$4(this.onMenuClick, child.props.onClick)
            });
          }
          var newTrigger = React__default.cloneElement(trigger, {
            onKeyDown: makeChain$4(this.onTriggerKeyDown, trigger.props.onKeyDown)
          });
          return React__default.createElement(
            Popup$1,
            _default$5({}, this.props, {
              rtl,
              autoFocus: this.state.autoFocus,
              trigger: newTrigger,
              visible: this.getVisible(),
              onVisibleChange: this.onVisibleChange,
              canCloseByOutSideClick: true
            }),
            content
          );
        };
        return Dropdown2;
      }(React__default.Component), _class$Q.propTypes = {
        prefix: PT.string,
        pure: PT.bool,
        rtl: PT.bool,
        className: PT.string,
        /**
         * 弹层内容
         */
        children: PT.node,
        /**
         * 弹层当前是否显示
         */
        visible: PT.bool,
        /**
         * 弹层默认是否显示
         */
        defaultVisible: PT.bool,
        /**
         * 弹层显示或隐藏时触发的回调函数
         * @param {Boolean} visible 弹层是否显示
         * @param {String} type 触发弹层显示或隐藏的来源 fromContent 表示由Dropdown内容触发; fromTrigger 表示由trigger的点击触发; docClick 表示由document的点击触发
         */
        onVisibleChange: PT.func,
        /**
         * 触发弹层显示或者隐藏的元素
         */
        trigger: PT.node,
        /**
         * 触发弹层显示或隐藏的操作类型,可以是 'click','hover',或者它们组成的数组,如 ['hover', 'click']
         */
        triggerType: PT.oneOfType([PT.string, PT.array]),
        /**
         * 设置此属性,弹层无法显示或隐藏
         */
        disabled: PT.bool,
        /**
         * 弹层相对于触发元素的定位, 详见 Overlay 的定位部分
         */
        align: PT.string,
        /**
         * 弹层相对于trigger的定位的微调, 接收数组[hoz, ver], 表示弹层在 left / top 上的增量
         * e.g. [100, 100] 表示往右(RTL 模式下是往左) 、下分布偏移100px
         */
        offset: PT.array,
        /**
         * 弹层显示或隐藏的延时时间(以毫秒为单位),在 triggerType 被设置为 hover 时生效
         */
        delay: PT.number,
        /**
         * 弹层打开时是否让其中的元素自动获取焦点
         */
        autoFocus: PT.bool,
        /**
         * 是否显示遮罩
         */
        hasMask: PT.bool,
        /**
         * 开启后,children 不管是不是Menu,点击后都默认关掉弹层(2.x默认设置为true)
         * @version 1.23
         */
        autoClose: PT.bool,
        /**
         * 隐藏时是否保留子节点
         */
        cache: PT.bool,
        /**
         * 配置动画的播放方式,支持 { in: 'enter-class', out: 'leave-class' } 的对象参数,如果设置为 false,则不播放动画
         * @default { in: 'expandInDown', out: 'expandOutUp' }
         */
        animation: PT.oneOfType([PT.object, PT.bool])
      }, _class$Q.defaultProps = {
        prefix: "next-",
        pure: false,
        defaultVisible: false,
        autoClose: false,
        onVisibleChange: noop$f,
        triggerType: "hover",
        disabled: false,
        align: "tl bl",
        offset: [0, 0],
        delay: 200,
        hasMask: false,
        cache: false,
        onPosition: noop$f
      }, _temp$y);
      Dropdown$1.displayName = "Dropdown";
      const Dropdown = ConfigProvider$1.config(Dropdown$1, {
        transform: (
          /* istanbul ignore next */
          function transform2(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$P, _temp$x;
      var bindCtx$8 = func.bindCtx;
      var pickOthers$8 = obj.pickOthers;
      var Item$2 = (_temp$x = _class$P = function(_Component) {
        _default(Item2, _Component);
        function Item2(props) {
          _default$3(this, Item2);
          var _this = _default$1(this, _Component.call(this, props));
          bindCtx$8(_this, ["handleClick", "handleKeyDown"]);
          return _this;
        }
        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$5({}, 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__default.createElement(
            TagName,
            _default$5({
              role,
              title: this.getTitle(children)
            }, others, {
              className: newClassName,
              onClick: this.handleClick,
              onKeyDown: this.handleKeyDown
            }),
            React__default.createElement(
              "div",
              { className: prefix + "menu-item-inner" },
              children
            )
          );
        };
        return Item2;
      }(React__default.Component), _class$P.propTypes = {
        _key: PT.string,
        level: PT.number,
        inlineLevel: PT.number,
        groupIndent: PT.number,
        root: PT.object,
        menu: PT.any,
        parent: PT.object,
        parentMode: PT.oneOf(["inline", "popup"]),
        type: PT.oneOf(["submenu", "item"]),
        component: PT.string,
        disabled: PT.bool,
        className: PT.string,
        onClick: PT.func,
        onKeyDown: PT.func,
        needIndent: PT.bool,
        replaceClassName: PT.bool
      }, _class$P.defaultProps = {
        component: "li",
        groupIndent: 0,
        replaceClassName: false,
        needIndent: true
      }, _temp$x);
      Item$2.displayName = "Item";
      var _class$O, _temp$w;
      var bindCtx$7 = func.bindCtx;
      var pickOthers$7 = obj.pickOthers;
      var SelectableItem = (_temp$w = _class$O = function(_Component) {
        _default(SelectableItem2, _Component);
        function SelectableItem2(props) {
          _default$3(this, SelectableItem2);
          var _this = _default$1(this, _Component.call(this, props));
          bindCtx$7(_this, ["handleKeyDown", "handleClick"]);
          return _this;
        }
        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__default.isValidElement(icons.select) && icons.select) {
            iconsSelect = React__default.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__default.cloneElement(iconsSelect || React__default.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$5({
            _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__default.createElement(
            Item$2,
            newProps,
            this.renderSelectedIcon(selected),
            React__default.createElement(
              "span",
              _default$5({ className: prefix + "menu-item-text" }, textProps),
              children
            ),
            helper ? React__default.createElement(
              "div",
              { className: prefix + "menu-item-helper" },
              helper
            ) : null
          );
        };
        return SelectableItem2;
      }(React__default.Component), _class$O.menuChildType = "item", _class$O.propTypes = {
        _key: PT.string,
        root: PT.object,
        selected: PT.bool,
        onSelect: PT.func,
        inlineIndent: PT.number,
        /**
         * 是否禁用
         */
        disabled: PT.bool,
        /**
         * 帮助文本
         */
        helper: PT.node,
        /**
         * 菜单项标签内容
         */
        children: PT.node,
        className: PT.string,
        onKeyDown: PT.func,
        onClick: PT.func,
        needIndent: PT.bool,
        hasSelectedIcon: PT.bool,
        isSelectIconRight: PT.bool,
        icons: PT.object
      }, _class$O.defaultProps = {
        disabled: false,
        needIndent: true,
        icons: {}
      }, _temp$w);
      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$N, _temp$v;
      var bindCtx$6 = func.bindCtx;
      var setStyle = dom.setStyle;
      var Popup = Overlay$1.Popup;
      var PopupItem = (_temp$v = _class$N = function(_Component) {
        _default(PopupItem2, _Component);
        function PopupItem2(props) {
          _default$3(this, PopupItem2);
          var _this = _default$1(this, _Component.call(this, props));
          bindCtx$6(_this, ["handleOpen", "handlePopupOpen", "handlePopupClose", "getPopup"]);
          return _this;
        }
        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$2;
          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__default.createElement(
            NewItem,
            _default$5({}, itemProps, others),
            React__default.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$4(positionProps, ["className"]);
          var className = classnames(propCls, posCls);
          return React__default.createElement(
            Popup,
            _default$5({
              ref: this.getPopup
            }, otherPostion, this.popupProps, {
              canCloseByEsc: false,
              trigger,
              triggerType,
              visible: open2,
              pinFollowBaseElementWhenFixed: true,
              onVisibleChange: this.handleOpen,
              onOpen: this.handlePopupOpen,
              onClose: this.handlePopupClose
            }),
            React__default.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__default.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__default.Component), _class$N.menuChildType = "submenu", _class$N.propTypes = {
        _key: PT.string,
        root: PT.object,
        level: PT.number,
        hasSubMenu: PT.bool,
        noIcon: PT.bool,
        rtl: PT.bool,
        selectable: PT.bool,
        /**
         * 标签内容
         */
        label: PT.node,
        /**
         * 自定义弹层内容
         */
        children: PT.node,
        className: PT.string,
        /**
         * 子菜单打开的触发行为
         */
        triggerType: PT.oneOf(["click", "hover"]),
        align: PT.oneOf(["outside", "follow"]),
        autoWidth: PT.bool
      }, _class$N.defaultProps = {
        selectable: false,
        noIcon: false
      }, _temp$v);
      PopupItem.displayName = "PopupItem";
      var _class$M, _temp$u;
      var Expand = Animate.Expand;
      var bindCtx$5 = func.bindCtx;
      var SubMenu = (_temp$u = _class$M = function(_Component) {
        _default(SubMenu2, _Component);
        function SubMenu2(props) {
          _default$3(this, SubMenu2);
          var _this = _default$1(this, _Component.call(this, props));
          bindCtx$5(_this, ["handleMouseEnter", "handleMouseLeave", "handleClick", "handleOpen", "afterLeave"]);
          return _this;
        }
        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__default.Children.map(children, function(child) {
            if (typeof child !== "function" && (typeof child === "undefined" ? "undefined" : _default$2(child)) !== "object") {
              return child;
            }
            return React__default.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$2;
          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__default.createElement(
            "ul",
            { role: roleMenu, dir: rtl ? "rtl" : void 0, className: newSubMenuContentClassName },
            this.passParentToChildren(children)
          ) : null;
          return React__default.createElement(
            "li",
            _default$5({ role: roleItem }, others, liProps),
            React__default.createElement(
              NewItem,
              itemProps,
              React__default.createElement(
                "span",
                { className: prefix + "menu-item-text" },
                label
              ),
              noIcon ? null : React__default.createElement(Icon, arrorProps)
            ),
            expandAnimation ? React__default.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$4(_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__default.createElement(
            PopupItem,
            _default$5({}, others, { noIcon, hasSubMenu: true }),
            React__default.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__default.Component), _class$M.menuChildType = "submenu", _class$M.propTypes = {
        _key: PT.string,
        root: PT.object,
        level: PT.number,
        inlineLevel: PT.number,
        groupIndent: PT.number,
        /**
         * 标签内容
         */
        label: PT.node,
        /**
         * 是否可选,该属性仅在设置 Menu 组件 selectMode 属性后生效
         */
        selectable: PT.bool,
        /**
         * 子菜单打开方式,如果设置会覆盖 Menu 上的同名属性
         * @default Menu 的 mode 属性值
         */
        mode: PT.oneOf(["inline", "popup"]),
        /**
         * 是否需要提示当前项可展开的 icon,默认是有的
         */
        noIcon: PT.bool,
        /**
         * 菜单项或下一级子菜单
         */
        children: PT.node,
        onMouseEnter: PT.func,
        onMouseLeave: PT.func,
        subMenuContentClassName: PT.string,
        triggerType: PT.oneOf(["click", "hover"]),
        align: PT.oneOf(["outside", "follow"]),
        parentMode: PT.oneOf(["inline", "popup"]),
        parent: PT.any
      }, _class$M.defaultProps = {
        groupIndent: 0,
        noIcon: false,
        selectable: false
      }, _temp$u);
      SubMenu.displayName = "SubMenu";
      var _class$L, _temp$t;
      var bindCtx$4 = func.bindCtx;
      var pickOthers$6 = obj.pickOthers, isNil$1 = obj.isNil;
      var noop$e = function noop2() {
      };
      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__default.isValidElement(moreNode) ? React__default.cloneElement(moreNode, {
            style,
            className: renderMoreCls
          }) : moreNode;
        }
        return React__default.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__default.Children.forEach(children, function(child, index2) {
          if (!child) {
            return;
          }
          var overflowedItems = [];
          if (index2 > lastVisibleIndex) {
            child = React__default.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, i2) {
              return React__default.cloneElement(c2, {
                key: c2.key || "more-" + index2 + "-" + i2
              });
            });
            arr.push(getIndicatorsItem(overflowedItems, false, prefix, renderMore));
          }
          arr.push(child);
        });
        arr.push(getIndicatorsItem([], true, prefix, renderMore));
        return arr;
      };
      var getNewChildren$1 = function getNewChildren2(_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__default.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$2(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__default.cloneElement(child, props, loop2(child.props.children, pos, void 0, childLevel));
                  break;
                case "group":
                  newChild = React__default.cloneElement(child, props, loop2(child.props.children, posPrefix, indexWrapper, props.level));
                  break;
                case "item":
                case "divider":
                  newChild = React__default.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$3 = (_temp$t = _class$L = function(_Component) {
        _default(Menu2, _Component);
        function Menu2(props) {
          _default$3(this, Menu2);
          var _this = _default$1(this, _Component.call(this, props));
          _this.getUpdateChildren = function() {
            var _this$state = _this.state, root = _this$state.root, lastVisibleIndex = _this$state.lastVisibleIndex;
            return getNewChildren$1(_default$5({
              root,
              lastVisibleIndex
            }, _this.props));
          };
          _this.menuContentRef = function(ref) {
            _this.menuContent = ref;
          };
          _this.menuHeaderRef = function(ref) {
            _this.menuHeader = ref;
          };
          _this.menuFooterRef = function(ref) {
            _this.menuFooter = ref;
          };
          var _this$props = _this.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;
          _this.state = {
            lastVisibleIndex: void 0
          };
          var _getNewChildren = getNewChildren$1(_default$5({
            root: _this
          }, _this.props)), newChildren = _getNewChildren.newChildren, _k2n = _getNewChildren._k2n, _p2n = _getNewChildren._p2n;
          var tabbableKey = focusable ? getFirstAvaliablelChildKey("0", _p2n) : void 0;
          _this.state = {
            root: _this,
            lastVisibleIndex: void 0,
            newChildren,
            _k2n,
            _p2n,
            tabbableKey,
            openKeys: _this.getInitOpenKeys(props, _k2n, _p2n),
            selectedKeys: normalizeToArray(selectedKeys || defaultSelectedKeys),
            focusedKey: !isNil$1(_this.props.focusedKey) ? focusedKey : focusable && autoFocus ? tabbableKey : null
          };
          bindCtx$4(_this, ["handleOpen", "handleSelect", "handleItemClick", "handleItemKeyDown", "onBlur", "adjustChildrenWidth"]);
          _this.popupNodes = [];
          return _this;
        }
        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$5({
            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 || React__default.Children.toArray(this.props.children).length !== React__default.Children.toArray(prevProps.children).length) {
            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, i2) {
            currentSumWidth += liWidth;
            if (i2 >= totalLen - 1 && currentSumWidth <= spaceWidth || currentSumWidth + moreWidth <= spaceWidth) {
              lastVisibleIndex++;
            }
          });
          if (lastVisibleIndex >= totalLen - 1) {
            dom.setStyle(moreNode, "display", "none");
          }
          this.setState(_default$5({
            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$5({
                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 i2 = 1; i2 < nums.length - 1; i2++) {
            var parentNums = nums.slice(0, i2 + 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$5({
              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__default.createElement(
            "li",
            { className: prefix + "menu-header", ref: this.menuHeaderRef },
            header
          ) : null;
          var itemsElement = !flatenContent && (header || footer) ? React__default.createElement(
            "ul",
            { className: prefix + "menu-content", ref: this.menuContentRef },
            newChildren
          ) : newChildren;
          var footerElement = footer ? React__default.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__default.createElement(
            "ul",
            _default$5({
              role,
              onBlur: this.onBlur,
              className: newClassName,
              onKeyDown: this.handleEnter,
              "aria-multiselectable": ariaMultiselectable
            }, others),
            headerElement,
            shouldWrapItemsAndFooter ? React__default.createElement(
              "div",
              { className: prefix + "menu-hoz-right" },
              itemsElement,
              footerElement
            ) : null,
            !shouldWrapItemsAndFooter ? itemsElement : null,
            !shouldWrapItemsAndFooter ? footerElement : null
          );
        };
        return Menu2;
      }(React__default.Component), _class$L.isNextMenu = true, _class$L.propTypes = _default$5({}, ConfigProvider$1.propTypes, {
        prefix: PT.string,
        pure: PT.bool,
        rtl: PT.bool,
        className: PT.string,
        /**
         * 菜单项和子菜单
         */
        children: PT.node,
        /**
         * 点击菜单项触发的回调函数
         * @param {String} key 点击的菜单项的 key 值
         * @param {Object} item 点击的菜单项对象
         * @param {Object} event 点击的事件对象
         */
        onItemClick: PT.func,
        /**
         * 当前打开的子菜单的 key 值
         */
        openKeys: PT.oneOfType([PT.string, PT.array]),
        /**
         * 初始打开的子菜单的 key 值
         */
        defaultOpenKeys: PT.oneOfType([PT.string, PT.array]),
        /**
         * 初始展开所有的子菜单,只在 mode 设置为 'inline' 以及 openMode 设置为 'multiple' 下生效,优先级高于 defaultOpenKeys
         */
        defaultOpenAll: PT.bool,
        /**
         * 打开或关闭子菜单触发的回调函数
         * @param {Array} key 打开的所有子菜单的 key 值
         * @param {Object} extra 额外参数
         * @param {String} extra.key 当前操作子菜单的 key 值
         * @param {Boolean} extra.open 是否是打开
         */
        onOpen: PT.func,
        /**
         * 子菜单打开的模式
         */
        mode: PT.oneOf(["inline", "popup"]),
        /**
         * 子菜单打开的触发行为
         */
        triggerType: PT.oneOf(["click", "hover"]),
        /**
         * 展开内连子菜单的模式,同时可以展开一个子菜单还是多个子菜单,该属性仅在 mode 为 inline 时生效
         */
        openMode: PT.oneOf(["single", "multiple"]),
        /**
         * 内连子菜单缩进距离
         */
        inlineIndent: PT.number,
        inlineArrowDirection: PT.oneOf(["down", "right"]),
        /**
         * 是否自动让弹层的宽度和菜单项保持一致,如果弹层的宽度比菜单项小则和菜单项保持一致,如果宽度大于菜单项则不做处理
         */
        popupAutoWidth: PT.bool,
        /**
         * 弹层的对齐方式
         */
        popupAlign: PT.oneOf(["follow", "outside"]),
        /**
         * 弹层自定义 props
         */
        popupProps: PT.oneOfType([PT.object, PT.func]),
        /**
         * 弹出子菜单自定义 className
         */
        popupClassName: PT.string,
        /**
         * 弹出子菜单自定义 style
         */
        popupStyle: PT.object,
        /**
         * 当前选中菜单项的 key 值
         */
        selectedKeys: PT.oneOfType([PT.string, PT.array]),
        /**
         * 初始选中菜单项的 key 值
         */
        defaultSelectedKeys: PT.oneOfType([PT.string, PT.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: PT.func,
        /**
         * 选中模式,单选还是多选,默认无值,不可选
         */
        selectMode: PT.oneOf(["single", "multiple"]),
        /**
         * 是否只能选择第一层菜单项(不能选择子菜单中的菜单项)
         */
        shallowSelect: PT.bool,
        /**
         * 是否显示选中图标,如果设置为 false 需配合配置平台设置选中时的背景色以示区分
         */
        hasSelectedIcon: PT.bool,
        labelToggleChecked: PT.bool,
        /**
         * 是否将选中图标居右,仅当 hasSelectedIcon 为true 时生效。
         * 注意:SubMenu 上的选中图标一直居左,不受此API控制
         */
        isSelectIconRight: PT.bool,
        /**
         * 菜单第一层展示方向
         */
        direction: PT.oneOf(["ver", "hoz"]),
        /**
         * 横向菜单条 item 和 footer 的对齐方向,在 direction 设置为 'hoz' 并且 header 存在时生效
         */
        hozAlign: PT.oneOf(["left", "right"]),
        /**
         * 横向菜单模式下,是否维持在一行,即超出一行折叠成 SubMenu 显示, 仅在 direction='hoz' mode='popup' 时生效
         */
        hozInLine: PT.bool,
        renderMore: PT.func,
        /**
         * 自定义菜单头部
         */
        header: PT.node,
        /**
         * 自定义菜单尾部
         */
        footer: PT.node,
        /**
         * 自定义菜单尾部容器的 className
         */
        footerWrapperClassName: PT.string,
        /**
         * 是否自动获得焦点
         */
        autoFocus: PT.bool,
        /**
         * 当前获得焦点的子菜单或菜单项 key 值
         */
        focusedKey: PT.oneOfType([PT.string, PT.number, PT.object]),
        focusable: PT.bool,
        onItemFocus: PT.func,
        onBlur: PT.func,
        /**
         * 是否开启嵌入式模式,一般用于Layout的布局中,开启后没有默认背景、外层border、box-shadow,可以配合`<Menu style={{lineHeight: '100px'}}>` 自定义高度
         * @version 1.18
         */
        embeddable: PT.bool,
        onItemKeyDown: PT.func,
        expandAnimation: PT.bool,
        itemClassName: PT.string,
        /**
         * 可配置的icons,包括 select 等
         */
        icons: PT.object,
        // content 是否为单层模式,目前主要在有 header 或 footer 的时候有意义
        flatenContent: PT.bool
      }), _class$L.defaultProps = {
        prefix: "next-",
        pure: false,
        defaultOpenKeys: [],
        defaultOpenAll: false,
        onOpen: noop$e,
        mode: "inline",
        triggerType: "click",
        openMode: "multiple",
        inlineIndent: 20,
        inlineArrowDirection: "down",
        popupAutoWidth: false,
        popupAlign: "follow",
        popupProps: {},
        defaultSelectedKeys: [],
        onSelect: noop$e,
        shallowSelect: false,
        hasSelectedIcon: true,
        isSelectIconRight: false,
        labelToggleChecked: true,
        direction: "ver",
        hozAlign: "left",
        hozInLine: false,
        autoFocus: false,
        focusable: true,
        embeddable: false,
        onItemFocus: noop$e,
        onItemKeyDown: noop$e,
        onItemClick: noop$e,
        expandAnimation: true,
        icons: {}
      }, _temp$t);
      Menu$3.displayName = "Menu";
      const Menu$4 = polyfill(Menu$3);
      var makeChain$3 = func.makeChain;
      var UIState = (
        /** @class */
        function(_super) {
          __extends(UIState2, _super);
          function UIState2(props) {
            var _this = _super.call(this, props) || this;
            _this.state = {};
            ["_onUIFocus", "_onUIBlur"].forEach(function(item) {
              _this[item] = _this[item].bind(_this);
            });
            return _this;
          }
          UIState2.prototype.getStateElement = function(base) {
            var _a = this.props, onFocus = _a.onFocus, onBlur = _a.onBlur;
            return React__default.cloneElement(base, {
              onFocus: makeChain$3(this._onUIFocus, onFocus),
              onBlur: makeChain$3(this._onUIBlur, onBlur)
            });
          };
          UIState2.prototype.getStateClassName = function() {
            var focused = this.state.focused;
            return classnames({
              focused
            });
          };
          UIState2.prototype.resetUIState = function() {
            this.setState({
              focused: false
            });
          };
          UIState2.prototype._onUIFocus = function() {
            this.setState({
              focused: true
            });
          };
          UIState2.prototype._onUIBlur = function() {
            this.setState({
              focused: false
            });
          };
          return UIState2;
        }(React__default.Component)
      );
      const UIState$1 = UIState;
      function withCheckboxContext(Checkbox2) {
        var _a;
        return _a = /** @class */
        function(_super) {
          __extends(WrappedComp, _super);
          function WrappedComp() {
            return _super !== null && _super.apply(this, arguments) || this;
          }
          WrappedComp.prototype.render = function() {
            return React__default__namespace.createElement(Checkbox2, __assign({}, this.props, { context: this.context }));
          };
          return WrappedComp;
        }(React__default__namespace.Component), _a.displayName = "Checkbox", _a.contextTypes = {
          onChange: propTypesExports.func,
          __group__: propTypesExports.bool,
          selectedValue: propTypesExports.array,
          disabled: propTypesExports.bool,
          prefix: propTypesExports.string
        }, _a;
      }
      var noop$d = func.noop;
      function isChecked(selectedValue, value) {
        return selectedValue.indexOf(value) > -1;
      }
      var Checkbox = (
        /** @class */
        function(_super) {
          __extends(Checkbox2, _super);
          function Checkbox2(props) {
            var _this = _super.call(this, props) || this;
            var context = props.context;
            var checked, indeterminate;
            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);
            }
            _this.state = {
              checked,
              indeterminate
            };
            _this.onChange = _this.onChange.bind(_this);
            return _this;
          }
          Checkbox2.getDerivedStateFromProps = function(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;
          };
          Object.defineProperty(Checkbox2.prototype, "disabled", {
            get: function() {
              var props = this.props;
              var context = props.context;
              return props.disabled || "disabled" in context && context.disabled;
            },
            enumerable: false,
            configurable: true
          });
          Checkbox2.prototype.shouldComponentUpdate = function(nextProps, nextState, nextContext) {
            var shallowEqual2 = obj.shallowEqual;
            return !shallowEqual2(this.props, nextProps) || !shallowEqual2(this.state, nextState) || !shallowEqual2(this.context, nextContext);
          };
          Checkbox2.prototype.onChange = function(event) {
            var _a, _b;
            var _c = this.props, context = _c.context, value = _c.value;
            var checked = event.target.checked;
            if (this.disabled) {
              return;
            }
            if (context.__group__) {
              context.onChange(value, event);
            } else {
              if (!("checked" in this.props)) {
                this.setState({
                  checked
                });
              }
              if (!("indeterminate" in this.props)) {
                this.setState({
                  indeterminate: false
                });
              }
              (_b = (_a = this.props).onChange) === null || _b === void 0 ? void 0 : _b.call(_a, checked, event);
            }
          };
          Checkbox2.prototype.render = function() {
            var _a, _b;
            var _c = this.props, id2 = _c.id, className = _c.className, children = _c.children, style = _c.style, label = _c.label, onMouseEnter = _c.onMouseEnter, onMouseLeave = _c.onMouseLeave, rtl = _c.rtl, isPreview = _c.isPreview, renderPreview = _c.renderPreview, context = _c.context, value = _c.value, name = _c.name, otherProps = __rest(_c, ["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__default__namespace.createElement("input", __assign({}, obj.pickOthers(Checkbox2.propTypes, otherProps), { id: id2, value, name, disabled, checked, type: "checkbox", onChange: this.onChange, "aria-checked": indeterminate ? "mixed" : checked, className: "".concat(prefix, "checkbox-input") }));
            if (!disabled) {
              childInput = this.getStateElement(childInput);
            }
            var cls = classnames(className, (_a = {}, _a["".concat(prefix, "checkbox-wrapper")] = true, _a.checked = checked, _a.disabled = disabled, _a.indeterminate = indeterminate, _a[this.getStateClassName()] = true, _a));
            var labelCls = "".concat(prefix, "checkbox-label");
            var type2 = indeterminate ? "semi-select" : "select";
            if (isPreview) {
              var previewCls = classnames(className, "".concat(prefix, "form-preview"));
              if ("renderPreview" in this.props) {
                return React__default__namespace.createElement("div", __assign({ id: id2, dir: rtl ? "rtl" : void 0 }, othersData, { className: previewCls }), renderPreview === null || renderPreview === void 0 ? void 0 : renderPreview(checked, this.props));
              }
              return React__default__namespace.createElement("p", __assign({ id: id2, dir: rtl ? "rtl" : void 0 }, othersData, { className: previewCls }), checked && (children || label || this.state.value));
            }
            var iconCls = classnames((_b = {
              zoomIn: indeterminate
            }, _b["".concat(prefix, "checkbox-semi-select-icon")] = indeterminate, _b["".concat(prefix, "checkbox-select-icon")] = !indeterminate, _b));
            return React__default__namespace.createElement(
              "label",
              __assign({}, othersData, { className: cls, style, dir: rtl ? "rtl" : void 0, onMouseEnter, onMouseLeave }),
              React__default__namespace.createElement(
                "span",
                { className: "".concat(prefix, "checkbox") },
                React__default__namespace.createElement(
                  "span",
                  { className: "".concat(prefix, "checkbox-inner") },
                  React__default__namespace.createElement(Icon, { type: type2, size: "xs", className: iconCls })
                ),
                childInput
              ),
              [label, children].map(function(item, i2) {
                return item !== void 0 && item !== null ? React__default__namespace.createElement("span", { key: i2, className: labelCls }, item) : null;
              })
            );
          };
          Checkbox2.displayName = "Checkbox";
          Checkbox2.propTypes = __assign(__assign({}, ConfigProvider$1.propTypes), { prefix: propTypesExports.string, rtl: propTypesExports.bool, className: propTypesExports.string, id: propTypesExports.string, style: propTypesExports.object, checked: propTypesExports.bool, defaultChecked: propTypesExports.bool, disabled: propTypesExports.bool, label: propTypesExports.node, indeterminate: propTypesExports.bool, defaultIndeterminate: propTypesExports.bool, onChange: propTypesExports.func, onMouseEnter: propTypesExports.func, onMouseLeave: propTypesExports.func, value: propTypesExports.oneOfType([propTypesExports.string, propTypesExports.number, propTypesExports.bool]), name: propTypesExports.string, isPreview: propTypesExports.bool, renderPreview: propTypesExports.func });
          Checkbox2.defaultProps = {
            defaultChecked: false,
            defaultIndeterminate: false,
            onChange: noop$d,
            onMouseEnter: noop$d,
            onMouseLeave: noop$d,
            prefix: "next-",
            isPreview: false
          };
          return Checkbox2;
        }(UIState$1)
      );
      const Checkbox$1 = ConfigProvider$1.config(withCheckboxContext(polyfill(Checkbox)));
      var pickOthers$5 = obj.pickOthers;
      var CheckboxGroup = (
        /** @class */
        function(_super) {
          __extends(CheckboxGroup2, _super);
          function CheckboxGroup2(props) {
            var _this = _super.call(this, props) || this;
            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];
              }
            }
            _this.state = {
              value: __spreadArray([], __read(value), false)
            };
            _this.onChange = _this.onChange.bind(_this);
            return _this;
          }
          CheckboxGroup2.prototype.getChildContext = function() {
            return {
              __group__: true,
              onChange: this.onChange,
              selectedValue: this.state.value,
              disabled: this.props.disabled
            };
          };
          CheckboxGroup2.getDerivedStateFromProps = function(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(currentValue, event) {
            var _a, _b;
            var value = this.state.value;
            var index2 = value.indexOf(currentValue);
            var valTemp = __spreadArray([], __read(value), false);
            if (index2 === -1) {
              valTemp.push(currentValue);
            } else {
              valTemp.splice(index2, 1);
            }
            if (!("value" in this.props)) {
              this.setState({ value: valTemp });
            }
            (_b = (_a = this.props).onChange) === null || _b === void 0 ? void 0 : _b.call(_a, valTemp, event);
          };
          CheckboxGroup2.prototype.render = function() {
            var _a;
            var _this = this;
            var _b;
            var _c = this.props, className = _c.className, style = _c.style, prefix = _c.prefix, disabled = _c.disabled, direction = _c.direction, rtl = _c.rtl, isPreview = _c.isPreview, renderPreview = _c.renderPreview;
            var others = pickOthers$5(CheckboxGroup2.propTypes, this.props);
            var children;
            var previewed = [];
            if (this.props.children) {
              children = React__default__namespace.Children.map(this.props.children, function(child) {
                var _a2, _b2, _c2, _d;
                if (!React__default__namespace.isValidElement(child)) {
                  return child;
                }
                var checked = _this.state.value && _this.state.value.indexOf((_a2 = child.props) === null || _a2 === void 0 ? void 0 : _a2.value) > -1;
                if (checked) {
                  previewed.push({
                    label: (_b2 = child.props) === null || _b2 === void 0 ? void 0 : _b2.children,
                    value: (_c2 = child.props) === null || _c2 === void 0 ? void 0 : _c2.value
                  });
                }
                return React__default__namespace.cloneElement(child, ((_d = child.props) === null || _d === void 0 ? void 0 : _d.rtl) === void 0 ? { rtl } : {});
              });
            } else {
              children = (_b = this.props.dataSource) === null || _b === void 0 ? void 0 : _b.map(function(item, index2) {
                var option;
                if (typeof item !== "object") {
                  option = {
                    label: item,
                    value: item,
                    disabled
                  };
                } else {
                  option = item;
                }
                var checked = _this.state.value && _this.state.value.indexOf(option.value) > -1;
                if (checked) {
                  previewed.push({
                    label: option.label,
                    value: option.value
                  });
                }
                return React__default__namespace.createElement(Checkbox$1, { key: index2, value: option.value, checked, rtl, disabled: disabled || option.disabled, label: option.label });
              });
            }
            if (isPreview) {
              var previewCls = classnames(className, "".concat(prefix, "form-preview"));
              if ("renderPreview" in this.props) {
                return React__default__namespace.createElement("div", __assign({}, others, { dir: rtl ? "rtl" : void 0, className: previewCls }), renderPreview === null || renderPreview === void 0 ? void 0 : renderPreview(previewed, this.props));
              }
              return React__default__namespace.createElement("p", __assign({}, others, { dir: rtl ? "rtl" : void 0, className: previewCls }), previewed.map(function(item) {
                return item.label;
              }).join(", "));
            }
            var cls = classnames(className, (_a = {}, _a["".concat(prefix, "checkbox-group")] = true, _a["".concat(prefix, "checkbox-group-").concat(direction)] = true, _a.disabled = disabled, _a));
            return React__default__namespace.createElement("span", __assign({ dir: rtl ? "rtl" : void 0 }, others, { className: cls, style }), children);
          };
          CheckboxGroup2.propTypes = {
            prefix: propTypesExports.string,
            rtl: propTypesExports.bool,
            className: propTypesExports.string,
            style: propTypesExports.object,
            disabled: propTypesExports.bool,
            dataSource: propTypesExports.oneOfType([
              propTypesExports.arrayOf(propTypesExports.string),
              propTypesExports.arrayOf(propTypesExports.object)
            ]),
            value: propTypesExports.oneOfType([
              propTypesExports.array,
              propTypesExports.string,
              propTypesExports.number,
              propTypesExports.bool
            ]),
            defaultValue: propTypesExports.oneOfType([
              propTypesExports.array,
              propTypesExports.string,
              propTypesExports.number,
              propTypesExports.bool
            ]),
            children: propTypesExports.arrayOf(propTypesExports.element),
            onChange: propTypesExports.func,
            direction: propTypesExports.oneOf(["hoz", "ver"]),
            isPreview: propTypesExports.bool,
            renderPreview: propTypesExports.func
          };
          CheckboxGroup2.defaultProps = {
            dataSource: [],
            onChange: function() {
            },
            prefix: "next-",
            direction: "hoz",
            isPreview: false
          };
          CheckboxGroup2.childContextTypes = {
            onChange: propTypesExports.func,
            __group__: propTypesExports.bool,
            selectedValue: propTypesExports.array,
            disabled: propTypesExports.bool
          };
          return CheckboxGroup2;
        }(React__default__namespace.Component)
      );
      const Group$6 = polyfill(CheckboxGroup);
      var CheckboxWithGroup = assignSubComponent(Checkbox$1, {
        Group: ConfigProvider$1.config(Group$6, {
          transform: (
            /* istanbul ignore next */
            function(props, deprecated2) {
              if ("itemDirection" in props) {
                deprecated2("itemDirection", "direction", "Checkbox");
                var itemDirection = props.itemDirection, others = __rest(props, ["itemDirection"]);
                props = __assign({ direction: itemDirection }, others);
              }
              return props;
            }
          )
        })
      });
      function withContext$1(Radio2) {
        var WrappedComp = (
          /** @class */
          function(_super) {
            __extends(WrappedComp2, _super);
            function WrappedComp2(props) {
              var _this = _super.call(this, props) || this;
              _this.radioRef = null;
              return _this;
            }
            WrappedComp2.prototype.focus = function() {
              if (this.radioRef) {
                this.radioRef.focus();
              }
            };
            WrappedComp2.prototype.render = function() {
              var _this = this;
              return React__default.createElement(Radio2, __assign({ ref: function(el) {
                _this.radioRef = el;
              } }, this.props, { context: this.context }));
            };
            WrappedComp2.displayName = "Radio";
            WrappedComp2.contextTypes = {
              onChange: PT.func,
              __group__: PT.bool,
              isButton: PT.bool,
              selectedValue: PT.oneOfType([
                PT.string,
                PT.number,
                PT.bool
              ]),
              disabled: PT.bool
            };
            return WrappedComp2;
          }(React__default.Component)
        );
        return WrappedComp;
      }
      var makeChain$2 = func.makeChain, noop$c = func.noop;
      var Radio = (
        /** @class */
        function(_super) {
          __extends(Radio2, _super);
          function Radio2(props) {
            var _this = _super.call(this, props) || this;
            var context = props.context;
            var checked;
            if (context.__group__) {
              checked = context.selectedValue === props.value;
            } else if ("checked" in props) {
              checked = props.checked;
            } else {
              checked = props.defaultChecked;
            }
            _this.state = { checked };
            _this.radioRef = null;
            _this.onChange = _this.onChange.bind(_this);
            return _this;
          }
          Radio2.getDerivedStateFromProps = function(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;
          };
          Object.defineProperty(Radio2.prototype, "disabled", {
            get: function() {
              var props = this.props;
              var context = props.context;
              var disabled = props.disabled || context.__group__ && "disabled" in context && context.disabled;
              return disabled;
            },
            enumerable: false,
            configurable: true
          });
          Radio2.prototype.shouldComponentUpdate = function(nextProps, nextState, nextContext) {
            var shallowEqual2 = obj.shallowEqual;
            return !shallowEqual2(this.props, nextProps) || !shallowEqual2(this.state, nextState) || !shallowEqual2(this.context, nextContext);
          };
          Radio2.prototype.componentDidUpdate = function() {
            if (this.disabled) {
              this.resetUIState();
            }
          };
          Radio2.prototype.onChange = function(e2) {
            var checked = e2.target.checked;
            var _a = this.props, context = _a.context, value = _a.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() {
            if (this.radioRef) {
              this.radioRef.focus();
              this._onUIFocus();
            }
          };
          Radio2.prototype.render = function() {
            var _a, _b, _c;
            var _this = this;
            var _d = this.props, id2 = _d.id, className = _d.className, children = _d.children, style = _d.style, label = _d.label, onMouseEnter = _d.onMouseEnter, onMouseLeave = _d.onMouseLeave, tabIndex = _d.tabIndex, rtl = _d.rtl, name = _d.name, isPreview = _d.isPreview, renderPreview = _d.renderPreview, value = _d.value, context = _d.context, otherProps = __rest(_d, ["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 = this.props.prefix;
            var others = obj.pickOthers(Radio2.propTypes, otherProps);
            var othersData = obj.pickAttrsWith(others, "data-");
            if (isPreview) {
              var previewCls = classnames(className, "".concat(prefix, "form-preview"));
              if ("renderPreview" in this.props) {
                return React__default.createElement("div", __assign({ id: id2, dir: rtl ? "rtl" : "ltr" }, others, { className: previewCls }), renderPreview(checked, this.props));
              }
              return React__default.createElement("p", __assign({ id: id2, dir: rtl ? "rtl" : "ltr" }, others, { className: previewCls }), checked && (children || label || value));
            }
            var input = React__default.createElement("input", __assign({}, obj.pickOthers(othersData, others), { name, id: id2, tabIndex, disabled, checked, type: "radio", onChange: this.onChange, "aria-checked": checked, className: "".concat(prefix, "radio-input"), ref: function(e2) {
              _this.radioRef = e2;
            } }));
            if (!disabled) {
              input = this.getStateElement(input);
            }
            var cls = classnames((_a = {}, _a["".concat(prefix, "radio")] = true, _a.checked = checked, _a.disabled = disabled, _a[this.getStateClassName()] = true, _a));
            var clsInner = classnames((_b = {}, _b["".concat(prefix, "radio-inner")] = true, _b.press = checked, _b.unpress = !checked, _b));
            var clsWrapper = classnames(className, (_c = {}, _c["".concat(prefix, "radio-wrapper")] = true, _c.checked = checked, _c.disabled = disabled, _c[this.getStateClassName()] = true, _c));
            var childrenCls = "".concat(prefix, "radio-label");
            var radioComp = !isButton ? React__default.createElement(
              "span",
              { className: cls },
              React__default.createElement("span", { className: clsInner }),
              input
            ) : React__default.createElement("span", { className: "".concat(prefix, "radio-single-input") }, input);
            return React__default.createElement(
              "label",
              __assign({}, othersData, { dir: rtl ? "rtl" : "ltr", style, "aria-checked": checked, "aria-disabled": disabled, className: clsWrapper, onMouseEnter: (
                // @ts-expect-error _onUIMouseEnter is not defined
                disabled ? onMouseEnter : makeChain$2(this._onUIMouseEnter, onMouseEnter)
              ), onMouseLeave: (
                // @ts-expect-error _onUIMouseLeave is not defined
                disabled ? onMouseLeave : makeChain$2(this._onUIMouseLeave, onMouseLeave)
              ) }),
              radioComp,
              [children, label].map(function(d2, i2) {
                return d2 !== void 0 ? React__default.createElement("span", { key: i2, className: childrenCls }, d2) : null;
              })
            );
          };
          Radio2.displayName = "Radio";
          Radio2.propTypes = __assign(__assign({}, ConfigProvider$1.propTypes), { className: PT.string, id: PT.string, style: PT.object, checked: PT.bool, defaultChecked: PT.bool, label: PT.node, onChange: PT.func, onMouseEnter: PT.func, onMouseLeave: PT.func, disabled: PT.bool, value: PT.oneOfType([PT.string, PT.number, PT.bool]), name: PT.string, isPreview: PT.bool, renderPreview: PT.func });
          Radio2.defaultProps = {
            onChange: noop$c,
            onMouseLeave: noop$c,
            onMouseEnter: noop$c,
            tabIndex: 0,
            prefix: "next-",
            isPreview: false
          };
          Radio2.contextTypes = {
            onChange: PT.func,
            __group__: PT.bool,
            isButton: PT.bool,
            selectedValue: PT.oneOfType([PT.string, PT.number, PT.bool]),
            disabled: PT.bool
          };
          return Radio2;
        }(UIState$1)
      );
      const Radio$1 = ConfigProvider$1.config(withContext$1(polyfill(Radio)));
      var makeChain$1 = func.makeChain;
      var focusRef = focus.focusRef;
      var pickOthers$4 = obj.pickOthers;
      var RadioGroup = (
        /** @class */
        function(_super) {
          __extends(RadioGroup2, _super);
          function RadioGroup2(props) {
            var _this = _super.call(this, props) || this;
            _this.saveRadioRef = function(el, index2) {
              if (el && typeof el.getInstance === "function") {
                var radio = el.getInstance();
                _this.radioRefs[index2] = radio;
              }
            };
            var value = "";
            if ("value" in props) {
              value = props.value;
            } else if ("defaultValue" in props) {
              value = props.defaultValue;
            }
            _this.radioRefs = [];
            _this.hasFocus = false;
            _this.state = { value };
            _this.onChange = _this.onChange.bind(_this);
            return _this;
          }
          RadioGroup2.getDerivedStateFromProps = function(props, state) {
            if ("value" in props && props.value !== state.value) {
              return {
                value: props.value
              };
            }
            return null;
          };
          RadioGroup2.prototype.getChildContext = function() {
            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(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() {
            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() {
            var _a;
            var _this = this;
            var _b = this.props, rtl = _b.rtl, className = _b.className, disabled = _b.disabled, shape = _b.shape, size2 = _b.size, style = _b.style, prefix = _b.prefix, direction = _b.direction, component = _b.component, isPreview = _b.isPreview, renderPreview = _b.renderPreview;
            var others = pickOthers$4(RadioGroup2.propTypes, this.props);
            if (rtl) {
              others.dir = "rtl";
            }
            var children;
            var previewed = {};
            this.radioRefs = [];
            if (this.props.children) {
              children = React__default.Children.map(this.props.children, function(child, index2) {
                if (!React__default.isValidElement(child)) {
                  return child;
                }
                var checked = _this.state.value === child.props.value;
                if (checked) {
                  previewed.label = child.props.children;
                  previewed.value = child.props.value;
                }
                var tabIndex = index2 === 0 && !_this.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__default.cloneElement(child, {
                    checked,
                    tabIndex,
                    rtl: childrtl,
                    ref: function(e2) {
                      _this.saveRadioRef(e2, index2);
                    }
                  });
                }
                return React__default.cloneElement(child, {
                  checked,
                  rtl: childrtl,
                  ref: function(e2) {
                    _this.saveRadioRef(e2, index2);
                  }
                });
              });
            } else {
              children = this.props.dataSource.map(function(item, index2) {
                var option;
                if (typeof item !== "object") {
                  option = {
                    label: item,
                    value: item,
                    disabled
                  };
                } else {
                  option = item;
                }
                var checked = _this.state.value === option.value;
                if (checked) {
                  previewed.label = option.label;
                  previewed.value = option.value;
                }
                return React__default.createElement(Radio$1, { key: index2, tabIndex: index2 === 0 && !_this.state.value || checked ? 0 : -1, value: option.value, checked, label: option.label, disabled: disabled || option.disabled, ref: function(e2) {
                  _this.saveRadioRef(e2, index2);
                } });
              });
            }
            if (isPreview) {
              var previewCls = classnames(className, "".concat(prefix, "form-preview"));
              if ("renderPreview" in this.props) {
                return React__default.createElement("div", __assign({}, others, { className: previewCls }), renderPreview(previewed, this.props));
              }
              return React__default.createElement("p", __assign({}, others, { className: previewCls }), previewed.label);
            }
            var isButtonShape = shape === "button";
            var cls = classnames(className, (_a = {}, _a["".concat(prefix, "radio-group")] = true, _a["".concat(prefix, "radio-group-").concat(direction)] = !isButtonShape, _a["".concat(prefix, "radio-button")] = isButtonShape, _a["".concat(prefix, "radio-button-").concat(size2)] = isButtonShape, _a.disabled = disabled, _a));
            var TagName = component;
            return React__default.createElement(TagName, __assign({}, 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);
          };
          RadioGroup2.propTypes = __assign(__assign({}, ConfigProvider$1.propTypes), { prefix: PT.string, className: PT.string, style: PT.object, name: PT.string, value: PT.oneOfType([PT.string, PT.number, PT.bool]), defaultValue: PT.oneOfType([PT.string, PT.number, PT.bool]), component: PT.oneOfType([PT.string, PT.func]), onChange: PT.func, disabled: PT.bool, shape: PT.oneOf(["normal", "button"]), size: PT.oneOf(["large", "medium", "small"]), dataSource: PT.oneOfType([
            PT.arrayOf(PT.string),
            PT.arrayOf(PT.object)
          ]), children: PT.oneOfType([PT.arrayOf(PT.element), PT.element]), direction: PT.oneOf(["hoz", "ver"]), isPreview: PT.bool, renderPreview: PT.func });
          RadioGroup2.defaultProps = {
            dataSource: [],
            size: "medium",
            onChange: function() {
            },
            prefix: "next-",
            component: "div",
            direction: "hoz",
            isPreview: false
          };
          RadioGroup2.childContextTypes = {
            onChange: PT.func,
            __group__: PT.bool,
            isButton: PT.bool,
            selectedValue: PT.oneOfType([PT.string, PT.number, PT.bool]),
            disabled: PT.bool
          };
          return RadioGroup2;
        }(React__default.Component)
      );
      const RadioGroup$1 = polyfill(RadioGroup);
      var RadioWithSub = assignSubComponent(Radio$1, {
        Group: ConfigProvider$1.config(RadioGroup$1, {
          transform: function(props, deprecated2) {
            if ("itemDirection" in props) {
              deprecated2("itemDirection", "direction", "Radio");
              var itemDirection = props.itemDirection, others = __rest(props, ["itemDirection"]);
              props = __assign({ direction: itemDirection }, others);
            }
            return props;
          }
        })
      });
      var _class$K, _temp$s;
      var noop$b = {};
      var bindCtx$3 = func.bindCtx;
      var pickOthers$3 = obj.pickOthers;
      var CheckableItem = (_temp$s = _class$K = function(_Component) {
        _default(CheckableItem2, _Component);
        function CheckableItem2(props) {
          _default$3(this, CheckableItem2);
          var _this = _default$1(this, _Component.call(this, props));
          bindCtx$3(_this, ["stopPropagation", "handleKeyDown", "handleClick"]);
          _this.id = htmlId.escapeForId("checkable-item-" + (props.id || props._key));
          return _this;
        }
        CheckableItem2.prototype.stopPropagation = function stopPropagation(e2) {
          e2.stopPropagation();
        };
        CheckableItem2.prototype.handleCheck = function handleCheck(e2) {
          var _props = this.props, checkType = _props.checkType, checked = _props.checked, onChange = _props.onChange;
          if (!(checkType === "radio" && checked)) {
            onChange(!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, onChange = _props2.onChange;
          var labelToggleChecked = root.props.labelToggleChecked;
          var Check = checkType === "radio" ? RadioWithSub : CheckboxWithGroup;
          var checkProps = {
            tabIndex: "-1",
            checked,
            disabled: disabled || checkDisabled
          };
          if (checkType === "checkbox") {
            checkProps.indeterminate = indeterminate;
          }
          if (!labelToggleChecked) {
            checkProps.onChange = onChange;
            checkProps.onClick = this.stopPropagation;
          }
          return React__default.createElement(Check, _default$5({ "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, onClick = _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$5({
            _key,
            root,
            disabled,
            type: "item",
            onClick,
            onKeyDown: this.handleKeyDown
          }, others);
          if (labelToggleChecked && !disabled) {
            newProps.onClick = this.handleClick;
          }
          var title = void 0;
          if (typeof children === "string") {
            title = children;
          }
          return React__default.createElement(
            Item$2,
            _default$5({ "aria-checked": checked, title }, newProps),
            this.renderCheck(),
            React__default.createElement(
              "span",
              { className: prefix + "menu-item-text", id: this.id },
              children
            ),
            helper ? React__default.createElement(
              "div",
              { className: prefix + "menu-item-helper" },
              helper
            ) : null
          );
        };
        return CheckableItem2;
      }(React__default.Component), _class$K.propTypes = {
        _key: PT.string,
        root: PT.object,
        disabled: PT.bool,
        inlineIndent: PT.number,
        checked: PT.bool,
        indeterminate: PT.bool,
        onChange: PT.func,
        checkType: PT.oneOf(["checkbox", "radio"]),
        checkDisabled: PT.bool,
        helper: PT.node,
        children: PT.node,
        onKeyDown: PT.func,
        onClick: PT.func,
        id: PT.string
      }, _class$K.defaultProps = {
        disabled: false,
        checked: false,
        indeterminate: false,
        checkType: "checkbox",
        checkDisabled: false,
        onChange: noop$b
      }, _temp$s);
      CheckableItem.displayName = "CheckableItem";
      var _class$J, _temp$r;
      var CheckboxItem = (_temp$r = _class$J = function(_Component) {
        _default(CheckboxItem2, _Component);
        function CheckboxItem2() {
          _default$3(this, CheckboxItem2);
          return _default$1(this, _Component.apply(this, arguments));
        }
        CheckboxItem2.prototype.render = function render2() {
          var _props = this.props, checkboxDisabled = _props.checkboxDisabled, others = _default$4(_props, ["checkboxDisabled"]);
          return React__default.createElement(CheckableItem, _default$5({ role: "menuitemcheckbox", checkType: "checkbox", checkDisabled: checkboxDisabled }, others));
        };
        return CheckboxItem2;
      }(React__default.Component), _class$J.menuChildType = "item", _class$J.propTypes = {
        /**
         * 是否选中
         */
        checked: PT.bool,
        /**
         * 是否半选中
         */
        indeterminate: PT.bool,
        /**
         * 是否禁用
         */
        disabled: PT.bool,
        /**
         * 选中或取消选中触发的回调函数
         * @param {Boolean} checked 是否选中
         * @param {Object} event 选中事件对象
         */
        onChange: PT.func,
        /**
         * 帮助文本
         */
        helper: PT.node,
        /**
         * 标签内容
         */
        children: PT.node,
        checkboxDisabled: PT.bool
      }, _class$J.defaultProps = {
        checked: false,
        indeterminate: false,
        disabled: false,
        onChange: function onChange() {
        },
        checkboxDisabled: false
      }, _temp$r);
      CheckboxItem.displayName = "CheckboxItem";
      var _class$I, _temp$q;
      var RadioItem = (_temp$q = _class$I = function(_Component) {
        _default(RadioItem2, _Component);
        function RadioItem2() {
          _default$3(this, RadioItem2);
          return _default$1(this, _Component.apply(this, arguments));
        }
        RadioItem2.prototype.render = function render2() {
          return React__default.createElement(CheckableItem, _default$5({ role: "menuitemradio", checkType: "radio" }, this.props));
        };
        return RadioItem2;
      }(React__default.Component), _class$I.menuChildType = "item", _class$I.propTypes = {
        /**
         * 是否选中
         */
        checked: PT.bool,
        /**
         * 是否禁用
         */
        disabled: PT.bool,
        /**
         * 选中或取消选中触发的回调函数
         * @param {Boolean} checked 是否选中
         * @param {Object} event 选中事件对象
         */
        onChange: PT.func,
        /**
         * 帮助文本
         */
        helper: PT.node,
        /**
         * 标签内容
         */
        children: PT.node
      }, _class$I.defaultProps = {
        checked: false,
        disabled: false,
        onChange: function onChange() {
        }
      }, _temp$q);
      RadioItem.displayName = "RadioItem";
      var _class$H, _temp$p;
      var Group$5 = (_temp$p = _class$H = function(_Component) {
        _default(Group2, _Component);
        function Group2() {
          _default$3(this, Group2);
          return _default$1(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$4(_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$2(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__default.cloneElement(child, {
              parentMode,
              className: newChildClassName
            });
          });
          return [React__default.createElement(
            Item$2,
            _default$5({
              key: "menu-group-label",
              className: newClassName,
              replaceClassName: true,
              root,
              parentMode
            }, others),
            label
          )].concat(newChildren);
        };
        return Group2;
      }(React__default.Component), _class$H.menuChildType = "group", _class$H.propTypes = {
        root: PT.object,
        className: PT.string,
        /**
         * 标签内容
         */
        label: PT.node,
        /**
         * 菜单项
         */
        children: PT.node,
        parentMode: PT.oneOf(["inline", "popup"])
      }, _temp$p);
      Group$5.displayName = "Group";
      var _class$G, _temp$o;
      var Divider = (_temp$o = _class$G = function(_Component) {
        _default(Divider2, _Component);
        function Divider2() {
          _default$3(this, Divider2);
          return _default$1(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$4(_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__default.createElement("li", _default$5({ role: "separator", className: newClassName }, others));
        };
        return Divider2;
      }(React__default.Component), _class$G.menuChildType = "divider", _class$G.propTypes = {
        root: PT.object,
        className: PT.string
      }, _temp$o);
      Divider.displayName = "Divider";
      var _class$F, _temp$n;
      var bindCtx$2 = func.bindCtx;
      var getContextProps = ConfigProvider$1.getContextProps;
      var Menu$2 = ConfigProvider$1.config(Menu$4);
      var menuInstance = void 0;
      var ContextMenu = (_temp$n = _class$F = function(_Component) {
        _default(ContextMenu2, _Component);
        function ContextMenu2(props) {
          _default$3(this, ContextMenu2);
          var _this = _default$1(this, _Component.call(this, props));
          _this.state = {
            visible: true
          };
          bindCtx$2(_this, ["handleOverlayClose", "handleOverlayOpen", "handleItemClick", "getOverlay"]);
          return _this;
        }
        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, offset2 = _props2.offset, afterClose = _props2.afterClose, _props2$overlayProps = _props2.overlayProps, overlayProps = _props2$overlayProps === void 0 ? {} : _props2$overlayProps, others = _default$4(_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$5({}, contextProps, overlayProps, {
            target,
            align,
            offset: offset2,
            afterClose,
            visible,
            onRequestClose: this.handleOverlayClose,
            onOpen: this.handleOverlayOpen,
            ref: this.getOverlay
          });
          var menuProps = _default$5({}, 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__default.createElement(
            Overlay$1,
            newOverlayProps,
            React__default.createElement(Menu$2, menuProps)
          );
        };
        return ContextMenu2;
      }(React__default.Component), _class$F.propTypes = {
        className: PT.string,
        popupClassName: PT.string,
        target: PT.any,
        align: PT.string,
        offset: PT.array,
        overlayProps: PT.object,
        afterClose: PT.func,
        mode: PT.oneOf(["inline", "popup"]),
        onOpen: PT.func,
        onItemClick: PT.func
      }, _class$F.defaultProps = {
        prefix: "next-",
        align: "tl tl",
        mode: "popup"
      }, _temp$n);
      ContextMenu.displayName = "ContextMenu";
      function create$1(props) {
        if (menuInstance) {
          menuInstance.destroy();
        }
        var afterClose = props.afterClose, others = _default$4(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__default.createElement(
          ConfigProvider$1,
          newContext,
          React__default.createElement(ContextMenu, _default$5({
            ref: function ref(_ref) {
              menu = _ref;
            },
            afterClose: closeChain
          }, others))
        ), div);
        menuInstance = {
          destroy: function destroy() {
            if (menu) {
              menu.close();
            }
          }
        };
        return menuInstance;
      }
      Menu$4.SubMenu = SubMenu;
      Menu$4.Item = SelectableItem;
      Menu$4.CheckboxItem = CheckboxItem;
      Menu$4.RadioItem = RadioItem;
      Menu$4.PopupItem = PopupItem;
      Menu$4.Group = Group$5;
      Menu$4.Divider = Divider;
      Menu$4.create = create$1;
      var transform = function transform2(props, deprecated2) {
        if ("indentSize" in props) {
          deprecated2("indentSize", "inlineIndent", "Menu");
          var _props = props, indentSize = _props.indentSize, others = _default$4(_props, ["indentSize"]);
          props = _default$5({ 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$4(_props2, ["onDeselect", "onSelect"]);
            var newOnSelect = function newOnSelect2(selectedKeys, item, extra) {
              if (!extra.select) {
                onDeselect(extra.key);
              }
              if (onSelect) {
                onSelect(selectedKeys, item, extra);
              }
            };
            props = _default$5({ onSelect: newOnSelect }, _others);
          }
        }
        return props;
      };
      const Menu$1 = ConfigProvider$1.config(Menu$4, {
        transform
      });
      function mapIconSize(size2) {
        return {
          large: "small",
          medium: "xs",
          small: "xs"
        }[size2];
      }
      var Button$2 = (
        /** @class */
        function(_super) {
          __extends(Button2, _super);
          function Button2() {
            var _this = _super.apply(this, __spreadArray([], __read(arguments), false)) || this;
            _this.onMouseUp = function(e2) {
              _this.button.blur();
              if (_this.props.onMouseUp) {
                _this.props.onMouseUp(e2);
              }
            };
            _this.buttonRefHandler = function(button) {
              _this.button = button;
            };
            return _this;
          }
          Button2.prototype.render = function() {
            var _a, _b;
            var _c = this.props, prefix = _c.prefix, className = _c.className, type2 = _c.type, size2 = _c.size, htmlType = _c.htmlType, loading = _c.loading, text = _c.text, warning2 = _c.warning, ghost = _c.ghost, component = _c.component, iconSize = _c.iconSize, icons = _c.icons, disabled = _c.disabled, onClick = _c.onClick, children = _c.children, rtl = _c.rtl, others = __rest(_c, ["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 = (_a = {}, _a["".concat(prefix, "btn")] = true, _a["".concat(prefix).concat(size2)] = size2, _a["".concat(prefix, "btn-").concat(type2)] = type2 && !ghost, _a["".concat(prefix, "btn-text")] = text, _a["".concat(prefix, "btn-warning")] = warning2, _a["".concat(prefix, "btn-loading")] = loading, _a["".concat(prefix, "btn-ghost")] = ghost, _a["".concat(prefix, "btn-").concat(ghostType)] = ghost, _a[className] = className, _a);
            var loadingIcon = null;
            if (icons && icons.loading && React__default.isValidElement(icons.loading)) {
              if (loading) {
                delete btnClsObj["".concat(prefix, "btn-loading")];
                btnClsObj["".concat(prefix, "btn-custom-loading")] = true;
              }
              var loadingSize = iconSize || mapIconSize(size2);
              loadingIcon = React__default.cloneElement(icons.loading, {
                className: classnames((_b = {}, _b["".concat(prefix, "btn-custom-loading-icon")] = true, _b.show = loading, _b)),
                size: loadingSize
              });
            }
            var count = React__default.Children.count(children);
            var clonedChildren = React__default.Children.map(children, function(child, index2) {
              var _a2;
              if (child && ["function", "object"].indexOf(typeof child.type) > -1 && child.type._typeMark === "icon") {
                var iconCls = classnames((_a2 = {}, _a2["".concat(prefix, "btn-icon")] = !iconSize, _a2["".concat(prefix, "btn-icon-size")] = iconSize, _a2["".concat(prefix, "icon-first")] = count > 1 && index2 === 0, _a2["".concat(prefix, "icon-last")] = count > 1 && index2 === count - 1, _a2["".concat(prefix, "icon-alone")] = count === 1, _a2[child.props.className] = !!child.props.className, _a2));
                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="'.concat(child.props.size, '" /></Button>), use <Button iconSize="').concat(child.props.size, '"> or <Button><div><Icon size="').concat(child.props.size, '" /></div></Button> instead of.'));
                }
                return React__default.cloneElement(child, {
                  className: iconCls,
                  size: iconSize || mapIconSize(size2)
                });
              }
              if (!React__default.isValidElement(child)) {
                return React__default.createElement("span", { className: "".concat(prefix, "btn-helper") }, child);
              }
              return child;
            });
            var TagName = component;
            var tagAttrs = __assign(__assign({}, obj.pickOthers(Object.keys(Button2.propTypes), others)), { type: htmlType, disabled, onClick, className: classnames(btnClsObj) });
            if (TagName !== "button") {
              delete tagAttrs.type;
              if (tagAttrs.disabled) {
                delete tagAttrs.onClick;
                if ("href" in tagAttrs && tagAttrs.href) {
                  delete tagAttrs.href;
                }
              }
            }
            return React__default.createElement(
              TagName,
              __assign({}, tagAttrs, { dir: rtl ? "rtl" : void 0, onMouseUp: this.onMouseUp, ref: this.buttonRefHandler }),
              loadingIcon,
              clonedChildren
            );
          };
          Button2.propTypes = __assign(__assign({}, ConfigProvider$1.propTypes), { prefix: PT.string, rtl: PT.bool, type: PT.oneOf(["primary", "secondary", "normal"]), size: PT.oneOf(["small", "medium", "large"]), icons: PT.shape({ loading: PT.node }), iconSize: PT.oneOfType([
            PT.oneOf([
              "xxs",
              "xs",
              "small",
              "medium",
              "large",
              "xl",
              "xxl",
              "xxxl",
              "inherit"
            ]),
            PT.number
          ]), htmlType: PT.oneOf(["submit", "reset", "button"]), component: PT.oneOf(["button", "a", "div", "span"]), loading: PT.bool, ghost: PT.oneOf([true, false, "light", "dark"]), text: PT.bool, warning: PT.bool, disabled: PT.bool, onClick: PT.func, className: PT.string, onMouseUp: PT.func, children: PT.node });
          Button2.defaultProps = {
            prefix: "next-",
            type: "normal",
            size: "medium",
            icons: {},
            htmlType: "button",
            component: "button",
            loading: false,
            ghost: false,
            text: false,
            warning: false,
            disabled: false,
            onClick: function() {
            }
          };
          return Button2;
        }(React__default.Component)
      );
      var ButtonGroup = (
        /** @class */
        function(_super) {
          __extends(ButtonGroup2, _super);
          function ButtonGroup2() {
            return _super !== null && _super.apply(this, arguments) || this;
          }
          ButtonGroup2.prototype.render = function() {
            var _a;
            var _b = this.props, prefix = _b.prefix, className = _b.className, size2 = _b.size, children = _b.children, rtl = _b.rtl, others = __rest(_b, ["prefix", "className", "size", "children", "rtl"]);
            var groupCls = classnames((_a = {}, _a["".concat(prefix, "btn-group")] = true, _a[className] = className, _a));
            var cloneChildren = React__default.Children.map(children, function(child) {
              if (child) {
                return React__default.cloneElement(child, {
                  size: size2
                });
              }
            });
            if (rtl) {
              others.dir = "rtl";
            }
            return React__default.createElement("div", __assign({}, others, { className: groupCls }), cloneChildren);
          };
          ButtonGroup2.propTypes = __assign(__assign({}, ConfigProvider$1.propTypes), { rtl: PT.bool, prefix: PT.string, size: PT.string, className: PT.string, children: PT.node });
          ButtonGroup2.defaultProps = {
            prefix: "next-",
            size: "medium"
          };
          return ButtonGroup2;
        }(React__default.Component)
      );
      const Group$4 = ConfigProvider$1.config(ButtonGroup);
      var WithSubButton = assignSubComponent(Button$2, { Group: Group$4 });
      const Button$1 = ConfigProvider$1.config(WithSubButton, {
        transform: (
          /* istanbul ignore next */
          function(props, deprecated2) {
            if ("shape" in props) {
              deprecated2("shape", "text | warning | ghost", "Button");
              var shape = props.shape, type2 = props.type, others = __rest(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$2.defaultProps.type];
              }
              var text = shape === "text";
              var warning2 = shape === "warning";
              return __assign({ type: newType, ghost, text, warning: warning2 }, others);
            }
            return props;
          }
        )
      });
      //! moment.js
      //! version : 2.30.1
      //! authors : Tim Wood, Iskren Chernev, Moment.js contributors
      //! license : MIT
      //! momentjs.com
      var hookCallback;
      function hooks() {
        return hookCallback.apply(null, arguments);
      }
      function setHookCallback(callback) {
        hookCallback = callback;
      }
      function isArray(input) {
        return input instanceof Array || Object.prototype.toString.call(input) === "[object Array]";
      }
      function isObject$1(input) {
        return input != null && Object.prototype.toString.call(input) === "[object Object]";
      }
      function hasOwnProp(a, b2) {
        return Object.prototype.hasOwnProperty.call(a, b2);
      }
      function isObjectEmpty(obj2) {
        if (Object.getOwnPropertyNames) {
          return Object.getOwnPropertyNames(obj2).length === 0;
        } else {
          var k2;
          for (k2 in obj2) {
            if (hasOwnProp(obj2, k2)) {
              return false;
            }
          }
          return true;
        }
      }
      function isUndefined(input) {
        return input === void 0;
      }
      function isNumber(input) {
        return typeof input === "number" || Object.prototype.toString.call(input) === "[object Number]";
      }
      function isDate(input) {
        return input instanceof Date || Object.prototype.toString.call(input) === "[object Date]";
      }
      function map(arr, fn) {
        var res = [], i2, arrLen = arr.length;
        for (i2 = 0; i2 < arrLen; ++i2) {
          res.push(fn(arr[i2], i2));
        }
        return res;
      }
      function extend(a, b2) {
        for (var i2 in b2) {
          if (hasOwnProp(b2, i2)) {
            a[i2] = b2[i2];
          }
        }
        if (hasOwnProp(b2, "toString")) {
          a.toString = b2.toString;
        }
        if (hasOwnProp(b2, "valueOf")) {
          a.valueOf = b2.valueOf;
        }
        return a;
      }
      function createUTC(input, format2, locale2, strict) {
        return createLocalOrUTC(input, format2, locale2, strict, true).utc();
      }
      function defaultParsingFlags() {
        return {
          empty: false,
          unusedTokens: [],
          unusedInput: [],
          overflow: -2,
          charsLeftOver: 0,
          nullInput: false,
          invalidEra: null,
          invalidMonth: null,
          invalidFormat: false,
          userInvalidated: false,
          iso: false,
          parsedDateParts: [],
          era: null,
          meridiem: null,
          rfc2822: false,
          weekdayMismatch: false
        };
      }
      function getParsingFlags(m2) {
        if (m2._pf == null) {
          m2._pf = defaultParsingFlags();
        }
        return m2._pf;
      }
      var some;
      if (Array.prototype.some) {
        some = Array.prototype.some;
      } else {
        some = function(fun) {
          var t2 = Object(this), len = t2.length >>> 0, i2;
          for (i2 = 0; i2 < len; i2++) {
            if (i2 in t2 && fun.call(this, t2[i2], i2, t2)) {
              return true;
            }
          }
          return false;
        };
      }
      function isValid(m2) {
        var flags = null, parsedParts = false, isNowValid = m2._d && !isNaN(m2._d.getTime());
        if (isNowValid) {
          flags = getParsingFlags(m2);
          parsedParts = some.call(flags.parsedDateParts, function(i2) {
            return i2 != null;
          });
          isNowValid = flags.overflow < 0 && !flags.empty && !flags.invalidEra && !flags.invalidMonth && !flags.invalidWeekday && !flags.weekdayMismatch && !flags.nullInput && !flags.invalidFormat && !flags.userInvalidated && (!flags.meridiem || flags.meridiem && parsedParts);
          if (m2._strict) {
            isNowValid = isNowValid && flags.charsLeftOver === 0 && flags.unusedTokens.length === 0 && flags.bigHour === void 0;
          }
        }
        if (Object.isFrozen == null || !Object.isFrozen(m2)) {
          m2._isValid = isNowValid;
        } else {
          return isNowValid;
        }
        return m2._isValid;
      }
      function createInvalid(flags) {
        var m2 = createUTC(NaN);
        if (flags != null) {
          extend(getParsingFlags(m2), flags);
        } else {
          getParsingFlags(m2).userInvalidated = true;
        }
        return m2;
      }
      var momentProperties = hooks.momentProperties = [], updateInProgress = false;
      function copyConfig(to2, from2) {
        var i2, prop, val, momentPropertiesLen = momentProperties.length;
        if (!isUndefined(from2._isAMomentObject)) {
          to2._isAMomentObject = from2._isAMomentObject;
        }
        if (!isUndefined(from2._i)) {
          to2._i = from2._i;
        }
        if (!isUndefined(from2._f)) {
          to2._f = from2._f;
        }
        if (!isUndefined(from2._l)) {
          to2._l = from2._l;
        }
        if (!isUndefined(from2._strict)) {
          to2._strict = from2._strict;
        }
        if (!isUndefined(from2._tzm)) {
          to2._tzm = from2._tzm;
        }
        if (!isUndefined(from2._isUTC)) {
          to2._isUTC = from2._isUTC;
        }
        if (!isUndefined(from2._offset)) {
          to2._offset = from2._offset;
        }
        if (!isUndefined(from2._pf)) {
          to2._pf = getParsingFlags(from2);
        }
        if (!isUndefined(from2._locale)) {
          to2._locale = from2._locale;
        }
        if (momentPropertiesLen > 0) {
          for (i2 = 0; i2 < momentPropertiesLen; i2++) {
            prop = momentProperties[i2];
            val = from2[prop];
            if (!isUndefined(val)) {
              to2[prop] = val;
            }
          }
        }
        return to2;
      }
      function Moment(config2) {
        copyConfig(this, config2);
        this._d = new Date(config2._d != null ? config2._d.getTime() : NaN);
        if (!this.isValid()) {
          this._d = /* @__PURE__ */ new Date(NaN);
        }
        if (updateInProgress === false) {
          updateInProgress = true;
          hooks.updateOffset(this);
          updateInProgress = false;
        }
      }
      function isMoment(obj2) {
        return obj2 instanceof Moment || obj2 != null && obj2._isAMomentObject != null;
      }
      function warn$1(msg) {
        if (hooks.suppressDeprecationWarnings === false && typeof console !== "undefined" && console.warn) {
          console.warn("Deprecation warning: " + msg);
        }
      }
      function deprecate(msg, fn) {
        var firstTime = true;
        return extend(function() {
          if (hooks.deprecationHandler != null) {
            hooks.deprecationHandler(null, msg);
          }
          if (firstTime) {
            var args = [], arg, i2, key, argLen = arguments.length;
            for (i2 = 0; i2 < argLen; i2++) {
              arg = "";
              if (typeof arguments[i2] === "object") {
                arg += "\n[" + i2 + "] ";
                for (key in arguments[0]) {
                  if (hasOwnProp(arguments[0], key)) {
                    arg += key + ": " + arguments[0][key] + ", ";
                  }
                }
                arg = arg.slice(0, -2);
              } else {
                arg = arguments[i2];
              }
              args.push(arg);
            }
            warn$1(
              msg + "\nArguments: " + Array.prototype.slice.call(args).join("") + "\n" + new Error().stack
            );
            firstTime = false;
          }
          return fn.apply(this, arguments);
        }, fn);
      }
      var deprecations = {};
      function deprecateSimple(name, msg) {
        if (hooks.deprecationHandler != null) {
          hooks.deprecationHandler(name, msg);
        }
        if (!deprecations[name]) {
          warn$1(msg);
          deprecations[name] = true;
        }
      }
      hooks.suppressDeprecationWarnings = false;
      hooks.deprecationHandler = null;
      function isFunction(input) {
        return typeof Function !== "undefined" && input instanceof Function || Object.prototype.toString.call(input) === "[object Function]";
      }
      function set(config2) {
        var prop, i2;
        for (i2 in config2) {
          if (hasOwnProp(config2, i2)) {
            prop = config2[i2];
            if (isFunction(prop)) {
              this[i2] = prop;
            } else {
              this["_" + i2] = prop;
            }
          }
        }
        this._config = config2;
        this._dayOfMonthOrdinalParseLenient = new RegExp(
          (this._dayOfMonthOrdinalParse.source || this._ordinalParse.source) + "|" + /\d{1,2}/.source
        );
      }
      function mergeConfigs(parentConfig, childConfig) {
        var res = extend({}, parentConfig), prop;
        for (prop in childConfig) {
          if (hasOwnProp(childConfig, prop)) {
            if (isObject$1(parentConfig[prop]) && isObject$1(childConfig[prop])) {
              res[prop] = {};
              extend(res[prop], parentConfig[prop]);
              extend(res[prop], childConfig[prop]);
            } else if (childConfig[prop] != null) {
              res[prop] = childConfig[prop];
            } else {
              delete res[prop];
            }
          }
        }
        for (prop in parentConfig) {
          if (hasOwnProp(parentConfig, prop) && !hasOwnProp(childConfig, prop) && isObject$1(parentConfig[prop])) {
            res[prop] = extend({}, res[prop]);
          }
        }
        return res;
      }
      function Locale(config2) {
        if (config2 != null) {
          this.set(config2);
        }
      }
      var keys$1;
      if (Object.keys) {
        keys$1 = Object.keys;
      } else {
        keys$1 = function(obj2) {
          var i2, res = [];
          for (i2 in obj2) {
            if (hasOwnProp(obj2, i2)) {
              res.push(i2);
            }
          }
          return res;
        };
      }
      var defaultCalendar = {
        sameDay: "[Today at] LT",
        nextDay: "[Tomorrow at] LT",
        nextWeek: "dddd [at] LT",
        lastDay: "[Yesterday at] LT",
        lastWeek: "[Last] dddd [at] LT",
        sameElse: "L"
      };
      function calendar(key, mom, now2) {
        var output = this._calendar[key] || this._calendar["sameElse"];
        return isFunction(output) ? output.call(mom, now2) : output;
      }
      function zeroFill(number, targetLength, forceSign) {
        var absNumber = "" + Math.abs(number), zerosToFill = targetLength - absNumber.length, sign2 = number >= 0;
        return (sign2 ? forceSign ? "+" : "" : "-") + Math.pow(10, Math.max(0, zerosToFill)).toString().substr(1) + absNumber;
      }
      var formattingTokens = /(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g, localFormattingTokens = /(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g, formatFunctions = {}, formatTokenFunctions = {};
      function addFormatToken(token2, padded, ordinal2, callback) {
        var func2 = callback;
        if (typeof callback === "string") {
          func2 = function() {
            return this[callback]();
          };
        }
        if (token2) {
          formatTokenFunctions[token2] = func2;
        }
        if (padded) {
          formatTokenFunctions[padded[0]] = function() {
            return zeroFill(func2.apply(this, arguments), padded[1], padded[2]);
          };
        }
        if (ordinal2) {
          formatTokenFunctions[ordinal2] = function() {
            return this.localeData().ordinal(
              func2.apply(this, arguments),
              token2
            );
          };
        }
      }
      function removeFormattingTokens(input) {
        if (input.match(/\[[\s\S]/)) {
          return input.replace(/^\[|\]$/g, "");
        }
        return input.replace(/\\/g, "");
      }
      function makeFormatFunction(format2) {
        var array = format2.match(formattingTokens), i2, length2;
        for (i2 = 0, length2 = array.length; i2 < length2; i2++) {
          if (formatTokenFunctions[array[i2]]) {
            array[i2] = formatTokenFunctions[array[i2]];
          } else {
            array[i2] = removeFormattingTokens(array[i2]);
          }
        }
        return function(mom) {
          var output = "", i3;
          for (i3 = 0; i3 < length2; i3++) {
            output += isFunction(array[i3]) ? array[i3].call(mom, format2) : array[i3];
          }
          return output;
        };
      }
      function formatMoment(m2, format2) {
        if (!m2.isValid()) {
          return m2.localeData().invalidDate();
        }
        format2 = expandFormat(format2, m2.localeData());
        formatFunctions[format2] = formatFunctions[format2] || makeFormatFunction(format2);
        return formatFunctions[format2](m2);
      }
      function expandFormat(format2, locale2) {
        var i2 = 5;
        function replaceLongDateFormatTokens(input) {
          return locale2.longDateFormat(input) || input;
        }
        localFormattingTokens.lastIndex = 0;
        while (i2 >= 0 && localFormattingTokens.test(format2)) {
          format2 = format2.replace(
            localFormattingTokens,
            replaceLongDateFormatTokens
          );
          localFormattingTokens.lastIndex = 0;
          i2 -= 1;
        }
        return format2;
      }
      var defaultLongDateFormat = {
        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"
      };
      function longDateFormat(key) {
        var format2 = this._longDateFormat[key], formatUpper = this._longDateFormat[key.toUpperCase()];
        if (format2 || !formatUpper) {
          return format2;
        }
        this._longDateFormat[key] = formatUpper.match(formattingTokens).map(function(tok) {
          if (tok === "MMMM" || tok === "MM" || tok === "DD" || tok === "dddd") {
            return tok.slice(1);
          }
          return tok;
        }).join("");
        return this._longDateFormat[key];
      }
      var defaultInvalidDate = "Invalid date";
      function invalidDate() {
        return this._invalidDate;
      }
      var defaultOrdinal = "%d", defaultDayOfMonthOrdinalParse = /\d{1,2}/;
      function ordinal(number) {
        return this._ordinal.replace("%d", number);
      }
      var defaultRelativeTime = {
        future: "in %s",
        past: "%s ago",
        s: "a few seconds",
        ss: "%d seconds",
        m: "a minute",
        mm: "%d minutes",
        h: "an hour",
        hh: "%d hours",
        d: "a day",
        dd: "%d days",
        w: "a week",
        ww: "%d weeks",
        M: "a month",
        MM: "%d months",
        y: "a year",
        yy: "%d years"
      };
      function relativeTime(number, withoutSuffix, string, isFuture) {
        var output = this._relativeTime[string];
        return isFunction(output) ? output(number, withoutSuffix, string, isFuture) : output.replace(/%d/i, number);
      }
      function pastFuture(diff2, output) {
        var format2 = this._relativeTime[diff2 > 0 ? "future" : "past"];
        return isFunction(format2) ? format2(output) : format2.replace(/%s/i, output);
      }
      var aliases = {
        D: "date",
        dates: "date",
        date: "date",
        d: "day",
        days: "day",
        day: "day",
        e: "weekday",
        weekdays: "weekday",
        weekday: "weekday",
        E: "isoWeekday",
        isoweekdays: "isoWeekday",
        isoweekday: "isoWeekday",
        DDD: "dayOfYear",
        dayofyears: "dayOfYear",
        dayofyear: "dayOfYear",
        h: "hour",
        hours: "hour",
        hour: "hour",
        ms: "millisecond",
        milliseconds: "millisecond",
        millisecond: "millisecond",
        m: "minute",
        minutes: "minute",
        minute: "minute",
        M: "month",
        months: "month",
        month: "month",
        Q: "quarter",
        quarters: "quarter",
        quarter: "quarter",
        s: "second",
        seconds: "second",
        second: "second",
        gg: "weekYear",
        weekyears: "weekYear",
        weekyear: "weekYear",
        GG: "isoWeekYear",
        isoweekyears: "isoWeekYear",
        isoweekyear: "isoWeekYear",
        w: "week",
        weeks: "week",
        week: "week",
        W: "isoWeek",
        isoweeks: "isoWeek",
        isoweek: "isoWeek",
        y: "year",
        years: "year",
        year: "year"
      };
      function normalizeUnits(units) {
        return typeof units === "string" ? aliases[units] || aliases[units.toLowerCase()] : void 0;
      }
      function normalizeObjectUnits(inputObject) {
        var normalizedInput = {}, normalizedProp, prop;
        for (prop in inputObject) {
          if (hasOwnProp(inputObject, prop)) {
            normalizedProp = normalizeUnits(prop);
            if (normalizedProp) {
              normalizedInput[normalizedProp] = inputObject[prop];
            }
          }
        }
        return normalizedInput;
      }
      var priorities = {
        date: 9,
        day: 11,
        weekday: 11,
        isoWeekday: 11,
        dayOfYear: 4,
        hour: 13,
        millisecond: 16,
        minute: 14,
        month: 8,
        quarter: 7,
        second: 15,
        weekYear: 1,
        isoWeekYear: 1,
        week: 5,
        isoWeek: 5,
        year: 1
      };
      function getPrioritizedUnits(unitsObj) {
        var units = [], u;
        for (u in unitsObj) {
          if (hasOwnProp(unitsObj, u)) {
            units.push({ unit: u, priority: priorities[u] });
          }
        }
        units.sort(function(a, b2) {
          return a.priority - b2.priority;
        });
        return units;
      }
      var match1 = /\d/, match2 = /\d\d/, match3 = /\d{3}/, match4 = /\d{4}/, match6 = /[+-]?\d{6}/, match1to2 = /\d\d?/, match3to4 = /\d\d\d\d?/, match5to6 = /\d\d\d\d\d\d?/, match1to3 = /\d{1,3}/, match1to4 = /\d{1,4}/, match1to6 = /[+-]?\d{1,6}/, matchUnsigned = /\d+/, matchSigned = /[+-]?\d+/, matchOffset = /Z|[+-]\d\d:?\d\d/gi, matchShortOffset = /Z|[+-]\d\d(?::?\d\d)?/gi, matchTimestamp = /[+-]?\d+(\.\d{1,3})?/, matchWord = /[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i, match1to2NoLeadingZero = /^[1-9]\d?/, match1to2HasZero = /^([1-9]\d|\d)/, regexes;
      regexes = {};
      function addRegexToken(token2, regex, strictRegex) {
        regexes[token2] = isFunction(regex) ? regex : function(isStrict, localeData2) {
          return isStrict && strictRegex ? strictRegex : regex;
        };
      }
      function getParseRegexForToken(token2, config2) {
        if (!hasOwnProp(regexes, token2)) {
          return new RegExp(unescapeFormat(token2));
        }
        return regexes[token2](config2._strict, config2._locale);
      }
      function unescapeFormat(s) {
        return regexEscape(
          s.replace("\\", "").replace(
            /\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,
            function(matched, p1, p2, p3, p4) {
              return p1 || p2 || p3 || p4;
            }
          )
        );
      }
      function regexEscape(s) {
        return s.replace(/[-\/\\^$*+?.()|[\]{}]/g, "\\$&");
      }
      function absFloor(number) {
        if (number < 0) {
          return Math.ceil(number) || 0;
        } else {
          return Math.floor(number);
        }
      }
      function toInt(argumentForCoercion) {
        var coercedNumber = +argumentForCoercion, value = 0;
        if (coercedNumber !== 0 && isFinite(coercedNumber)) {
          value = absFloor(coercedNumber);
        }
        return value;
      }
      var tokens = {};
      function addParseToken(token2, callback) {
        var i2, func2 = callback, tokenLen;
        if (typeof token2 === "string") {
          token2 = [token2];
        }
        if (isNumber(callback)) {
          func2 = function(input, array) {
            array[callback] = toInt(input);
          };
        }
        tokenLen = token2.length;
        for (i2 = 0; i2 < tokenLen; i2++) {
          tokens[token2[i2]] = func2;
        }
      }
      function addWeekParseToken(token2, callback) {
        addParseToken(token2, function(input, array, config2, token3) {
          config2._w = config2._w || {};
          callback(input, config2._w, config2, token3);
        });
      }
      function addTimeToArrayFromToken(token2, input, config2) {
        if (input != null && hasOwnProp(tokens, token2)) {
          tokens[token2](input, config2._a, config2, token2);
        }
      }
      function isLeapYear(year) {
        return year % 4 === 0 && year % 100 !== 0 || year % 400 === 0;
      }
      var YEAR = 0, MONTH = 1, DATE = 2, HOUR = 3, MINUTE = 4, SECOND = 5, MILLISECOND = 6, WEEK = 7, WEEKDAY = 8;
      addFormatToken("Y", 0, 0, function() {
        var y2 = this.year();
        return y2 <= 9999 ? zeroFill(y2, 4) : "+" + y2;
      });
      addFormatToken(0, ["YY", 2], 0, function() {
        return this.year() % 100;
      });
      addFormatToken(0, ["YYYY", 4], 0, "year");
      addFormatToken(0, ["YYYYY", 5], 0, "year");
      addFormatToken(0, ["YYYYYY", 6, true], 0, "year");
      addRegexToken("Y", matchSigned);
      addRegexToken("YY", match1to2, match2);
      addRegexToken("YYYY", match1to4, match4);
      addRegexToken("YYYYY", match1to6, match6);
      addRegexToken("YYYYYY", match1to6, match6);
      addParseToken(["YYYYY", "YYYYYY"], YEAR);
      addParseToken("YYYY", function(input, array) {
        array[YEAR] = input.length === 2 ? hooks.parseTwoDigitYear(input) : toInt(input);
      });
      addParseToken("YY", function(input, array) {
        array[YEAR] = hooks.parseTwoDigitYear(input);
      });
      addParseToken("Y", function(input, array) {
        array[YEAR] = parseInt(input, 10);
      });
      function daysInYear(year) {
        return isLeapYear(year) ? 366 : 365;
      }
      hooks.parseTwoDigitYear = function(input) {
        return toInt(input) + (toInt(input) > 68 ? 1900 : 2e3);
      };
      var getSetYear = makeGetSet("FullYear", true);
      function getIsLeapYear() {
        return isLeapYear(this.year());
      }
      function makeGetSet(unit, keepTime) {
        return function(value) {
          if (value != null) {
            set$1(this, unit, value);
            hooks.updateOffset(this, keepTime);
            return this;
          } else {
            return get(this, unit);
          }
        };
      }
      function get(mom, unit) {
        if (!mom.isValid()) {
          return NaN;
        }
        var d2 = mom._d, isUTC = mom._isUTC;
        switch (unit) {
          case "Milliseconds":
            return isUTC ? d2.getUTCMilliseconds() : d2.getMilliseconds();
          case "Seconds":
            return isUTC ? d2.getUTCSeconds() : d2.getSeconds();
          case "Minutes":
            return isUTC ? d2.getUTCMinutes() : d2.getMinutes();
          case "Hours":
            return isUTC ? d2.getUTCHours() : d2.getHours();
          case "Date":
            return isUTC ? d2.getUTCDate() : d2.getDate();
          case "Day":
            return isUTC ? d2.getUTCDay() : d2.getDay();
          case "Month":
            return isUTC ? d2.getUTCMonth() : d2.getMonth();
          case "FullYear":
            return isUTC ? d2.getUTCFullYear() : d2.getFullYear();
          default:
            return NaN;
        }
      }
      function set$1(mom, unit, value) {
        var d2, isUTC, year, month, date;
        if (!mom.isValid() || isNaN(value)) {
          return;
        }
        d2 = mom._d;
        isUTC = mom._isUTC;
        switch (unit) {
          case "Milliseconds":
            return void (isUTC ? d2.setUTCMilliseconds(value) : d2.setMilliseconds(value));
          case "Seconds":
            return void (isUTC ? d2.setUTCSeconds(value) : d2.setSeconds(value));
          case "Minutes":
            return void (isUTC ? d2.setUTCMinutes(value) : d2.setMinutes(value));
          case "Hours":
            return void (isUTC ? d2.setUTCHours(value) : d2.setHours(value));
          case "Date":
            return void (isUTC ? d2.setUTCDate(value) : d2.setDate(value));
          case "FullYear":
            break;
          default:
            return;
        }
        year = value;
        month = mom.month();
        date = mom.date();
        date = date === 29 && month === 1 && !isLeapYear(year) ? 28 : date;
        void (isUTC ? d2.setUTCFullYear(year, month, date) : d2.setFullYear(year, month, date));
      }
      function stringGet(units) {
        units = normalizeUnits(units);
        if (isFunction(this[units])) {
          return this[units]();
        }
        return this;
      }
      function stringSet(units, value) {
        if (typeof units === "object") {
          units = normalizeObjectUnits(units);
          var prioritized = getPrioritizedUnits(units), i2, prioritizedLen = prioritized.length;
          for (i2 = 0; i2 < prioritizedLen; i2++) {
            this[prioritized[i2].unit](units[prioritized[i2].unit]);
          }
        } else {
          units = normalizeUnits(units);
          if (isFunction(this[units])) {
            return this[units](value);
          }
        }
        return this;
      }
      function mod(n2, x2) {
        return (n2 % x2 + x2) % x2;
      }
      var indexOf;
      if (Array.prototype.indexOf) {
        indexOf = Array.prototype.indexOf;
      } else {
        indexOf = function(o) {
          var i2;
          for (i2 = 0; i2 < this.length; ++i2) {
            if (this[i2] === o) {
              return i2;
            }
          }
          return -1;
        };
      }
      function daysInMonth(year, month) {
        if (isNaN(year) || isNaN(month)) {
          return NaN;
        }
        var modMonth = mod(month, 12);
        year += (month - modMonth) / 12;
        return modMonth === 1 ? isLeapYear(year) ? 29 : 28 : 31 - modMonth % 7 % 2;
      }
      addFormatToken("M", ["MM", 2], "Mo", function() {
        return this.month() + 1;
      });
      addFormatToken("MMM", 0, 0, function(format2) {
        return this.localeData().monthsShort(this, format2);
      });
      addFormatToken("MMMM", 0, 0, function(format2) {
        return this.localeData().months(this, format2);
      });
      addRegexToken("M", match1to2, match1to2NoLeadingZero);
      addRegexToken("MM", match1to2, match2);
      addRegexToken("MMM", function(isStrict, locale2) {
        return locale2.monthsShortRegex(isStrict);
      });
      addRegexToken("MMMM", function(isStrict, locale2) {
        return locale2.monthsRegex(isStrict);
      });
      addParseToken(["M", "MM"], function(input, array) {
        array[MONTH] = toInt(input) - 1;
      });
      addParseToken(["MMM", "MMMM"], function(input, array, config2, token2) {
        var month = config2._locale.monthsParse(input, token2, config2._strict);
        if (month != null) {
          array[MONTH] = month;
        } else {
          getParsingFlags(config2).invalidMonth = input;
        }
      });
      var defaultLocaleMonths = "January_February_March_April_May_June_July_August_September_October_November_December".split(
        "_"
      ), defaultLocaleMonthsShort = "Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"), MONTHS_IN_FORMAT = /D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/, defaultMonthsShortRegex = matchWord, defaultMonthsRegex = matchWord;
      function localeMonths(m2, format2) {
        if (!m2) {
          return isArray(this._months) ? this._months : this._months["standalone"];
        }
        return isArray(this._months) ? this._months[m2.month()] : this._months[(this._months.isFormat || MONTHS_IN_FORMAT).test(format2) ? "format" : "standalone"][m2.month()];
      }
      function localeMonthsShort(m2, format2) {
        if (!m2) {
          return isArray(this._monthsShort) ? this._monthsShort : this._monthsShort["standalone"];
        }
        return isArray(this._monthsShort) ? this._monthsShort[m2.month()] : this._monthsShort[MONTHS_IN_FORMAT.test(format2) ? "format" : "standalone"][m2.month()];
      }
      function handleStrictParse(monthName, format2, strict) {
        var i2, ii, mom, llc = monthName.toLocaleLowerCase();
        if (!this._monthsParse) {
          this._monthsParse = [];
          this._longMonthsParse = [];
          this._shortMonthsParse = [];
          for (i2 = 0; i2 < 12; ++i2) {
            mom = createUTC([2e3, i2]);
            this._shortMonthsParse[i2] = this.monthsShort(
              mom,
              ""
            ).toLocaleLowerCase();
            this._longMonthsParse[i2] = this.months(mom, "").toLocaleLowerCase();
          }
        }
        if (strict) {
          if (format2 === "MMM") {
            ii = indexOf.call(this._shortMonthsParse, llc);
            return ii !== -1 ? ii : null;
          } else {
            ii = indexOf.call(this._longMonthsParse, llc);
            return ii !== -1 ? ii : null;
          }
        } else {
          if (format2 === "MMM") {
            ii = indexOf.call(this._shortMonthsParse, llc);
            if (ii !== -1) {
              return ii;
            }
            ii = indexOf.call(this._longMonthsParse, llc);
            return ii !== -1 ? ii : null;
          } else {
            ii = indexOf.call(this._longMonthsParse, llc);
            if (ii !== -1) {
              return ii;
            }
            ii = indexOf.call(this._shortMonthsParse, llc);
            return ii !== -1 ? ii : null;
          }
        }
      }
      function localeMonthsParse(monthName, format2, strict) {
        var i2, mom, regex;
        if (this._monthsParseExact) {
          return handleStrictParse.call(this, monthName, format2, strict);
        }
        if (!this._monthsParse) {
          this._monthsParse = [];
          this._longMonthsParse = [];
          this._shortMonthsParse = [];
        }
        for (i2 = 0; i2 < 12; i2++) {
          mom = createUTC([2e3, i2]);
          if (strict && !this._longMonthsParse[i2]) {
            this._longMonthsParse[i2] = new RegExp(
              "^" + this.months(mom, "").replace(".", "") + "$",
              "i"
            );
            this._shortMonthsParse[i2] = new RegExp(
              "^" + this.monthsShort(mom, "").replace(".", "") + "$",
              "i"
            );
          }
          if (!strict && !this._monthsParse[i2]) {
            regex = "^" + this.months(mom, "") + "|^" + this.monthsShort(mom, "");
            this._monthsParse[i2] = new RegExp(regex.replace(".", ""), "i");
          }
          if (strict && format2 === "MMMM" && this._longMonthsParse[i2].test(monthName)) {
            return i2;
          } else if (strict && format2 === "MMM" && this._shortMonthsParse[i2].test(monthName)) {
            return i2;
          } else if (!strict && this._monthsParse[i2].test(monthName)) {
            return i2;
          }
        }
      }
      function setMonth(mom, value) {
        if (!mom.isValid()) {
          return mom;
        }
        if (typeof value === "string") {
          if (/^\d+$/.test(value)) {
            value = toInt(value);
          } else {
            value = mom.localeData().monthsParse(value);
            if (!isNumber(value)) {
              return mom;
            }
          }
        }
        var month = value, date = mom.date();
        date = date < 29 ? date : Math.min(date, daysInMonth(mom.year(), month));
        void (mom._isUTC ? mom._d.setUTCMonth(month, date) : mom._d.setMonth(month, date));
        return mom;
      }
      function getSetMonth(value) {
        if (value != null) {
          setMonth(this, value);
          hooks.updateOffset(this, true);
          return this;
        } else {
          return get(this, "Month");
        }
      }
      function getDaysInMonth() {
        return daysInMonth(this.year(), this.month());
      }
      function monthsShortRegex(isStrict) {
        if (this._monthsParseExact) {
          if (!hasOwnProp(this, "_monthsRegex")) {
            computeMonthsParse.call(this);
          }
          if (isStrict) {
            return this._monthsShortStrictRegex;
          } else {
            return this._monthsShortRegex;
          }
        } else {
          if (!hasOwnProp(this, "_monthsShortRegex")) {
            this._monthsShortRegex = defaultMonthsShortRegex;
          }
          return this._monthsShortStrictRegex && isStrict ? this._monthsShortStrictRegex : this._monthsShortRegex;
        }
      }
      function monthsRegex(isStrict) {
        if (this._monthsParseExact) {
          if (!hasOwnProp(this, "_monthsRegex")) {
            computeMonthsParse.call(this);
          }
          if (isStrict) {
            return this._monthsStrictRegex;
          } else {
            return this._monthsRegex;
          }
        } else {
          if (!hasOwnProp(this, "_monthsRegex")) {
            this._monthsRegex = defaultMonthsRegex;
          }
          return this._monthsStrictRegex && isStrict ? this._monthsStrictRegex : this._monthsRegex;
        }
      }
      function computeMonthsParse() {
        function cmpLenRev(a, b2) {
          return b2.length - a.length;
        }
        var shortPieces = [], longPieces = [], mixedPieces = [], i2, mom, shortP, longP;
        for (i2 = 0; i2 < 12; i2++) {
          mom = createUTC([2e3, i2]);
          shortP = regexEscape(this.monthsShort(mom, ""));
          longP = regexEscape(this.months(mom, ""));
          shortPieces.push(shortP);
          longPieces.push(longP);
          mixedPieces.push(longP);
          mixedPieces.push(shortP);
        }
        shortPieces.sort(cmpLenRev);
        longPieces.sort(cmpLenRev);
        mixedPieces.sort(cmpLenRev);
        this._monthsRegex = new RegExp("^(" + mixedPieces.join("|") + ")", "i");
        this._monthsShortRegex = this._monthsRegex;
        this._monthsStrictRegex = new RegExp(
          "^(" + longPieces.join("|") + ")",
          "i"
        );
        this._monthsShortStrictRegex = new RegExp(
          "^(" + shortPieces.join("|") + ")",
          "i"
        );
      }
      function createDate(y2, m2, d2, h2, M, s, ms) {
        var date;
        if (y2 < 100 && y2 >= 0) {
          date = new Date(y2 + 400, m2, d2, h2, M, s, ms);
          if (isFinite(date.getFullYear())) {
            date.setFullYear(y2);
          }
        } else {
          date = new Date(y2, m2, d2, h2, M, s, ms);
        }
        return date;
      }
      function createUTCDate(y2) {
        var date, args;
        if (y2 < 100 && y2 >= 0) {
          args = Array.prototype.slice.call(arguments);
          args[0] = y2 + 400;
          date = new Date(Date.UTC.apply(null, args));
          if (isFinite(date.getUTCFullYear())) {
            date.setUTCFullYear(y2);
          }
        } else {
          date = new Date(Date.UTC.apply(null, arguments));
        }
        return date;
      }
      function firstWeekOffset(year, dow, doy) {
        var fwd = 7 + dow - doy, fwdlw = (7 + createUTCDate(year, 0, fwd).getUTCDay() - dow) % 7;
        return -fwdlw + fwd - 1;
      }
      function dayOfYearFromWeeks(year, week, weekday, dow, doy) {
        var localWeekday = (7 + weekday - dow) % 7, weekOffset = firstWeekOffset(year, dow, doy), dayOfYear = 1 + 7 * (week - 1) + localWeekday + weekOffset, resYear, resDayOfYear;
        if (dayOfYear <= 0) {
          resYear = year - 1;
          resDayOfYear = daysInYear(resYear) + dayOfYear;
        } else if (dayOfYear > daysInYear(year)) {
          resYear = year + 1;
          resDayOfYear = dayOfYear - daysInYear(year);
        } else {
          resYear = year;
          resDayOfYear = dayOfYear;
        }
        return {
          year: resYear,
          dayOfYear: resDayOfYear
        };
      }
      function weekOfYear(mom, dow, doy) {
        var weekOffset = firstWeekOffset(mom.year(), dow, doy), week = Math.floor((mom.dayOfYear() - weekOffset - 1) / 7) + 1, resWeek, resYear;
        if (week < 1) {
          resYear = mom.year() - 1;
          resWeek = week + weeksInYear(resYear, dow, doy);
        } else if (week > weeksInYear(mom.year(), dow, doy)) {
          resWeek = week - weeksInYear(mom.year(), dow, doy);
          resYear = mom.year() + 1;
        } else {
          resYear = mom.year();
          resWeek = week;
        }
        return {
          week: resWeek,
          year: resYear
        };
      }
      function weeksInYear(year, dow, doy) {
        var weekOffset = firstWeekOffset(year, dow, doy), weekOffsetNext = firstWeekOffset(year + 1, dow, doy);
        return (daysInYear(year) - weekOffset + weekOffsetNext) / 7;
      }
      addFormatToken("w", ["ww", 2], "wo", "week");
      addFormatToken("W", ["WW", 2], "Wo", "isoWeek");
      addRegexToken("w", match1to2, match1to2NoLeadingZero);
      addRegexToken("ww", match1to2, match2);
      addRegexToken("W", match1to2, match1to2NoLeadingZero);
      addRegexToken("WW", match1to2, match2);
      addWeekParseToken(
        ["w", "ww", "W", "WW"],
        function(input, week, config2, token2) {
          week[token2.substr(0, 1)] = toInt(input);
        }
      );
      function localeWeek(mom) {
        return weekOfYear(mom, this._week.dow, this._week.doy).week;
      }
      var defaultLocaleWeek = {
        dow: 0,
        // Sunday is the first day of the week.
        doy: 6
        // The week that contains Jan 6th is the first week of the year.
      };
      function localeFirstDayOfWeek() {
        return this._week.dow;
      }
      function localeFirstDayOfYear() {
        return this._week.doy;
      }
      function getSetWeek(input) {
        var week = this.localeData().week(this);
        return input == null ? week : this.add((input - week) * 7, "d");
      }
      function getSetISOWeek(input) {
        var week = weekOfYear(this, 1, 4).week;
        return input == null ? week : this.add((input - week) * 7, "d");
      }
      addFormatToken("d", 0, "do", "day");
      addFormatToken("dd", 0, 0, function(format2) {
        return this.localeData().weekdaysMin(this, format2);
      });
      addFormatToken("ddd", 0, 0, function(format2) {
        return this.localeData().weekdaysShort(this, format2);
      });
      addFormatToken("dddd", 0, 0, function(format2) {
        return this.localeData().weekdays(this, format2);
      });
      addFormatToken("e", 0, 0, "weekday");
      addFormatToken("E", 0, 0, "isoWeekday");
      addRegexToken("d", match1to2);
      addRegexToken("e", match1to2);
      addRegexToken("E", match1to2);
      addRegexToken("dd", function(isStrict, locale2) {
        return locale2.weekdaysMinRegex(isStrict);
      });
      addRegexToken("ddd", function(isStrict, locale2) {
        return locale2.weekdaysShortRegex(isStrict);
      });
      addRegexToken("dddd", function(isStrict, locale2) {
        return locale2.weekdaysRegex(isStrict);
      });
      addWeekParseToken(["dd", "ddd", "dddd"], function(input, week, config2, token2) {
        var weekday = config2._locale.weekdaysParse(input, token2, config2._strict);
        if (weekday != null) {
          week.d = weekday;
        } else {
          getParsingFlags(config2).invalidWeekday = input;
        }
      });
      addWeekParseToken(["d", "e", "E"], function(input, week, config2, token2) {
        week[token2] = toInt(input);
      });
      function parseWeekday(input, locale2) {
        if (typeof input !== "string") {
          return input;
        }
        if (!isNaN(input)) {
          return parseInt(input, 10);
        }
        input = locale2.weekdaysParse(input);
        if (typeof input === "number") {
          return input;
        }
        return null;
      }
      function parseIsoWeekday(input, locale2) {
        if (typeof input === "string") {
          return locale2.weekdaysParse(input) % 7 || 7;
        }
        return isNaN(input) ? null : input;
      }
      function shiftWeekdays(ws, n2) {
        return ws.slice(n2, 7).concat(ws.slice(0, n2));
      }
      var defaultLocaleWeekdays = "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), defaultLocaleWeekdaysShort = "Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"), defaultLocaleWeekdaysMin = "Su_Mo_Tu_We_Th_Fr_Sa".split("_"), defaultWeekdaysRegex = matchWord, defaultWeekdaysShortRegex = matchWord, defaultWeekdaysMinRegex = matchWord;
      function localeWeekdays(m2, format2) {
        var weekdays = isArray(this._weekdays) ? this._weekdays : this._weekdays[m2 && m2 !== true && this._weekdays.isFormat.test(format2) ? "format" : "standalone"];
        return m2 === true ? shiftWeekdays(weekdays, this._week.dow) : m2 ? weekdays[m2.day()] : weekdays;
      }
      function localeWeekdaysShort(m2) {
        return m2 === true ? shiftWeekdays(this._weekdaysShort, this._week.dow) : m2 ? this._weekdaysShort[m2.day()] : this._weekdaysShort;
      }
      function localeWeekdaysMin(m2) {
        return m2 === true ? shiftWeekdays(this._weekdaysMin, this._week.dow) : m2 ? this._weekdaysMin[m2.day()] : this._weekdaysMin;
      }
      function handleStrictParse$1(weekdayName, format2, strict) {
        var i2, ii, mom, llc = weekdayName.toLocaleLowerCase();
        if (!this._weekdaysParse) {
          this._weekdaysParse = [];
          this._shortWeekdaysParse = [];
          this._minWeekdaysParse = [];
          for (i2 = 0; i2 < 7; ++i2) {
            mom = createUTC([2e3, 1]).day(i2);
            this._minWeekdaysParse[i2] = this.weekdaysMin(
              mom,
              ""
            ).toLocaleLowerCase();
            this._shortWeekdaysParse[i2] = this.weekdaysShort(
              mom,
              ""
            ).toLocaleLowerCase();
            this._weekdaysParse[i2] = this.weekdays(mom, "").toLocaleLowerCase();
          }
        }
        if (strict) {
          if (format2 === "dddd") {
            ii = indexOf.call(this._weekdaysParse, llc);
            return ii !== -1 ? ii : null;
          } else if (format2 === "ddd") {
            ii = indexOf.call(this._shortWeekdaysParse, llc);
            return ii !== -1 ? ii : null;
          } else {
            ii = indexOf.call(this._minWeekdaysParse, llc);
            return ii !== -1 ? ii : null;
          }
        } else {
          if (format2 === "dddd") {
            ii = indexOf.call(this._weekdaysParse, llc);
            if (ii !== -1) {
              return ii;
            }
            ii = indexOf.call(this._shortWeekdaysParse, llc);
            if (ii !== -1) {
              return ii;
            }
            ii = indexOf.call(this._minWeekdaysParse, llc);
            return ii !== -1 ? ii : null;
          } else if (format2 === "ddd") {
            ii = indexOf.call(this._shortWeekdaysParse, llc);
            if (ii !== -1) {
              return ii;
            }
            ii = indexOf.call(this._weekdaysParse, llc);
            if (ii !== -1) {
              return ii;
            }
            ii = indexOf.call(this._minWeekdaysParse, llc);
            return ii !== -1 ? ii : null;
          } else {
            ii = indexOf.call(this._minWeekdaysParse, llc);
            if (ii !== -1) {
              return ii;
            }
            ii = indexOf.call(this._weekdaysParse, llc);
            if (ii !== -1) {
              return ii;
            }
            ii = indexOf.call(this._shortWeekdaysParse, llc);
            return ii !== -1 ? ii : null;
          }
        }
      }
      function localeWeekdaysParse(weekdayName, format2, strict) {
        var i2, mom, regex;
        if (this._weekdaysParseExact) {
          return handleStrictParse$1.call(this, weekdayName, format2, strict);
        }
        if (!this._weekdaysParse) {
          this._weekdaysParse = [];
          this._minWeekdaysParse = [];
          this._shortWeekdaysParse = [];
          this._fullWeekdaysParse = [];
        }
        for (i2 = 0; i2 < 7; i2++) {
          mom = createUTC([2e3, 1]).day(i2);
          if (strict && !this._fullWeekdaysParse[i2]) {
            this._fullWeekdaysParse[i2] = new RegExp(
              "^" + this.weekdays(mom, "").replace(".", "\\.?") + "$",
              "i"
            );
            this._shortWeekdaysParse[i2] = new RegExp(
              "^" + this.weekdaysShort(mom, "").replace(".", "\\.?") + "$",
              "i"
            );
            this._minWeekdaysParse[i2] = new RegExp(
              "^" + this.weekdaysMin(mom, "").replace(".", "\\.?") + "$",
              "i"
            );
          }
          if (!this._weekdaysParse[i2]) {
            regex = "^" + this.weekdays(mom, "") + "|^" + this.weekdaysShort(mom, "") + "|^" + this.weekdaysMin(mom, "");
            this._weekdaysParse[i2] = new RegExp(regex.replace(".", ""), "i");
          }
          if (strict && format2 === "dddd" && this._fullWeekdaysParse[i2].test(weekdayName)) {
            return i2;
          } else if (strict && format2 === "ddd" && this._shortWeekdaysParse[i2].test(weekdayName)) {
            return i2;
          } else if (strict && format2 === "dd" && this._minWeekdaysParse[i2].test(weekdayName)) {
            return i2;
          } else if (!strict && this._weekdaysParse[i2].test(weekdayName)) {
            return i2;
          }
        }
      }
      function getSetDayOfWeek(input) {
        if (!this.isValid()) {
          return input != null ? this : NaN;
        }
        var day = get(this, "Day");
        if (input != null) {
          input = parseWeekday(input, this.localeData());
          return this.add(input - day, "d");
        } else {
          return day;
        }
      }
      function getSetLocaleDayOfWeek(input) {
        if (!this.isValid()) {
          return input != null ? this : NaN;
        }
        var weekday = (this.day() + 7 - this.localeData()._week.dow) % 7;
        return input == null ? weekday : this.add(input - weekday, "d");
      }
      function getSetISODayOfWeek(input) {
        if (!this.isValid()) {
          return input != null ? this : NaN;
        }
        if (input != null) {
          var weekday = parseIsoWeekday(input, this.localeData());
          return this.day(this.day() % 7 ? weekday : weekday - 7);
        } else {
          return this.day() || 7;
        }
      }
      function weekdaysRegex(isStrict) {
        if (this._weekdaysParseExact) {
          if (!hasOwnProp(this, "_weekdaysRegex")) {
            computeWeekdaysParse.call(this);
          }
          if (isStrict) {
            return this._weekdaysStrictRegex;
          } else {
            return this._weekdaysRegex;
          }
        } else {
          if (!hasOwnProp(this, "_weekdaysRegex")) {
            this._weekdaysRegex = defaultWeekdaysRegex;
          }
          return this._weekdaysStrictRegex && isStrict ? this._weekdaysStrictRegex : this._weekdaysRegex;
        }
      }
      function weekdaysShortRegex(isStrict) {
        if (this._weekdaysParseExact) {
          if (!hasOwnProp(this, "_weekdaysRegex")) {
            computeWeekdaysParse.call(this);
          }
          if (isStrict) {
            return this._weekdaysShortStrictRegex;
          } else {
            return this._weekdaysShortRegex;
          }
        } else {
          if (!hasOwnProp(this, "_weekdaysShortRegex")) {
            this._weekdaysShortRegex = defaultWeekdaysShortRegex;
          }
          return this._weekdaysShortStrictRegex && isStrict ? this._weekdaysShortStrictRegex : this._weekdaysShortRegex;
        }
      }
      function weekdaysMinRegex(isStrict) {
        if (this._weekdaysParseExact) {
          if (!hasOwnProp(this, "_weekdaysRegex")) {
            computeWeekdaysParse.call(this);
          }
          if (isStrict) {
            return this._weekdaysMinStrictRegex;
          } else {
            return this._weekdaysMinRegex;
          }
        } else {
          if (!hasOwnProp(this, "_weekdaysMinRegex")) {
            this._weekdaysMinRegex = defaultWeekdaysMinRegex;
          }
          return this._weekdaysMinStrictRegex && isStrict ? this._weekdaysMinStrictRegex : this._weekdaysMinRegex;
        }
      }
      function computeWeekdaysParse() {
        function cmpLenRev(a, b2) {
          return b2.length - a.length;
        }
        var minPieces = [], shortPieces = [], longPieces = [], mixedPieces = [], i2, mom, minp, shortp, longp;
        for (i2 = 0; i2 < 7; i2++) {
          mom = createUTC([2e3, 1]).day(i2);
          minp = regexEscape(this.weekdaysMin(mom, ""));
          shortp = regexEscape(this.weekdaysShort(mom, ""));
          longp = regexEscape(this.weekdays(mom, ""));
          minPieces.push(minp);
          shortPieces.push(shortp);
          longPieces.push(longp);
          mixedPieces.push(minp);
          mixedPieces.push(shortp);
          mixedPieces.push(longp);
        }
        minPieces.sort(cmpLenRev);
        shortPieces.sort(cmpLenRev);
        longPieces.sort(cmpLenRev);
        mixedPieces.sort(cmpLenRev);
        this._weekdaysRegex = new RegExp("^(" + mixedPieces.join("|") + ")", "i");
        this._weekdaysShortRegex = this._weekdaysRegex;
        this._weekdaysMinRegex = this._weekdaysRegex;
        this._weekdaysStrictRegex = new RegExp(
          "^(" + longPieces.join("|") + ")",
          "i"
        );
        this._weekdaysShortStrictRegex = new RegExp(
          "^(" + shortPieces.join("|") + ")",
          "i"
        );
        this._weekdaysMinStrictRegex = new RegExp(
          "^(" + minPieces.join("|") + ")",
          "i"
        );
      }
      function hFormat() {
        return this.hours() % 12 || 12;
      }
      function kFormat() {
        return this.hours() || 24;
      }
      addFormatToken("H", ["HH", 2], 0, "hour");
      addFormatToken("h", ["hh", 2], 0, hFormat);
      addFormatToken("k", ["kk", 2], 0, kFormat);
      addFormatToken("hmm", 0, 0, function() {
        return "" + hFormat.apply(this) + zeroFill(this.minutes(), 2);
      });
      addFormatToken("hmmss", 0, 0, function() {
        return "" + hFormat.apply(this) + zeroFill(this.minutes(), 2) + zeroFill(this.seconds(), 2);
      });
      addFormatToken("Hmm", 0, 0, function() {
        return "" + this.hours() + zeroFill(this.minutes(), 2);
      });
      addFormatToken("Hmmss", 0, 0, function() {
        return "" + this.hours() + zeroFill(this.minutes(), 2) + zeroFill(this.seconds(), 2);
      });
      function meridiem(token2, lowercase) {
        addFormatToken(token2, 0, 0, function() {
          return this.localeData().meridiem(
            this.hours(),
            this.minutes(),
            lowercase
          );
        });
      }
      meridiem("a", true);
      meridiem("A", false);
      function matchMeridiem(isStrict, locale2) {
        return locale2._meridiemParse;
      }
      addRegexToken("a", matchMeridiem);
      addRegexToken("A", matchMeridiem);
      addRegexToken("H", match1to2, match1to2HasZero);
      addRegexToken("h", match1to2, match1to2NoLeadingZero);
      addRegexToken("k", match1to2, match1to2NoLeadingZero);
      addRegexToken("HH", match1to2, match2);
      addRegexToken("hh", match1to2, match2);
      addRegexToken("kk", match1to2, match2);
      addRegexToken("hmm", match3to4);
      addRegexToken("hmmss", match5to6);
      addRegexToken("Hmm", match3to4);
      addRegexToken("Hmmss", match5to6);
      addParseToken(["H", "HH"], HOUR);
      addParseToken(["k", "kk"], function(input, array, config2) {
        var kInput = toInt(input);
        array[HOUR] = kInput === 24 ? 0 : kInput;
      });
      addParseToken(["a", "A"], function(input, array, config2) {
        config2._isPm = config2._locale.isPM(input);
        config2._meridiem = input;
      });
      addParseToken(["h", "hh"], function(input, array, config2) {
        array[HOUR] = toInt(input);
        getParsingFlags(config2).bigHour = true;
      });
      addParseToken("hmm", function(input, array, config2) {
        var pos = input.length - 2;
        array[HOUR] = toInt(input.substr(0, pos));
        array[MINUTE] = toInt(input.substr(pos));
        getParsingFlags(config2).bigHour = true;
      });
      addParseToken("hmmss", function(input, array, config2) {
        var pos1 = input.length - 4, pos2 = input.length - 2;
        array[HOUR] = toInt(input.substr(0, pos1));
        array[MINUTE] = toInt(input.substr(pos1, 2));
        array[SECOND] = toInt(input.substr(pos2));
        getParsingFlags(config2).bigHour = true;
      });
      addParseToken("Hmm", function(input, array, config2) {
        var pos = input.length - 2;
        array[HOUR] = toInt(input.substr(0, pos));
        array[MINUTE] = toInt(input.substr(pos));
      });
      addParseToken("Hmmss", function(input, array, config2) {
        var pos1 = input.length - 4, pos2 = input.length - 2;
        array[HOUR] = toInt(input.substr(0, pos1));
        array[MINUTE] = toInt(input.substr(pos1, 2));
        array[SECOND] = toInt(input.substr(pos2));
      });
      function localeIsPM(input) {
        return (input + "").toLowerCase().charAt(0) === "p";
      }
      var defaultLocaleMeridiemParse = /[ap]\.?m?\.?/i, getSetHour = makeGetSet("Hours", true);
      function localeMeridiem(hours2, minutes2, isLower) {
        if (hours2 > 11) {
          return isLower ? "pm" : "PM";
        } else {
          return isLower ? "am" : "AM";
        }
      }
      var baseConfig = {
        calendar: defaultCalendar,
        longDateFormat: defaultLongDateFormat,
        invalidDate: defaultInvalidDate,
        ordinal: defaultOrdinal,
        dayOfMonthOrdinalParse: defaultDayOfMonthOrdinalParse,
        relativeTime: defaultRelativeTime,
        months: defaultLocaleMonths,
        monthsShort: defaultLocaleMonthsShort,
        week: defaultLocaleWeek,
        weekdays: defaultLocaleWeekdays,
        weekdaysMin: defaultLocaleWeekdaysMin,
        weekdaysShort: defaultLocaleWeekdaysShort,
        meridiemParse: defaultLocaleMeridiemParse
      };
      var locales = {}, localeFamilies = {}, globalLocale;
      function commonPrefix(arr1, arr2) {
        var i2, minl = Math.min(arr1.length, arr2.length);
        for (i2 = 0; i2 < minl; i2 += 1) {
          if (arr1[i2] !== arr2[i2]) {
            return i2;
          }
        }
        return minl;
      }
      function normalizeLocale(key) {
        return key ? key.toLowerCase().replace("_", "-") : key;
      }
      function chooseLocale(names) {
        var i2 = 0, j2, next, locale2, split;
        while (i2 < names.length) {
          split = normalizeLocale(names[i2]).split("-");
          j2 = split.length;
          next = normalizeLocale(names[i2 + 1]);
          next = next ? next.split("-") : null;
          while (j2 > 0) {
            locale2 = loadLocale(split.slice(0, j2).join("-"));
            if (locale2) {
              return locale2;
            }
            if (next && next.length >= j2 && commonPrefix(split, next) >= j2 - 1) {
              break;
            }
            j2--;
          }
          i2++;
        }
        return globalLocale;
      }
      function isLocaleNameSane(name) {
        return !!(name && name.match("^[^/\\\\]*$"));
      }
      function loadLocale(name) {
        var oldLocale = null, aliasedRequire;
        if (locales[name] === void 0 && typeof module !== "undefined" && module && module.exports && isLocaleNameSane(name)) {
          try {
            oldLocale = globalLocale._abbr;
            aliasedRequire = require;
            aliasedRequire("./locale/" + name);
            getSetGlobalLocale(oldLocale);
          } catch (e2) {
            locales[name] = null;
          }
        }
        return locales[name];
      }
      function getSetGlobalLocale(key, values2) {
        var data;
        if (key) {
          if (isUndefined(values2)) {
            data = getLocale(key);
          } else {
            data = defineLocale(key, values2);
          }
          if (data) {
            globalLocale = data;
          } else {
            if (typeof console !== "undefined" && console.warn) {
              console.warn(
                "Locale " + key + " not found. Did you forget to load it?"
              );
            }
          }
        }
        return globalLocale._abbr;
      }
      function defineLocale(name, config2) {
        if (config2 !== null) {
          var locale2, parentConfig = baseConfig;
          config2.abbr = name;
          if (locales[name] != null) {
            deprecateSimple(
              "defineLocaleOverride",
              "use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."
            );
            parentConfig = locales[name]._config;
          } else if (config2.parentLocale != null) {
            if (locales[config2.parentLocale] != null) {
              parentConfig = locales[config2.parentLocale]._config;
            } else {
              locale2 = loadLocale(config2.parentLocale);
              if (locale2 != null) {
                parentConfig = locale2._config;
              } else {
                if (!localeFamilies[config2.parentLocale]) {
                  localeFamilies[config2.parentLocale] = [];
                }
                localeFamilies[config2.parentLocale].push({
                  name,
                  config: config2
                });
                return null;
              }
            }
          }
          locales[name] = new Locale(mergeConfigs(parentConfig, config2));
          if (localeFamilies[name]) {
            localeFamilies[name].forEach(function(x2) {
              defineLocale(x2.name, x2.config);
            });
          }
          getSetGlobalLocale(name);
          return locales[name];
        } else {
          delete locales[name];
          return null;
        }
      }
      function updateLocale(name, config2) {
        if (config2 != null) {
          var locale2, tmpLocale, parentConfig = baseConfig;
          if (locales[name] != null && locales[name].parentLocale != null) {
            locales[name].set(mergeConfigs(locales[name]._config, config2));
          } else {
            tmpLocale = loadLocale(name);
            if (tmpLocale != null) {
              parentConfig = tmpLocale._config;
            }
            config2 = mergeConfigs(parentConfig, config2);
            if (tmpLocale == null) {
              config2.abbr = name;
            }
            locale2 = new Locale(config2);
            locale2.parentLocale = locales[name];
            locales[name] = locale2;
          }
          getSetGlobalLocale(name);
        } else {
          if (locales[name] != null) {
            if (locales[name].parentLocale != null) {
              locales[name] = locales[name].parentLocale;
              if (name === getSetGlobalLocale()) {
                getSetGlobalLocale(name);
              }
            } else if (locales[name] != null) {
              delete locales[name];
            }
          }
        }
        return locales[name];
      }
      function getLocale(key) {
        var locale2;
        if (key && key._locale && key._locale._abbr) {
          key = key._locale._abbr;
        }
        if (!key) {
          return globalLocale;
        }
        if (!isArray(key)) {
          locale2 = loadLocale(key);
          if (locale2) {
            return locale2;
          }
          key = [key];
        }
        return chooseLocale(key);
      }
      function listLocales() {
        return keys$1(locales);
      }
      function checkOverflow(m2) {
        var overflow, a = m2._a;
        if (a && getParsingFlags(m2).overflow === -2) {
          overflow = a[MONTH] < 0 || a[MONTH] > 11 ? MONTH : a[DATE] < 1 || a[DATE] > daysInMonth(a[YEAR], a[MONTH]) ? DATE : a[HOUR] < 0 || a[HOUR] > 24 || a[HOUR] === 24 && (a[MINUTE] !== 0 || a[SECOND] !== 0 || a[MILLISECOND] !== 0) ? HOUR : a[MINUTE] < 0 || a[MINUTE] > 59 ? MINUTE : a[SECOND] < 0 || a[SECOND] > 59 ? SECOND : a[MILLISECOND] < 0 || a[MILLISECOND] > 999 ? MILLISECOND : -1;
          if (getParsingFlags(m2)._overflowDayOfYear && (overflow < YEAR || overflow > DATE)) {
            overflow = DATE;
          }
          if (getParsingFlags(m2)._overflowWeeks && overflow === -1) {
            overflow = WEEK;
          }
          if (getParsingFlags(m2)._overflowWeekday && overflow === -1) {
            overflow = WEEKDAY;
          }
          getParsingFlags(m2).overflow = overflow;
        }
        return m2;
      }
      var extendedIsoRegex = /^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/, basicIsoRegex = /^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/, tzRegex = /Z|[+-]\d\d(?::?\d\d)?/, isoDates = [
        ["YYYYYY-MM-DD", /[+-]\d{6}-\d\d-\d\d/],
        ["YYYY-MM-DD", /\d{4}-\d\d-\d\d/],
        ["GGGG-[W]WW-E", /\d{4}-W\d\d-\d/],
        ["GGGG-[W]WW", /\d{4}-W\d\d/, false],
        ["YYYY-DDD", /\d{4}-\d{3}/],
        ["YYYY-MM", /\d{4}-\d\d/, false],
        ["YYYYYYMMDD", /[+-]\d{10}/],
        ["YYYYMMDD", /\d{8}/],
        ["GGGG[W]WWE", /\d{4}W\d{3}/],
        ["GGGG[W]WW", /\d{4}W\d{2}/, false],
        ["YYYYDDD", /\d{7}/],
        ["YYYYMM", /\d{6}/, false],
        ["YYYY", /\d{4}/, false]
      ], isoTimes = [
        ["HH:mm:ss.SSSS", /\d\d:\d\d:\d\d\.\d+/],
        ["HH:mm:ss,SSSS", /\d\d:\d\d:\d\d,\d+/],
        ["HH:mm:ss", /\d\d:\d\d:\d\d/],
        ["HH:mm", /\d\d:\d\d/],
        ["HHmmss.SSSS", /\d\d\d\d\d\d\.\d+/],
        ["HHmmss,SSSS", /\d\d\d\d\d\d,\d+/],
        ["HHmmss", /\d\d\d\d\d\d/],
        ["HHmm", /\d\d\d\d/],
        ["HH", /\d\d/]
      ], aspNetJsonRegex = /^\/?Date\((-?\d+)/i, rfc2822 = /^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/, obsOffsets = {
        UT: 0,
        GMT: 0,
        EDT: -4 * 60,
        EST: -5 * 60,
        CDT: -5 * 60,
        CST: -6 * 60,
        MDT: -6 * 60,
        MST: -7 * 60,
        PDT: -7 * 60,
        PST: -8 * 60
      };
      function configFromISO(config2) {
        var i2, l2, string = config2._i, match = extendedIsoRegex.exec(string) || basicIsoRegex.exec(string), allowTime, dateFormat, timeFormat, tzFormat, isoDatesLen = isoDates.length, isoTimesLen = isoTimes.length;
        if (match) {
          getParsingFlags(config2).iso = true;
          for (i2 = 0, l2 = isoDatesLen; i2 < l2; i2++) {
            if (isoDates[i2][1].exec(match[1])) {
              dateFormat = isoDates[i2][0];
              allowTime = isoDates[i2][2] !== false;
              break;
            }
          }
          if (dateFormat == null) {
            config2._isValid = false;
            return;
          }
          if (match[3]) {
            for (i2 = 0, l2 = isoTimesLen; i2 < l2; i2++) {
              if (isoTimes[i2][1].exec(match[3])) {
                timeFormat = (match[2] || " ") + isoTimes[i2][0];
                break;
              }
            }
            if (timeFormat == null) {
              config2._isValid = false;
              return;
            }
          }
          if (!allowTime && timeFormat != null) {
            config2._isValid = false;
            return;
          }
          if (match[4]) {
            if (tzRegex.exec(match[4])) {
              tzFormat = "Z";
            } else {
              config2._isValid = false;
              return;
            }
          }
          config2._f = dateFormat + (timeFormat || "") + (tzFormat || "");
          configFromStringAndFormat(config2);
        } else {
          config2._isValid = false;
        }
      }
      function extractFromRFC2822Strings(yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr) {
        var result = [
          untruncateYear(yearStr),
          defaultLocaleMonthsShort.indexOf(monthStr),
          parseInt(dayStr, 10),
          parseInt(hourStr, 10),
          parseInt(minuteStr, 10)
        ];
        if (secondStr) {
          result.push(parseInt(secondStr, 10));
        }
        return result;
      }
      function untruncateYear(yearStr) {
        var year = parseInt(yearStr, 10);
        if (year <= 49) {
          return 2e3 + year;
        } else if (year <= 999) {
          return 1900 + year;
        }
        return year;
      }
      function preprocessRFC2822(s) {
        return s.replace(/\([^()]*\)|[\n\t]/g, " ").replace(/(\s\s+)/g, " ").replace(/^\s\s*/, "").replace(/\s\s*$/, "");
      }
      function checkWeekday(weekdayStr, parsedInput, config2) {
        if (weekdayStr) {
          var weekdayProvided = defaultLocaleWeekdaysShort.indexOf(weekdayStr), weekdayActual = new Date(
            parsedInput[0],
            parsedInput[1],
            parsedInput[2]
          ).getDay();
          if (weekdayProvided !== weekdayActual) {
            getParsingFlags(config2).weekdayMismatch = true;
            config2._isValid = false;
            return false;
          }
        }
        return true;
      }
      function calculateOffset(obsOffset, militaryOffset, numOffset) {
        if (obsOffset) {
          return obsOffsets[obsOffset];
        } else if (militaryOffset) {
          return 0;
        } else {
          var hm = parseInt(numOffset, 10), m2 = hm % 100, h2 = (hm - m2) / 100;
          return h2 * 60 + m2;
        }
      }
      function configFromRFC2822(config2) {
        var match = rfc2822.exec(preprocessRFC2822(config2._i)), parsedArray;
        if (match) {
          parsedArray = extractFromRFC2822Strings(
            match[4],
            match[3],
            match[2],
            match[5],
            match[6],
            match[7]
          );
          if (!checkWeekday(match[1], parsedArray, config2)) {
            return;
          }
          config2._a = parsedArray;
          config2._tzm = calculateOffset(match[8], match[9], match[10]);
          config2._d = createUTCDate.apply(null, config2._a);
          config2._d.setUTCMinutes(config2._d.getUTCMinutes() - config2._tzm);
          getParsingFlags(config2).rfc2822 = true;
        } else {
          config2._isValid = false;
        }
      }
      function configFromString(config2) {
        var matched = aspNetJsonRegex.exec(config2._i);
        if (matched !== null) {
          config2._d = /* @__PURE__ */ new Date(+matched[1]);
          return;
        }
        configFromISO(config2);
        if (config2._isValid === false) {
          delete config2._isValid;
        } else {
          return;
        }
        configFromRFC2822(config2);
        if (config2._isValid === false) {
          delete config2._isValid;
        } else {
          return;
        }
        if (config2._strict) {
          config2._isValid = false;
        } else {
          hooks.createFromInputFallback(config2);
        }
      }
      hooks.createFromInputFallback = deprecate(
        "value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",
        function(config2) {
          config2._d = /* @__PURE__ */ new Date(config2._i + (config2._useUTC ? " UTC" : ""));
        }
      );
      function defaults(a, b2, c2) {
        if (a != null) {
          return a;
        }
        if (b2 != null) {
          return b2;
        }
        return c2;
      }
      function currentDateArray(config2) {
        var nowValue = new Date(hooks.now());
        if (config2._useUTC) {
          return [
            nowValue.getUTCFullYear(),
            nowValue.getUTCMonth(),
            nowValue.getUTCDate()
          ];
        }
        return [nowValue.getFullYear(), nowValue.getMonth(), nowValue.getDate()];
      }
      function configFromArray(config2) {
        var i2, date, input = [], currentDate, expectedWeekday, yearToUse;
        if (config2._d) {
          return;
        }
        currentDate = currentDateArray(config2);
        if (config2._w && config2._a[DATE] == null && config2._a[MONTH] == null) {
          dayOfYearFromWeekInfo(config2);
        }
        if (config2._dayOfYear != null) {
          yearToUse = defaults(config2._a[YEAR], currentDate[YEAR]);
          if (config2._dayOfYear > daysInYear(yearToUse) || config2._dayOfYear === 0) {
            getParsingFlags(config2)._overflowDayOfYear = true;
          }
          date = createUTCDate(yearToUse, 0, config2._dayOfYear);
          config2._a[MONTH] = date.getUTCMonth();
          config2._a[DATE] = date.getUTCDate();
        }
        for (i2 = 0; i2 < 3 && config2._a[i2] == null; ++i2) {
          config2._a[i2] = input[i2] = currentDate[i2];
        }
        for (; i2 < 7; i2++) {
          config2._a[i2] = input[i2] = config2._a[i2] == null ? i2 === 2 ? 1 : 0 : config2._a[i2];
        }
        if (config2._a[HOUR] === 24 && config2._a[MINUTE] === 0 && config2._a[SECOND] === 0 && config2._a[MILLISECOND] === 0) {
          config2._nextDay = true;
          config2._a[HOUR] = 0;
        }
        config2._d = (config2._useUTC ? createUTCDate : createDate).apply(
          null,
          input
        );
        expectedWeekday = config2._useUTC ? config2._d.getUTCDay() : config2._d.getDay();
        if (config2._tzm != null) {
          config2._d.setUTCMinutes(config2._d.getUTCMinutes() - config2._tzm);
        }
        if (config2._nextDay) {
          config2._a[HOUR] = 24;
        }
        if (config2._w && typeof config2._w.d !== "undefined" && config2._w.d !== expectedWeekday) {
          getParsingFlags(config2).weekdayMismatch = true;
        }
      }
      function dayOfYearFromWeekInfo(config2) {
        var w2, weekYear2, week, weekday, dow, doy, temp, weekdayOverflow, curWeek;
        w2 = config2._w;
        if (w2.GG != null || w2.W != null || w2.E != null) {
          dow = 1;
          doy = 4;
          weekYear2 = defaults(
            w2.GG,
            config2._a[YEAR],
            weekOfYear(createLocal(), 1, 4).year
          );
          week = defaults(w2.W, 1);
          weekday = defaults(w2.E, 1);
          if (weekday < 1 || weekday > 7) {
            weekdayOverflow = true;
          }
        } else {
          dow = config2._locale._week.dow;
          doy = config2._locale._week.doy;
          curWeek = weekOfYear(createLocal(), dow, doy);
          weekYear2 = defaults(w2.gg, config2._a[YEAR], curWeek.year);
          week = defaults(w2.w, curWeek.week);
          if (w2.d != null) {
            weekday = w2.d;
            if (weekday < 0 || weekday > 6) {
              weekdayOverflow = true;
            }
          } else if (w2.e != null) {
            weekday = w2.e + dow;
            if (w2.e < 0 || w2.e > 6) {
              weekdayOverflow = true;
            }
          } else {
            weekday = dow;
          }
        }
        if (week < 1 || week > weeksInYear(weekYear2, dow, doy)) {
          getParsingFlags(config2)._overflowWeeks = true;
        } else if (weekdayOverflow != null) {
          getParsingFlags(config2)._overflowWeekday = true;
        } else {
          temp = dayOfYearFromWeeks(weekYear2, week, weekday, dow, doy);
          config2._a[YEAR] = temp.year;
          config2._dayOfYear = temp.dayOfYear;
        }
      }
      hooks.ISO_8601 = function() {
      };
      hooks.RFC_2822 = function() {
      };
      function configFromStringAndFormat(config2) {
        if (config2._f === hooks.ISO_8601) {
          configFromISO(config2);
          return;
        }
        if (config2._f === hooks.RFC_2822) {
          configFromRFC2822(config2);
          return;
        }
        config2._a = [];
        getParsingFlags(config2).empty = true;
        var string = "" + config2._i, i2, parsedInput, tokens2, token2, skipped, stringLength = string.length, totalParsedInputLength = 0, era, tokenLen;
        tokens2 = expandFormat(config2._f, config2._locale).match(formattingTokens) || [];
        tokenLen = tokens2.length;
        for (i2 = 0; i2 < tokenLen; i2++) {
          token2 = tokens2[i2];
          parsedInput = (string.match(getParseRegexForToken(token2, config2)) || [])[0];
          if (parsedInput) {
            skipped = string.substr(0, string.indexOf(parsedInput));
            if (skipped.length > 0) {
              getParsingFlags(config2).unusedInput.push(skipped);
            }
            string = string.slice(
              string.indexOf(parsedInput) + parsedInput.length
            );
            totalParsedInputLength += parsedInput.length;
          }
          if (formatTokenFunctions[token2]) {
            if (parsedInput) {
              getParsingFlags(config2).empty = false;
            } else {
              getParsingFlags(config2).unusedTokens.push(token2);
            }
            addTimeToArrayFromToken(token2, parsedInput, config2);
          } else if (config2._strict && !parsedInput) {
            getParsingFlags(config2).unusedTokens.push(token2);
          }
        }
        getParsingFlags(config2).charsLeftOver = stringLength - totalParsedInputLength;
        if (string.length > 0) {
          getParsingFlags(config2).unusedInput.push(string);
        }
        if (config2._a[HOUR] <= 12 && getParsingFlags(config2).bigHour === true && config2._a[HOUR] > 0) {
          getParsingFlags(config2).bigHour = void 0;
        }
        getParsingFlags(config2).parsedDateParts = config2._a.slice(0);
        getParsingFlags(config2).meridiem = config2._meridiem;
        config2._a[HOUR] = meridiemFixWrap(
          config2._locale,
          config2._a[HOUR],
          config2._meridiem
        );
        era = getParsingFlags(config2).era;
        if (era !== null) {
          config2._a[YEAR] = config2._locale.erasConvertYear(era, config2._a[YEAR]);
        }
        configFromArray(config2);
        checkOverflow(config2);
      }
      function meridiemFixWrap(locale2, hour, meridiem2) {
        var isPm;
        if (meridiem2 == null) {
          return hour;
        }
        if (locale2.meridiemHour != null) {
          return locale2.meridiemHour(hour, meridiem2);
        } else if (locale2.isPM != null) {
          isPm = locale2.isPM(meridiem2);
          if (isPm && hour < 12) {
            hour += 12;
          }
          if (!isPm && hour === 12) {
            hour = 0;
          }
          return hour;
        } else {
          return hour;
        }
      }
      function configFromStringAndArray(config2) {
        var tempConfig, bestMoment, scoreToBeat, i2, currentScore, validFormatFound, bestFormatIsValid = false, configfLen = config2._f.length;
        if (configfLen === 0) {
          getParsingFlags(config2).invalidFormat = true;
          config2._d = /* @__PURE__ */ new Date(NaN);
          return;
        }
        for (i2 = 0; i2 < configfLen; i2++) {
          currentScore = 0;
          validFormatFound = false;
          tempConfig = copyConfig({}, config2);
          if (config2._useUTC != null) {
            tempConfig._useUTC = config2._useUTC;
          }
          tempConfig._f = config2._f[i2];
          configFromStringAndFormat(tempConfig);
          if (isValid(tempConfig)) {
            validFormatFound = true;
          }
          currentScore += getParsingFlags(tempConfig).charsLeftOver;
          currentScore += getParsingFlags(tempConfig).unusedTokens.length * 10;
          getParsingFlags(tempConfig).score = currentScore;
          if (!bestFormatIsValid) {
            if (scoreToBeat == null || currentScore < scoreToBeat || validFormatFound) {
              scoreToBeat = currentScore;
              bestMoment = tempConfig;
              if (validFormatFound) {
                bestFormatIsValid = true;
              }
            }
          } else {
            if (currentScore < scoreToBeat) {
              scoreToBeat = currentScore;
              bestMoment = tempConfig;
            }
          }
        }
        extend(config2, bestMoment || tempConfig);
      }
      function configFromObject(config2) {
        if (config2._d) {
          return;
        }
        var i2 = normalizeObjectUnits(config2._i), dayOrDate = i2.day === void 0 ? i2.date : i2.day;
        config2._a = map(
          [i2.year, i2.month, dayOrDate, i2.hour, i2.minute, i2.second, i2.millisecond],
          function(obj2) {
            return obj2 && parseInt(obj2, 10);
          }
        );
        configFromArray(config2);
      }
      function createFromConfig(config2) {
        var res = new Moment(checkOverflow(prepareConfig(config2)));
        if (res._nextDay) {
          res.add(1, "d");
          res._nextDay = void 0;
        }
        return res;
      }
      function prepareConfig(config2) {
        var input = config2._i, format2 = config2._f;
        config2._locale = config2._locale || getLocale(config2._l);
        if (input === null || format2 === void 0 && input === "") {
          return createInvalid({ nullInput: true });
        }
        if (typeof input === "string") {
          config2._i = input = config2._locale.preparse(input);
        }
        if (isMoment(input)) {
          return new Moment(checkOverflow(input));
        } else if (isDate(input)) {
          config2._d = input;
        } else if (isArray(format2)) {
          configFromStringAndArray(config2);
        } else if (format2) {
          configFromStringAndFormat(config2);
        } else {
          configFromInput(config2);
        }
        if (!isValid(config2)) {
          config2._d = null;
        }
        return config2;
      }
      function configFromInput(config2) {
        var input = config2._i;
        if (isUndefined(input)) {
          config2._d = new Date(hooks.now());
        } else if (isDate(input)) {
          config2._d = new Date(input.valueOf());
        } else if (typeof input === "string") {
          configFromString(config2);
        } else if (isArray(input)) {
          config2._a = map(input.slice(0), function(obj2) {
            return parseInt(obj2, 10);
          });
          configFromArray(config2);
        } else if (isObject$1(input)) {
          configFromObject(config2);
        } else if (isNumber(input)) {
          config2._d = new Date(input);
        } else {
          hooks.createFromInputFallback(config2);
        }
      }
      function createLocalOrUTC(input, format2, locale2, strict, isUTC) {
        var c2 = {};
        if (format2 === true || format2 === false) {
          strict = format2;
          format2 = void 0;
        }
        if (locale2 === true || locale2 === false) {
          strict = locale2;
          locale2 = void 0;
        }
        if (isObject$1(input) && isObjectEmpty(input) || isArray(input) && input.length === 0) {
          input = void 0;
        }
        c2._isAMomentObject = true;
        c2._useUTC = c2._isUTC = isUTC;
        c2._l = locale2;
        c2._i = input;
        c2._f = format2;
        c2._strict = strict;
        return createFromConfig(c2);
      }
      function createLocal(input, format2, locale2, strict) {
        return createLocalOrUTC(input, format2, locale2, strict, false);
      }
      var prototypeMin = deprecate(
        "moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",
        function() {
          var other = createLocal.apply(null, arguments);
          if (this.isValid() && other.isValid()) {
            return other < this ? this : other;
          } else {
            return createInvalid();
          }
        }
      ), prototypeMax = deprecate(
        "moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",
        function() {
          var other = createLocal.apply(null, arguments);
          if (this.isValid() && other.isValid()) {
            return other > this ? this : other;
          } else {
            return createInvalid();
          }
        }
      );
      function pickBy(fn, moments) {
        var res, i2;
        if (moments.length === 1 && isArray(moments[0])) {
          moments = moments[0];
        }
        if (!moments.length) {
          return createLocal();
        }
        res = moments[0];
        for (i2 = 1; i2 < moments.length; ++i2) {
          if (!moments[i2].isValid() || moments[i2][fn](res)) {
            res = moments[i2];
          }
        }
        return res;
      }
      function min() {
        var args = [].slice.call(arguments, 0);
        return pickBy("isBefore", args);
      }
      function max() {
        var args = [].slice.call(arguments, 0);
        return pickBy("isAfter", args);
      }
      var now = function() {
        return Date.now ? Date.now() : +/* @__PURE__ */ new Date();
      };
      var ordering = [
        "year",
        "quarter",
        "month",
        "week",
        "day",
        "hour",
        "minute",
        "second",
        "millisecond"
      ];
      function isDurationValid(m2) {
        var key, unitHasDecimal = false, i2, orderLen = ordering.length;
        for (key in m2) {
          if (hasOwnProp(m2, key) && !(indexOf.call(ordering, key) !== -1 && (m2[key] == null || !isNaN(m2[key])))) {
            return false;
          }
        }
        for (i2 = 0; i2 < orderLen; ++i2) {
          if (m2[ordering[i2]]) {
            if (unitHasDecimal) {
              return false;
            }
            if (parseFloat(m2[ordering[i2]]) !== toInt(m2[ordering[i2]])) {
              unitHasDecimal = true;
            }
          }
        }
        return true;
      }
      function isValid$1() {
        return this._isValid;
      }
      function createInvalid$1() {
        return createDuration(NaN);
      }
      function Duration(duration) {
        var normalizedInput = normalizeObjectUnits(duration), years2 = normalizedInput.year || 0, quarters = normalizedInput.quarter || 0, months2 = normalizedInput.month || 0, weeks2 = normalizedInput.week || normalizedInput.isoWeek || 0, days2 = normalizedInput.day || 0, hours2 = normalizedInput.hour || 0, minutes2 = normalizedInput.minute || 0, seconds2 = normalizedInput.second || 0, milliseconds2 = normalizedInput.millisecond || 0;
        this._isValid = isDurationValid(normalizedInput);
        this._milliseconds = +milliseconds2 + seconds2 * 1e3 + // 1000
        minutes2 * 6e4 + // 1000 * 60
        hours2 * 1e3 * 60 * 60;
        this._days = +days2 + weeks2 * 7;
        this._months = +months2 + quarters * 3 + years2 * 12;
        this._data = {};
        this._locale = getLocale();
        this._bubble();
      }
      function isDuration(obj2) {
        return obj2 instanceof Duration;
      }
      function absRound(number) {
        if (number < 0) {
          return Math.round(-1 * number) * -1;
        } else {
          return Math.round(number);
        }
      }
      function compareArrays(array1, array2, dontConvert) {
        var len = Math.min(array1.length, array2.length), lengthDiff = Math.abs(array1.length - array2.length), diffs = 0, i2;
        for (i2 = 0; i2 < len; i2++) {
          if (dontConvert && array1[i2] !== array2[i2] || !dontConvert && toInt(array1[i2]) !== toInt(array2[i2])) {
            diffs++;
          }
        }
        return diffs + lengthDiff;
      }
      function offset(token2, separator) {
        addFormatToken(token2, 0, 0, function() {
          var offset2 = this.utcOffset(), sign2 = "+";
          if (offset2 < 0) {
            offset2 = -offset2;
            sign2 = "-";
          }
          return sign2 + zeroFill(~~(offset2 / 60), 2) + separator + zeroFill(~~offset2 % 60, 2);
        });
      }
      offset("Z", ":");
      offset("ZZ", "");
      addRegexToken("Z", matchShortOffset);
      addRegexToken("ZZ", matchShortOffset);
      addParseToken(["Z", "ZZ"], function(input, array, config2) {
        config2._useUTC = true;
        config2._tzm = offsetFromString(matchShortOffset, input);
      });
      var chunkOffset = /([\+\-]|\d\d)/gi;
      function offsetFromString(matcher, string) {
        var matches2 = (string || "").match(matcher), chunk, parts, minutes2;
        if (matches2 === null) {
          return null;
        }
        chunk = matches2[matches2.length - 1] || [];
        parts = (chunk + "").match(chunkOffset) || ["-", 0, 0];
        minutes2 = +(parts[1] * 60) + toInt(parts[2]);
        return minutes2 === 0 ? 0 : parts[0] === "+" ? minutes2 : -minutes2;
      }
      function cloneWithOffset(input, model) {
        var res, diff2;
        if (model._isUTC) {
          res = model.clone();
          diff2 = (isMoment(input) || isDate(input) ? input.valueOf() : createLocal(input).valueOf()) - res.valueOf();
          res._d.setTime(res._d.valueOf() + diff2);
          hooks.updateOffset(res, false);
          return res;
        } else {
          return createLocal(input).local();
        }
      }
      function getDateOffset(m2) {
        return -Math.round(m2._d.getTimezoneOffset());
      }
      hooks.updateOffset = function() {
      };
      function getSetOffset(input, keepLocalTime, keepMinutes) {
        var offset2 = this._offset || 0, localAdjust;
        if (!this.isValid()) {
          return input != null ? this : NaN;
        }
        if (input != null) {
          if (typeof input === "string") {
            input = offsetFromString(matchShortOffset, input);
            if (input === null) {
              return this;
            }
          } else if (Math.abs(input) < 16 && !keepMinutes) {
            input = input * 60;
          }
          if (!this._isUTC && keepLocalTime) {
            localAdjust = getDateOffset(this);
          }
          this._offset = input;
          this._isUTC = true;
          if (localAdjust != null) {
            this.add(localAdjust, "m");
          }
          if (offset2 !== input) {
            if (!keepLocalTime || this._changeInProgress) {
              addSubtract(
                this,
                createDuration(input - offset2, "m"),
                1,
                false
              );
            } else if (!this._changeInProgress) {
              this._changeInProgress = true;
              hooks.updateOffset(this, true);
              this._changeInProgress = null;
            }
          }
          return this;
        } else {
          return this._isUTC ? offset2 : getDateOffset(this);
        }
      }
      function getSetZone(input, keepLocalTime) {
        if (input != null) {
          if (typeof input !== "string") {
            input = -input;
          }
          this.utcOffset(input, keepLocalTime);
          return this;
        } else {
          return -this.utcOffset();
        }
      }
      function setOffsetToUTC(keepLocalTime) {
        return this.utcOffset(0, keepLocalTime);
      }
      function setOffsetToLocal(keepLocalTime) {
        if (this._isUTC) {
          this.utcOffset(0, keepLocalTime);
          this._isUTC = false;
          if (keepLocalTime) {
            this.subtract(getDateOffset(this), "m");
          }
        }
        return this;
      }
      function setOffsetToParsedOffset() {
        if (this._tzm != null) {
          this.utcOffset(this._tzm, false, true);
        } else if (typeof this._i === "string") {
          var tZone = offsetFromString(matchOffset, this._i);
          if (tZone != null) {
            this.utcOffset(tZone);
          } else {
            this.utcOffset(0, true);
          }
        }
        return this;
      }
      function hasAlignedHourOffset(input) {
        if (!this.isValid()) {
          return false;
        }
        input = input ? createLocal(input).utcOffset() : 0;
        return (this.utcOffset() - input) % 60 === 0;
      }
      function isDaylightSavingTime() {
        return this.utcOffset() > this.clone().month(0).utcOffset() || this.utcOffset() > this.clone().month(5).utcOffset();
      }
      function isDaylightSavingTimeShifted() {
        if (!isUndefined(this._isDSTShifted)) {
          return this._isDSTShifted;
        }
        var c2 = {}, other;
        copyConfig(c2, this);
        c2 = prepareConfig(c2);
        if (c2._a) {
          other = c2._isUTC ? createUTC(c2._a) : createLocal(c2._a);
          this._isDSTShifted = this.isValid() && compareArrays(c2._a, other.toArray()) > 0;
        } else {
          this._isDSTShifted = false;
        }
        return this._isDSTShifted;
      }
      function isLocal() {
        return this.isValid() ? !this._isUTC : false;
      }
      function isUtcOffset() {
        return this.isValid() ? this._isUTC : false;
      }
      function isUtc() {
        return this.isValid() ? this._isUTC && this._offset === 0 : false;
      }
      var aspNetRegex = /^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/, isoRegex = /^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;
      function createDuration(input, key) {
        var duration = input, match = null, sign2, ret, diffRes;
        if (isDuration(input)) {
          duration = {
            ms: input._milliseconds,
            d: input._days,
            M: input._months
          };
        } else if (isNumber(input) || !isNaN(+input)) {
          duration = {};
          if (key) {
            duration[key] = +input;
          } else {
            duration.milliseconds = +input;
          }
        } else if (match = aspNetRegex.exec(input)) {
          sign2 = match[1] === "-" ? -1 : 1;
          duration = {
            y: 0,
            d: toInt(match[DATE]) * sign2,
            h: toInt(match[HOUR]) * sign2,
            m: toInt(match[MINUTE]) * sign2,
            s: toInt(match[SECOND]) * sign2,
            ms: toInt(absRound(match[MILLISECOND] * 1e3)) * sign2
            // the millisecond decimal point is included in the match
          };
        } else if (match = isoRegex.exec(input)) {
          sign2 = match[1] === "-" ? -1 : 1;
          duration = {
            y: parseIso(match[2], sign2),
            M: parseIso(match[3], sign2),
            w: parseIso(match[4], sign2),
            d: parseIso(match[5], sign2),
            h: parseIso(match[6], sign2),
            m: parseIso(match[7], sign2),
            s: parseIso(match[8], sign2)
          };
        } else if (duration == null) {
          duration = {};
        } else if (typeof duration === "object" && ("from" in duration || "to" in duration)) {
          diffRes = momentsDifference(
            createLocal(duration.from),
            createLocal(duration.to)
          );
          duration = {};
          duration.ms = diffRes.milliseconds;
          duration.M = diffRes.months;
        }
        ret = new Duration(duration);
        if (isDuration(input) && hasOwnProp(input, "_locale")) {
          ret._locale = input._locale;
        }
        if (isDuration(input) && hasOwnProp(input, "_isValid")) {
          ret._isValid = input._isValid;
        }
        return ret;
      }
      createDuration.fn = Duration.prototype;
      createDuration.invalid = createInvalid$1;
      function parseIso(inp, sign2) {
        var res = inp && parseFloat(inp.replace(",", "."));
        return (isNaN(res) ? 0 : res) * sign2;
      }
      function positiveMomentsDifference(base, other) {
        var res = {};
        res.months = other.month() - base.month() + (other.year() - base.year()) * 12;
        if (base.clone().add(res.months, "M").isAfter(other)) {
          --res.months;
        }
        res.milliseconds = +other - +base.clone().add(res.months, "M");
        return res;
      }
      function momentsDifference(base, other) {
        var res;
        if (!(base.isValid() && other.isValid())) {
          return { milliseconds: 0, months: 0 };
        }
        other = cloneWithOffset(other, base);
        if (base.isBefore(other)) {
          res = positiveMomentsDifference(base, other);
        } else {
          res = positiveMomentsDifference(other, base);
          res.milliseconds = -res.milliseconds;
          res.months = -res.months;
        }
        return res;
      }
      function createAdder(direction, name) {
        return function(val, period) {
          var dur, tmp;
          if (period !== null && !isNaN(+period)) {
            deprecateSimple(
              name,
              "moment()." + name + "(period, number) is deprecated. Please use moment()." + name + "(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."
            );
            tmp = val;
            val = period;
            period = tmp;
          }
          dur = createDuration(val, period);
          addSubtract(this, dur, direction);
          return this;
        };
      }
      function addSubtract(mom, duration, isAdding, updateOffset) {
        var milliseconds2 = duration._milliseconds, days2 = absRound(duration._days), months2 = absRound(duration._months);
        if (!mom.isValid()) {
          return;
        }
        updateOffset = updateOffset == null ? true : updateOffset;
        if (months2) {
          setMonth(mom, get(mom, "Month") + months2 * isAdding);
        }
        if (days2) {
          set$1(mom, "Date", get(mom, "Date") + days2 * isAdding);
        }
        if (milliseconds2) {
          mom._d.setTime(mom._d.valueOf() + milliseconds2 * isAdding);
        }
        if (updateOffset) {
          hooks.updateOffset(mom, days2 || months2);
        }
      }
      var add = createAdder(1, "add"), subtract = createAdder(-1, "subtract");
      function isString(input) {
        return typeof input === "string" || input instanceof String;
      }
      function isMomentInput(input) {
        return isMoment(input) || isDate(input) || isString(input) || isNumber(input) || isNumberOrStringArray(input) || isMomentInputObject(input) || input === null || input === void 0;
      }
      function isMomentInputObject(input) {
        var objectTest = isObject$1(input) && !isObjectEmpty(input), propertyTest = false, properties = [
          "years",
          "year",
          "y",
          "months",
          "month",
          "M",
          "days",
          "day",
          "d",
          "dates",
          "date",
          "D",
          "hours",
          "hour",
          "h",
          "minutes",
          "minute",
          "m",
          "seconds",
          "second",
          "s",
          "milliseconds",
          "millisecond",
          "ms"
        ], i2, property, propertyLen = properties.length;
        for (i2 = 0; i2 < propertyLen; i2 += 1) {
          property = properties[i2];
          propertyTest = propertyTest || hasOwnProp(input, property);
        }
        return objectTest && propertyTest;
      }
      function isNumberOrStringArray(input) {
        var arrayTest = isArray(input), dataTypeTest = false;
        if (arrayTest) {
          dataTypeTest = input.filter(function(item) {
            return !isNumber(item) && isString(input);
          }).length === 0;
        }
        return arrayTest && dataTypeTest;
      }
      function isCalendarSpec(input) {
        var objectTest = isObject$1(input) && !isObjectEmpty(input), propertyTest = false, properties = [
          "sameDay",
          "nextDay",
          "lastDay",
          "nextWeek",
          "lastWeek",
          "sameElse"
        ], i2, property;
        for (i2 = 0; i2 < properties.length; i2 += 1) {
          property = properties[i2];
          propertyTest = propertyTest || hasOwnProp(input, property);
        }
        return objectTest && propertyTest;
      }
      function getCalendarFormat(myMoment, now2) {
        var diff2 = myMoment.diff(now2, "days", true);
        return diff2 < -6 ? "sameElse" : diff2 < -1 ? "lastWeek" : diff2 < 0 ? "lastDay" : diff2 < 1 ? "sameDay" : diff2 < 2 ? "nextDay" : diff2 < 7 ? "nextWeek" : "sameElse";
      }
      function calendar$1(time, formats) {
        if (arguments.length === 1) {
          if (!arguments[0]) {
            time = void 0;
            formats = void 0;
          } else if (isMomentInput(arguments[0])) {
            time = arguments[0];
            formats = void 0;
          } else if (isCalendarSpec(arguments[0])) {
            formats = arguments[0];
            time = void 0;
          }
        }
        var now2 = time || createLocal(), sod = cloneWithOffset(now2, this).startOf("day"), format2 = hooks.calendarFormat(this, sod) || "sameElse", output = formats && (isFunction(formats[format2]) ? formats[format2].call(this, now2) : formats[format2]);
        return this.format(
          output || this.localeData().calendar(format2, this, createLocal(now2))
        );
      }
      function clone() {
        return new Moment(this);
      }
      function isAfter(input, units) {
        var localInput = isMoment(input) ? input : createLocal(input);
        if (!(this.isValid() && localInput.isValid())) {
          return false;
        }
        units = normalizeUnits(units) || "millisecond";
        if (units === "millisecond") {
          return this.valueOf() > localInput.valueOf();
        } else {
          return localInput.valueOf() < this.clone().startOf(units).valueOf();
        }
      }
      function isBefore(input, units) {
        var localInput = isMoment(input) ? input : createLocal(input);
        if (!(this.isValid() && localInput.isValid())) {
          return false;
        }
        units = normalizeUnits(units) || "millisecond";
        if (units === "millisecond") {
          return this.valueOf() < localInput.valueOf();
        } else {
          return this.clone().endOf(units).valueOf() < localInput.valueOf();
        }
      }
      function isBetween(from2, to2, units, inclusivity) {
        var localFrom = isMoment(from2) ? from2 : createLocal(from2), localTo = isMoment(to2) ? to2 : createLocal(to2);
        if (!(this.isValid() && localFrom.isValid() && localTo.isValid())) {
          return false;
        }
        inclusivity = inclusivity || "()";
        return (inclusivity[0] === "(" ? this.isAfter(localFrom, units) : !this.isBefore(localFrom, units)) && (inclusivity[1] === ")" ? this.isBefore(localTo, units) : !this.isAfter(localTo, units));
      }
      function isSame(input, units) {
        var localInput = isMoment(input) ? input : createLocal(input), inputMs;
        if (!(this.isValid() && localInput.isValid())) {
          return false;
        }
        units = normalizeUnits(units) || "millisecond";
        if (units === "millisecond") {
          return this.valueOf() === localInput.valueOf();
        } else {
          inputMs = localInput.valueOf();
          return this.clone().startOf(units).valueOf() <= inputMs && inputMs <= this.clone().endOf(units).valueOf();
        }
      }
      function isSameOrAfter(input, units) {
        return this.isSame(input, units) || this.isAfter(input, units);
      }
      function isSameOrBefore(input, units) {
        return this.isSame(input, units) || this.isBefore(input, units);
      }
      function diff(input, units, asFloat) {
        var that, zoneDelta, output;
        if (!this.isValid()) {
          return NaN;
        }
        that = cloneWithOffset(input, this);
        if (!that.isValid()) {
          return NaN;
        }
        zoneDelta = (that.utcOffset() - this.utcOffset()) * 6e4;
        units = normalizeUnits(units);
        switch (units) {
          case "year":
            output = monthDiff(this, that) / 12;
            break;
          case "month":
            output = monthDiff(this, that);
            break;
          case "quarter":
            output = monthDiff(this, that) / 3;
            break;
          case "second":
            output = (this - that) / 1e3;
            break;
          case "minute":
            output = (this - that) / 6e4;
            break;
          case "hour":
            output = (this - that) / 36e5;
            break;
          case "day":
            output = (this - that - zoneDelta) / 864e5;
            break;
          case "week":
            output = (this - that - zoneDelta) / 6048e5;
            break;
          default:
            output = this - that;
        }
        return asFloat ? output : absFloor(output);
      }
      function monthDiff(a, b2) {
        if (a.date() < b2.date()) {
          return -monthDiff(b2, a);
        }
        var wholeMonthDiff = (b2.year() - a.year()) * 12 + (b2.month() - a.month()), anchor = a.clone().add(wholeMonthDiff, "months"), anchor2, adjust;
        if (b2 - anchor < 0) {
          anchor2 = a.clone().add(wholeMonthDiff - 1, "months");
          adjust = (b2 - anchor) / (anchor - anchor2);
        } else {
          anchor2 = a.clone().add(wholeMonthDiff + 1, "months");
          adjust = (b2 - anchor) / (anchor2 - anchor);
        }
        return -(wholeMonthDiff + adjust) || 0;
      }
      hooks.defaultFormat = "YYYY-MM-DDTHH:mm:ssZ";
      hooks.defaultFormatUtc = "YYYY-MM-DDTHH:mm:ss[Z]";
      function toString() {
        return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ");
      }
      function toISOString(keepOffset) {
        if (!this.isValid()) {
          return null;
        }
        var utc = keepOffset !== true, m2 = utc ? this.clone().utc() : this;
        if (m2.year() < 0 || m2.year() > 9999) {
          return formatMoment(
            m2,
            utc ? "YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]" : "YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"
          );
        }
        if (isFunction(Date.prototype.toISOString)) {
          if (utc) {
            return this.toDate().toISOString();
          } else {
            return new Date(this.valueOf() + this.utcOffset() * 60 * 1e3).toISOString().replace("Z", formatMoment(m2, "Z"));
          }
        }
        return formatMoment(
          m2,
          utc ? "YYYY-MM-DD[T]HH:mm:ss.SSS[Z]" : "YYYY-MM-DD[T]HH:mm:ss.SSSZ"
        );
      }
      function inspect() {
        if (!this.isValid()) {
          return "moment.invalid(/* " + this._i + " */)";
        }
        var func2 = "moment", zone = "", prefix, year, datetime, suffix;
        if (!this.isLocal()) {
          func2 = this.utcOffset() === 0 ? "moment.utc" : "moment.parseZone";
          zone = "Z";
        }
        prefix = "[" + func2 + '("]';
        year = 0 <= this.year() && this.year() <= 9999 ? "YYYY" : "YYYYYY";
        datetime = "-MM-DD[T]HH:mm:ss.SSS";
        suffix = zone + '[")]';
        return this.format(prefix + year + datetime + suffix);
      }
      function format$2(inputString) {
        if (!inputString) {
          inputString = this.isUtc() ? hooks.defaultFormatUtc : hooks.defaultFormat;
        }
        var output = formatMoment(this, inputString);
        return this.localeData().postformat(output);
      }
      function from(time, withoutSuffix) {
        if (this.isValid() && (isMoment(time) && time.isValid() || createLocal(time).isValid())) {
          return createDuration({ to: this, from: time }).locale(this.locale()).humanize(!withoutSuffix);
        } else {
          return this.localeData().invalidDate();
        }
      }
      function fromNow(withoutSuffix) {
        return this.from(createLocal(), withoutSuffix);
      }
      function to(time, withoutSuffix) {
        if (this.isValid() && (isMoment(time) && time.isValid() || createLocal(time).isValid())) {
          return createDuration({ from: this, to: time }).locale(this.locale()).humanize(!withoutSuffix);
        } else {
          return this.localeData().invalidDate();
        }
      }
      function toNow(withoutSuffix) {
        return this.to(createLocal(), withoutSuffix);
      }
      function locale(key) {
        var newLocaleData;
        if (key === void 0) {
          return this._locale._abbr;
        } else {
          newLocaleData = getLocale(key);
          if (newLocaleData != null) {
            this._locale = newLocaleData;
          }
          return this;
        }
      }
      var lang = deprecate(
        "moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",
        function(key) {
          if (key === void 0) {
            return this.localeData();
          } else {
            return this.locale(key);
          }
        }
      );
      function localeData() {
        return this._locale;
      }
      var MS_PER_SECOND = 1e3, MS_PER_MINUTE = 60 * MS_PER_SECOND, MS_PER_HOUR = 60 * MS_PER_MINUTE, MS_PER_400_YEARS = (365 * 400 + 97) * 24 * MS_PER_HOUR;
      function mod$1(dividend, divisor) {
        return (dividend % divisor + divisor) % divisor;
      }
      function localStartOfDate(y2, m2, d2) {
        if (y2 < 100 && y2 >= 0) {
          return new Date(y2 + 400, m2, d2) - MS_PER_400_YEARS;
        } else {
          return new Date(y2, m2, d2).valueOf();
        }
      }
      function utcStartOfDate(y2, m2, d2) {
        if (y2 < 100 && y2 >= 0) {
          return Date.UTC(y2 + 400, m2, d2) - MS_PER_400_YEARS;
        } else {
          return Date.UTC(y2, m2, d2);
        }
      }
      function startOf(units) {
        var time, startOfDate;
        units = normalizeUnits(units);
        if (units === void 0 || units === "millisecond" || !this.isValid()) {
          return this;
        }
        startOfDate = this._isUTC ? utcStartOfDate : localStartOfDate;
        switch (units) {
          case "year":
            time = startOfDate(this.year(), 0, 1);
            break;
          case "quarter":
            time = startOfDate(
              this.year(),
              this.month() - this.month() % 3,
              1
            );
            break;
          case "month":
            time = startOfDate(this.year(), this.month(), 1);
            break;
          case "week":
            time = startOfDate(
              this.year(),
              this.month(),
              this.date() - this.weekday()
            );
            break;
          case "isoWeek":
            time = startOfDate(
              this.year(),
              this.month(),
              this.date() - (this.isoWeekday() - 1)
            );
            break;
          case "day":
          case "date":
            time = startOfDate(this.year(), this.month(), this.date());
            break;
          case "hour":
            time = this._d.valueOf();
            time -= mod$1(
              time + (this._isUTC ? 0 : this.utcOffset() * MS_PER_MINUTE),
              MS_PER_HOUR
            );
            break;
          case "minute":
            time = this._d.valueOf();
            time -= mod$1(time, MS_PER_MINUTE);
            break;
          case "second":
            time = this._d.valueOf();
            time -= mod$1(time, MS_PER_SECOND);
            break;
        }
        this._d.setTime(time);
        hooks.updateOffset(this, true);
        return this;
      }
      function endOf(units) {
        var time, startOfDate;
        units = normalizeUnits(units);
        if (units === void 0 || units === "millisecond" || !this.isValid()) {
          return this;
        }
        startOfDate = this._isUTC ? utcStartOfDate : localStartOfDate;
        switch (units) {
          case "year":
            time = startOfDate(this.year() + 1, 0, 1) - 1;
            break;
          case "quarter":
            time = startOfDate(
              this.year(),
              this.month() - this.month() % 3 + 3,
              1
            ) - 1;
            break;
          case "month":
            time = startOfDate(this.year(), this.month() + 1, 1) - 1;
            break;
          case "week":
            time = startOfDate(
              this.year(),
              this.month(),
              this.date() - this.weekday() + 7
            ) - 1;
            break;
          case "isoWeek":
            time = startOfDate(
              this.year(),
              this.month(),
              this.date() - (this.isoWeekday() - 1) + 7
            ) - 1;
            break;
          case "day":
          case "date":
            time = startOfDate(this.year(), this.month(), this.date() + 1) - 1;
            break;
          case "hour":
            time = this._d.valueOf();
            time += MS_PER_HOUR - mod$1(
              time + (this._isUTC ? 0 : this.utcOffset() * MS_PER_MINUTE),
              MS_PER_HOUR
            ) - 1;
            break;
          case "minute":
            time = this._d.valueOf();
            time += MS_PER_MINUTE - mod$1(time, MS_PER_MINUTE) - 1;
            break;
          case "second":
            time = this._d.valueOf();
            time += MS_PER_SECOND - mod$1(time, MS_PER_SECOND) - 1;
            break;
        }
        this._d.setTime(time);
        hooks.updateOffset(this, true);
        return this;
      }
      function valueOf() {
        return this._d.valueOf() - (this._offset || 0) * 6e4;
      }
      function unix() {
        return Math.floor(this.valueOf() / 1e3);
      }
      function toDate() {
        return new Date(this.valueOf());
      }
      function toArray() {
        var m2 = this;
        return [
          m2.year(),
          m2.month(),
          m2.date(),
          m2.hour(),
          m2.minute(),
          m2.second(),
          m2.millisecond()
        ];
      }
      function toObject() {
        var m2 = this;
        return {
          years: m2.year(),
          months: m2.month(),
          date: m2.date(),
          hours: m2.hours(),
          minutes: m2.minutes(),
          seconds: m2.seconds(),
          milliseconds: m2.milliseconds()
        };
      }
      function toJSON() {
        return this.isValid() ? this.toISOString() : null;
      }
      function isValid$2() {
        return isValid(this);
      }
      function parsingFlags() {
        return extend({}, getParsingFlags(this));
      }
      function invalidAt() {
        return getParsingFlags(this).overflow;
      }
      function creationData() {
        return {
          input: this._i,
          format: this._f,
          locale: this._locale,
          isUTC: this._isUTC,
          strict: this._strict
        };
      }
      addFormatToken("N", 0, 0, "eraAbbr");
      addFormatToken("NN", 0, 0, "eraAbbr");
      addFormatToken("NNN", 0, 0, "eraAbbr");
      addFormatToken("NNNN", 0, 0, "eraName");
      addFormatToken("NNNNN", 0, 0, "eraNarrow");
      addFormatToken("y", ["y", 1], "yo", "eraYear");
      addFormatToken("y", ["yy", 2], 0, "eraYear");
      addFormatToken("y", ["yyy", 3], 0, "eraYear");
      addFormatToken("y", ["yyyy", 4], 0, "eraYear");
      addRegexToken("N", matchEraAbbr);
      addRegexToken("NN", matchEraAbbr);
      addRegexToken("NNN", matchEraAbbr);
      addRegexToken("NNNN", matchEraName);
      addRegexToken("NNNNN", matchEraNarrow);
      addParseToken(
        ["N", "NN", "NNN", "NNNN", "NNNNN"],
        function(input, array, config2, token2) {
          var era = config2._locale.erasParse(input, token2, config2._strict);
          if (era) {
            getParsingFlags(config2).era = era;
          } else {
            getParsingFlags(config2).invalidEra = input;
          }
        }
      );
      addRegexToken("y", matchUnsigned);
      addRegexToken("yy", matchUnsigned);
      addRegexToken("yyy", matchUnsigned);
      addRegexToken("yyyy", matchUnsigned);
      addRegexToken("yo", matchEraYearOrdinal);
      addParseToken(["y", "yy", "yyy", "yyyy"], YEAR);
      addParseToken(["yo"], function(input, array, config2, token2) {
        var match;
        if (config2._locale._eraYearOrdinalRegex) {
          match = input.match(config2._locale._eraYearOrdinalRegex);
        }
        if (config2._locale.eraYearOrdinalParse) {
          array[YEAR] = config2._locale.eraYearOrdinalParse(input, match);
        } else {
          array[YEAR] = parseInt(input, 10);
        }
      });
      function localeEras(m2, format2) {
        var i2, l2, date, eras = this._eras || getLocale("en")._eras;
        for (i2 = 0, l2 = eras.length; i2 < l2; ++i2) {
          switch (typeof eras[i2].since) {
            case "string":
              date = hooks(eras[i2].since).startOf("day");
              eras[i2].since = date.valueOf();
              break;
          }
          switch (typeof eras[i2].until) {
            case "undefined":
              eras[i2].until = Infinity;
              break;
            case "string":
              date = hooks(eras[i2].until).startOf("day").valueOf();
              eras[i2].until = date.valueOf();
              break;
          }
        }
        return eras;
      }
      function localeErasParse(eraName, format2, strict) {
        var i2, l2, eras = this.eras(), name, abbr, narrow;
        eraName = eraName.toUpperCase();
        for (i2 = 0, l2 = eras.length; i2 < l2; ++i2) {
          name = eras[i2].name.toUpperCase();
          abbr = eras[i2].abbr.toUpperCase();
          narrow = eras[i2].narrow.toUpperCase();
          if (strict) {
            switch (format2) {
              case "N":
              case "NN":
              case "NNN":
                if (abbr === eraName) {
                  return eras[i2];
                }
                break;
              case "NNNN":
                if (name === eraName) {
                  return eras[i2];
                }
                break;
              case "NNNNN":
                if (narrow === eraName) {
                  return eras[i2];
                }
                break;
            }
          } else if ([name, abbr, narrow].indexOf(eraName) >= 0) {
            return eras[i2];
          }
        }
      }
      function localeErasConvertYear(era, year) {
        var dir = era.since <= era.until ? 1 : -1;
        if (year === void 0) {
          return hooks(era.since).year();
        } else {
          return hooks(era.since).year() + (year - era.offset) * dir;
        }
      }
      function getEraName() {
        var i2, l2, val, eras = this.localeData().eras();
        for (i2 = 0, l2 = eras.length; i2 < l2; ++i2) {
          val = this.clone().startOf("day").valueOf();
          if (eras[i2].since <= val && val <= eras[i2].until) {
            return eras[i2].name;
          }
          if (eras[i2].until <= val && val <= eras[i2].since) {
            return eras[i2].name;
          }
        }
        return "";
      }
      function getEraNarrow() {
        var i2, l2, val, eras = this.localeData().eras();
        for (i2 = 0, l2 = eras.length; i2 < l2; ++i2) {
          val = this.clone().startOf("day").valueOf();
          if (eras[i2].since <= val && val <= eras[i2].until) {
            return eras[i2].narrow;
          }
          if (eras[i2].until <= val && val <= eras[i2].since) {
            return eras[i2].narrow;
          }
        }
        return "";
      }
      function getEraAbbr() {
        var i2, l2, val, eras = this.localeData().eras();
        for (i2 = 0, l2 = eras.length; i2 < l2; ++i2) {
          val = this.clone().startOf("day").valueOf();
          if (eras[i2].since <= val && val <= eras[i2].until) {
            return eras[i2].abbr;
          }
          if (eras[i2].until <= val && val <= eras[i2].since) {
            return eras[i2].abbr;
          }
        }
        return "";
      }
      function getEraYear() {
        var i2, l2, dir, val, eras = this.localeData().eras();
        for (i2 = 0, l2 = eras.length; i2 < l2; ++i2) {
          dir = eras[i2].since <= eras[i2].until ? 1 : -1;
          val = this.clone().startOf("day").valueOf();
          if (eras[i2].since <= val && val <= eras[i2].until || eras[i2].until <= val && val <= eras[i2].since) {
            return (this.year() - hooks(eras[i2].since).year()) * dir + eras[i2].offset;
          }
        }
        return this.year();
      }
      function erasNameRegex(isStrict) {
        if (!hasOwnProp(this, "_erasNameRegex")) {
          computeErasParse.call(this);
        }
        return isStrict ? this._erasNameRegex : this._erasRegex;
      }
      function erasAbbrRegex(isStrict) {
        if (!hasOwnProp(this, "_erasAbbrRegex")) {
          computeErasParse.call(this);
        }
        return isStrict ? this._erasAbbrRegex : this._erasRegex;
      }
      function erasNarrowRegex(isStrict) {
        if (!hasOwnProp(this, "_erasNarrowRegex")) {
          computeErasParse.call(this);
        }
        return isStrict ? this._erasNarrowRegex : this._erasRegex;
      }
      function matchEraAbbr(isStrict, locale2) {
        return locale2.erasAbbrRegex(isStrict);
      }
      function matchEraName(isStrict, locale2) {
        return locale2.erasNameRegex(isStrict);
      }
      function matchEraNarrow(isStrict, locale2) {
        return locale2.erasNarrowRegex(isStrict);
      }
      function matchEraYearOrdinal(isStrict, locale2) {
        return locale2._eraYearOrdinalRegex || matchUnsigned;
      }
      function computeErasParse() {
        var abbrPieces = [], namePieces = [], narrowPieces = [], mixedPieces = [], i2, l2, erasName, erasAbbr, erasNarrow, eras = this.eras();
        for (i2 = 0, l2 = eras.length; i2 < l2; ++i2) {
          erasName = regexEscape(eras[i2].name);
          erasAbbr = regexEscape(eras[i2].abbr);
          erasNarrow = regexEscape(eras[i2].narrow);
          namePieces.push(erasName);
          abbrPieces.push(erasAbbr);
          narrowPieces.push(erasNarrow);
          mixedPieces.push(erasName);
          mixedPieces.push(erasAbbr);
          mixedPieces.push(erasNarrow);
        }
        this._erasRegex = new RegExp("^(" + mixedPieces.join("|") + ")", "i");
        this._erasNameRegex = new RegExp("^(" + namePieces.join("|") + ")", "i");
        this._erasAbbrRegex = new RegExp("^(" + abbrPieces.join("|") + ")", "i");
        this._erasNarrowRegex = new RegExp(
          "^(" + narrowPieces.join("|") + ")",
          "i"
        );
      }
      addFormatToken(0, ["gg", 2], 0, function() {
        return this.weekYear() % 100;
      });
      addFormatToken(0, ["GG", 2], 0, function() {
        return this.isoWeekYear() % 100;
      });
      function addWeekYearFormatToken(token2, getter) {
        addFormatToken(0, [token2, token2.length], 0, getter);
      }
      addWeekYearFormatToken("gggg", "weekYear");
      addWeekYearFormatToken("ggggg", "weekYear");
      addWeekYearFormatToken("GGGG", "isoWeekYear");
      addWeekYearFormatToken("GGGGG", "isoWeekYear");
      addRegexToken("G", matchSigned);
      addRegexToken("g", matchSigned);
      addRegexToken("GG", match1to2, match2);
      addRegexToken("gg", match1to2, match2);
      addRegexToken("GGGG", match1to4, match4);
      addRegexToken("gggg", match1to4, match4);
      addRegexToken("GGGGG", match1to6, match6);
      addRegexToken("ggggg", match1to6, match6);
      addWeekParseToken(
        ["gggg", "ggggg", "GGGG", "GGGGG"],
        function(input, week, config2, token2) {
          week[token2.substr(0, 2)] = toInt(input);
        }
      );
      addWeekParseToken(["gg", "GG"], function(input, week, config2, token2) {
        week[token2] = hooks.parseTwoDigitYear(input);
      });
      function getSetWeekYear(input) {
        return getSetWeekYearHelper.call(
          this,
          input,
          this.week(),
          this.weekday() + this.localeData()._week.dow,
          this.localeData()._week.dow,
          this.localeData()._week.doy
        );
      }
      function getSetISOWeekYear(input) {
        return getSetWeekYearHelper.call(
          this,
          input,
          this.isoWeek(),
          this.isoWeekday(),
          1,
          4
        );
      }
      function getISOWeeksInYear() {
        return weeksInYear(this.year(), 1, 4);
      }
      function getISOWeeksInISOWeekYear() {
        return weeksInYear(this.isoWeekYear(), 1, 4);
      }
      function getWeeksInYear() {
        var weekInfo = this.localeData()._week;
        return weeksInYear(this.year(), weekInfo.dow, weekInfo.doy);
      }
      function getWeeksInWeekYear() {
        var weekInfo = this.localeData()._week;
        return weeksInYear(this.weekYear(), weekInfo.dow, weekInfo.doy);
      }
      function getSetWeekYearHelper(input, week, weekday, dow, doy) {
        var weeksTarget;
        if (input == null) {
          return weekOfYear(this, dow, doy).year;
        } else {
          weeksTarget = weeksInYear(input, dow, doy);
          if (week > weeksTarget) {
            week = weeksTarget;
          }
          return setWeekAll.call(this, input, week, weekday, dow, doy);
        }
      }
      function setWeekAll(weekYear2, week, weekday, dow, doy) {
        var dayOfYearData = dayOfYearFromWeeks(weekYear2, week, weekday, dow, doy), date = createUTCDate(dayOfYearData.year, 0, dayOfYearData.dayOfYear);
        this.year(date.getUTCFullYear());
        this.month(date.getUTCMonth());
        this.date(date.getUTCDate());
        return this;
      }
      addFormatToken("Q", 0, "Qo", "quarter");
      addRegexToken("Q", match1);
      addParseToken("Q", function(input, array) {
        array[MONTH] = (toInt(input) - 1) * 3;
      });
      function getSetQuarter(input) {
        return input == null ? Math.ceil((this.month() + 1) / 3) : this.month((input - 1) * 3 + this.month() % 3);
      }
      addFormatToken("D", ["DD", 2], "Do", "date");
      addRegexToken("D", match1to2, match1to2NoLeadingZero);
      addRegexToken("DD", match1to2, match2);
      addRegexToken("Do", function(isStrict, locale2) {
        return isStrict ? locale2._dayOfMonthOrdinalParse || locale2._ordinalParse : locale2._dayOfMonthOrdinalParseLenient;
      });
      addParseToken(["D", "DD"], DATE);
      addParseToken("Do", function(input, array) {
        array[DATE] = toInt(input.match(match1to2)[0]);
      });
      var getSetDayOfMonth = makeGetSet("Date", true);
      addFormatToken("DDD", ["DDDD", 3], "DDDo", "dayOfYear");
      addRegexToken("DDD", match1to3);
      addRegexToken("DDDD", match3);
      addParseToken(["DDD", "DDDD"], function(input, array, config2) {
        config2._dayOfYear = toInt(input);
      });
      function getSetDayOfYear(input) {
        var dayOfYear = Math.round(
          (this.clone().startOf("day") - this.clone().startOf("year")) / 864e5
        ) + 1;
        return input == null ? dayOfYear : this.add(input - dayOfYear, "d");
      }
      addFormatToken("m", ["mm", 2], 0, "minute");
      addRegexToken("m", match1to2, match1to2HasZero);
      addRegexToken("mm", match1to2, match2);
      addParseToken(["m", "mm"], MINUTE);
      var getSetMinute = makeGetSet("Minutes", false);
      addFormatToken("s", ["ss", 2], 0, "second");
      addRegexToken("s", match1to2, match1to2HasZero);
      addRegexToken("ss", match1to2, match2);
      addParseToken(["s", "ss"], SECOND);
      var getSetSecond = makeGetSet("Seconds", false);
      addFormatToken("S", 0, 0, function() {
        return ~~(this.millisecond() / 100);
      });
      addFormatToken(0, ["SS", 2], 0, function() {
        return ~~(this.millisecond() / 10);
      });
      addFormatToken(0, ["SSS", 3], 0, "millisecond");
      addFormatToken(0, ["SSSS", 4], 0, function() {
        return this.millisecond() * 10;
      });
      addFormatToken(0, ["SSSSS", 5], 0, function() {
        return this.millisecond() * 100;
      });
      addFormatToken(0, ["SSSSSS", 6], 0, function() {
        return this.millisecond() * 1e3;
      });
      addFormatToken(0, ["SSSSSSS", 7], 0, function() {
        return this.millisecond() * 1e4;
      });
      addFormatToken(0, ["SSSSSSSS", 8], 0, function() {
        return this.millisecond() * 1e5;
      });
      addFormatToken(0, ["SSSSSSSSS", 9], 0, function() {
        return this.millisecond() * 1e6;
      });
      addRegexToken("S", match1to3, match1);
      addRegexToken("SS", match1to3, match2);
      addRegexToken("SSS", match1to3, match3);
      var token, getSetMillisecond;
      for (token = "SSSS"; token.length <= 9; token += "S") {
        addRegexToken(token, matchUnsigned);
      }
      function parseMs(input, array) {
        array[MILLISECOND] = toInt(("0." + input) * 1e3);
      }
      for (token = "S"; token.length <= 9; token += "S") {
        addParseToken(token, parseMs);
      }
      getSetMillisecond = makeGetSet("Milliseconds", false);
      addFormatToken("z", 0, 0, "zoneAbbr");
      addFormatToken("zz", 0, 0, "zoneName");
      function getZoneAbbr() {
        return this._isUTC ? "UTC" : "";
      }
      function getZoneName() {
        return this._isUTC ? "Coordinated Universal Time" : "";
      }
      var proto = Moment.prototype;
      proto.add = add;
      proto.calendar = calendar$1;
      proto.clone = clone;
      proto.diff = diff;
      proto.endOf = endOf;
      proto.format = format$2;
      proto.from = from;
      proto.fromNow = fromNow;
      proto.to = to;
      proto.toNow = toNow;
      proto.get = stringGet;
      proto.invalidAt = invalidAt;
      proto.isAfter = isAfter;
      proto.isBefore = isBefore;
      proto.isBetween = isBetween;
      proto.isSame = isSame;
      proto.isSameOrAfter = isSameOrAfter;
      proto.isSameOrBefore = isSameOrBefore;
      proto.isValid = isValid$2;
      proto.lang = lang;
      proto.locale = locale;
      proto.localeData = localeData;
      proto.max = prototypeMax;
      proto.min = prototypeMin;
      proto.parsingFlags = parsingFlags;
      proto.set = stringSet;
      proto.startOf = startOf;
      proto.subtract = subtract;
      proto.toArray = toArray;
      proto.toObject = toObject;
      proto.toDate = toDate;
      proto.toISOString = toISOString;
      proto.inspect = inspect;
      if (typeof Symbol !== "undefined" && Symbol.for != null) {
        proto[Symbol.for("nodejs.util.inspect.custom")] = function() {
          return "Moment<" + this.format() + ">";
        };
      }
      proto.toJSON = toJSON;
      proto.toString = toString;
      proto.unix = unix;
      proto.valueOf = valueOf;
      proto.creationData = creationData;
      proto.eraName = getEraName;
      proto.eraNarrow = getEraNarrow;
      proto.eraAbbr = getEraAbbr;
      proto.eraYear = getEraYear;
      proto.year = getSetYear;
      proto.isLeapYear = getIsLeapYear;
      proto.weekYear = getSetWeekYear;
      proto.isoWeekYear = getSetISOWeekYear;
      proto.quarter = proto.quarters = getSetQuarter;
      proto.month = getSetMonth;
      proto.daysInMonth = getDaysInMonth;
      proto.week = proto.weeks = getSetWeek;
      proto.isoWeek = proto.isoWeeks = getSetISOWeek;
      proto.weeksInYear = getWeeksInYear;
      proto.weeksInWeekYear = getWeeksInWeekYear;
      proto.isoWeeksInYear = getISOWeeksInYear;
      proto.isoWeeksInISOWeekYear = getISOWeeksInISOWeekYear;
      proto.date = getSetDayOfMonth;
      proto.day = proto.days = getSetDayOfWeek;
      proto.weekday = getSetLocaleDayOfWeek;
      proto.isoWeekday = getSetISODayOfWeek;
      proto.dayOfYear = getSetDayOfYear;
      proto.hour = proto.hours = getSetHour;
      proto.minute = proto.minutes = getSetMinute;
      proto.second = proto.seconds = getSetSecond;
      proto.millisecond = proto.milliseconds = getSetMillisecond;
      proto.utcOffset = getSetOffset;
      proto.utc = setOffsetToUTC;
      proto.local = setOffsetToLocal;
      proto.parseZone = setOffsetToParsedOffset;
      proto.hasAlignedHourOffset = hasAlignedHourOffset;
      proto.isDST = isDaylightSavingTime;
      proto.isLocal = isLocal;
      proto.isUtcOffset = isUtcOffset;
      proto.isUtc = isUtc;
      proto.isUTC = isUtc;
      proto.zoneAbbr = getZoneAbbr;
      proto.zoneName = getZoneName;
      proto.dates = deprecate(
        "dates accessor is deprecated. Use date instead.",
        getSetDayOfMonth
      );
      proto.months = deprecate(
        "months accessor is deprecated. Use month instead",
        getSetMonth
      );
      proto.years = deprecate(
        "years accessor is deprecated. Use year instead",
        getSetYear
      );
      proto.zone = deprecate(
        "moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",
        getSetZone
      );
      proto.isDSTShifted = deprecate(
        "isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",
        isDaylightSavingTimeShifted
      );
      function createUnix(input) {
        return createLocal(input * 1e3);
      }
      function createInZone() {
        return createLocal.apply(null, arguments).parseZone();
      }
      function preParsePostFormat(string) {
        return string;
      }
      var proto$1 = Locale.prototype;
      proto$1.calendar = calendar;
      proto$1.longDateFormat = longDateFormat;
      proto$1.invalidDate = invalidDate;
      proto$1.ordinal = ordinal;
      proto$1.preparse = preParsePostFormat;
      proto$1.postformat = preParsePostFormat;
      proto$1.relativeTime = relativeTime;
      proto$1.pastFuture = pastFuture;
      proto$1.set = set;
      proto$1.eras = localeEras;
      proto$1.erasParse = localeErasParse;
      proto$1.erasConvertYear = localeErasConvertYear;
      proto$1.erasAbbrRegex = erasAbbrRegex;
      proto$1.erasNameRegex = erasNameRegex;
      proto$1.erasNarrowRegex = erasNarrowRegex;
      proto$1.months = localeMonths;
      proto$1.monthsShort = localeMonthsShort;
      proto$1.monthsParse = localeMonthsParse;
      proto$1.monthsRegex = monthsRegex;
      proto$1.monthsShortRegex = monthsShortRegex;
      proto$1.week = localeWeek;
      proto$1.firstDayOfYear = localeFirstDayOfYear;
      proto$1.firstDayOfWeek = localeFirstDayOfWeek;
      proto$1.weekdays = localeWeekdays;
      proto$1.weekdaysMin = localeWeekdaysMin;
      proto$1.weekdaysShort = localeWeekdaysShort;
      proto$1.weekdaysParse = localeWeekdaysParse;
      proto$1.weekdaysRegex = weekdaysRegex;
      proto$1.weekdaysShortRegex = weekdaysShortRegex;
      proto$1.weekdaysMinRegex = weekdaysMinRegex;
      proto$1.isPM = localeIsPM;
      proto$1.meridiem = localeMeridiem;
      function get$1(format2, index2, field, setter2) {
        var locale2 = getLocale(), utc = createUTC().set(setter2, index2);
        return locale2[field](utc, format2);
      }
      function listMonthsImpl(format2, index2, field) {
        if (isNumber(format2)) {
          index2 = format2;
          format2 = void 0;
        }
        format2 = format2 || "";
        if (index2 != null) {
          return get$1(format2, index2, field, "month");
        }
        var i2, out = [];
        for (i2 = 0; i2 < 12; i2++) {
          out[i2] = get$1(format2, i2, field, "month");
        }
        return out;
      }
      function listWeekdaysImpl(localeSorted, format2, index2, field) {
        if (typeof localeSorted === "boolean") {
          if (isNumber(format2)) {
            index2 = format2;
            format2 = void 0;
          }
          format2 = format2 || "";
        } else {
          format2 = localeSorted;
          index2 = format2;
          localeSorted = false;
          if (isNumber(format2)) {
            index2 = format2;
            format2 = void 0;
          }
          format2 = format2 || "";
        }
        var locale2 = getLocale(), shift = localeSorted ? locale2._week.dow : 0, i2, out = [];
        if (index2 != null) {
          return get$1(format2, (index2 + shift) % 7, field, "day");
        }
        for (i2 = 0; i2 < 7; i2++) {
          out[i2] = get$1(format2, (i2 + shift) % 7, field, "day");
        }
        return out;
      }
      function listMonths(format2, index2) {
        return listMonthsImpl(format2, index2, "months");
      }
      function listMonthsShort(format2, index2) {
        return listMonthsImpl(format2, index2, "monthsShort");
      }
      function listWeekdays(localeSorted, format2, index2) {
        return listWeekdaysImpl(localeSorted, format2, index2, "weekdays");
      }
      function listWeekdaysShort(localeSorted, format2, index2) {
        return listWeekdaysImpl(localeSorted, format2, index2, "weekdaysShort");
      }
      function listWeekdaysMin(localeSorted, format2, index2) {
        return listWeekdaysImpl(localeSorted, format2, index2, "weekdaysMin");
      }
      getSetGlobalLocale("en", {
        eras: [
          {
            since: "0001-01-01",
            until: Infinity,
            offset: 1,
            name: "Anno Domini",
            narrow: "AD",
            abbr: "AD"
          },
          {
            since: "0000-12-31",
            until: -Infinity,
            offset: 1,
            name: "Before Christ",
            narrow: "BC",
            abbr: "BC"
          }
        ],
        dayOfMonthOrdinalParse: /\d{1,2}(th|st|nd|rd)/,
        ordinal: function(number) {
          var b2 = number % 10, output = toInt(number % 100 / 10) === 1 ? "th" : b2 === 1 ? "st" : b2 === 2 ? "nd" : b2 === 3 ? "rd" : "th";
          return number + output;
        }
      });
      hooks.lang = deprecate(
        "moment.lang is deprecated. Use moment.locale instead.",
        getSetGlobalLocale
      );
      hooks.langData = deprecate(
        "moment.langData is deprecated. Use moment.localeData instead.",
        getLocale
      );
      var mathAbs = Math.abs;
      function abs() {
        var data = this._data;
        this._milliseconds = mathAbs(this._milliseconds);
        this._days = mathAbs(this._days);
        this._months = mathAbs(this._months);
        data.milliseconds = mathAbs(data.milliseconds);
        data.seconds = mathAbs(data.seconds);
        data.minutes = mathAbs(data.minutes);
        data.hours = mathAbs(data.hours);
        data.months = mathAbs(data.months);
        data.years = mathAbs(data.years);
        return this;
      }
      function addSubtract$1(duration, input, value, direction) {
        var other = createDuration(input, value);
        duration._milliseconds += direction * other._milliseconds;
        duration._days += direction * other._days;
        duration._months += direction * other._months;
        return duration._bubble();
      }
      function add$1(input, value) {
        return addSubtract$1(this, input, value, 1);
      }
      function subtract$1(input, value) {
        return addSubtract$1(this, input, value, -1);
      }
      function absCeil(number) {
        if (number < 0) {
          return Math.floor(number);
        } else {
          return Math.ceil(number);
        }
      }
      function bubble() {
        var milliseconds2 = this._milliseconds, days2 = this._days, months2 = this._months, data = this._data, seconds2, minutes2, hours2, years2, monthsFromDays;
        if (!(milliseconds2 >= 0 && days2 >= 0 && months2 >= 0 || milliseconds2 <= 0 && days2 <= 0 && months2 <= 0)) {
          milliseconds2 += absCeil(monthsToDays(months2) + days2) * 864e5;
          days2 = 0;
          months2 = 0;
        }
        data.milliseconds = milliseconds2 % 1e3;
        seconds2 = absFloor(milliseconds2 / 1e3);
        data.seconds = seconds2 % 60;
        minutes2 = absFloor(seconds2 / 60);
        data.minutes = minutes2 % 60;
        hours2 = absFloor(minutes2 / 60);
        data.hours = hours2 % 24;
        days2 += absFloor(hours2 / 24);
        monthsFromDays = absFloor(daysToMonths(days2));
        months2 += monthsFromDays;
        days2 -= absCeil(monthsToDays(monthsFromDays));
        years2 = absFloor(months2 / 12);
        months2 %= 12;
        data.days = days2;
        data.months = months2;
        data.years = years2;
        return this;
      }
      function daysToMonths(days2) {
        return days2 * 4800 / 146097;
      }
      function monthsToDays(months2) {
        return months2 * 146097 / 4800;
      }
      function as(units) {
        if (!this.isValid()) {
          return NaN;
        }
        var days2, months2, milliseconds2 = this._milliseconds;
        units = normalizeUnits(units);
        if (units === "month" || units === "quarter" || units === "year") {
          days2 = this._days + milliseconds2 / 864e5;
          months2 = this._months + daysToMonths(days2);
          switch (units) {
            case "month":
              return months2;
            case "quarter":
              return months2 / 3;
            case "year":
              return months2 / 12;
          }
        } else {
          days2 = this._days + Math.round(monthsToDays(this._months));
          switch (units) {
            case "week":
              return days2 / 7 + milliseconds2 / 6048e5;
            case "day":
              return days2 + milliseconds2 / 864e5;
            case "hour":
              return days2 * 24 + milliseconds2 / 36e5;
            case "minute":
              return days2 * 1440 + milliseconds2 / 6e4;
            case "second":
              return days2 * 86400 + milliseconds2 / 1e3;
            case "millisecond":
              return Math.floor(days2 * 864e5) + milliseconds2;
            default:
              throw new Error("Unknown unit " + units);
          }
        }
      }
      function makeAs(alias) {
        return function() {
          return this.as(alias);
        };
      }
      var asMilliseconds = makeAs("ms"), asSeconds = makeAs("s"), asMinutes = makeAs("m"), asHours = makeAs("h"), asDays = makeAs("d"), asWeeks = makeAs("w"), asMonths = makeAs("M"), asQuarters = makeAs("Q"), asYears = makeAs("y"), valueOf$1 = asMilliseconds;
      function clone$1() {
        return createDuration(this);
      }
      function get$2(units) {
        units = normalizeUnits(units);
        return this.isValid() ? this[units + "s"]() : NaN;
      }
      function makeGetter(name) {
        return function() {
          return this.isValid() ? this._data[name] : NaN;
        };
      }
      var milliseconds = makeGetter("milliseconds"), seconds = makeGetter("seconds"), minutes = makeGetter("minutes"), hours = makeGetter("hours"), days$1 = makeGetter("days"), months$1 = makeGetter("months"), years = makeGetter("years");
      function weeks() {
        return absFloor(this.days() / 7);
      }
      var round = Math.round, thresholds = {
        ss: 44,
        // a few seconds to seconds
        s: 45,
        // seconds to minute
        m: 45,
        // minutes to hour
        h: 22,
        // hours to day
        d: 26,
        // days to month/week
        w: null,
        // weeks to month
        M: 11
        // months to year
      };
      function substituteTimeAgo(string, number, withoutSuffix, isFuture, locale2) {
        return locale2.relativeTime(number || 1, !!withoutSuffix, string, isFuture);
      }
      function relativeTime$1(posNegDuration, withoutSuffix, thresholds2, locale2) {
        var duration = createDuration(posNegDuration).abs(), seconds2 = round(duration.as("s")), minutes2 = round(duration.as("m")), hours2 = round(duration.as("h")), days2 = round(duration.as("d")), months2 = round(duration.as("M")), weeks2 = round(duration.as("w")), years2 = round(duration.as("y")), a = seconds2 <= thresholds2.ss && ["s", seconds2] || seconds2 < thresholds2.s && ["ss", seconds2] || minutes2 <= 1 && ["m"] || minutes2 < thresholds2.m && ["mm", minutes2] || hours2 <= 1 && ["h"] || hours2 < thresholds2.h && ["hh", hours2] || days2 <= 1 && ["d"] || days2 < thresholds2.d && ["dd", days2];
        if (thresholds2.w != null) {
          a = a || weeks2 <= 1 && ["w"] || weeks2 < thresholds2.w && ["ww", weeks2];
        }
        a = a || months2 <= 1 && ["M"] || months2 < thresholds2.M && ["MM", months2] || years2 <= 1 && ["y"] || ["yy", years2];
        a[2] = withoutSuffix;
        a[3] = +posNegDuration > 0;
        a[4] = locale2;
        return substituteTimeAgo.apply(null, a);
      }
      function getSetRelativeTimeRounding(roundingFunction) {
        if (roundingFunction === void 0) {
          return round;
        }
        if (typeof roundingFunction === "function") {
          round = roundingFunction;
          return true;
        }
        return false;
      }
      function getSetRelativeTimeThreshold(threshold, limit) {
        if (thresholds[threshold] === void 0) {
          return false;
        }
        if (limit === void 0) {
          return thresholds[threshold];
        }
        thresholds[threshold] = limit;
        if (threshold === "s") {
          thresholds.ss = limit - 1;
        }
        return true;
      }
      function humanize(argWithSuffix, argThresholds) {
        if (!this.isValid()) {
          return this.localeData().invalidDate();
        }
        var withSuffix = false, th = thresholds, locale2, output;
        if (typeof argWithSuffix === "object") {
          argThresholds = argWithSuffix;
          argWithSuffix = false;
        }
        if (typeof argWithSuffix === "boolean") {
          withSuffix = argWithSuffix;
        }
        if (typeof argThresholds === "object") {
          th = Object.assign({}, thresholds, argThresholds);
          if (argThresholds.s != null && argThresholds.ss == null) {
            th.ss = argThresholds.s - 1;
          }
        }
        locale2 = this.localeData();
        output = relativeTime$1(this, !withSuffix, th, locale2);
        if (withSuffix) {
          output = locale2.pastFuture(+this, output);
        }
        return locale2.postformat(output);
      }
      var abs$1 = Math.abs;
      function sign(x2) {
        return (x2 > 0) - (x2 < 0) || +x2;
      }
      function toISOString$1() {
        if (!this.isValid()) {
          return this.localeData().invalidDate();
        }
        var seconds2 = abs$1(this._milliseconds) / 1e3, days2 = abs$1(this._days), months2 = abs$1(this._months), minutes2, hours2, years2, s, total = this.asSeconds(), totalSign, ymSign, daysSign, hmsSign;
        if (!total) {
          return "P0D";
        }
        minutes2 = absFloor(seconds2 / 60);
        hours2 = absFloor(minutes2 / 60);
        seconds2 %= 60;
        minutes2 %= 60;
        years2 = absFloor(months2 / 12);
        months2 %= 12;
        s = seconds2 ? seconds2.toFixed(3).replace(/\.?0+$/, "") : "";
        totalSign = total < 0 ? "-" : "";
        ymSign = sign(this._months) !== sign(total) ? "-" : "";
        daysSign = sign(this._days) !== sign(total) ? "-" : "";
        hmsSign = sign(this._milliseconds) !== sign(total) ? "-" : "";
        return totalSign + "P" + (years2 ? ymSign + years2 + "Y" : "") + (months2 ? ymSign + months2 + "M" : "") + (days2 ? daysSign + days2 + "D" : "") + (hours2 || minutes2 || seconds2 ? "T" : "") + (hours2 ? hmsSign + hours2 + "H" : "") + (minutes2 ? hmsSign + minutes2 + "M" : "") + (seconds2 ? hmsSign + s + "S" : "");
      }
      var proto$2 = Duration.prototype;
      proto$2.isValid = isValid$1;
      proto$2.abs = abs;
      proto$2.add = add$1;
      proto$2.subtract = subtract$1;
      proto$2.as = as;
      proto$2.asMilliseconds = asMilliseconds;
      proto$2.asSeconds = asSeconds;
      proto$2.asMinutes = asMinutes;
      proto$2.asHours = asHours;
      proto$2.asDays = asDays;
      proto$2.asWeeks = asWeeks;
      proto$2.asMonths = asMonths;
      proto$2.asQuarters = asQuarters;
      proto$2.asYears = asYears;
      proto$2.valueOf = valueOf$1;
      proto$2._bubble = bubble;
      proto$2.clone = clone$1;
      proto$2.get = get$2;
      proto$2.milliseconds = milliseconds;
      proto$2.seconds = seconds;
      proto$2.minutes = minutes;
      proto$2.hours = hours;
      proto$2.days = days$1;
      proto$2.weeks = weeks;
      proto$2.months = months$1;
      proto$2.years = years;
      proto$2.humanize = humanize;
      proto$2.toISOString = toISOString$1;
      proto$2.toString = toISOString$1;
      proto$2.toJSON = toISOString$1;
      proto$2.locale = locale;
      proto$2.localeData = localeData;
      proto$2.toIsoString = deprecate(
        "toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",
        toISOString$1
      );
      proto$2.lang = lang;
      addFormatToken("X", 0, 0, "unix");
      addFormatToken("x", 0, 0, "valueOf");
      addRegexToken("x", matchSigned);
      addRegexToken("X", matchTimestamp);
      addParseToken("X", function(input, array, config2) {
        config2._d = new Date(parseFloat(input) * 1e3);
      });
      addParseToken("x", function(input, array, config2) {
        config2._d = new Date(toInt(input));
      });
      //! moment.js
      hooks.version = "2.30.1";
      setHookCallback(createLocal);
      hooks.fn = proto;
      hooks.min = min;
      hooks.max = max;
      hooks.now = now;
      hooks.utc = createUTC;
      hooks.unix = createUnix;
      hooks.months = listMonths;
      hooks.isDate = isDate;
      hooks.locale = getSetGlobalLocale;
      hooks.invalid = createInvalid;
      hooks.duration = createDuration;
      hooks.isMoment = isMoment;
      hooks.weekdays = listWeekdays;
      hooks.parseZone = createInZone;
      hooks.localeData = getLocale;
      hooks.isDuration = isDuration;
      hooks.monthsShort = listMonthsShort;
      hooks.weekdaysMin = listWeekdaysMin;
      hooks.defineLocale = defineLocale;
      hooks.updateLocale = updateLocale;
      hooks.locales = listLocales;
      hooks.weekdaysShort = listWeekdaysShort;
      hooks.normalizeUnits = normalizeUnits;
      hooks.relativeTimeRounding = getSetRelativeTimeRounding;
      hooks.relativeTimeThreshold = getSetRelativeTimeThreshold;
      hooks.calendarFormat = getCalendarFormat;
      hooks.prototype = proto;
      hooks.HTML5_FMT = {
        DATETIME_LOCAL: "YYYY-MM-DDTHH:mm",
        // <input type="datetime-local" />
        DATETIME_LOCAL_SECONDS: "YYYY-MM-DDTHH:mm:ss",
        // <input type="datetime-local" step="1" />
        DATETIME_LOCAL_MS: "YYYY-MM-DDTHH:mm:ss.SSS",
        // <input type="datetime-local" step="0.001" />
        DATE: "YYYY-MM-DD",
        // <input type="date" />
        TIME: "HH:mm",
        // <input type="time" />
        TIME_SECONDS: "HH:mm:ss",
        // <input type="time" step="1" />
        TIME_MS: "HH:mm:ss.SSS",
        // <input type="time" step="0.001" />
        WEEK: "GGGG-[W]WW",
        // <input type="week" />
        MONTH: "YYYY-MM"
        // <input type="month" />
      };
      const moment = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
        __proto__: null,
        default: hooks
      }, Symbol.toStringTag, { value: "Module" }));
      var noop$a = func.noop, bindCtx$1 = func.bindCtx;
      var PRESET_COLOR_REG = /blue|green|orange|red|turquoise|yellow/;
      var Tag = (
        /** @class */
        function(_super) {
          __extends(Tag2, _super);
          function Tag2(props) {
            var _this = _super.call(this, props) || this;
            _this.tagNode = null;
            _this.onKeyDown = function(e2) {
              var _a = _this.props, closable = _a.closable, closeArea = _a.closeArea, onClick = _a.onClick, disabled = _a.disabled;
              if (e2.keyCode !== KEYCODE.SPACE || disabled) {
                return;
              }
              e2.preventDefault();
              e2.stopPropagation();
              if (closable) {
                _this.handleClose(closeArea);
              } else {
                return onClick(e2);
              }
            };
            _this.state = {
              visible: true
            };
            bindCtx$1(_this, [
              "handleBodyClick",
              "handleTailClick",
              "handleAnimationInit",
              "handleAnimationEnd",
              "renderTailNode"
            ]);
            return _this;
          }
          Tag2.prototype.componentWillUnmount = function() {
            this.__destroyed = true;
          };
          Tag2.prototype.handleClose = function(from2) {
            var _this = this;
            var _a = this.props, animation2 = _a.animation, onClose = _a.onClose;
            var hasAnimation = support.animation && animation2;
            var result = onClose(from2, this.tagNode);
            if (result !== false && !this.__destroyed) {
              this.setState({
                visible: false
              }, function() {
                !hasAnimation && _this.props.afterClose(_this.tagNode);
              });
            }
          };
          Tag2.prototype.handleBodyClick = function(e2) {
            var _a = this.props, closable = _a.closable, closeArea = _a.closeArea, onClick = _a.onClick;
            var node = e2.currentTarget;
            if (node && (node === e2.target || node.contains(e2.target))) {
              if (closable && closeArea === "tag") {
                this.handleClose("tag");
              }
              if (typeof onClick === "function") {
                return onClick(e2);
              }
            }
          };
          Tag2.prototype.handleTailClick = function(e2) {
            e2 && e2.preventDefault();
            e2 && e2.stopPropagation();
            this.handleClose("tail");
          };
          Tag2.prototype.handleAnimationInit = function(node) {
            this.props.afterAppear(node);
          };
          Tag2.prototype.handleAnimationEnd = function(node) {
            this.props.afterClose(node);
          };
          Tag2.prototype.renderAnimatedTag = function(children, animationName) {
            return React__default.createElement(Animate, { animation: animationName, afterAppear: this.handleAnimationInit, afterLeave: this.handleAnimationEnd }, children);
          };
          Tag2.prototype.renderTailNode = function() {
            var _a = this.props, prefix = _a.prefix, closable = _a.closable, locale2 = _a.locale;
            if (!closable) {
              return null;
            }
            return React__default.createElement(
              "span",
              { className: "".concat(prefix, "tag-close-btn"), onClick: this.handleTailClick, role: "button", "aria-label": locale2.delete },
              React__default.createElement(Icon, { type: "close" })
            );
          };
          Tag2.prototype.isPresetColor = function() {
            var color = this.props.color;
            if (!color) {
              return false;
            }
            return PRESET_COLOR_REG.test(color);
          };
          Tag2.prototype.getTagStyle = function() {
            var _a = this.props, _b = _a.color, color = _b === void 0 ? "" : _b, style = _a.style;
            var isPresetColor = this.isPresetColor();
            var customColorStyle = {
              backgroundColor: color,
              borderColor: color,
              color: "#fff"
            };
            return __assign(__assign({}, color && !isPresetColor ? customColorStyle : null), style);
          };
          Tag2.prototype.render = function() {
            var _a;
            var _this = this;
            var _b = this.props, prefix = _b.prefix, type2 = _b.type, size2 = _b.size, color = _b.color, _shape = _b._shape, closable = _b.closable, closeArea = _b.closeArea, className = _b.className, children = _b.children, animation2 = _b.animation, disabled = _b.disabled, rtl = _b.rtl;
            var visible = this.state.visible;
            var isPresetColor = this.isPresetColor();
            var others = obj.pickOthers(Tag2.propTypes, this.props);
            others.style;
            var otherTagProps = __rest(others, ["style"]);
            var shape = closable ? "closable" : _shape;
            var bodyClazz = classnames(["".concat(prefix, "tag"), "".concat(prefix, "tag-").concat(shape), "".concat(prefix, "tag-").concat(size2)], (_a = {}, _a["".concat(prefix, "tag-level-").concat(type2)] = !color, _a["".concat(prefix, "tag-closable")] = closable, _a["".concat(prefix, "tag-body-pointer")] = closable && closeArea === "tag", _a["".concat(prefix, "tag-").concat(color)] = color && isPresetColor && type2 === "primary", _a["".concat(prefix, "tag-").concat(color, "-inverse")] = color && isPresetColor && type2 === "normal", _a), className);
            var tailNode = this.renderTailNode();
            var tagNode = !visible ? null : React__default.createElement(
              "div",
              __assign({
                className: bodyClazz,
                onClick: this.handleBodyClick,
                onKeyDown: this.onKeyDown,
                // @ts-expect-error tagIndex required number
                tabIndex: disabled ? "" : "0",
                role: "button",
                "aria-disabled": disabled,
                disabled,
                dir: rtl ? "rtl" : void 0,
                ref: function(n2) {
                  return _this.tagNode = n2;
                },
                style: this.getTagStyle()
              }, otherTagProps),
              React__default.createElement("span", { className: "".concat(prefix, "tag-body") }, children),
              tailNode
            );
            if (animation2 && support.animation) {
              return this.renderAnimatedTag(tagNode, "".concat(prefix, "tag-zoom"));
            }
            return tagNode;
          };
          Tag2.propTypes = __assign(__assign({}, ConfigProvider$1.propTypes), { type: PT.oneOf(["normal", "primary"]), size: PT.oneOf(["small", "medium", "large"]), color: PT.string, animation: PT.bool, closeArea: PT.oneOf(["tag", "tail"]), closable: PT.bool, onClose: PT.func, afterClose: PT.func, afterAppear: PT.func, className: PT.any, children: PT.node, onClick: PT.func, _shape: PT.oneOf(["default", "closable", "checkable"]), disabled: PT.bool, rtl: PT.bool, locale: PT.object });
          Tag2.defaultProps = {
            prefix: "next-",
            type: "normal",
            size: "medium",
            closeArea: "tail",
            animation: false,
            onClose: noop$a,
            afterClose: noop$a,
            afterAppear: noop$a,
            onClick: noop$a,
            _shape: "default",
            disabled: false,
            rtl: false,
            locale: locale$1.Tag
          };
          return Tag2;
        }(React__default.Component)
      );
      const Tag$1 = ConfigProvider$1.config(Tag);
      var Group$2 = (
        /** @class */
        function(_super) {
          __extends(Group2, _super);
          function Group2() {
            return _super !== null && _super.apply(this, arguments) || this;
          }
          Group2.prototype.render = function() {
            var _a = this.props, className = _a.className, prefix = _a.prefix, children = _a.children, rtl = _a.rtl, others = __rest(_a, ["className", "prefix", "children", "rtl"]);
            var clazz = classnames("".concat(prefix || "next-", "tag-group"), className);
            return React__default.createElement("div", __assign({ className: clazz, dir: rtl ? "rtl" : void 0 }, others), children);
          };
          Group2.defaultProps = {
            prefix: "next-",
            rtl: false
          };
          return Group2;
        }(React__default.Component)
      );
      const Group$3 = Group$2;
      var noop$9 = func.noop, bindCtx = func.bindCtx;
      var Selectable = (
        /** @class */
        function(_super) {
          __extends(Selectable2, _super);
          function Selectable2(props) {
            var _this = _super.call(this, props) || this;
            _this.state = {
              checked: "checked" in props ? props.checked : props.defaultChecked || false
            };
            bindCtx(_this, ["handleClick"]);
            return _this;
          }
          Selectable2.getDerivedStateFromProps = function(props, state) {
            if (props.checked !== void 0 && props.checked !== state.checked) {
              return {
                checked: props.checked
              };
            }
            return null;
          };
          Selectable2.prototype.handleClick = function(e2) {
            e2 && e2.preventDefault();
            if (this.props.disabled) {
              return false;
            }
            var checked = this.state.checked;
            this.setState({
              checked: !checked
            });
            this.props.onChange(!checked, e2);
          };
          Selectable2.prototype.render = function() {
            var attrFilterTarget = [
              "checked",
              "defaultChecked",
              "onChange",
              "className",
              // 防止这些额外的参数影响 tag 的类型
              "_shape",
              "closable"
            ];
            var others = obj.pickOthers(attrFilterTarget, this.props);
            var isChecked2 = "checked" in this.props ? this.props.checked : this.state.checked;
            var clazz = classnames(this.props.className, {
              checked: isChecked2
            });
            return React__default.createElement(Tag$1, __assign({}, others, { role: "checkbox", _shape: "checkable", "aria-checked": isChecked2, className: clazz, onClick: this.handleClick }));
          };
          Selectable2.defaultProps = {
            onChange: noop$9
          };
          return Selectable2;
        }(React__default.Component)
      );
      const Selectable$1 = polyfill(Selectable);
      var Closeable = (
        /** @class */
        function(_super) {
          __extends(Closeable2, _super);
          function Closeable2() {
            return _super !== null && _super.apply(this, arguments) || this;
          }
          Closeable2.prototype.render = function() {
            var _a = this.props, disabled = _a.disabled, className = _a.className, closeArea = _a.closeArea, onClose = _a.onClose, afterClose = _a.afterClose, onClick = _a.onClick, type2 = _a.type, size2 = _a.size, children = _a.children, rtl = _a.rtl, others = __rest(_a, ["disabled", "className", "closeArea", "onClose", "afterClose", "onClick", "type", "size", "children", "rtl"]);
            return React__default.createElement(Tag$1, __assign({}, others, { rtl, disabled, className, closeArea, onClose, afterClose, onClick, type: type2, size: size2, closable: true }), children);
          };
          Closeable2.defaultProps = {
            disabled: false,
            type: "normal"
          };
          return Closeable2;
        }(React__default.Component)
      );
      const Closable = Closeable;
      var ConfigTag = ConfigProvider$1.config(Tag$1, {
        transform: function(props, deprecated2) {
          var _a = props, shape = _a.shape, type2 = _a.type;
          if (shape === "selectable") {
            deprecated2("shape=selectable", "Tag.Selectable", "Tag");
          }
          if (shape === "deletable") {
            deprecated2("shape=deletable", "Tag.Closeable", "Tag");
          }
          if (shape === "link") {
            deprecated2("shape=link", '<Tag><a href="x">x</a></Tag>', "Tag");
          }
          if (shape === "readonly" || shape === "interactive") {
            log.warning("Warning: [ shape=".concat(shape, " ] is deprecated at [ Tag ]"));
          }
          if (type2 === "secondary") {
            log.warning("Warning: [ type=secondary ] is deprecated at [ Tag ]");
          }
          ["count", "marked", "value", "onChange"].forEach(function(key) {
            if (key in props) {
              log.warning("Warning: [ ".concat(key, " ] is deprecated at [ Tag ]"));
            }
          });
          if ("selected" in props || "defaultSelected" in props) {
            log.warning("Warning: [ selected|defaultSelected  ] is deprecated at [ Tag ], use [ checked|defaultChecked ] at [ Tag.Selectable ] instead of it");
          }
          if ("closed" in props) {
            log.warning("Warning: [ closed  ] is deprecated at [ Tag ], use [ onClose ] at [ Tag.Closeable ] instead of it");
          }
          if ("onSelect" in props) {
            deprecated2("onSelect", "<Tag.Selectable onChange/>", "Tag");
          }
          if ("afterClose" in props) {
            log.warning("Warning: [ afterClose  ] is deprecated at [ Tag ], use [ afterClose ] at [ Tag.Closeable ] instead of it");
          }
          return props;
        }
      });
      var ConfigClosable = ConfigProvider$1.config(Closable);
      var TagWithSub = assignSubComponent(ConfigTag, {
        Group: ConfigProvider$1.config(Group$3),
        Selectable: ConfigProvider$1.config(Selectable$1),
        // 有的地方叫做 Closeable 有的地方用 Closeable, 为了保持兼容 文档类出现 Closeable, Closeable 可以继续用
        Closable: ConfigClosable,
        Closeable: ConfigClosable
      });
      var _class$E, _temp2$h;
      var Base$1 = (_temp2$h = _class$E = function(_React$Component) {
        _default(Base2, _React$Component);
        function Base2() {
          var _temp3, _this, _ret;
          _default$3(this, Base2);
          for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
            args[_key] = arguments[_key];
          }
          return _ret = (_temp3 = (_this = _default$1(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.handleCompositionStart = function(e2) {
            _this.setState({
              composition: true
            });
            _this.props.onCompositionStart(e2);
          }, _this.handleCompositionEnd = function(e2) {
            _this.setState({
              composition: false
            });
            _this.props.onCompositionEnd(e2);
            var value = e2.target.value;
            _this.props.onChange(value, e2);
          }, _this.handleKeyDownFromClear = function(e2) {
            if (e2.keyCode === 13) {
              _this.onClear(e2);
            }
          }, _this.saveRef = function(input) {
            _this.inputRef = input;
          }, _temp3), _default$1(_this, _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 onChange(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.onClear = function onClear(e2) {
          if (this.props.disabled) {
            return;
          }
          if (!("value" in this.props)) {
            this.setState({
              value: ""
            });
          }
          this.props.onChange("", e2, "clear");
          this.focus();
        };
        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__default.createElement(
            "span",
            { className: classesLenWrap },
            content
          ) : 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__default.Component), _class$E.propTypes = _default$5({}, ConfigProvider$1.propTypes, {
        /**
         * 当前值
         */
        value: PT.oneOfType([PT.string, PT.number]),
        /**
         * 初始化值
         */
        defaultValue: PT.oneOfType([PT.string, PT.number]),
        /**
         * 发生改变的时候触发的回调
         * @param {String} value 数据
         * @param {Event} e DOM事件对象
         */
        onChange: PT.func,
        /**
         * 键盘按下的时候触发的回调
         * @param {Event} e DOM事件对象
         * @param {Object} opts 可扩展的附加信息:<br> - opts.overMaxLength: {Boolean} 已超出最大长度<br> - opts.beTrimed: {Boolean} 输入的空格被清理
         */
        onKeyDown: PT.func,
        /**
         * 禁用状态
         */
        disabled: PT.bool,
        /**
         * 最大长度
         */
        maxLength: PT.number,
        /**
         * 是否展现最大长度样式(旧版本为 hasLimitHint,目前仍兼容旧用法,将在2.x直接废弃)
         */
        showLimitHint: PT.bool,
        /**
         * 当设置了maxLength时,是否截断超出字符串
         */
        cutString: PT.bool,
        /**
         * 只读
         */
        readOnly: PT.bool,
        /**
         * onChange返回会自动去除头尾空字符
         */
        trim: PT.bool,
        /**
         * 输入提示
         */
        placeholder: PT.string,
        /**
         * 获取焦点时候触发的回调
         * @param {Event} e DOM事件对象
         */
        onFocus: PT.func,
        /**
         * 失去焦点时候触发的回调
         * @param {Event} e DOM事件对象
         */
        onBlur: PT.func,
        /**
         * 自定义字符串计算长度方式
         * @param {String} value 数据
         * @returns {Number} 自定义长度
         */
        getValueLength: PT.func,
        inputStyle: PT.object,
        /**
         * 自定义class
         */
        className: PT.string,
        /**
         * 自定义内联样式
         */
        style: PT.object,
        /**
         * 原生type
         */
        htmlType: PT.string,
        /**
         * name
         */
        name: PT.string,
        rtl: PT.bool,
        state: PT.oneOf(["error", "loading", "success", "warning"]),
        locale: PT.object,
        /**
         * 是否为预览态
         */
        isPreview: PT.bool,
        /**
         * 预览态模式下渲染的内容
         * @param {number} value 评分值
         */
        renderPreview: PT.func,
        /**
         * 尺寸
         * @enumdesc 小, 中, 大
         */
        size: PT.oneOf(["small", "medium", "large"]),
        /**
         * 开启后会过滤输入法中间字母状态,文字输入完成后才会触发 onChange
         * @version 1.23
         */
        composition: PT.bool,
        onCompositionStart: PT.func,
        onCompositionEnd: PT.func
      }), _class$E.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: locale$1.Input
      }, _temp2$h);
      Base$1.displayName = "Base";
      const Base$2 = polyfill(Base$1);
      var _class$D, _temp$m;
      var Group = (_temp$m = _class$D = function(_React$Component) {
        _default(Group2, _React$Component);
        function Group2() {
          _default$3(this, Group2);
          return _default$1(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$4(_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__default.createElement(
            "span",
            { className: beforeCls },
            addonBefore
          ) : null;
          var after = addonAfter ? React__default.createElement(
            "span",
            { className: afterCls },
            addonAfter
          ) : null;
          return React__default.createElement(
            "span",
            _default$5({}, others, { disabled, dir: rtl ? "rtl" : void 0, className: cls, style }),
            before,
            children,
            after
          );
        };
        return Group2;
      }(React__default.Component), _class$D.displayName = "Group", _class$D.propTypes = {
        /**
         * 样式前缀
         */
        prefix: PT.string,
        className: PT.string,
        style: PT.object,
        children: PT.node,
        /**
         * 输入框前附加内容
         */
        addonBefore: PT.node,
        /**
         * 输入框前附加内容css
         */
        addonBeforeClassName: PT.string,
        /**
         * 输入框后附加内容
         */
        addonAfter: PT.node,
        /**
         * 输入框后额外css
         */
        addonAfterClassName: PT.string,
        /**
         * rtl
         */
        rtl: PT.bool
      }, _class$D.defaultProps = {
        prefix: "next-"
      }, _temp$m);
      Group.displayName = "Group";
      const Group$1 = ConfigProvider$1.config(Group);
      var _class$C, _temp$l;
      function preventDefault$2(e2) {
        e2.preventDefault();
      }
      var Input$1 = (_temp$l = _class$C = function(_Base) {
        _default(Input2, _Base);
        function Input2(props) {
          _default$3(this, Input2);
          var _this = _default$1(this, _Base.call(this, props));
          _this.handleKeyDown = function(e2) {
            if (e2.keyCode === 13) {
              _this.props.onPressEnter(e2);
            }
            _this.onKeyDown(e2);
          };
          var value = void 0;
          if ("value" in props) {
            value = props.value;
          } else {
            value = props.defaultValue;
          }
          _this.state = {
            value: typeof value === "undefined" ? "" : value
          };
          return _this;
        }
        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, locale2 = _props.locale, disabled = _props.disabled, hoverShowClear = _props.hoverShowClear;
          var lenWrap = this.renderLength();
          var stateWrap = null;
          if (state === "success") {
            stateWrap = React__default.createElement(Icon, { type: "success-filling", className: prefix + "input-success-icon" });
          } else if (state === "loading") {
            stateWrap = React__default.createElement(Icon, { type: "loading", className: prefix + "input-loading-icon" });
          } else if (state === "warning") {
            stateWrap = React__default.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__default.createElement(Icon, { type: hint, className: prefix + "input-hint" });
              } else if (React__default.isValidElement(hint)) {
                hintIcon = React__default.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__default.createElement(Icon, {
                type: "delete-filling",
                role: "button",
                tabIndex: "0",
                className: cls,
                "aria-label": locale2.clear,
                onClick: this.onClear.bind(this),
                onMouseDown: preventDefault$2,
                onKeyDown: this.handleKeyDownFromClear
              });
            }
            clearWrap = React__default.createElement(
              "span",
              { className: prefix + "input-hint-wrap" },
              hasClear && hint ? React__default.createElement(Icon, {
                type: "delete-filling",
                role: "button",
                tabIndex: "0",
                className: prefix + "input-clear " + prefix + "input-clear-icon",
                "aria-label": locale2.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__default.createElement(
            "span",
            { onClick: function onClick() {
              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__default.createElement(
            "label",
            { className: prefix + "input-label", htmlFor: id2 },
            label
          ) : null;
        };
        Input2.prototype.renderInner = function renderInner(inner, cls) {
          return inner ? React__default.createElement(
            "span",
            { className: cls },
            inner
          ) : null;
        };
        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, inputRender = _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$5({}, dataProps, Input2.propTypes), this.props);
          if (isPreview) {
            var value = props.value;
            var label = this.props.label;
            if (typeof renderPreview === "function") {
              return React__default.createElement(
                "div",
                _default$5({}, others, { className: previewCls }),
                renderPreview(value, this.props)
              );
            }
            return React__default.createElement(
              "div",
              _default$5({}, 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__default.createElement("input", _default$5({}, others, props, compositionProps, {
            height: "100%",
            type: htmlType,
            size: htmlSize,
            autoFocus,
            autoComplete,
            onKeyDown: this.handleKeyDown,
            ref: this.saveRef
          }));
          var inputWrap = React__default.createElement(
            "span",
            _default$5({}, dataProps, { dir: rtl ? "rtl" : void 0, className: cls, style: hasAddon ? void 0 : style }),
            this.renderLabel(),
            this.renderInner(innerBefore, innerBeforeCls),
            inputRender(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__default.createElement(
              Group$1,
              _default$5({}, dataProps, {
                prefix,
                className,
                style,
                disabled,
                addonBefore: addonBefore || addonTextBefore,
                addonBeforeClassName: addonBeforeCls,
                addonAfter: addonAfter || addonTextAfter,
                addonAfterClassName: addonAfterCls
              }),
              inputWrap
            );
          }
          return inputWrap;
        };
        return Input2;
      }(Base$2), _class$C.displayName = "Input", _class$C.getDerivedStateFromProps = Base$2.getDerivedStateFromProps, _class$C.propTypes = _default$5({}, Base$2.propTypes, {
        /**
         * label
         */
        label: PT.node,
        /**
         * 是否出现clear按钮
         */
        hasClear: PT.bool,
        /**
         * 是否有边框
         */
        hasBorder: PT.bool,
        /**
         * 状态
         * @enumdesc 错误, 校验中, 成功, 警告
         */
        state: PT.oneOf(["error", "loading", "success", "warning"]),
        /**
         * 按下回车的回调
         */
        onPressEnter: PT.func,
        /**
         * 原生type
         */
        htmlType: PT.string,
        htmlSize: PT.string,
        /**
         * 水印 (Icon的type类型,和hasClear占用一个地方)
         */
        hint: PT.oneOfType([PT.string, PT.node]),
        /**
         * 文字前附加内容
         */
        innerBefore: PT.node,
        /**
         * 文字后附加内容
         */
        innerAfter: PT.node,
        /**
         * 输入框前附加内容
         */
        addonBefore: PT.node,
        /**
         * 输入框后附加内容
         */
        addonAfter: PT.node,
        /**
         * 输入框前附加文字
         */
        addonTextBefore: PT.node,
        /**
         * 输入框后附加文字
         */
        addonTextAfter: PT.node,
        /**
         * (原生input支持)
         */
        autoComplete: PT.string,
        /**
         * 自动聚焦(原生input支持)
         */
        autoFocus: PT.bool,
        inputRender: PT.func,
        extra: PT.node,
        innerBeforeClassName: PT.string,
        innerAfterClassName: PT.string,
        /**
         * 是否为预览态
         */
        isPreview: PT.bool,
        /**
         * 预览态模式下渲染的内容
         * @param {number} value 评分值
         */
        renderPreview: PT.func,
        /**
         * hover展示clear (配合 hasClear=true使用)
         * @version 1.24
         */
        hoverShowClear: PT.bool
      }), _class$C.defaultProps = _default$5({}, Base$2.defaultProps, {
        autoComplete: "off",
        hasBorder: true,
        isPreview: false,
        hoverShowClear: false,
        onPressEnter: func.noop,
        inputRender: function inputRender(el) {
          return el;
        }
      }), _temp$l);
      const Input$2 = Input$1;
      var _class$B, _temp2$g;
      function preventDefault$1(e2) {
        e2.preventDefault();
      }
      var Password = (_temp2$g = _class$B = function(_Input) {
        _default(Password2, _Input);
        function Password2() {
          var _temp3, _this, _ret;
          _default$3(this, Password2);
          for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
            args[_key] = arguments[_key];
          }
          return _ret = (_temp3 = (_this = _default$1(this, _Input.call.apply(_Input, [this].concat(args))), _this), _this.state = {
            hint: "eye-close",
            htmlType: "password"
          }, _this.toggleEye = function(e2) {
            e2.preventDefault();
            if (_this.props.disabled)
              return;
            var eyeClose = _this.state.hint === "eye";
            _this.setState({
              hint: eyeClose ? "eye-close" : "eye",
              htmlType: eyeClose || !_this.props.showToggle ? "password" : "text"
            });
          }, _temp3), _default$1(_this, _ret);
        }
        Password2.prototype.render = function render2() {
          var _props = this.props, showToggle = _props.showToggle, others = _default$4(_props, ["showToggle"]);
          var _state = this.state, hint = _state.hint, htmlType = _state.htmlType;
          var extra = showToggle ? React__default.createElement(Icon, { type: hint, onClick: this.toggleEye, onMouseDown: preventDefault$1 }) : null;
          return React__default.createElement(Input$2, _default$5({}, others, { extra, htmlType }));
        };
        return Password2;
      }(Input$2), _class$B.displayName = "Password", _class$B.getDerivedStateFromProps = Input$2.getDerivedStateFromProps, _class$B.propTypes = _default$5({}, Input$2.propTypes, {
        /**
         * 是否展示切换按钮
         */
        showToggle: PT.bool
      }), _class$B.defaultProps = _default$5({}, Input$2.defaultProps, {
        showToggle: true
      }), _temp2$g);
      var _class$A, _temp$k, _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$k = _class$A = function(_Base) {
        _default(TextArea2, _Base);
        function TextArea2(props) {
          _default$3(this, TextArea2);
          var _this = _default$1(this, _Base.call(this, props));
          _initialiseProps$1.call(_this);
          var value = void 0;
          if ("value" in props) {
            value = props.value;
          } else {
            value = props.defaultValue;
          }
          _this.state = {
            value: typeof value === "undefined" || value === null ? "" : value
          };
          return _this;
        }
        TextArea2.prototype.componentDidMount = function componentDidMount() {
          var autoHeight = this.props.autoHeight;
          if (autoHeight) {
            if ((typeof autoHeight === "undefined" ? "undefined" : _default$2(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.renderClear = function renderClear() {
          var _classNames;
          var _props2 = this.props, hasClear = _props2.hasClear, readOnly = _props2.readOnly, state = _props2.state, prefix = _props2.prefix, disabled = _props2.disabled, locale2 = _props2.locale;
          var clearWrap = null;
          var showClear = hasClear && !readOnly && !!("" + this.state.value) && !disabled;
          var cls = classnames((_classNames = {}, _classNames[prefix + "input-textarea-clear"] = true, _classNames));
          clearWrap = showClear ? React__default.createElement(
            "span",
            {
              className: cls,
              onClick: this.onClear.bind(this),
              onKeyDown: this.handleKeyDownFromClear
            },
            " ",
            locale2.clear
          ) : null;
          if (state === "loading") {
            clearWrap = null;
          }
          return clearWrap;
        };
        TextArea2.prototype.renderControl = function renderControl() {
          var _this2 = this;
          var prefix = this.props.prefix;
          var lenWrap = this.renderLength();
          var clearText = this.renderClear();
          var isShowLine = Boolean(lenWrap && clearText);
          var cls = classnames(prefix + "input-control", prefix + "input-textarea-control");
          return lenWrap || clearText ? React__default.createElement(
            "span",
            { onClick: function onClick() {
              return _this2.focus();
            }, className: cls },
            lenWrap,
            isShowLine && React__default.createElement("span", { className: prefix + "input-textarea-control-line" }),
            clearText
          ) : null;
        };
        TextArea2.prototype.render = function render2() {
          var _classNames2, _classNames3;
          var _props3 = this.props, rows = _props3.rows, style = _props3.style, className = _props3.className, autoHeight = _props3.autoHeight, isPreview = _props3.isPreview, renderPreview = _props3.renderPreview, prefix = _props3.prefix, rtl = _props3.rtl, hasBorder = _props3.hasBorder, size2 = _props3.size, composition = _props3.composition;
          var cls = classnames(this.getClass(), (_classNames2 = {}, _classNames2["" + prefix + size2] = size2 === "large" || false, _classNames2[prefix + "input-textarea"] = true, _classNames2[prefix + "noborder"] = !hasBorder, _classNames2[className] = !!className, _classNames2));
          var props = this.getProps();
          var dataProps = obj.pickAttrsWith(this.props, "data-");
          var others = obj.pickOthers(_default$5({}, dataProps, TextArea2.propTypes), this.props);
          var textareStyle = _default$5({}, props.style, {
            height: this.state.height,
            minHeight: this.state.minHeight,
            maxHeight: this.state.maxHeight,
            overflowY: this.state.overflowY
          });
          var previewCls = classnames((_classNames3 = {}, _classNames3[prefix + "input-textarea"] = true, _classNames3[prefix + "form-preview"] = true, _classNames3[className] = !!className, _classNames3));
          var wrapStyle = autoHeight ? _default$5({}, style, { position: "relative" }) : style;
          if (isPreview) {
            var value = props.value;
            if ("renderPreview" in this.props) {
              return React__default.createElement(
                "div",
                _default$5({}, others, { className: previewCls }),
                renderPreview(value, this.props)
              );
            }
            return React__default.createElement(
              "div",
              _default$5({}, others, { className: previewCls }),
              value.split("\n").map(function(data, i2) {
                return React__default.createElement(
                  "p",
                  { key: "p-" + i2 },
                  data
                );
              })
            );
          }
          var compositionProps = {};
          if (composition) {
            compositionProps.onCompositionStart = this.handleCompositionStart;
            compositionProps.onCompositionEnd = this.handleCompositionEnd;
          }
          return React__default.createElement(
            "span",
            _default$5({ className: cls, style: wrapStyle, dir: rtl ? "rtl" : void 0 }, dataProps),
            React__default.createElement("textarea", _default$5({}, others, props, compositionProps, {
              "data-real": true,
              rows,
              style: textareStyle,
              ref: this.saveRef.bind(this),
              onKeyDown: this.onKeyDown.bind(this)
            })),
            autoHeight ? React__default.createElement("textarea", {
              "data-fake": true,
              ref: this.saveHelpRef.bind(this),
              style: _default$5({}, props.style, hiddenStyle),
              rows: "1"
            }) : null,
            this.renderControl()
          );
        };
        return TextArea2;
      }(Base$2), _class$A.displayName = "TextArea", _class$A.getDerivedStateFromProps = Base$2.getDerivedStateFromProps, _class$A.propTypes = _default$5({}, Base$2.propTypes, {
        /**
         * 是否有边框
         */
        hasBorder: PT.bool,
        /**
         * 状态
         * @enumdesc 错误
         */
        state: PT.oneOf(["error", "warning"]),
        /**
         * 自动高度 true / {minRows: 2, maxRows: 4}
         */
        autoHeight: PT.oneOfType([PT.bool, PT.object]),
        /**
         * 多行文本框高度 <br />(不要直接用height设置多行文本框的高度, ie9 10会有兼容性问题)
         */
        rows: PT.number,
        /**
         * 是否为预览态
         */
        isPreview: PT.bool,
        /**
         * 预览态模式下渲染的内容
         * @param {number} value 评分值
         */
        renderPreview: PT.func,
        /**
         * 国际化配置
         */
        locale: PT.object
      }), _class$A.defaultProps = _default$5({}, Base$2.defaultProps, {
        hasBorder: true,
        isPreview: false,
        rows: 4,
        autoHeight: false,
        locale: locale$1.TextArea
      }), _initialiseProps$1 = function _initialiseProps2() {
        var _this3 = this;
        this._resizeTextArea = function(value) {
          if (_this3.nextFrameActionId) {
            clearNextFrameAction(_this3.nextFrameActionId);
          }
          _this3.nextFrameActionId = onNextFrame(function() {
            var height = _this3._getHeight(value);
            var maxHeight = _this3.state.maxHeight ? _this3.state.maxHeight : Infinity;
            _this3.setState({
              height: _this3._getHeight(value),
              overflowY: height <= maxHeight ? "hidden" : void 0
            });
          });
        };
      }, _temp$k);
      Input$2.Password = ConfigProvider$1.config(Password, {
        exportNames: ["getInputNode", "focus"],
        transform: (
          /* istanbul ignore next */
          function transform2(props, deprecated2) {
            if ("hasLimitHint" in props) {
              deprecated2("hasLimitHint", "showLimitHint", "Input");
              var _props = props, hasLimitHint = _props.hasLimitHint, others = _default$4(_props, ["hasLimitHint"]);
              props = _default$5({ showLimitHint: hasLimitHint }, others);
            }
            return props;
          }
        )
      });
      Input$2.TextArea = ConfigProvider$1.config(TextArea, {
        exportNames: ["getInputNode", "focus"],
        transform: (
          /* istanbul ignore next */
          function transform2(props, deprecated2) {
            if ("hasLimitHint" in props) {
              deprecated2("hasLimitHint", "showLimitHint", "Input");
              var _props2 = props, hasLimitHint = _props2.hasLimitHint, others = _default$4(_props2, ["hasLimitHint"]);
              props = _default$5({ 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 transform2(props, deprecated2) {
            if ("hasLimitHint" in props) {
              deprecated2("hasLimitHint", "showLimitHint", "Input");
              var _props3 = props, hasLimitHint = _props3.hasLimitHint, others = _default$4(_props3, ["hasLimitHint"]);
              props = _default$5({ showLimitHint: hasLimitHint }, others);
            }
            return props;
          }
        )
      });
      var _class$z, _temp2$f;
      var noop$8 = function noop2() {
      };
      var Message = (_temp2$f = _class$z = function(_Component) {
        _default(Message2, _Component);
        function Message2() {
          var _temp3, _this, _ret;
          _default$3(this, Message2);
          for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
            args[_key] = arguments[_key];
          }
          return _ret = (_temp3 = (_this = _default$1(this, _Component.call.apply(_Component, [this].concat(args))), _this), _this.state = {
            visible: typeof _this.props.visible === "undefined" ? _this.props.defaultVisible : _this.props.visible
          }, _this.onClose = function() {
            if (!("visible" in _this.props)) {
              _this.setState({
                visible: false
              });
            }
            _this.props.onClose(false);
          }, _temp3), _default$1(_this, _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, locale2 = _props.locale;
          var others = _default$5({}, 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__default.createElement(
            "div",
            _default$5({ role: "alert", style }, others, { className: classes, dir: rtl ? "rtl" : void 0 }),
            closeable ? React__default.createElement(
              "a",
              {
                role: "button",
                "aria-label": locale2.closeAriaLabel,
                className: messagePrefix + "-close",
                onClick: this.onClose
              },
              React__default.createElement(Icon, { type: "close" })
            ) : null,
            icon !== false ? React__default.createElement(Icon, {
              className: messagePrefix + "-symbol " + (!icon && messagePrefix + "-symbol-icon"),
              type: icon
            }) : null,
            title ? React__default.createElement(
              "div",
              { className: messagePrefix + "-title" },
              title
            ) : null,
            children ? React__default.createElement(
              "div",
              { className: messagePrefix + "-content" },
              children
            ) : null
          ) : null;
          if (animation2) {
            return React__default.createElement(
              Animate.Expand,
              { animationAppear: false, afterLeave: afterClose },
              newChildren
            );
          }
          return newChildren;
        };
        return Message2;
      }(React__default.Component), _class$z.propTypes = {
        prefix: PT.string,
        pure: PT.bool,
        className: PT.string,
        style: PT.object,
        /**
         * 反馈类型
         */
        type: PT.oneOf(["success", "warning", "error", "notice", "help", "loading"]),
        /**
         * 反馈外观
         */
        shape: PT.oneOf(["inline", "addon", "toast"]),
        /**
         * 反馈大小
         */
        size: PT.oneOf(["medium", "large"]),
        /**
         * 标题
         */
        title: PT.node,
        /**
         * 内容
         */
        children: PT.node,
        /**
         * 默认是否显示
         */
        defaultVisible: PT.bool,
        /**
         * 当前是否显示
         */
        visible: PT.bool,
        /**
         * 显示的图标类型,会覆盖内部设置的IconType,传false不显示图标
         */
        iconType: PT.oneOfType([PT.string, PT.bool]),
        /**
         * 显示关闭按钮
         */
        closeable: PT.bool,
        /**
         * 关闭按钮的回调
         */
        onClose: PT.func,
        /**
         * 关闭之后调用的函数
         */
        afterClose: PT.func,
        /**
         * 是否开启展开收起动画
         */
        animation: PT.bool,
        locale: PT.object,
        rtl: PT.bool
      }, _class$z.defaultProps = {
        prefix: "next-",
        pure: false,
        type: "success",
        shape: "inline",
        size: "medium",
        defaultVisible: true,
        closeable: false,
        onClose: noop$8,
        afterClose: noop$8,
        animation: true,
        locale: locale$1.Message
      }, _temp2$f);
      Message.displayName = "Message";
      const Message$1 = ConfigProvider$1.config(polyfill(Message));
      var _class$y, _temp2$e;
      var config = ConfigProvider$1.config;
      var instance = void 0;
      var timeouts = {};
      var Mask = (_temp2$e = _class$y = function(_React$Component) {
        _default(Mask2, _React$Component);
        function Mask2() {
          var _temp3, _this, _ret;
          _default$3(this, Mask2);
          for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
            args[_key] = arguments[_key];
          }
          return _ret = (_temp3 = (_this = _default$1(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.state = {
            visible: true
          }, _this.handleClose = function() {
            var silent = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : false;
            _this.setState({
              visible: false
            });
            if (!silent) {
              _this.props.onClose && _this.props.onClose();
            }
          }, _temp3), _default$1(_this, _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, offset2 = _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$4(_props, ["prefix", "type", "title", "content", "align", "offset", "hasMask", "afterClose", "animation", "overlayProps", "timeoutId", "className", "style"]);
          var visible = this.state.visible;
          return React__default.createElement(
            Overlay$1,
            _default$5({}, overlayProps, {
              prefix,
              animation: animation2,
              visible,
              align,
              offset: offset2,
              hasMask,
              afterClose
            }),
            React__default.createElement(
              Message$1,
              _default$5({}, others, {
                prefix,
                visible: true,
                type: type2,
                shape: "toast",
                title,
                style,
                className: prefix + "message-wrapper " + className,
                onClose: this.handleClose
              }),
              content
            )
          );
        };
        return Mask2;
      }(React__default.Component), _class$y.contextTypes = {
        prefix: PT.string
      }, _class$y.propTypes = {
        prefix: PT.string,
        type: PT.string,
        title: PT.node,
        content: PT.node,
        align: PT.string,
        offset: PT.array,
        hasMask: PT.bool,
        afterClose: PT.func,
        animation: PT.oneOfType([PT.object, PT.bool]),
        overlayProps: PT.object,
        onClose: PT.func,
        timeoutId: PT.string,
        style: PT.object,
        className: PT.string
      }, _class$y.defaultProps = {
        prefix: "next-",
        align: "tc tc",
        offset: [0, 30],
        hasMask: false,
        animation: {
          in: "pulse",
          out: "zoomOut"
        },
        style: {},
        className: ""
      }, _temp2$e);
      Mask.displayName = "Mask";
      var NewMask = config(Mask);
      var create = function create2(props) {
        props.duration;
        var afterClose = props.afterClose, contextConfig = props.contextConfig, others = _default$4(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__default.createElement(
          ConfigProvider$1,
          newContext,
          React__default.createElement(NewMask, _default$5({
            afterClose: closeChain
          }, others, {
            ref: function ref(_ref) {
              myRef = _ref;
            }
          }))
        ), div, function() {
          mask = myRef;
          if (mask && destroyed) {
            destroy();
          }
        });
        return {
          component: mask,
          destroy
        };
      };
      function handleConfig$1(config2, type2) {
        var newConfig = {};
        if (typeof config2 === "string" || React__default.isValidElement(config2)) {
          newConfig.title = config2;
        } else if (isObject(config2)) {
          newConfig = _default$5({}, config2);
        }
        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(config2, type2) {
        close$1();
        config2 = handleConfig$1(config2, type2);
        var timeoutId = guid();
        instance = create(_default$5({}, config2, { timeoutId }));
        if (config2.duration > 0) {
          var timeout = setTimeout(close$1, config2.duration);
          timeouts[timeoutId] = timeout;
        }
      }
      function close$1() {
        if (instance) {
          instance.destroy();
          instance = null;
        }
      }
      function _show(config2) {
        open$1(config2);
      }
      function hide() {
        close$1();
      }
      function _success(config2) {
        open$1(config2, "success");
      }
      function _warning(config2) {
        open$1(config2, "warning");
      }
      function _error(config2) {
        open$1(config2, "error");
      }
      function _help(config2) {
        open$1(config2, "help");
      }
      function _loading(config2) {
        open$1(config2, "loading");
      }
      function _notice(config2) {
        open$1(config2, "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__default.createElement(
            ConfigProvider$1.Consumer,
            null,
            function(contextConfig) {
              return React__default.createElement(WrappedComponent, _default$5({}, props, {
                contextMessage: {
                  show: function show() {
                    var config2 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
                    return _show(_default$5({}, config2, { contextConfig }));
                  },
                  hide,
                  success: function success() {
                    var config2 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
                    return _success(_default$5({}, config2, { contextConfig }));
                  },
                  warning: function warning2() {
                    var config2 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
                    return _warning(_default$5({}, config2, { contextConfig }));
                  },
                  error: function error() {
                    var config2 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
                    return _error(_default$5({}, config2, { contextConfig }));
                  },
                  help: function help() {
                    var config2 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
                    return _help(_default$5({}, config2, { contextConfig }));
                  },
                  loading: function loading() {
                    var config2 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
                    return _loading(_default$5({}, config2, { contextConfig }));
                  },
                  notice: function notice() {
                    var config2 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
                    return _notice(_default$5({}, config2, { 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__default.useState(), forceUpdate = _useState[1];
        dataSource.forEach(function(i2) {
          if (!i2.timer) {
            i2.timer = setTimeout(function() {
              var idx = dataSource.indexOf(i2);
              if (idx > -1) {
                var item = dataSource[idx];
                typeof item.onClose === "function" && item.onClose();
                dataSource.splice(idx, 1);
                forceUpdate({});
              }
            }, i2.duration);
          }
        });
        return React__default.createElement(
          "div",
          { className: prefix + "message-wrapper-v2", style: { top: _config.top } },
          React__default.createElement(
            Animate,
            {
              animationAppear: true,
              animation: {
                appear: "pulse",
                enter: "pulse",
                leave: prefix + "message-fade-leave"
              },
              singleMode: false
            },
            dataSource.map(function(i2) {
              var key = i2.key, className = i2.className, type2 = i2.type, title = i2.title, content = i2.content, style = i2.style, others = _default$4(i2, ["key", "className", "type", "title", "content", "style"]);
              return React__default.createElement(
                "div",
                { className: prefix + "message-list", key },
                React__default.createElement(
                  Message$1,
                  _default$5({}, 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$4(props, ["key"]);
        if (!messageRootNode) {
          messageRootNode = document.createElement("div");
          document.body.appendChild(messageRootNode);
        }
        var maxCount = _config.maxCount, duration = _config.duration;
        var item = _default$5({
          key,
          duration
        }, others);
        messageList.push(item);
        if (maxCount && messageList.length > maxCount) {
          messageList.shift();
        }
        ReactDOM.render(React__default.createElement(
          ConfigProvider$1,
          ConfigProvider$1.getContext(),
          React__default.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__default.createElement(
                ConfigProvider$1,
                ConfigProvider$1.getContext(),
                React__default.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__default.createElement(
            ConfigProvider$1,
            ConfigProvider$1.getContext(),
            React__default.createElement(ConfigedMessages, { dataSource: messageList })
          ), messageRootNode);
        }
      }
      function handleConfig(config2, type2) {
        var newConfig = {};
        if (typeof config2 === "string" || React__default.isValidElement(config2)) {
          newConfig.title = config2;
        } else if (obj.typeOf(config2) === "Object") {
          newConfig = _default$5({}, config2);
        }
        if (type2) {
          newConfig.type = type2;
        }
        return newConfig;
      }
      function open(type2) {
        return function(config2) {
          config2 = handleConfig(config2, type2);
          return createMessage(config2);
        };
      }
      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__default.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$5.apply(void 0, [_config].concat(args));
        }
      };
      Message$1.show = toast.show;
      Message$1.success = toast.success;
      Message$1.warning = toast.warning;
      Message$1.error = toast.error;
      Message$1.notice = toast.notice;
      Message$1.help = toast.help;
      Message$1.loading = toast.loading;
      Message$1.hide = toast.hide;
      Message$1.withContext = withContext;
      var MessageProvider = ConfigProvider$1.config(Message$1, {
        componentName: "Message"
      });
      var openV2 = false;
      MessageProvider.config = function(config2) {
        message.config(config2);
        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 formatRegExp = /%[sdj%]/g;
      function format$1() {
        var args = [];
        for (var _i = 0; _i < arguments.length; _i++) {
          args[_i] = arguments[_i];
        }
        var i2 = 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 (i2 >= len) {
              return x2;
            }
            switch (x2) {
              case "%s":
                return String(args[i2++]);
              case "%d":
                return Number(args[i2++]);
              case "%j":
                try {
                  return JSON.stringify(args[i2++]);
                } catch (_) {
                  return "[Circular]";
                }
              default:
                return x2;
            }
          });
          return str;
        }
        return f2;
      }
      function _asyncValidateSerials(arr, validator, 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) {
            validator(arr[original], next);
          } else {
            return callback([]);
          }
        }
        next([]);
      }
      function _promiseValidateSeries(arr, validator) {
        return __awaiter(this, void 0, void 0, function() {
          var _this = this;
          return __generator(this, function(_a) {
            return [2, arr.reduce(function(prevPromise, next) {
              return __awaiter(_this, void 0, void 0, function() {
                var errors, e_1;
                return __generator(this, function(_a2) {
                  switch (_a2.label) {
                    case 0:
                      _a2.trys.push([0, 2, , 3]);
                      return [4, prevPromise];
                    case 1:
                      errors = _a2.sent();
                      return [3, 3];
                    case 2:
                      e_1 = _a2.sent();
                      errors = e_1;
                      return [3, 3];
                    case 3:
                      if (errors && errors.length) {
                        return [2, errors];
                      }
                      return [2, validator(next)];
                  }
                });
              });
            }, [])];
          });
        });
      }
      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, validator, callback) {
        if (option.first) {
          var flattenArr = flattenObjArr(objArr);
          return _asyncValidateSerials(flattenArr, validator, callback);
        }
        var objArrKeys = Object.keys(objArr);
        var objArrLength = objArrKeys.length;
        var total = 0;
        var results = [];
        var next = function(errors) {
          results.push(errors);
          total++;
          if (total === objArrLength) {
            return callback(results);
          }
        };
        objArrKeys.forEach(function(key) {
          var arr = objArr[key];
          _asyncValidateSerials(arr, validator, next);
        });
      }
      function asyncMapPromise(objArr, option, validator) {
        return __awaiter(this, void 0, void 0, function() {
          var flatObjArr, objArrValues;
          return __generator(this, function(_a) {
            switch (_a.label) {
              case 0:
                if (!option.first)
                  return [3, 2];
                flatObjArr = flattenObjArr(objArr);
                return [4, _promiseValidateSeries(flatObjArr, validator)];
              case 1:
                return [2, _a.sent()];
              case 2:
                objArrValues = Object.values(objArr);
                return [4, Promise.all(objArrValues.map(function(val) {
                  return _promiseValidateSeries(val, validator);
                }))];
              case 3:
                return [2, _a.sent()];
            }
          });
        });
      }
      function complementError(rule) {
        return function(oe) {
          if (oe && typeof oe === "object" && oe.message) {
            oe.field = rule.field;
            return oe;
          }
          return {
            message: oe,
            field: rule.field
          };
        };
      }
      function processErrorResults(results) {
        if (results === void 0) {
          results = [];
        }
        var errors = [];
        var fields = {};
        function add2(e2) {
          if (Array.isArray(e2)) {
            errors = errors.concat(e2);
          } else {
            errors.push(e2);
          }
        }
        for (var i2 = 0; i2 < results.length; i2++) {
          add2(results[i2]);
        }
        if (!errors.length) {
          return {
            errors: null,
            fields: null
          };
        } else {
          for (var i2 = 0; i2 < errors.length; i2++) {
            var field = errors[i2].field;
            if (field) {
              fields[field] = fields[field] || [];
              fields[field].push(errors[i2]);
            }
          }
          return {
            errors,
            fields
          };
        }
      }
      const defaultMessages = {
        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"
      };
      var required = function required2(rule, value, errors, options) {
        if (value === void 0 || value === null || value === "" || value.length === 0) {
          errors.push(format$1(options.messages.required, rule.aliasName || rule.field));
        }
      };
      var pattern$1 = {
        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}))$)$|^([ ]?)$/
      };
      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 i2 = 0; i2 < len; i2++) {
          num += arr[i2] * weightFactor[i2];
        }
        var lastNo = checkCode[num % 11];
        return last === lastNo;
      }
      var types = {
        number: function(value) {
          if (isNaN(value)) {
            return false;
          }
          return typeof value === "number" || typeof value === "string" && !!value.match(pattern$1.number);
        },
        email: function(value) {
          return typeof value === "string" && !!value.match(pattern$1.email) && value.length < 255;
        },
        url: function(value) {
          return typeof value === "string" && !!value.match(pattern$1.url);
        },
        tel: function(value) {
          return typeof value === "string" && !!value.match(pattern$1.tel);
        },
        IDNumber: function(value) {
          return validatorIDNumber(value);
        }
      };
      var format = function format2(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(format$1(options.messages.format[ruleType], rule.aliasName || rule.field, rule.format));
        }
      };
      var size = function size2(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(format$1(options.messages[key].min, rule.aliasName || rule.field, rule.min));
          } else if (val > max2) {
            errors.push(format$1(options.messages[key].max, rule.aliasName || rule.field, rule.max));
          }
        }
      };
      var length = function length2(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 = isNum ? "".concat(value) : value;
        var length3 = Number(rule.length);
        var maxLength = Number(rule.maxLength);
        var minLength = Number(rule.minLength);
        if (minLength || maxLength || length3) {
          var len = val.length;
          if (length3 && len !== rule.length) {
            errors.push(format$1(options.messages[key].length, rule.aliasName || rule.field, rule.length));
          } else if (len < minLength) {
            errors.push(format$1(options.messages[key].minLength, rule.aliasName || rule.field, rule.minLength));
          } else if (len > maxLength) {
            errors.push(format$1(options.messages[key].maxLength, rule.aliasName || rule.field, rule.maxLength));
          }
        }
      };
      var pattern = function pattern2(rule, value, errors, options) {
        if (rule.pattern) {
          if (rule.pattern instanceof RegExp) {
            if (!rule.pattern.test(value)) {
              errors.push(format$1(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(format$1(options.messages.pattern, rule.aliasName || rule.field, value, rule.pattern));
            }
          }
        }
      };
      const rules = {
        required,
        format,
        min: size,
        max: size,
        minLength: length,
        maxLength: length,
        length,
        pattern
      };
      function validateFunc(validator, ruleType) {
        return function(rule, value, cb, options) {
          var errors = [];
          if (ruleType !== "required") {
            var errors_1 = [];
            rules.required(rule, value, errors_1, options);
            if (errors_1.length > 0) {
              if ("required" in rule && rule.required) {
                if (cb) {
                  return cb(errors_1);
                } else {
                  return Promise.reject(errors_1);
                }
              } else if (cb) {
                return cb([]);
              } else {
                return Promise.resolve(null);
              }
            }
          }
          validator(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 keys2 = Object.keys(rule);
        for (var i2 = 0; i2 < keys2.length; i2++) {
          var ruleType = keys2[i2];
          if (ruleType === "required") {
            continue;
          }
          if (ruleType in rules) {
            return validateFunc(rules[ruleType], ruleType);
          }
        }
        if ("required" in rule && rule.required) {
          return validateFunc(rules.required, "required");
        }
        return null;
      }
      function noop$7() {
      }
      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 = 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 = (
        /** @class */
        function() {
          function Schema2(rules2, options) {
            if (options === void 0) {
              options = {};
            }
            this._rules = rules2;
            this._options = __assign(__assign({}, options), { messages: __assign(__assign({}, defaultMessages), options.messages) });
            this.complete = [];
          }
          Schema2.prototype.abort = function() {
            for (var i2 = 0; i2 < this.complete.length; i2++) {
              this.complete[i2] = noop$7;
            }
          };
          Schema2.prototype.messages = function(messages) {
            this._options.messages = Object.assign({}, this._options.messages, messages);
          };
          Schema2.prototype.validate = function(source, callback) {
            var _this = 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 i2;
              var field;
              var errors = [];
              var fields = {};
              function add2(e2) {
                if (Array.isArray(e2)) {
                  errors = errors.concat(e2);
                } else {
                  errors.push(e2);
                }
              }
              for (i2 = 0; i2 < results.length; i2++) {
                add2(results[i2]);
              }
              if (!errors.length) {
                callback(null, null);
              } else {
                for (i2 = 0; i2 < errors.length; i2++) {
                  field = errors[i2].field;
                  fields[field] = fields[field] || [];
                  fields[field].push(errors[i2]);
                }
                callback(errors, fields);
              }
            }
            this.complete.push(complete);
            var idx = this.complete.length;
            asyncMap(series, this._options, function(data, next) {
              var rule = data.rule;
              rule.field = data.field;
              var cb = function cb2(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);
                }
                var normalizeErrors = errors.map(complementError(rule));
                next(normalizeErrors);
              };
              var res = rule.validator(rule, data.value, cb, _this._options);
              if (res && res.then) {
                res.then(function() {
                  return cb();
                }, function(e2) {
                  return cb(e2);
                });
              }
            }, function(results) {
              _this.complete[idx - 1](results);
            });
          };
          Schema2.prototype.validatePromise = function(source) {
            return __awaiter(this, void 0, void 0, function() {
              var series, results;
              var _this = this;
              return __generator(this, function(_a) {
                switch (_a.label) {
                  case 0:
                    if (!this._rules || Object.keys(this._rules).length === 0) {
                      return [2, { errors: null }];
                    }
                    series = serializeRules(source, this._rules);
                    if (Object.keys(series).length === 0) {
                      return [2, { errors: null }];
                    }
                    return [4, asyncMapPromise(series, this._options, function(data) {
                      return __awaiter(_this, void 0, void 0, function() {
                        var rule, errors, error_1;
                        var _this2 = this;
                        return __generator(this, function(_a2) {
                          switch (_a2.label) {
                            case 0:
                              rule = data.rule;
                              rule.field = data.field;
                              _a2.label = 1;
                            case 1:
                              _a2.trys.push([1, 3, , 4]);
                              return [4, new Promise(function(resolve) {
                                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 2:
                              errors = _a2.sent();
                              return [3, 4];
                            case 3:
                              error_1 = _a2.sent();
                              errors = error_1;
                              return [3, 4];
                            case 4:
                              if (errors) {
                                if (!Array.isArray(errors)) {
                                  errors = [errors];
                                }
                                if (errors.length && rule.message) {
                                  errors = [].concat(rule.message);
                                }
                                return [2, errors.map(complementError(rule))];
                              } else {
                                return [2, []];
                              }
                          }
                        });
                      });
                    })];
                  case 1:
                    results = _a.sent();
                    return [2, processErrorResults(results)];
                }
              });
            });
          };
          return Schema2;
        }()
      );
      var define_process_env_default = {};
      function splitNameToPath(name) {
        return typeof name === "string" && name ? name.replace(/\[/, ".").replace(/\]/, "").split(".") : "";
      }
      function hasIn(state, name) {
        if (!state) {
          return false;
        }
        var path = splitNameToPath(name);
        var length2 = path.length;
        if (!length2) {
          return false;
        }
        var result = state;
        for (var i2 = 0; i2 < length2; ++i2) {
          if (typeof result !== "object" || result === null) {
            return false;
          }
          var thisName = path[i2];
          if (!(thisName in result)) {
            return false;
          }
          result = result[thisName];
        }
        return true;
      }
      function getIn(state, name) {
        if (!state) {
          return state;
        }
        var path = splitNameToPath(name);
        var length2 = path.length;
        if (!length2) {
          return void 0;
        }
        var result = state;
        for (var i2 = 0; i2 < length2; ++i2) {
          if (typeof result !== "object" || result === null) {
            return void 0;
          }
          result = result[path[i2]];
        }
        return result;
      }
      function setInWithPath(state, value, path, pathIndex) {
        var _a;
        if (pathIndex >= path.length) {
          return value;
        }
        var first = path[pathIndex];
        var next = setInWithPath(state && state[first], value, path, pathIndex + 1);
        if (!state) {
          var initialized = isNaN(first) ? {} : [];
          initialized[first] = next;
          return initialized;
        }
        if (Array.isArray(state)) {
          var copy = __spreadArray([], __read(state), false);
          copy[first] = next;
          return copy;
        }
        return Object.assign({}, state, (_a = {}, _a[first] = next, _a));
      }
      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 i2 = 0; i2 < length2 && !!result; ++i2) {
          if (i2 === length2 - 1) {
            delete result[path[i2]];
          } else {
            result = result[path[i2]];
          }
        }
        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 isOverwritten(values2, name) {
        var e_1, _a;
        if (!values2 || typeof values2 !== "object" || !name || typeof name !== "string") {
          return false;
        }
        var paths = splitNameToPath(name);
        var obj2 = values2;
        try {
          for (var paths_1 = __values(paths), paths_1_1 = paths_1.next(); !paths_1_1.done; paths_1_1 = paths_1.next()) {
            var path = paths_1_1.value;
            if (path in obj2) {
              var pathValue = obj2[path];
              if (!pathValue || typeof pathValue !== "object") {
                return true;
              } else {
                obj2 = pathValue;
              }
            } else {
              if (Array.isArray(obj2)) {
                return true;
              }
              return false;
            }
          }
        } catch (e_1_1) {
          e_1 = { error: e_1_1 };
        } finally {
          try {
            if (paths_1_1 && !paths_1_1.done && (_a = paths_1.return))
              _a.call(paths_1);
          } finally {
            if (e_1)
              throw e_1.error;
          }
        }
        return true;
      }
      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 i2 = 0; i2 < nrule.trigger.length; i2++) {
          var trigger = nrule.trigger[i2];
          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() {
      };
      if (typeof process !== "undefined" && define_process_env_default && false) {
        warn = function() {
          var args = [];
          for (var _i = 0; _i < arguments.length; _i++) {
            args[_i] = arguments[_i];
          }
          if (typeof console !== "undefined" && console.error) {
            console.error.apply(console, __spreadArray([], __read(args), false));
          }
        };
      }
      var warning = warn;
      function cloneToRuleArr(rules2) {
        if (!rules2) {
          return [];
        }
        var rulesArr = Array.isArray(rules2) ? rules2 : [rules2];
        return rulesArr.map(function(rule) {
          return __assign({}, rule);
        });
      }
      var initMeta = {
        state: "",
        valueName: "value",
        trigger: "onChange",
        inputValues: []
      };
      var Field = (
        /** @class */
        function() {
          function Field2(com, options) {
            if (options === void 0) {
              options = {};
            }
            var _this_1 = this;
            if (!com) {
              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.listeners = {};
            this.values = Object.assign({}, options.values);
            this.processErrorMessage = options.processErrorMessage;
            this.afterValidateRerender = options.afterValidateRerender;
            this.options = Object.assign({
              parseName: false,
              forceUpdate: false,
              first: false,
              onChange: function() {
              },
              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) {
              _this_1[m2] = _this_1[m2].bind(_this_1);
            });
          }
          Field2.create = function(com, options) {
            if (options === void 0) {
              options = {};
            }
            return new this(com, options);
          };
          Field2.getUseField = function(_a) {
            var _this_1 = this;
            var useState2 = _a.useState, useMemo2 = _a.useMemo;
            return function(options) {
              if (options === void 0) {
                options = {};
              }
              var _a2 = __read(useState2(), 2), setState = _a2[1];
              var field = useMemo2(function() {
                return _this_1.create({ setState }, options);
              }, [setState]);
              return field;
            };
          };
          Field2.prototype.setOptions = function(options) {
            Object.assign(this.options, options);
          };
          Field2.prototype.init = function(name, option, rprops) {
            var _a;
            var _this_1 = this;
            if (option === void 0) {
              option = {};
            }
            var id2 = option.id, initValue = option.initValue, _b = option.valueName, valueName = _b === void 0 ? "value" : _b, _c = option.trigger, trigger = _c === void 0 ? "onChange" : _c, _d = option.rules, rules2 = _d === void 0 ? [] : _d, _e = option.props, props = _e === void 0 ? {} : _e, _f = option.getValueFromEvent, getValueFromEvent2 = _f === void 0 ? null : _f, _g = option.getValueFormatter, getValueFormatter = _g === void 0 ? getValueFromEvent2 : _g, setValueFormatter = option.setValueFormatter, _h = option.autoValidate, autoValidate = _h === void 0 ? true : _h, reRender = option.reRender;
            var parseName = this.options.parseName;
            if (getValueFromEvent2) {
              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: cloneToRuleArr(rules2),
              ref: originalProps.ref
            });
            var oldValue = field.value;
            if (valueName in originalProps) {
              var originalValue = originalProps[valueName];
              if (parseName) {
                if (!("value" in field)) {
                  this._proxyFieldValue(field);
                }
              } else {
                this.values[name] = originalValue;
              }
              field.value = originalValue;
            }
            if (!("value" in field)) {
              if (parseName) {
                var cachedValue = getIn(this.values, name);
                if (typeof cachedValue !== "undefined") {
                  oldValue = cachedValue;
                }
                var initValue_1 = typeof cachedValue !== "undefined" ? cachedValue : defaultValue;
                this._proxyFieldValue(field);
                field.value = initValue_1;
              } else {
                var cachedValue = this.values[name];
                if (typeof cachedValue !== "undefined") {
                  field.value = cachedValue;
                  oldValue = cachedValue;
                } else if (typeof defaultValue !== "undefined") {
                  field.value = defaultValue;
                  this.values[name] = field.value;
                }
              }
            }
            var newValue = field.value;
            this._triggerFieldChange(name, newValue, oldValue, "init");
            var inputProps = (_a = {
              "data-meta": "Field",
              id: id2 || name,
              ref: this._getCacheBind(name, "".concat(name, "__ref"), this._saveRef)
            }, _a[valueName] = setValueFormatter ? setValueFormatter(field.value, field.inputValues) : field.value, _a);
            var rulesMap = {};
            if (this.options.autoValidate && autoValidate !== false) {
              rulesMap = mapValidateRules(field.rules, trigger);
              var _loop_1 = function(action2) {
                if (action2 === trigger) {
                  return "continue";
                }
                var actionRule = rulesMap[action2];
                inputProps[action2] = function() {
                  var args = [];
                  for (var _i = 0; _i < arguments.length; _i++) {
                    args[_i] = arguments[_i];
                  }
                  _this_1._callNativePropsEvent.apply(_this_1, __spreadArray([action2, originalProps], __read(args), false));
                  _this_1._validate(name, actionRule, action2);
                };
              };
              for (var action in rulesMap) {
                _loop_1(action);
              }
            }
            inputProps[trigger] = function() {
              var args = [];
              for (var _i = 0; _i < arguments.length; _i++) {
                args[_i] = arguments[_i];
              }
              var oldValue2 = _this_1.getValue(name);
              _this_1._updateFieldValue.apply(_this_1, __spreadArray([name], __read(args), false));
              var newValue2 = _this_1.getValue(name);
              _this_1._triggerFieldChange(name, newValue2, oldValue2, "change");
              _this_1._resetError(name);
              _this_1._callNativePropsEvent.apply(_this_1, __spreadArray([trigger, originalProps], __read(args), false));
              _this_1.options.onChange(name, field.value);
              var rule = rulesMap[trigger];
              rule && _this_1._validate(name, rule, trigger);
              _this_1._reRender(name, trigger);
            };
            if (reRender && typeof reRender === "function") {
              this.reRenders[name] = reRender;
            }
            delete originalProps[defaultValueName];
            return Object.assign({}, originalProps, inputProps);
          };
          Field2.prototype.getValue = function(name) {
            if (this.options.parseName) {
              return getIn(this.values, name);
            }
            return this.values[name];
          };
          Field2.prototype.getValues = function(names) {
            var _this_1 = this;
            var allValues = {};
            if (names && names.length) {
              names.forEach(function(name) {
                allValues[name] = _this_1.getValue(name);
              });
            } else {
              Object.assign(allValues, this.values);
            }
            return allValues;
          };
          Field2.prototype.setValue = function(name, value, reRender, triggerChange) {
            if (reRender === void 0) {
              reRender = true;
            }
            if (triggerChange === void 0) {
              triggerChange = true;
            }
            var oldValue = this.getValue(name);
            if (name in this.fieldsMeta) {
              this.fieldsMeta[name].value = value;
            }
            if (this.options.parseName) {
              this.values = setIn(this.values, name, value);
            } else {
              this.values[name] = value;
            }
            var newValue = this.getValue(name);
            if (triggerChange) {
              this._triggerFieldChange(name, newValue, oldValue, "setValue");
            }
            reRender && this._reRender(name, "setValue");
          };
          Field2.prototype.setValues = function(fieldsValue, reRender) {
            var e_1, _a;
            var _this_1 = this;
            if (fieldsValue === void 0) {
              fieldsValue = {};
            }
            if (reRender === void 0) {
              reRender = true;
            }
            if (!this.options.parseName) {
              Object.keys(fieldsValue).forEach(function(name) {
                _this_1.setValue(name, fieldsValue[name], false, true);
              });
            } else {
              var newValues_1 = Object.assign({}, this.values, fieldsValue);
              var fields = this.getNames();
              var allOldFieldValues = this.getValues(fields);
              var oldFieldValues = fields.filter(function(name) {
                return !isOverwritten(fieldsValue, name);
              }).map(function(name) {
                return { name, value: _this_1.fieldsMeta[name].value };
              });
              oldFieldValues.forEach(function(_a2) {
                var name = _a2.name, value = _a2.value;
                if (!hasIn(newValues_1, name)) {
                  newValues_1 = setIn(newValues_1, name, value);
                }
              });
              this.values = newValues_1;
              try {
                for (var fields_1 = __values(fields), fields_1_1 = fields_1.next(); !fields_1_1.done; fields_1_1 = fields_1.next()) {
                  var name_1 = fields_1_1.value;
                  this._triggerFieldChange(name_1, this.getValue(name_1), allOldFieldValues[name_1], "setValue");
                }
              } catch (e_1_1) {
                e_1 = { error: e_1_1 };
              } finally {
                try {
                  if (fields_1_1 && !fields_1_1.done && (_a = fields_1.return))
                    _a.call(fields_1);
                } finally {
                  if (e_1)
                    throw e_1.error;
                }
              }
            }
            reRender && this._reRender();
          };
          Field2.prototype.getError = function(name) {
            var field = this._get(name);
            if (field && field.errors && field.errors.length) {
              return field.errors;
            }
            return null;
          };
          Field2.prototype.getErrors = function(names) {
            var _this_1 = this;
            var fields = names || this.getNames();
            var allErrors = {};
            fields.forEach(function(f2) {
              allErrors[f2] = _this_1.getError(f2);
            });
            return allErrors;
          };
          Field2.prototype.setError = function(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");
          };
          Field2.prototype.setErrors = function(fieldsErrors) {
            var _this_1 = this;
            if (fieldsErrors === void 0) {
              fieldsErrors = {};
            }
            Object.keys(fieldsErrors).forEach(function(name) {
              _this_1.setError(name, fieldsErrors[name]);
            });
          };
          Field2.prototype.getState = function(name) {
            var field = this._get(name);
            if (field && field.state) {
              return field.state;
            }
            return "";
          };
          Field2.prototype.validateCallback = function(ns, cb) {
            var _this_1 = this;
            var _a = getParams(ns, cb), names = _a.names, callback = _a.callback;
            var fieldNames = names || this.getNames();
            var descriptor2 = {};
            var values2 = {};
            var hasRule = false;
            for (var i2 = 0; i2 < fieldNames.length; i2++) {
              var name_2 = fieldNames[i2];
              var field = this._get(name_2);
              if (!field) {
                continue;
              }
              if (field.rules && field.rules.length) {
                descriptor2[name_2] = field.rules;
                values2[name_2] = this.getValue(name_2);
                hasRule = true;
                field.errors = [];
                field.state = "";
              }
            }
            if (!hasRule) {
              var errors = this.formatGetErrors(fieldNames);
              callback && callback(errors, this.getValues(names ? fieldNames : []));
              return;
            }
            var validate = new Schema(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(i4) {
                  var field3 = _this_1._get(i4);
                  if (field3) {
                    field3.errors = getErrorStrs(errorsGroup[i4].errors, _this_1.processErrorMessage);
                    field3.state = "error";
                  }
                });
              }
              var formattedGetErrors = _this_1.formatGetErrors(fieldNames);
              if (formattedGetErrors) {
                errorsGroup = Object.assign({}, formattedGetErrors, errorsGroup);
              }
              for (var i3 = 0; i3 < fieldNames.length; i3++) {
                var name_3 = fieldNames[i3];
                var field2 = _this_1._get(name_3);
                if (field2 && field2.rules && !(errorsGroup && name_3 in errorsGroup)) {
                  field2.state = "success";
                }
              }
              callback && callback(errorsGroup, _this_1.getValues(names ? fieldNames : []));
              _this_1._reRender(names, "validate");
              _this_1._triggerAfterValidateRerender(errorsGroup);
            });
          };
          Field2.prototype.validatePromise = function(ns, formatter) {
            return __awaiter(this, void 0, void 0, function() {
              var _a, names, callback, fieldNames, descriptor2, values2, hasRule, i2, name_4, field, errors_1, validate, results, errors, errorsGroup, callbackResults, error_1;
              return __generator(this, function(_b) {
                switch (_b.label) {
                  case 0:
                    _a = getParams(ns, formatter), names = _a.names, callback = _a.callback;
                    fieldNames = names || this.getNames();
                    descriptor2 = {};
                    values2 = {};
                    hasRule = false;
                    for (i2 = 0; i2 < fieldNames.length; i2++) {
                      name_4 = fieldNames[i2];
                      field = this._get(name_4);
                      if (!field) {
                        continue;
                      }
                      if (field.rules && field.rules.length) {
                        descriptor2[name_4] = field.rules;
                        values2[name_4] = this.getValue(name_4);
                        hasRule = true;
                        field.errors = [];
                        field.state = "";
                      }
                    }
                    if (!hasRule) {
                      errors_1 = this.formatGetErrors(fieldNames);
                      if (callback) {
                        return [2, callback({
                          errors: errors_1,
                          values: this.getValues(names ? fieldNames : [])
                        })];
                      } else {
                        return [2, {
                          errors: errors_1,
                          values: this.getValues(names ? fieldNames : [])
                        }];
                      }
                    }
                    validate = new Schema(descriptor2, {
                      first: this.options.first,
                      messages: this.options.messages
                    });
                    return [4, validate.validatePromise(values2)];
                  case 1:
                    results = _b.sent();
                    errors = results && results.errors || [];
                    errorsGroup = this._getErrorsGroup({ errors, fieldNames });
                    callbackResults = {
                      errors: errorsGroup,
                      values: this.getValues(names ? fieldNames : [])
                    };
                    _b.label = 2;
                  case 2:
                    _b.trys.push([2, 5, , 6]);
                    if (!callback)
                      return [3, 4];
                    return [4, callback(callbackResults)];
                  case 3:
                    callbackResults = _b.sent();
                    _b.label = 4;
                  case 4:
                    return [3, 6];
                  case 5:
                    error_1 = _b.sent();
                    return [2, error_1];
                  case 6:
                    this._reRender(names, "validate");
                    this._triggerAfterValidateRerender(errorsGroup);
                    return [2, callbackResults];
                }
              });
            });
          };
          Field2.prototype.reset = function(ns) {
            this._reset(ns, false);
          };
          Field2.prototype.resetToDefault = function(ns) {
            this._reset(ns, true);
          };
          Field2.prototype.getNames = function() {
            var fieldsMeta = this.fieldsMeta;
            return Object.keys(fieldsMeta).filter(function() {
              return true;
            });
          };
          Field2.prototype.remove = function(ns) {
            var _this_1 = 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 _this_1.fieldsMeta) {
                delete _this_1.fieldsMeta[name];
              }
              if (_this_1.options.parseName) {
                _this_1.values = deleteIn(_this_1.values, name);
              } else {
                delete _this_1.values[name];
              }
            });
          };
          Field2.prototype.addArrayValue = function(name, index2) {
            var argv = [];
            for (var _i = 2; _i < arguments.length; _i++) {
              argv[_i - 2] = arguments[_i];
            }
            return this._spliceArrayValue.apply(this, __spreadArray([name, index2, 0], __read(argv), false));
          };
          Field2.prototype.deleteArrayValue = function(name, index2, howmany) {
            if (howmany === void 0) {
              howmany = 1;
            }
            return this._spliceArrayValue(name, index2, howmany);
          };
          Field2.prototype.spliceArray = function(keyMatch, startIndex) {
            var e_2, _a;
            var _this_1 = this;
            if (keyMatch.match(/{index}$/) === -1) {
              warning("key should match /{index}$/");
              return;
            }
            var reg = keyMatch.replace("{index}", "(\\d+)");
            var keyReg = new RegExp("^".concat(reg));
            var listMap = {};
            var names = this.getNames();
            var willChangeNames = [];
            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).toString())).concat(n2.replace(ret[0], ""))
                  };
                  willChangeNames.push(item.from);
                  if (names.includes(item.to)) {
                    willChangeNames.push(item.to);
                  }
                  if (!l2) {
                    listMap[index2] = [item];
                  } else {
                    l2.push(item);
                  }
                }
              }
            });
            var oldValues = this.getValues(willChangeNames);
            var idxList = Object.keys(listMap).map(function(i2) {
              return {
                index: Number(i2),
                list: listMap[i2]
              };
            }).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(i2) {
                  var v2 = _this_1.getValue(i2.from);
                  _this_1.setValue(i2.to, v2, false, false);
                });
              });
              var lastIdxList = idxList[idxList.length - 1];
              lastIdxList.list.forEach(function(i2) {
                _this_1.remove(i2.from);
              });
              var parentName = keyMatch.replace(".{index}", "");
              parentName = parentName.replace("[{index}]", "");
              var parent_1 = this.getValue(parentName);
              if (parent_1) {
                parent_1.length--;
              }
            }
            try {
              for (var willChangeNames_1 = __values(willChangeNames), willChangeNames_1_1 = willChangeNames_1.next(); !willChangeNames_1_1.done; willChangeNames_1_1 = willChangeNames_1.next()) {
                var name_5 = willChangeNames_1_1.value;
                this._triggerFieldChange(name_5, this.getValue(name_5), oldValues[name_5], "setValue");
              }
            } catch (e_2_1) {
              e_2 = { error: e_2_1 };
            } finally {
              try {
                if (willChangeNames_1_1 && !willChangeNames_1_1.done && (_a = willChangeNames_1.return))
                  _a.call(willChangeNames_1);
              } finally {
                if (e_2)
                  throw e_2.error;
              }
            }
          };
          Field2.prototype.get = function(name) {
            if (name) {
              return this._get(name);
            } else {
              return this.fieldsMeta;
            }
          };
          Field2.prototype.watch = function(names, callback) {
            var e_3, _a;
            var _this_1 = this;
            try {
              for (var names_1 = __values(names), names_1_1 = names_1.next(); !names_1_1.done; names_1_1 = names_1.next()) {
                var name_6 = names_1_1.value;
                if (!this.listeners[name_6]) {
                  this.listeners[name_6] = /* @__PURE__ */ new Set();
                }
                var set2 = this.listeners[name_6];
                set2.add(callback);
              }
            } catch (e_3_1) {
              e_3 = { error: e_3_1 };
            } finally {
              try {
                if (names_1_1 && !names_1_1.done && (_a = names_1.return))
                  _a.call(names_1);
              } finally {
                if (e_3)
                  throw e_3.error;
              }
            }
            return function() {
              var e_4, _a2;
              try {
                for (var names_2 = __values(names), names_2_1 = names_2.next(); !names_2_1.done; names_2_1 = names_2.next()) {
                  var name_7 = names_2_1.value;
                  if (_this_1.listeners[name_7]) {
                    _this_1.listeners[name_7].delete(callback);
                  }
                }
              } catch (e_4_1) {
                e_4 = { error: e_4_1 };
              } finally {
                try {
                  if (names_2_1 && !names_2_1.done && (_a2 = names_2.return))
                    _a2.call(names_2);
                } finally {
                  if (e_4)
                    throw e_4.error;
                }
              }
            };
          };
          Field2.prototype._get = function(name) {
            return name in this.fieldsMeta ? this.fieldsMeta[name] : null;
          };
          Field2.prototype._getInitMeta = function(name) {
            if (!(name in this.fieldsMeta)) {
              this.fieldsMeta[name] = Object.assign({ name }, initMeta);
            }
            return this.fieldsMeta[name];
          };
          Field2.prototype._getErrorsGroup = function(_a) {
            var _this_1 = this;
            var errors = _a.errors, fieldNames = _a.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(i3) {
                var field2 = _this_1._get(i3);
                if (field2) {
                  field2.errors = getErrorStrs(errorsGroup[i3].errors, _this_1.processErrorMessage);
                  field2.state = "error";
                }
              });
            }
            var formattedGetErrors = this.formatGetErrors(fieldNames);
            if (formattedGetErrors) {
              errorsGroup = Object.assign({}, formattedGetErrors, errorsGroup);
            }
            for (var i2 = 0; i2 < fieldNames.length; i2++) {
              var name_8 = fieldNames[i2];
              var field = this._get(name_8);
              if (field && field.rules && !(errorsGroup && name_8 in errorsGroup)) {
                field.state = "success";
              }
            }
            return errorsGroup;
          };
          Field2.prototype._reset = function(ns, backToDefault) {
            var _this_1 = this;
            if (typeof ns === "string") {
              ns = [ns];
            }
            var changed = false;
            var names = ns || Object.keys(this.fieldsMeta);
            var oldValues = this.getValues(names);
            if (!ns) {
              this.values = {};
            }
            names.forEach(function(name) {
              var field = _this_1._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 (_this_1.options.parseName) {
                  _this_1.values = setIn(_this_1.values, name, field.value);
                } else {
                  _this_1.values[name] = field.value;
                }
              }
              _this_1._triggerFieldChange(name, _this_1.getValue(name), oldValues[name], "reset");
            });
            if (changed) {
              this._reRender(names, "reset");
            }
          };
          Field2.prototype._resetError = function(name) {
            var field = this._get(name);
            if (field) {
              delete field.errors;
              field.state = "";
            }
          };
          Field2.prototype._reRender = function(name, action) {
            var _this_1 = this;
            if (name) {
              var names = Array.isArray(name) ? name : [name];
              if (names.length && names.every(function(n2) {
                return _this_1.reRenders[n2];
              })) {
                names.forEach(function(n2) {
                  var reRender = _this_1.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();
              }
            }
          };
          Field2.prototype.formatGetErrors = function(names) {
            var errors = this.getErrors(names);
            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;
          };
          Field2.prototype._callNativePropsEvent = function(action, props) {
            var args = [];
            for (var _i = 2; _i < arguments.length; _i++) {
              args[_i - 2] = arguments[_i];
            }
            action in props && typeof props[action] === "function" && props[action].apply(props, __spreadArray([], __read(args), false));
          };
          Field2.prototype._proxyFieldValue = function(field) {
            var _this = this;
            Object.defineProperty(field, "value", {
              configurable: true,
              enumerable: true,
              get: function() {
                return getIn(_this.values, this.name);
              },
              set: function(v2) {
                _this.values = setIn(_this.values, this.name, v2);
                return true;
              }
            });
          };
          Field2.prototype._updateFieldValue = function(name) {
            var others = [];
            for (var _i = 1; _i < arguments.length; _i++) {
              others[_i - 1] = arguments[_i];
            }
            var e2 = others[0];
            var field = this._get(name);
            if (!field) {
              return;
            }
            field.value = field.getValueFormatter ? field.getValueFormatter.apply(this, others) : getValueFromEvent(e2);
            field.inputValues = others;
            if (this.options.parseName) {
              this.values = setIn(this.values, name, field.value);
            } else {
              this.values[name] = field.value;
            }
          };
          Field2.prototype._getCacheBind = function(name, action, fn) {
            var cache = this.cachedBind[name] = this.cachedBind[name] || {};
            if (!cache[action]) {
              cache[action] = fn.bind(this, name);
            }
            return cache[action];
          };
          Field2.prototype._setCache = function(name, action, hander) {
            var cache = this.cachedBind[name] = this.cachedBind[name] || {};
            cache[action] = hander;
          };
          Field2.prototype._getCache = function(name, action) {
            var cache = this.cachedBind[name] || {};
            return cache[action];
          };
          Field2.prototype._saveRef = function(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];
              if (cache) {
                if (this.options.parseName) {
                  cache._value = cache.value;
                }
                this._setCache(name, key, cache);
              }
              delete this.instance[name];
              delete this.reRenders[name];
              var oldValue = this.getValue(name);
              this.remove(name);
              var newValue = this.getValue(name);
              this._triggerFieldChange(name, newValue, oldValue, "unmount");
              return;
            }
            if (autoUnmount && !this.fieldsMeta[name] && this._getCache(name, key)) {
              var cache = this._getCache(name, key);
              this.fieldsMeta[name] = cache;
              this.setValue(name, this.options.parseName ? cache._value : cache.value, false, false);
              this.options.parseName && "_value" in cache && delete cache._value;
            }
            var field = this._get(name);
            if (field) {
              if (!component && !autoUnmount) {
                field.state = "";
                delete field.errors;
                delete field.rules;
                delete field.rulesMap;
              }
              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 (typeof 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;
            }
          };
          Field2.prototype._validate = function(name, rule, trigger) {
            var _a, _b;
            var _this_1 = 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 Schema((_a = {}, _a[name] = rule, _a), { messages: this.options.messages });
            this._setCache(name, trigger, validate);
            validate.validate((_b = {}, _b[name] = value, _b), function(errors) {
              var newErrors, newState;
              if (errors && errors.length) {
                newErrors = getErrorStrs(errors, _this_1.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 && _this_1._reRender(name, "validate");
            });
          };
          Field2.prototype._spliceArrayValue = function(key, index2, howmany) {
            var e_5, _a;
            var _this_1 = this;
            var argv = [];
            for (var _i = 3; _i < arguments.length; _i++) {
              argv[_i - 3] = arguments[_i];
            }
            var argc = argv.length;
            var offset2 = 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();
            var willChangeNames = [];
            names.forEach(function(n2) {
              var ret = keyReg.exec(n2);
              if (ret) {
                var idx_1 = parseInt(ret[2]);
                if (idx_1 >= startIndex) {
                  var l2 = listMap[idx_1];
                  var item = {
                    from: n2,
                    to: n2.replace(keyReg, function(match, p1) {
                      return "".concat(p1).concat(idx_1 - offset2);
                    })
                  };
                  willChangeNames.push(item.from);
                  if (names.includes(item.to)) {
                    willChangeNames.push(item.to);
                  }
                  if (!l2) {
                    listMap[idx_1] = [item];
                  } else {
                    l2.push(item);
                  }
                }
                if (offset2 > 0 && idx_1 >= index2 && idx_1 < index2 + howmany) {
                  replaceArgv.push(n2);
                }
              }
            });
            var oldValues = this.getValues(willChangeNames);
            var offsetList = Object.keys(listMap).map(function(i2) {
              return {
                index: Number(i2),
                list: listMap[i2]
              };
            }).sort(function(a, b2) {
              return offset2 > 0 ? a.index - b2.index : b2.index - a.index;
            });
            offsetList.forEach(function(l2) {
              var list2 = l2.list;
              list2.forEach(function(i2) {
                _this_1.fieldsMeta[i2.to] = _this_1.fieldsMeta[i2.from];
                _this_1.fieldsMeta[i2.to].name = i2.to;
              });
            });
            if (offsetList.length > 0) {
              var removeList = offsetList.slice(offsetList.length - (offset2 < 0 ? -offset2 : offset2), offsetList.length);
              removeList.forEach(function(item) {
                item.list.forEach(function(i2) {
                  delete _this_1.fieldsMeta[i2.from];
                });
              });
            } else {
              replaceArgv.forEach(function(i2) {
                delete _this_1.fieldsMeta[i2];
              });
            }
            var p2 = this.getValue(key);
            if (p2) {
              p2.splice.apply(p2, __spreadArray([index2, howmany], __read(argv), false));
            }
            try {
              for (var willChangeNames_2 = __values(willChangeNames), willChangeNames_2_1 = willChangeNames_2.next(); !willChangeNames_2_1.done; willChangeNames_2_1 = willChangeNames_2.next()) {
                var name_9 = willChangeNames_2_1.value;
                this._triggerFieldChange(name_9, this.getValue(name_9), oldValues[name_9], "setValue");
              }
            } catch (e_5_1) {
              e_5 = { error: e_5_1 };
            } finally {
              try {
                if (willChangeNames_2_1 && !willChangeNames_2_1.done && (_a = willChangeNames_2.return))
                  _a.call(willChangeNames_2);
              } finally {
                if (e_5)
                  throw e_5.error;
              }
            }
            this._reRender();
          };
          Field2.prototype._triggerFieldChange = function(name, value, oldValue, triggerType) {
            var e_6, _a;
            if (Object.is(value, oldValue)) {
              return;
            }
            var listenerSet = this.listeners[name];
            if (!(listenerSet === null || listenerSet === void 0 ? void 0 : listenerSet.size)) {
              return;
            }
            try {
              for (var listenerSet_1 = __values(listenerSet), listenerSet_1_1 = listenerSet_1.next(); !listenerSet_1_1.done; listenerSet_1_1 = listenerSet_1.next()) {
                var callback = listenerSet_1_1.value;
                callback(name, value, oldValue, triggerType);
              }
            } catch (e_6_1) {
              e_6 = { error: e_6_1 };
            } finally {
              try {
                if (listenerSet_1_1 && !listenerSet_1_1.done && (_a = listenerSet_1.return))
                  _a.call(listenerSet_1);
              } finally {
                if (e_6)
                  throw e_6.error;
              }
            }
          };
          Field2.prototype._triggerAfterValidateRerender = function(errorsGroup) {
            if (typeof this.afterValidateRerender === "function") {
              this.afterValidateRerender({
                errorsGroup,
                options: this.options,
                instance: this.instance
              });
            }
          };
          return Field2;
        }()
      );
      function cloneAndAddKey(element) {
        if (element && React__default.isValidElement(element)) {
          var key = element.key || "error";
          return React__default.cloneElement(element, { key });
        }
        return element;
      }
      function scrollToFirstError(_a) {
        var errorsGroup = _a.errorsGroup, options = _a.options, instance2 = _a.instance;
        if (errorsGroup && options.scrollToFirstError) {
          var firstNode = void 0;
          var firstTop = void 0;
          for (var i2 in errorsGroup) {
            if (errorsGroup.hasOwnProperty(i2)) {
              var node = ReactDOM.findDOMNode(instance2[i2]);
              if (!node) {
                return;
              }
              var top_1 = node.offsetTop;
              if (firstTop === void 0 || firstTop > top_1) {
                firstTop = top_1;
                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 ("scrollIntoViewIfNeeded" in firstNode && typeof firstNode.scrollIntoViewIfNeeded === "function") {
              firstNode.scrollIntoViewIfNeeded(true);
            } else {
              firstNode.scrollIntoView({ block: "center" });
            }
          }
        }
      }
      var NextField = (
        /** @class */
        function(_super) {
          __extends(NextField2, _super);
          function NextField2(com, options) {
            if (options === void 0) {
              options = {};
            }
            var _this = this;
            var _a = options.scrollToFirstError, scrollToFirstErrorOption = _a === void 0 ? true : _a;
            var newOptions = Object.assign({}, options, {
              scrollToFirstError: scrollToFirstErrorOption,
              afterValidateRerender: scrollToFirstError,
              processErrorMessage: cloneAndAddKey
            });
            _this = _super.call(this, com, newOptions) || this;
            _this.validate = _this.validate.bind(_this);
            _this.reset = _this.reset.bind(_this);
            return _this;
          }
          NextField2.useField = function(options) {
            if (options === void 0) {
              options = {};
            }
            if (!React__default.useState || !React__default.useMemo) {
              log.warning("need react version > 16.8.0");
              return;
            }
            return this.getUseField({ useMemo: React__default.useMemo, useState: React__default.useState })(options);
          };
          NextField2.useWatch = function(field, names, callback) {
            var callbackRef = React__default.useRef(callback);
            callbackRef.current = callback;
            var unwatch = React__default.useMemo(function() {
              return field.watch(names, function() {
                var args = [];
                for (var _i = 0; _i < arguments.length; _i++) {
                  args[_i] = arguments[_i];
                }
                if (typeof callbackRef.current === "function") {
                  callbackRef.current.apply(callbackRef, __spreadArray([], __read(args), false));
                }
              });
            }, [field, names.join(",")]);
            React__default.useEffect(function() {
              return unwatch;
            }, [unwatch]);
          };
          NextField2.prototype.validate = function(names, callback) {
            if (typeof names === "function") {
              return this.validateCallback(names);
            }
            return this.validateCallback(names, callback);
          };
          NextField2.prototype.reset = function(names, backToDefault) {
            if (backToDefault === void 0) {
              backToDefault = false;
            }
            if (names === true) {
              log.deprecated("reset(true)", "resetToDefault()", "Field");
              this.resetToDefault();
            } else if (backToDefault === true) {
              log.deprecated("reset(ns,true)", "resetToDefault(ns)", "Field");
              this.resetToDefault(names || void 0);
            } else {
              _super.prototype.reset.call(this, names || void 0);
            }
          };
          return NextField2;
        }(Field)
      );
      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$5({}, 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$2(colSpan)) === "object" && "desktop" in colSpan ? colSpan.desktop : colSpan;
        ["tablet", "phone"].forEach(function(deviceKey) {
          if (deviceKey === device) {
            if ((typeof colSpan === "undefined" ? "undefined" : _default$2(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$5({
          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$5({
          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$5({}, 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$5({}, 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$5({
              // 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 pickOthers$2 = obj.pickOthers;
      var createChildren$1 = function(children, _a) {
        var spacing = _a.spacing, direction = _a.direction, wrap2 = _a.wrap;
        var array = React__default.Children.toArray(children);
        if (!children) {
          return null;
        }
        return array.map(function(child, index2) {
          var spacingMargin = {};
          spacingMargin = getChildMargin(spacing);
          if (!wrap2) {
            var isNone_1 = [index2 === 0, index2 === array.length - 1];
            var props_1 = direction === "row" ? ["marginLeft", "marginRight"] : ["marginTop", "marginBottom"];
            ["marginTop", "marginRight", "marginBottom", "marginLeft"].forEach(function(prop) {
              if (prop in spacingMargin && props_1.indexOf(prop) === -1) {
                spacingMargin[prop] = 0;
              }
              props_1.forEach(function(key, i2) {
                if (key in spacingMargin && isNone_1[i2]) {
                  spacingMargin[key] = 0;
                }
              });
            });
          }
          if (React__default.isValidElement(child)) {
            var propsMargin = child.props.margin;
            var childPropsMargin = getMargin(propsMargin);
            var gridProps = {};
            if (["function", "object"].indexOf(typeof child.type) > -1 && child.type._typeMark === "responsive_grid") {
              gridProps = createStyle(__assign({ display: "grid" }, child.props));
            }
            return React__default.cloneElement(child, {
              style: __assign(__assign(__assign(__assign({}, spacingMargin), childPropsMargin), gridProps), child.props.style || {})
            });
          }
          return child;
        });
      };
      var getStyle$1 = function(style, props) {
        return __assign(__assign({}, createStyle(__assign({ display: "flex" }, props))), style);
      };
      var getOuterStyle = function(style, styleProps) {
        var sheet = getStyle$1(style, styleProps);
        return filterOuterStyle(sheet);
      };
      var getHelperStyle = function(style, styleProps) {
        var sheet = getStyle$1(style, styleProps);
        return filterHelperStyle(__assign(__assign({}, sheet), getSpacingHelperMargin(styleProps.spacing)));
      };
      var getInnerStyle = function(style, styleProps) {
        var sheet = getStyle$1(style, styleProps);
        return filterInnerStyle(sheet);
      };
      var Box = (
        /** @class */
        function(_super) {
          __extends(Box2, _super);
          function Box2() {
            return _super !== null && _super.apply(this, arguments) || this;
          }
          Box2.prototype.render = function() {
            var _a;
            var _b = this.props, prefix = _b.prefix, direction = _b.direction, justify = _b.justify, align = _b.align, wrap2 = _b.wrap, flex2 = _b.flex, spacing = _b.spacing, padding = _b.padding, margin = _b.margin, style = _b.style, className = _b.className, children = _b.children, device = _b.device, component = _b.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((_a = {}, _a["".concat(prefix, "box")] = true, _a), className);
            if (wrap2 && spacing) {
              var outerStyle = getOuterStyle(style, styleProps);
              var helperStyle = getHelperStyle(style, styleProps);
              var innerStyle = getInnerStyle(style, styleProps);
              return React__default.createElement(
                View,
                __assign({ style: outerStyle, className: cls }, others),
                React__default.createElement(
                  "div",
                  { style: helperStyle },
                  React__default.createElement("div", { style: innerStyle, className: "".concat(prefix, "box") }, boxs)
                )
              );
            }
            return React__default.createElement(View, __assign({ style: styleSheet, className: cls }, others), boxs);
          };
          Box2.propTypes = {
            prefix: PT.string,
            style: PT.object,
            className: PT.any,
            /**
             * 布局属性
             */
            flex: PT.oneOfType([
              PT.arrayOf(PT.oneOfType([PT.number, PT.string])),
              PT.number
            ]),
            /**
             * 布局方向,默认为 column ,一个元素占据一整行
             * @defaultValue column
             */
            direction: PT.oneOf(["row", "column", "row-reverse"]),
            /**
             * 是否折行 支持IE11+
             */
            wrap: PT.bool,
            /**
             * 元素之间的间距 [bottom&top, right&left]
             */
            spacing: PT.oneOfType([PT.arrayOf(PT.number), PT.number]),
            /**
             * 设置 margin [bottom&top, right&left]
             */
            margin: PT.oneOfType([PT.arrayOf(PT.number), PT.number]),
            /**
             * 设置 padding [bottom&top, right&left]
             */
            padding: PT.oneOfType([PT.arrayOf(PT.number), PT.number]),
            /**
             * 沿着主轴方向,子元素们的排布关系 (兼容性同 justify-content )
             */
            justify: PT.oneOf([
              "flex-start",
              "center",
              "flex-end",
              "space-between",
              "space-around"
            ]),
            /**
             * 垂直主轴方向,子元素们的排布关系 (兼容性同 align-items )
             */
            align: PT.oneOf(["flex-start", "center", "flex-end", "baseline", "stretch"]),
            device: PT.oneOf(["phone", "tablet", "desktop"]),
            /**
             * 定制标签名, 例如section等
             */
            component: PT.string
          };
          Box2.defaultProps = {
            prefix: "next-",
            direction: "column",
            wrap: false,
            component: "div"
          };
          return Box2;
        }(React__default.Component)
      );
      const Box$1 = ConfigProvider$1.config(Box);
      var _class$x, _temp$j;
      var pickOthers$1 = obj.pickOthers;
      var Cell$2 = (_temp$j = _class$x = function(_Component) {
        _default(Cell2, _Component);
        function Cell2() {
          _default$3(this, Cell2);
          return _default$1(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__default.createElement(
            View,
            others,
            children
          );
        };
        return Cell2;
      }(React__default.Component), _class$x._typeMark = "responsive_grid_cell", _class$x.propTypes = {
        device: PT.oneOf(["phone", "tablet", "desktop"]),
        /**
         * 横向,占据几列
         */
        colSpan: PT.oneOfType([PT.number, PT.object]),
        /**
         * 纵向,占据几行
         */
        rowSpan: PT.number,
        /**
         * 设置标签类型
         */
        component: PT.elementType
      }, _class$x.defaultProps = {
        component: "div",
        device: "desktop"
      }, _temp$j);
      Cell$2.displayName = "Cell";
      const Cell$3 = ConfigProvider$1.config(Cell$2);
      var _class$w, _temp$i;
      var ieVersion$2 = env.ieVersion;
      var pickOthers = obj.pickOthers, isReactFragment = obj.isReactFragment;
      var createChildren = function createChildren2(children, device, gap) {
        var array = React__default.Children.toArray(children);
        if (!children) {
          return null;
        }
        return array.map(function(child) {
          if (isReactFragment(child)) {
            return createChildren2(child.props.children, device, gap);
          }
          if (React__default.isValidElement(child) && ["function", "object"].indexOf(_default$2(child.type)) > -1 && ["form_item", "responsive_grid_cell"].indexOf(child.type._typeMark) > -1) {
            return React__default.cloneElement(child, {
              style: _default$5({}, getGridChildProps(child.props, device, gap), child.props.style || {})
            });
          }
          return child;
        });
      };
      var getStyle = function getStyle2() {
        var style = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
        var props = arguments[1];
        return _default$5({}, createStyle(_default$5({ display: "grid" }, props)), style);
      };
      var ResponsiveGrid = (_temp$i = _class$w = function(_Component) {
        _default(ResponsiveGrid2, _Component);
        function ResponsiveGrid2() {
          _default$3(this, ResponsiveGrid2);
          return _default$1(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 = getStyle(style, styleProps);
          var cls = classnames((_classNames = {}, _classNames[prefix + "responsive-grid"] = true, _classNames[prefix + "responsive-grid-ie"] = ieVersion$2, _classNames), className);
          return ieVersion$2 ? React__default.createElement(Box$1, _default$5({}, this.props, { direction: "row", wrap: true, spacing: gap, children: createChildren(children, device, gap) })) : React__default.createElement(
            View,
            _default$5({ style: styleSheet, className: cls }, others),
            createChildren(children, device, gap)
          );
        };
        return ResponsiveGrid2;
      }(React__default.Component), _class$w._typeMark = "responsive_grid", _class$w.propTypes = {
        prefix: PT.string,
        className: PT.any,
        /**
         * 设备,用来做自适应,默认为 PC
         * @enumdesc 手机, 平板, PC
         */
        device: PT.oneOf(["phone", "tablet", "desktop"]),
        rows: PT.oneOfType([PT.number, PT.string]),
        /**
         * 分为几列, 默认是 12 列
         */
        columns: PT.oneOfType([PT.number, PT.string]),
        /**
         * 每个 cell 之间的间距, [bottom&top, right&left]
         */
        gap: PT.oneOfType([PT.arrayOf(PT.number), PT.number]),
        /**
         * 设置标签类型
         */
        component: PT.elementType,
        /**
         * 是否开启紧密模式,开启后尽可能能紧密填满,尽量不出现空格
         */
        dense: PT.bool,
        style: PT.object
      }, _class$w.defaultProps = {
        prefix: "next-",
        component: "div",
        device: "desktop",
        dense: false
      }, _temp$i);
      ResponsiveGrid.displayName = "ResponsiveGrid";
      ResponsiveGrid.Cell = Cell$3;
      const RGrid = ConfigProvider$1.config(ResponsiveGrid);
      var _class$v, _temp$h;
      function pickerDefined(obj2) {
        var newObj = {};
        Object.keys(obj2).forEach(function(i2) {
          if (typeof obj2[i2] !== "undefined") {
            newObj[i2] = obj2[i2];
          }
        });
        return newObj;
      }
      function preventDefault(e2) {
        e2.preventDefault();
      }
      var getNewChildren = function getNewChildren2(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__default.Children.map(children, function(child) {
          if (obj.isReactFragment(child)) {
            return getNewChildren2(child.props.children, props);
          }
          if (child && ["function", "object"].indexOf(_default$2(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__default.cloneElement(child, pickerDefined(childrenProps));
          }
          return child;
        });
      };
      var Form$1 = (_temp$h = _class$v = function(_React$Component) {
        _default(Form2, _React$Component);
        function Form2(props) {
          _default$3(this, Form2);
          var _this = _default$1(this, _React$Component.call(this, props));
          _this.onChange = function(name, value) {
            _this.props.onChange(_this._formField.getValues(), {
              name,
              value,
              field: _this._formField
            });
          };
          _this._formField = null;
          if (props.field !== false) {
            var options = _default$5({}, props.fieldOptions, {
              onChange: _this.onChange
            });
            if (props.field) {
              _this._formField = props.field;
              var onChange = _this._formField.options.onChange;
              options.onChange = func.makeChain(onChange, _this.onChange);
              _this._formField.setOptions && _this._formField.setOptions(options);
            } else {
              if ("value" in props) {
                options.values = props.value;
              }
              _this._formField = new NextField(_this, options);
            }
            if (props.locale && props.locale.Validate) {
              _this._formField.setOptions({ messages: props.locale.Validate });
            }
            props.saveField(_this._formField);
          }
          return _this;
        }
        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,
            _formMarginToDisplayHelp: this.props.preferMarginToDisplayHelp
          };
        };
        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, device = _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, Tag2 = _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 = getNewChildren(children, this.props);
          return React__default.createElement(
            Tag2,
            _default$5({
              role: "grid"
            }, obj.pickOthers(Form2.propTypes, this.props), {
              className: formClassName,
              style,
              dir: rtl ? "rtl" : void 0,
              onSubmit
            }),
            responsive ? React__default.createElement(
              RGrid,
              { gap, device },
              newChildren
            ) : newChildren
          );
        };
        return Form2;
      }(React__default.Component), _class$v.propTypes = {
        /**
         * 样式前缀
         */
        prefix: PT.string,
        /**
         * 内联表单
         */
        inline: PT.bool,
        /**
         * 单个 Item 的 size 自定义,优先级高于 Form 的 size, 并且当组件与 Item 一起使用时,组件自身设置 size 属性无效。
         * @enumdesc 大, 中, 小
         */
        size: PT.oneOf(["large", "medium", "small"]),
        /**
         * 单个 Item 中表单类组件宽度是否是100%
         */
        fullWidth: PT.bool,
        /**
         * 标签的位置, 如果不设置 labelCol 和 wrapperCol 那么默认是标签在上
         * @enumdesc 上, 左, 内
         */
        labelAlign: PT.oneOf(["top", "left", "inset"]),
        /**
         * 标签的左右对齐方式
         * @enumdesc 左, 右
         */
        labelTextAlign: PT.oneOf(["left", "right"]),
        /**
         * field 实例, 传 false 会禁用 field
         */
        field: PT.any,
        /**
         * 保存 Form 自动生成的 field 对象
         */
        saveField: PT.func,
        /**
         * 控制第一级 Item 的 labelCol
         */
        labelCol: PT.object,
        /**
         * 控制第一级 Item 的 wrapperCol
         */
        wrapperCol: PT.object,
        /**
         * form内有 `htmlType="submit"` 的元素的时候会触发
         */
        onSubmit: PT.func,
        /**
         * 子元素
         */
        children: PT.any,
        /**
         * 扩展class
         */
        className: PT.string,
        /**
         * 自定义内联样式
         */
        style: PT.object,
        /**
         * 表单数值
         */
        value: PT.object,
        /**
         * 表单变化回调
         * @param {Object} values 表单数据
         * @param {Object} item 详细
         * @param {String} item.name 变化的组件名
         * @param {String} item.value 变化的数据
         * @param {Object} item.field field 实例
         */
        onChange: PT.func,
        /**
         * 设置标签类型
         */
        component: PT.oneOfType([PT.string, PT.func]),
        fieldOptions: PT.object,
        rtl: PT.bool,
        /**
         * 预设屏幕宽度
         */
        device: PT.oneOf(["phone", "tablet", "desktop"]),
        /**
         * 是否开启内置的响应式布局 (使用ResponsiveGrid)
         * @version 1.19
         */
        responsive: PT.bool,
        /**
         * 是否开启预览态
         * @version 1.19
         */
        isPreview: PT.bool,
        /**
         * 是否使用 label 替换校验信息的 name 字段
         * @version 1.20
         */
        useLabelForErrorMessage: PT.bool,
        /**
         * 倾向使用 item 的 margin 空间来展示 help
         * @default false
         * @version 1.26.37
         */
        preferMarginToDisplayHelp: PT.bool,
        /**
         * 表示是否显示 label 后面的冒号
         * @version 1.22
         */
        colon: PT.bool,
        /**
         * 是否禁用表单
         */
        disabled: PT.bool,
        // 在 responsive模式下,透传给 ResponsiveGrid的, 表示 每个 cell 之间的间距, [bottom&top, right&left]
        gap: PT.oneOfType([PT.arrayOf(PT.number), PT.number])
      }, _class$v.defaultProps = {
        prefix: "next-",
        onSubmit: preventDefault,
        size: "medium",
        labelAlign: "left",
        onChange: func.noop,
        component: "form",
        saveField: func.noop,
        device: "desktop",
        colon: false,
        disabled: false,
        preferMarginToDisplayHelp: false
      }, _class$v.childContextTypes = {
        _formField: PT.object,
        _formSize: PT.string,
        _formDisabled: PT.bool,
        _formPreview: PT.bool,
        _formFullWidth: PT.bool,
        _formLabelForErrorMessage: PT.bool,
        _formMarginToDisplayHelp: PT.bool
      }, _temp$h);
      Form$1.displayName = "Form";
      var Row$2 = (
        /** @class */
        function(_super) {
          __extends(Row2, _super);
          function Row2() {
            return _super !== null && _super.apply(this, arguments) || this;
          }
          Row2.prototype.render = function() {
            var _a, _b, _c, _d;
            var _e = this.props, prefix = _e.prefix;
            _e.pure;
            var wrap2 = _e.wrap, fixed2 = _e.fixed, gutter = _e.gutter, fixedWidth = _e.fixedWidth, align = _e.align, justify = _e.justify, hidden = _e.hidden, className = _e.className, style = _e.style, component = _e.component, children = _e.children, rtl = _e.rtl, others = __rest(_e, ["prefix", "pure", "wrap", "fixed", "gutter", "fixedWidth", "align", "justify", "hidden", "className", "style", "component", "children", "rtl"]);
            var domOtherProps = obj.pickOthers(Row2.propTypes, others);
            var Tag2 = component;
            var hiddenClassObj = {};
            if (hidden === true) {
              hiddenClassObj = (_a = {}, _a["".concat(prefix, "row-hidden")] = true, _a);
            } else if (typeof hidden === "string") {
              hiddenClassObj = (_b = {}, _b["".concat(prefix, "row-").concat(hidden, "-hidden")] = !!hidden, _b);
            } else if (Array.isArray(hidden)) {
              hiddenClassObj = hidden.reduce(function(ret, point) {
                ret["".concat(prefix, "row-").concat(point, "-hidden")] = !!point;
                return ret;
              }, {});
            }
            var newClassName = classnames(__assign(__assign((_c = {}, _c["".concat(prefix, "row")] = true, _c["".concat(prefix, "row-wrap")] = wrap2, _c["".concat(prefix, "row-fixed")] = fixed2, _c["".concat(prefix, "row-fixed-").concat(fixedWidth)] = !!fixedWidth, _c["".concat(prefix, "row-justify-").concat(justify)] = !!justify, _c["".concat(prefix, "row-align-").concat(align)] = !!align, _c), hiddenClassObj), (_d = {}, _d[className] = !!className, _d)));
            var newChildren = children;
            var newStyle = style;
            var gutterNumber = parseInt(gutter.toString(), 10);
            if (gutterNumber !== 0) {
              var halfGutterString_1 = "".concat(gutterNumber / 2, "px");
              newStyle = __assign({ marginLeft: "-".concat(halfGutterString_1), marginRight: "-".concat(halfGutterString_1) }, newStyle);
              newChildren = React__default.Children.map(children, function(child) {
                if (child && child.type && typeof child.type === "function" && child.type.isNextCol) {
                  var newChild = React__default.cloneElement(child, {
                    style: __assign({ paddingLeft: halfGutterString_1, paddingRight: halfGutterString_1 }, child.style || {})
                  });
                  return newChild;
                }
                return child;
              });
            }
            return React__default.createElement(Tag2, __assign({ dir: rtl ? "rtl" : "ltr", role: "row", className: newClassName, style: newStyle }, domOtherProps), newChildren);
          };
          Row2.propTypes = __assign(__assign({}, ConfigProvider$1.propTypes), {
            prefix: PT.string,
            pure: PT.bool,
            rtl: PT.bool,
            className: PT.string,
            style: PT.object,
            /**
             * 行内容
             */
            children: PT.node,
            /**
             * 列间隔
             */
            gutter: PT.oneOfType([PT.string, PT.number]),
            /**
             * 列在行中宽度溢出后是否换行
             */
            wrap: PT.bool,
            /**
             * 行在某一断点下宽度是否保持不变(默认行宽度随视口变化而变化)
             */
            fixed: PT.bool,
            fixedWidth: PT.oneOf(["xxs", "xs", "s", "m", "l", "xl"]),
            align: PT.oneOf(["top", "center", "bottom", "baseline", "stretch"]),
            justify: PT.oneOf(["start", "center", "end", "space-between", "space-around"]),
            hidden: PT.oneOfType([PT.bool, PT.string, PT.array]),
            component: PT.oneOfType([PT.string, PT.func])
          });
          Row2.defaultProps = {
            prefix: "next-",
            pure: false,
            fixed: false,
            gutter: 0,
            wrap: false,
            component: "div"
          };
          return Row2;
        }(React__default.Component)
      );
      const Row$3 = Row$2;
      var breakPoints = ["xxs", "xs", "s", "m", "l", "xl"];
      var Col$1 = (
        /** @class */
        function(_super) {
          __extends(Col2, _super);
          function Col2() {
            return _super !== null && _super.apply(this, arguments) || this;
          }
          Col2.prototype.render = function() {
            var _a, _b, _c, _d;
            var _this = this;
            var _e = this.props, prefix = _e.prefix;
            _e.pure;
            var span = _e.span, offset2 = _e.offset, fixedSpan = _e.fixedSpan, fixedOffset = _e.fixedOffset, hidden = _e.hidden, align = _e.align;
            _e.xxs;
            _e.xs;
            _e.s;
            _e.m;
            _e.l;
            _e.xl;
            var component = _e.component, className = _e.className, children = _e.children, rtl = _e.rtl, others = __rest(_e, ["prefix", "pure", "span", "offset", "fixedSpan", "fixedOffset", "hidden", "align", "xxs", "xs", "s", "m", "l", "xl", "component", "className", "children", "rtl"]);
            var domOtherProps = obj.pickOthers(Col2.propTypes, others);
            var Tag2 = component;
            var pointClassObj = breakPoints.reduce(function(ret, point) {
              var pointProps = {};
              var pointValue = _this.props[point];
              if (typeof pointValue === "object" && pointValue !== null) {
                pointProps = pointValue;
              } else {
                pointProps.span = pointValue;
              }
              ret["".concat(prefix, "col-").concat(point, "-").concat(pointProps.span)] = !!pointProps.span;
              ret["".concat(prefix, "col-").concat(point, "-offset-").concat(pointProps.offset)] = !!pointProps.offset;
              return ret;
            }, {});
            var hiddenClassObj = {};
            if (hidden === true) {
              hiddenClassObj = (_a = {}, _a["".concat(prefix, "col-hidden")] = true, _a);
            } else if (typeof hidden === "string") {
              hiddenClassObj = (_b = {}, _b["".concat(prefix, "col-").concat(hidden, "-hidden")] = !!hidden, _b);
            } else if (Array.isArray(hidden)) {
              hiddenClassObj = hidden.reduce(function(ret, point) {
                ret["".concat(prefix, "col-").concat(point, "-hidden")] = !!point;
                return ret;
              }, {});
            }
            var classes = classnames(__assign(__assign(__assign((_c = {}, _c["".concat(prefix, "col")] = true, _c["".concat(prefix, "col-").concat(span)] = !!span, _c["".concat(prefix, "col-fixed-").concat(fixedSpan)] = !!fixedSpan, _c["".concat(prefix, "col-offset-").concat(offset2)] = !!offset2, _c["".concat(prefix, "col-offset-fixed-").concat(fixedOffset)] = !!fixedOffset, _c["".concat(prefix, "col-").concat(align)] = !!align, _c), pointClassObj), hiddenClassObj), (_d = {}, _d[className] = !!className, _d)));
            return React__default.createElement(Tag2, __assign({ dir: rtl ? "rtl" : "ltr", role: "gridcell", className: classes }, domOtherProps), children);
          };
          Col2.isNextCol = true;
          Col2.propTypes = __assign(__assign({}, ConfigProvider$1.propTypes), {
            prefix: PT.string,
            pure: PT.bool,
            rtl: PT.bool,
            className: PT.string,
            /**
             * 列内容
             */
            children: PT.node,
            /**
             * 列宽度<br><br>**可选值**:<br>1, 2, 3, ..., 22, 23, 24
             */
            span: PT.oneOfType([PT.string, PT.number]),
            /**
             * 固定列宽度,宽度值为20 * 栅格数<br><br>**可选值**:<br>1, 2, 3, ..., 28, 29, 30
             */
            fixedSpan: PT.oneOfType([PT.string, PT.number]),
            /**
             * (不支持IE9浏览器)列偏移<br><br>**可选值**:<br>1, 2, 3, ..., 22, 23, 24
             */
            offset: PT.oneOfType([PT.string, PT.number]),
            /**
             * (不支持IE9浏览器)固定列偏移,宽度值为20 * 栅格数<br><br>**可选值**:<br>1, 2, 3, ..., 28, 29, 30
             */
            fixedOffset: PT.oneOfType([PT.string, PT.number]),
            /**
             * (不支持IE9浏览器)多列垂直方向对齐方式,可覆盖Row的align属性
             */
            align: PT.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: PT.oneOfType([PT.bool, PT.string, PT.array]),
            xxs: PT.oneOfType([PT.string, PT.number, PT.object]),
            xs: PT.oneOfType([PT.string, PT.number, PT.object]),
            s: PT.oneOfType([PT.string, PT.number, PT.object]),
            m: PT.oneOfType([PT.string, PT.number, PT.object]),
            l: PT.oneOfType([PT.string, PT.number, PT.object]),
            xl: PT.oneOfType([PT.string, PT.number, PT.object]),
            component: PT.oneOfType([PT.string, PT.func])
          });
          Col2.defaultProps = {
            prefix: "next-",
            pure: false,
            component: "div"
          };
          return Col2;
        }(React__default.Component)
      );
      const Col$2 = Col$1;
      var Grid = {
        Row: ConfigProvider$1.config(Row$3, {
          transform: (
            /* istanbul ignore next */
            function(props, deprecated2) {
              if ("type" in props) {
                deprecated2("type", "fixed | wrap | gutter", "Row");
                var type2 = props.type, others = __rest(props, ["type"]);
                var types2 = Array.isArray(type2) ? type2 : [type2];
                var fixed2 = void 0;
                if (types2.indexOf("fixed") > -1) {
                  fixed2 = true;
                }
                var wrap2 = void 0;
                if (types2.indexOf("wrap") > -1) {
                  wrap2 = true;
                }
                props = __assign({ fixed: fixed2, wrap: wrap2 }, others);
              }
              return props;
            }
          )
        }),
        Col: ConfigProvider$1.config(Col$2)
      };
      var _class$u, _temp2$d;
      var Error$1 = (_temp2$d = _class$u = function(_React$Component) {
        _default(Error2, _React$Component);
        function Error2() {
          var _temp3, _this, _ret;
          _default$3(this, Error2);
          for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
            args[_key] = arguments[_key];
          }
          return _ret = (_temp3 = (_this = _default$1(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.itemRender = function(errors) {
            return errors.length ? errors : null;
          }, _temp3), _default$1(_this, _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, preferMarginToDisplayHelp = _props.preferMarginToDisplayHelp, others = _default$4(_props, ["children", "name", "prefix", "style", "className", "field", "preferMarginToDisplayHelp"]);
          if (children && typeof children !== "function") {
            return React__default.createElement(
              "div",
              { className: prefix + "form-item-help" },
              children,
              !!preferMarginToDisplayHelp && React__default.createElement("div", { className: prefix + "form-item-help-margin-offset" })
            );
          }
          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__default.createElement(
            "div",
            _default$5({}, others, { className: cls, style }),
            result,
            !!preferMarginToDisplayHelp && React__default.createElement("div", { className: prefix + "form-item-help-margin-offset" })
          );
        };
        return Error2;
      }(React__default.Component), _class$u.propTypes = {
        /**
         * 表单名
         */
        name: PT.oneOfType([PT.string, PT.array]),
        /**
         * 自定义 field (在 Form 内不需要设置)
         */
        field: PT.object,
        style: PT.object,
        className: PT.string,
        /**
         * 自定义错误渲染, 可以是 node 或者 function(errors, state)
         */
        children: PT.oneOfType([PT.node, PT.func]),
        prefix: PT.string,
        preferMarginToDisplayHelp: PT.bool
      }, _class$u.defaultProps = {
        prefix: "next-",
        preferMarginToDisplayHelp: false
      }, _class$u.contextTypes = {
        _formField: PT.object
      }, _class$u._typeMark = "form_error", _temp2$d);
      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$t, _temp$g;
      var Row$1 = Grid.Row, Col = Grid.Col;
      var Cell$1 = RGrid.Cell;
      var isNil = obj.isNil;
      var Item$1 = (_temp$g = _class$t = function(_React$Component) {
        _default(Item2, _React$Component);
        function Item2() {
          _default$3(this, Item2);
          return _default$1(this, _React$Component.apply(this, arguments));
        }
        Item2.prototype.getNames = function getNames(children) {
          var name = this.props.name;
          var childrenList = React__default.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 _props = this.props, help = _props.help, preferMarginToDisplayHelp = _props.preferMarginToDisplayHelp;
          var _context = this.context, _formField = _context._formField, _formMarginToDisplayHelp = _context._formMarginToDisplayHelp;
          var useMargin = typeof preferMarginToDisplayHelp !== "undefined" ? preferMarginToDisplayHelp : _formMarginToDisplayHelp;
          return React__default.createElement(
            Error$2,
            {
              name: help === void 0 ? this.getNames(children) : void 0,
              field: _formField,
              preferMarginToDisplayHelp: useMargin
            },
            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 _props2 = this.props, errorMessageName = _props2.errorMessageName, label = _props2.label, useLabelForErrorMessage = _props2.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 _props3 = this.props, id2 = _props3.id, required2 = _props3.required, _props3$asterisk = _props3.asterisk, asterisk = _props3$asterisk === void 0 ? required2 : _props3$asterisk, label = _props3.label, labelCol = _props3.labelCol, wrapperCol = _props3.wrapperCol, prefix = _props3.prefix, responsive = _props3.responsive, labelWidth = _props3.labelWidth, labelTextAlign = _props3.labelTextAlign, colon = _props3.colon;
          var labelAlign = this.getLabelAlign(this.props.labelAlign, this.props.device);
          if (!label) {
            return null;
          }
          var ele = React__default.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__default.createElement(
              "div",
              { className: cls, style: { width: labelWidth } },
              ele
            );
          }
          if ((wrapperCol || labelCol) && labelAlign !== "top") {
            return React__default.createElement(
              Col,
              _default$5({}, labelCol, { className: cls }),
              ele
            );
          }
          return React__default.createElement(
            "div",
            { className: cls },
            ele
          );
        };
        Item2.prototype.getItemWrapper = function getItemWrapper(children) {
          var _this2 = this;
          var _props4 = this.props, hasFeedback = _props4.hasFeedback, labelCol = _props4.labelCol, wrapperCol = _props4.wrapperCol, extra = _props4.extra, prefix = _props4.prefix, renderPreview = _props4.renderPreview, name = _props4.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__default.Children.map(children, function(child, idx) {
            if (child && ["function", "object"].indexOf(_default$2(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$5({}, getFieldInitCfg(_this2.props, child.type.displayName, labelForErrorMessage), {
                  props: _default$5({}, child.props, { ref: child.ref })
                }), childrenProps);
              } else {
                extraProps = _default$5({}, child.props, extraProps);
              }
              return React__default.cloneElement(child, extraProps);
            }
            return child;
          });
          var help = this.getHelper(children);
          if ((wrapperCol || labelCol) && labelAlign !== "top") {
            return React__default.createElement(
              Col,
              _default$5({}, wrapperCol, { className: prefix + "form-item-control", key: "item" }),
              ele,
              " ",
              help,
              " ",
              extra
            );
          }
          return React__default.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 _props5 = this.props, className = _props5.className, style = _props5.style, prefix = _props5.prefix, wrapperCol = _props5.wrapperCol, labelCol = _props5.labelCol, responsive = _props5.responsive, children = _props5.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 Tag2 = responsive ? Cell$1 : (wrapperCol || labelCol) && labelAlign !== "top" ? Row$1 : "div";
          var label = labelAlign === "inset" ? null : this.getItemLabel(childrenNode);
          return React__default.createElement(
            Tag2,
            _default$5({}, obj.pickOthers(Item2.propTypes, this.props), { className: itemClassName, style }),
            label,
            this.getItemWrapper(childrenNode)
          );
        };
        return Item2;
      }(React__default.Component), _class$t.propTypes = {
        /**
         * 样式前缀
         */
        prefix: PT.string,
        rtl: PT.bool,
        /**
         * label 标签的文本
         */
        label: PT.node,
        /**
         * label 标签布局,通 `<Col>` 组件,设置 span offset 值,如 {span: 8, offset: 16},该项仅在垂直表单有效
         */
        labelCol: PT.object,
        /**
         * 需要为输入控件设置布局样式时,使用该属性,用法同 labelCol
         */
        wrapperCol: PT.object,
        /**
         * 自定义提示信息,如不设置,则会根据校验规则自动生成.
         */
        help: PT.node,
        /**
         * 字段名,默认赋值给第一个子元素
         */
        name: PT.string,
        /**
         * 额外的提示信息,和 help 类似,当需要错误信息和提示文案同时出现时,可以使用这个。 位于错误信息后面
         */
        extra: PT.node,
        /**
         * 校验状态,如不设置,则会根据校验规则自动生成
         * @enumdesc 失败, 成功, 校验中, 警告
         */
        validateState: PT.oneOf(["error", "success", "loading", "warning"]),
        /**
         * 配合 validateState 属性使用,是否展示 success/loading 的校验状态图标, 目前只有Input支持
         */
        hasFeedback: PT.bool,
        //TODO: hasFeedback => validateStatus=[error,success,loading]
        /**
         * 自定义内联样式
         */
        style: PT.object,
        id: PT.string,
        /**
         * node 或者 function(values)
         */
        children: PT.oneOfType([PT.node, PT.func]),
        /**
         * 单个 Item 的 size 自定义,优先级高于 Form 的 size, 并且当组件与 Item 一起使用时,组件自身设置 size 属性无效。
         */
        size: PT.oneOf(["large", "small", "medium"]),
        /**
         * 单个 Item 中表单类组件宽度是否是100%
         */
        fullWidth: PT.bool,
        /**
         * 标签的位置, 如果不设置 labelCol 和 wrapperCol 那么默认是标签在上
         * @enumdesc 上, 左, 内
         */
        labelAlign: PT.oneOf(["top", "left", "inset"]),
        /**
         * 标签的左右对齐方式
         * @enumdesc 左, 右
         */
        labelTextAlign: PT.oneOf(["left", "right"]),
        /**
         * 扩展class
         */
        className: PT.string,
        /**
         * [表单校验] 不能为空
         */
        required: PT.bool,
        /**
         * required 的星号是否显示
         */
        asterisk: PT.bool,
        /**
         * required 自定义错误信息
         */
        requiredMessage: PT.string,
        /**
         * required 校验何时触发,默认值 onChange, 原生事件均可使用 onChange/onBlur/onFocus/...
         */
        requiredTrigger: PT.oneOfType([PT.string, PT.array]),
        /**
         * [表单校验] 最小值
         */
        min: PT.number,
        /**
         * [表单校验] 最大值
         */
        max: PT.number,
        /**
         * min/max 自定义错误信息
         */
        minmaxMessage: PT.string,
        /**
         * min/max 校验何时触发,默认值 onChange, 原生事件均可使用 onChange/onBlur/onFocus/...
         */
        minmaxTrigger: PT.oneOfType([PT.string, PT.array]),
        /**
         * [表单校验] 字符串最小长度 / 数组最小个数
         */
        minLength: PT.number,
        /**
         * [表单校验] 字符串最大长度 / 数组最大个数
         */
        maxLength: PT.number,
        /**
         * minLength/maxLength 自定义错误信息
         */
        minmaxLengthMessage: PT.string,
        /**
         * minLength/maxLength 校验何时触发,默认值 onChange, 原生事件均可使用 onChange/onBlur/onFocus/...
         */
        minmaxLengthTrigger: PT.oneOfType([PT.string, PT.array]),
        /**
         * [表单校验] 字符串精确长度 / 数组精确个数
         */
        length: PT.number,
        /**
         * length 自定义错误信息
         */
        lengthMessage: PT.string,
        /**
         * length 校验何时触发,默认值 onChange, 原生事件均可使用 onChange/onBlur/onFocus/...
         */
        lengthTrigger: PT.oneOfType([PT.string, PT.array]),
        /**
         * 正则校验
         */
        pattern: PT.any,
        /**
         * pattern 自定义错误信息
         */
        patternMessage: PT.string,
        /**
         * pattern 校验何时触发,默认值 onChange, 原生事件均可使用 onChange/onBlur/onFocus/...
         */
        patternTrigger: PT.oneOfType([PT.string, PT.array]),
        /**
         * [表单校验] 四种常用的 pattern
         */
        format: PT.oneOf(["number", "email", "url", "tel"]),
        /**
         * format 自定义错误信息
         */
        formatMessage: PT.string,
        /**
         * format 校验何时触发,默认值 onChange, 原生事件均可使用 onChange/onBlur/onFocus/...
         */
        formatTrigger: PT.oneOfType([PT.string, PT.array]),
        /**
         * [表单校验] 自定义校验函数
         */
        validator: PT.func,
        /**
         * validator 校验何时触发,默认值 onChange, 原生事件均可使用 onChange/onBlur/onFocus/...
         */
        validatorTrigger: PT.oneOfType([PT.string, PT.array]),
        /**
         * 是否修改数据时自动触发校验
         */
        autoValidate: PT.bool,
        /**
         * 预设屏幕宽度
         */
        device: PT.oneOf(["phone", "tablet", "desktop"]),
        responsive: PT.bool,
        /**
         * 在响应式布局模式下,表单项占多少列
         */
        colSpan: PT.number,
        /**
         * 在响应式布局下,且label在左边时,label的宽度是多少
         */
        labelWidth: PT.oneOfType([PT.string, PT.number]),
        /**
         * 是否开启预览态
         */
        isPreview: PT.bool,
        /**
         * 预览态模式下渲染的内容
         * @param {any} value 根据包裹的组件的 value 类型而决定
         */
        renderPreview: PT.func,
        /**
         * 替代校验信息的 name 字段,useLabelForErrorMessage 开启的情况下比 label 优先级高
         */
        errorMessageName: PT.string,
        /**
         * 是否使用 label 替换校验信息的 name 字段
         */
        useLabelForErrorMessage: PT.bool,
        /**
         * 倾向使用 item 的 margin 空间来展示 help
         * @default false
         * @version 1.26.37
         */
        preferMarginToDisplayHelp: PT.bool,
        /**
         * 表示是否显示 label 后面的冒号
         */
        colon: PT.bool,
        /**
         * 是否禁用表单
         */
        disabled: PT.bool,
        /**
         * 子元素的 value 名称
         */
        valueName: PT.string
      }, _class$t.defaultProps = {
        prefix: "next-",
        hasFeedback: false,
        labelWidth: 100
      }, _class$t.contextTypes = {
        _formField: PT.object,
        _formSize: PT.oneOf(["large", "small", "medium"]),
        _formDisabled: PT.bool,
        _formPreview: PT.bool,
        _formFullWidth: PT.bool,
        _formLabelForErrorMessage: PT.bool,
        _formMarginToDisplayHelp: PT.bool
      }, _class$t._typeMark = "form_item", _temp$g);
      Item$1.displayName = "Item";
      var _class$s, _temp2$c;
      var Submit = (_temp2$c = _class$s = function(_React$Component) {
        _default(Submit2, _React$Component);
        function Submit2() {
          var _temp3, _this, _ret;
          _default$3(this, Submit2);
          for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
            args[_key] = arguments[_key];
          }
          return _ret = (_temp3 = (_this = _default$1(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.handleClick = function() {
            var _this$props = _this.props, onClick = _this$props.onClick, validate = _this$props.validate;
            var field = _this.context._formField || _this.props.field;
            if (!field) {
              onClick();
              return;
            }
            if (validate === true) {
              field.validate(function(errors) {
                onClick(field.getValues(), errors, field);
              });
            } else if (Array.isArray(validate)) {
              field.validate(validate, function(errors) {
                onClick(field.getValues(), errors, field);
              });
            } else {
              onClick(field.getValues(), null, field);
            }
          }, _temp3), _default$1(_this, _ret);
        }
        Submit2.prototype.render = function render2() {
          var children = this.props.children;
          return React__default.createElement(
            Button$1,
            _default$5({}, obj.pickOthers(Submit2.propTypes, this.props), { onClick: this.handleClick }),
            children
          );
        };
        return Submit2;
      }(React__default.Component), _class$s.propTypes = {
        /**
         * 点击提交后触发
         * @param {Object} value 数据
         * @param {Object} errors 错误数据
         * @param {class} field 实例
         */
        onClick: PT.func,
        /**
         * 是否校验/需要校验的 name 数组
         */
        validate: PT.oneOfType([PT.bool, PT.array]),
        /**
         * 自定义 field (在 Form 内不需要设置)
         */
        field: PT.object,
        children: PT.node
      }, _class$s.defaultProps = {
        onClick: func.noop
      }, _class$s.contextTypes = {
        _formField: PT.object
      }, _temp2$c);
      Submit.displayName = "Submit";
      const Submit$1 = Submit;
      var _class$r, _temp2$b;
      var Reset = (_temp2$b = _class$r = function(_React$Component) {
        _default(Reset2, _React$Component);
        function Reset2() {
          var _temp3, _this, _ret;
          _default$3(this, Reset2);
          for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
            args[_key] = arguments[_key];
          }
          return _ret = (_temp3 = (_this = _default$1(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.handleClick = function() {
            var _this$props = _this.props, names = _this$props.names, toDefault = _this$props.toDefault, onClick = _this$props.onClick;
            var field = _this.context._formField || _this.props.field;
            if (!field) {
              onClick();
              return;
            }
            if (toDefault) {
              field.resetToDefault(names);
            } else {
              field.reset(names);
            }
            onClick();
          }, _temp3), _default$1(_this, _ret);
        }
        Reset2.prototype.render = function render2() {
          var children = this.props.children;
          return React__default.createElement(
            Button$1,
            _default$5({}, obj.pickOthers(Reset2.propTypes, this.props), { onClick: this.handleClick }),
            children
          );
        };
        return Reset2;
      }(React__default.Component), _class$r.propTypes = {
        /**
         * 自定义重置的字段
         */
        names: PT.array,
        /**
         * 点击提交后触发
         */
        onClick: PT.func,
        /**
         * 返回默认值
         */
        toDefault: PT.bool,
        /**
         * 自定义 field (在 Form 内不需要设置)
         */
        field: PT.object,
        children: PT.node
      }, _class$r.defaultProps = {
        onClick: func.noop
      }, _class$r.contextTypes = {
        _formField: PT.object
      }, _temp2$b);
      Reset.displayName = "Reset";
      const Reset$1 = Reset;
      Form$1.Item = ConfigProvider$1.config(Item$1, {
        transform: (
          /* istanbul ignore next */
          function transform2(props, deprecated2) {
            if ("validateStatus" in props) {
              deprecated2("validateStatus", "validateState", "Form.Item");
              var _props = props, validateStatus = _props.validateStatus, others = _default$4(_props, ["validateStatus"]);
              props = _default$5({ 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 transform2(props, deprecated2) {
            if ("direction" in props) {
              deprecated2("direction", "inline", "Form");
              var _props2 = props, direction = _props2.direction, others = _default$4(_props2, ["direction"]);
              if (direction === "hoz") {
                props = _default$5({ inline: true }, others);
              }
            }
            return props;
          }
        )
      });
      var Loading = (
        /** @class */
        function(_super) {
          __extends(Loading2, _super);
          function Loading2() {
            return _super !== null && _super.apply(this, arguments) || this;
          }
          Loading2.prototype.render = function() {
            var _a, _b, _c, _d;
            var _e = this.props, tip = _e.tip, visible = _e.visible, children = _e.children, className = _e.className, style = _e.style, indicator = _e.indicator, color = _e.color, prefix = _e.prefix, fullScreen = _e.fullScreen, disableScroll = _e.disableScroll, onVisibleChange = _e.onVisibleChange, tipAlign = _e.tipAlign, size2 = _e.size, inline = _e.inline, rtl = _e.rtl, safeNode = _e.safeNode;
            var indicatorDom = null;
            var dotCls = "".concat(prefix, "loading-dot");
            if (indicator) {
              indicatorDom = indicator;
            } else {
              var backgroundColor = color;
              var fusionReactorCls = classnames((_a = {}, _a["".concat(prefix, "loading-fusion-reactor")] = true, _a["".concat(prefix, "loading-medium-fusion-reactor")] = size2 === "medium", _a));
              indicatorDom = React__default.createElement(
                "div",
                { className: fusionReactorCls, dir: rtl ? "rtl" : void 0 },
                React__default.createElement("span", { className: dotCls, style: { backgroundColor } }),
                React__default.createElement("span", { className: dotCls, style: { backgroundColor } }),
                React__default.createElement("span", { className: dotCls, style: { backgroundColor } }),
                React__default.createElement("span", { className: dotCls, style: { backgroundColor } })
              );
            }
            var loadingCls = classnames((_b = {}, _b["".concat(prefix, "loading")] = true, _b["".concat(prefix, "open")] = visible, _b["".concat(prefix, "loading-inline")] = inline, _b[className] = className, _b));
            var tipCls = classnames((_c = {}, _c["".concat(prefix, "loading-tip")] = true, _c["".concat(prefix, "loading-tip-fullscreen")] = fullScreen, // 默认非 right就是 bottom
            _c["".concat(prefix, "loading-right-tip")] = tipAlign === "right", _c));
            var others = obj.pickOthers(Loading2.propTypes, this.props);
            var contentCls = classnames((_d = {}, _d["".concat(prefix, "loading-component")] = visible, _d["".concat(prefix, "loading-wrap")] = true, _d));
            return fullScreen ? [
              children,
              React__default.createElement(
                Overlay$1,
                __assign({ key: "overlay", hasMask: true, align: "cc cc", safeNode, disableScroll }, others, { className, style, visible, onRequestClose: onVisibleChange }),
                React__default.createElement(
                  "div",
                  { className: tipCls },
                  React__default.createElement("div", { className: "".concat(prefix, "loading-indicator") }, indicatorDom),
                  React__default.createElement("div", { className: "".concat(prefix, "loading-tip-content") }, tip),
                  React__default.createElement("div", { className: "".concat(prefix, "loading-tip-placeholder") }, tip)
                )
              )
            ] : React__default.createElement(
              "div",
              __assign({ className: loadingCls, style }, others),
              visible ? React__default.createElement(
                "div",
                { className: tipCls },
                React__default.createElement("div", { className: "".concat(prefix, "loading-indicator") }, indicatorDom),
                React__default.createElement("div", { className: "".concat(prefix, "loading-tip-content") }, tip),
                React__default.createElement("div", { className: "".concat(prefix, "loading-tip-placeholder") }, tip)
              ) : null,
              React__default.createElement(
                "div",
                { className: contentCls },
                visible ? React__default.createElement("div", { className: "".concat(prefix, "loading-masker") }) : null,
                children
              )
            );
          };
          Loading2.propTypes = __assign(__assign({}, ConfigProvider$1.propTypes), { prefix: PT.string, tip: PT.any, tipAlign: PT.oneOf(["right", "bottom"]), visible: PT.bool, onVisibleChange: PT.func, className: PT.string, style: PT.object, size: PT.oneOf(["large", "medium"]), indicator: PT.any, color: PT.string, fullScreen: PT.bool, disableScroll: PT.bool, safeNode: PT.any, children: PT.any, inline: PT.bool, rtl: PT.bool });
          Loading2.defaultProps = {
            prefix: "next-",
            visible: true,
            onVisibleChange: func.noop,
            animate: null,
            tipAlign: "bottom",
            size: "large",
            inline: true,
            disableScroll: false
          };
          return Loading2;
        }(React__default.Component)
      );
      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 i2 = 0; i2 < a.length; i2++) {
          if (!transformEntryEqual(a[i2], b2[i2])) {
            return false;
          }
        }
        return true;
      }
      function shallowObjectEquals(a, b2) {
        var k2;
        var i2 = 0;
        var j2 = 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;
            }
            i2++;
          }
        }
        for (k2 in b2) {
          if (hasOwnProperty$1.call(b2, k2)) {
            j2++;
          }
        }
        return i2 === j2;
      }
      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 i2 = 0; i2 < a.length; i2++) {
                if (!styleEqual$1(a[i2], b2[i2])) {
                  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 i2 = 0; i2 < a.length; i2++) {
              if (!elementEquals(a[i2], b2[i2]))
                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$2(key[1]) === "object" && _default$2(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 offset2 = offsetArr[index2];
          if (offset2 > -1) {
            style[dir] = offset2;
          }
          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$5({}, col.style, style);
          col.cellStyle = style;
        });
        var setOffset = function setOffset2(col, index2, dir2, isBorder) {
          var _classnames2;
          var style = {
            position: "sticky"
          };
          var offset2 = offsetArr[index2];
          if (offset2 > -1) {
            style[dir2] = offset2;
          }
          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$5({}, 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, i2) {
            if (i2 < idx) {
              return ret + getLeafNodes(item);
            }
            return ret;
          }, 0);
        };
        var loop = function loop2(arr, i2) {
          dir === "right" && arr.reverse();
          arr.forEach(function(child, j2) {
            var p2 = dir === "right" ? i2 - getPreNodes(arr, j2) : i2 + getPreNodes(arr, j2);
            if (child.children) {
              loop2(child.children, p2);
              setOffset(child, p2, dir, j2 === arr.length - 1);
            }
          });
          dir === "right" && arr.reverse();
        };
        loop(lockChildren, dir === "left" ? 0 : len - 1);
      };
      var _class$q, _temp2$a;
      var noop$6 = function noop2() {
      };
      var Row = (_temp2$a = _class$q = function(_React$Component) {
        _default(Row2, _React$Component);
        function Row2() {
          var _temp3, _this, _ret;
          _default$3(this, Row2);
          for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
            args[_key] = arguments[_key];
          }
          return _ret = (_temp3 = (_this = _default$1(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.onClick = function(e2) {
            var _this$props = _this.props, record = _this$props.record, rowIndex = _this$props.rowIndex;
            _this.props.onClick(record, rowIndex, e2);
          }, _this.onMouseEnter = function(e2) {
            var _this$props2 = _this.props, record = _this$props2.record, rowIndex = _this$props2.rowIndex, __rowIndex = _this$props2.__rowIndex;
            var row = __rowIndex || rowIndex;
            _this.onRowHover(record, row, true, e2);
          }, _this.onMouseLeave = function(e2) {
            var _this$props3 = _this.props, record = _this$props3.record, rowIndex = _this$props3.rowIndex, __rowIndex = _this$props3.__rowIndex;
            var row = __rowIndex || rowIndex;
            _this.onRowHover(record, row, false, e2);
          }, _temp3), _default$1(_this, _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, locale2 = _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$4(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$5({}, attrs.style, cellStyle);
            return React__default.createElement(Cell2, _default$5({
              key: __rowIndex + "-" + colIndex
            }, others, attrs, {
              style: newStyle,
              "data-next-table-col": colIndex,
              "data-next-table-row": rowIndex,
              ref: function ref(cell) {
                return cellRef(__rowIndex, colIndex, cell);
              },
              prefix,
              pure,
              primaryKey,
              record,
              className,
              value,
              colIndex,
              rowIndex,
              align,
              locale: locale2,
              rtl,
              width
            }));
          });
        };
        Row2.prototype._getNotRenderCellIndex = function _getNotRenderCellIndex(colIndex, rowIndex, colSpan, rowSpan) {
          var maxColIndex = colSpan;
          var maxRowIndex = rowSpan;
          var notRenderCellIndex = [];
          for (var i2 = 0; i2 < maxColIndex; i2++) {
            for (var j2 = 0; j2 < maxRowIndex; j2++) {
              notRenderCellIndex.push([rowIndex + j2, colIndex + i2]);
            }
          }
          [].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 wrapper = _props3.wrapper, others = _default$4(_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__default.createElement(
            "tr",
            _default$5({
              className: cls,
              role: "row"
            }, others, {
              onClick: this.onClick,
              onMouseEnter: this.onMouseEnter,
              onMouseLeave: this.onMouseLeave
            }),
            this.renderCells(record),
            children
          );
          return wrapper(tr);
        };
        return Row2;
      }(React__default.Component), _class$q.propTypes = {
        prefix: PT.string,
        pure: PT.bool,
        primaryKey: PT.oneOfType([PT.symbol, PT.string]),
        className: PT.string,
        columns: PT.array,
        record: PT.any,
        Cell: PT.func,
        rowIndex: PT.number,
        getCellProps: PT.func,
        onClick: PT.func,
        onMouseEnter: PT.func,
        onMouseLeave: PT.func,
        children: PT.any,
        cellRef: PT.func,
        colGroup: PT.object,
        locale: PT.object,
        wrapper: PT.func
      }, _class$q.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$q.contextTypes = {
        notRenderCellIndex: PT.array,
        lockType: PT.oneOf(["left", "right"])
      }, _temp2$a);
      Row.displayName = "Row";
      var _class$p, _temp$f;
      var Cell = (_temp$f = _class$p = function(_React$Component) {
        _default(Cell2, _React$Component);
        function Cell2() {
          _default$3(this, Cell2);
          return _default$1(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, cell = _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, Tag2 = _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, type2 = _props.type, htmlTitle = _props.htmlTitle, wordBreak = _props.wordBreak, others = _default$4(_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$5({}, style);
          var cellProps = { value, index: rowIndex, record, context };
          var content = cell;
          if (React__default.isValidElement(content)) {
            content = React__default.cloneElement(content, type2 === "header" ? void 0 : 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__default.createElement(
            Tag2,
            _default$5({}, pickAttrs(others), { className: cls, style: tagStyle, role: "gridcell" }),
            React__default.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__default.Component), _class$p.propTypes = {
        prefix: PT.string,
        pure: PT.bool,
        primaryKey: PT.oneOfType([PT.symbol, PT.string]),
        className: PT.string,
        record: PT.any,
        value: PT.any,
        isIconLeft: PT.bool,
        colIndex: PT.number,
        rowIndex: PT.number,
        // 经过锁列调整后的列索引,lock right的列会从非0开始
        __colIndex: PT.oneOfType([PT.number, PT.string]),
        title: PT.any,
        width: PT.oneOfType([PT.number, PT.string]),
        context: PT.any,
        cell: PT.oneOfType([PT.element, PT.node, PT.func]),
        align: PT.oneOf(["left", "center", "right"]),
        component: PT.oneOf(["td", "th", "div"]),
        children: PT.any,
        style: PT.object,
        innerStyle: PT.object,
        filterMode: PT.oneOf(["single", "multiple"]),
        filterMenuProps: PT.object,
        filterProps: PT.object,
        filters: PT.array,
        sortable: PT.bool,
        sortDirections: PT.arrayOf(PT.oneOf(["desc", "asc", "default"])),
        lock: PT.any,
        type: PT.oneOf(["header", "body"]),
        resizable: PT.bool,
        asyncResizable: PT.bool,
        __normalized: PT.bool
      }, _class$p.defaultProps = {
        component: "td",
        type: "body",
        isIconLeft: false,
        cell: function cell(value) {
          return value;
        },
        prefix: "next-"
      }, _temp$f);
      Cell.displayName = "Cell";
      var _class$o, _temp2$9;
      var noop$5 = function noop2() {
      };
      var Body = (_temp2$9 = _class$o = function(_React$Component) {
        _default(Body2, _React$Component);
        function Body2() {
          var _temp3, _this, _ret;
          _default$3(this, Body2);
          for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
            args[_key] = arguments[_key];
          }
          return _ret = (_temp3 = (_this = _default$1(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.getRowRef = function(i2, row) {
            _this.props.rowRef(i2, row);
          }, _this.onRowClick = function(record, index2, e2) {
            _this.props.onRowClick(record, index2, e2);
          }, _this.onRowMouseEnter = function(record, index2, e2) {
            _this.props.onRowMouseEnter(record, index2, e2);
          }, _this.onRowMouseLeave = function(record, index2, e2) {
            _this.props.onRowMouseLeave(record, index2, e2);
          }, _this.onBodyMouseOver = function(e2) {
            _this.props.onBodyMouseOver(e2);
          }, _this.onBodyMouseOut = function(e2) {
            _this.props.onBodyMouseOut(e2);
          }, _this.getEmptyNode = function(ref) {
            _this.emptyNode = ref;
          }, _this.setEmptyDomStyle = function() {
            var tableEl = _this.props.tableEl;
            var borderLeftWidth = dom.getStyle(tableEl, "borderLeftWidth");
            var tableWidth = tableEl && tableEl.getBoundingClientRect().width;
            var totalWidth = tableWidth - borderLeftWidth - 1 || "100%";
            dom.setStyle(_this.emptyNode, { width: totalWidth });
          }, _temp3), _default$1(_this, _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, Tag2 = _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 locale2 = _props.locale, pure = _props.pure, expandedIndexSimulate = _props.expandedIndexSimulate, tableEl = _props.tableEl, rtl = _props.rtl, crossline = _props.crossline;
          _props.tableWidth;
          var others = _default$4(_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__default.createElement(
            "span",
            null,
            " "
          ) : emptyContent || locale2.empty;
          var rows = React__default.createElement(
            "tr",
            null,
            React__default.createElement(
              "td",
              { colSpan: columns.length },
              React__default.createElement(
                "div",
                {
                  ref: this.getEmptyNode,
                  className: prefix + "table-empty",
                  style: { position: "sticky", left: 0, overflow: "hidden", width: totalWidth }
                },
                empty
              )
            )
          );
          if (Tag2 === "div") {
            rows = React__default.createElement(
              "table",
              { role: "table" },
              React__default.createElement(
                "tbody",
                null,
                rows
              )
            );
          }
          if (dataSource.length) {
            rows = dataSource.map(function(record, index2) {
              var _classnames;
              var rowProps = {};
              var rowIndex = (typeof record === "undefined" ? "undefined" : _default$2(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__default.createElement(Row$12, _default$5({
                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: locale2,
                onMouseEnter: _this2.onRowMouseEnter,
                onMouseLeave: _this2.onRowMouseLeave
              }));
            });
          } else {
            this.setEmptyDomStyle();
          }
          var event = crossline ? {
            onMouseOver: this.onBodyMouseOver,
            onMouseOut: this.onBodyMouseOut
          } : {};
          return React__default.createElement(
            Tag2,
            _default$5({ className }, others, event),
            rows,
            children
          );
        };
        return Body2;
      }(React__default.Component), _class$o.propTypes = {
        loading: PT.bool,
        emptyContent: PT.any,
        tableEl: PT.any,
        prefix: PT.string,
        pure: PT.bool,
        components: PT.object,
        getCellProps: PT.func,
        cellRef: PT.func,
        primaryKey: PT.oneOfType([PT.symbol, PT.string]),
        getRowProps: PT.func,
        rowRef: PT.func,
        dataSource: PT.array,
        children: PT.any,
        className: PT.string,
        component: PT.string,
        colGroup: PT.object,
        columns: PT.array,
        onRowClick: PT.func,
        onRowMouseEnter: PT.func,
        onRowMouseLeave: PT.func,
        onBodyMouseOver: PT.func,
        onBodyMouseOut: PT.func,
        locale: PT.object,
        crossline: PT.bool,
        tableWidth: PT.number
      }, _class$o.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$9);
      Body.displayName = "Body";
      var _class$n, _temp$e, _initialiseProps;
      var Filter = (_temp$e = _class$n = function(_React$Component) {
        _default(Filter2, _React$Component);
        function Filter2(props) {
          _default$3(this, Filter2);
          var _this = _default$1(this, _React$Component.call(this, props));
          _initialiseProps.call(_this);
          var filterParams = props.filterParams || {};
          var filterConfig = filterParams[props.dataIndex] || {};
          _this.state = {
            visible: filterConfig.visible || false,
            selectedKeys: filterConfig.selectedKeys || [],
            selectedKeysChangedByInner: true
          };
          _this._selectedKeys = [].concat(_this.state.selectedKeys);
          return _this;
        }
        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, locale2 = _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$4(_ref, ["subMenuSelectable"]);
          function renderMenuItem(item) {
            return React__default.createElement(
              Menu$1.Item,
              { key: item.value },
              item.label
            );
          }
          function renderSubMenu(parent, children) {
            return React__default.createElement(
              Menu$1.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__default.createElement(
            "div",
            { className: prefix + "table-filter-footer" },
            React__default.createElement(
              Button$1,
              { type: "primary", onClick: this.onFilterConfirm },
              locale2.ok
            ),
            React__default.createElement(
              Button$1,
              { onClick: this.onFilterClear },
              locale2.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__default.createElement(
            Dropdown,
            _default$5({
              trigger: React__default.createElement(
                "span",
                {
                  role: "button",
                  "aria-label": locale2.filter,
                  onKeyDown: this.filterKeydown,
                  tabIndex: "0",
                  className: cls
                },
                React__default.createElement(Icon, { type: "filter", size: "small", className: filterIconCls })
              ),
              triggerType: "click",
              visible,
              autoFocus: true,
              rtl,
              needAdjust: false,
              onVisibleChange: this.onFilterVisible,
              className: dropdownClassname
            }, filterProps),
            React__default.createElement(
              Menu$1,
              _default$5({
                footer,
                rtl,
                selectedKeys,
                selectMode: filterMode,
                onSelect: this.onFilterSelect
              }, others),
              content
            )
          );
        };
        return Filter2;
      }(React__default.Component), _class$n.propTypes = {
        dataIndex: PT.string,
        filters: PT.array,
        filterMode: PT.string,
        filterParams: PT.object,
        filterMenuProps: PT.object,
        filterProps: PT.object,
        locale: PT.object,
        onFilter: PT.func,
        prefix: PT.string,
        rtl: PT.bool
      }, _class$n.defaultProps = {
        onFilter: function onFilter() {
        }
      }, _initialiseProps = function _initialiseProps2() {
        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$e);
      Filter.displayName = "Filter";
      const FilterComponent = polyfill(Filter);
      var _class$m, _temp2$8;
      var Sort = (_temp2$8 = _class$m = function(_React$Component) {
        _default(Sort2, _React$Component);
        function Sort2() {
          var _temp3, _this, _ret;
          _default$3(this, Sort2);
          for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
            args[_key] = arguments[_key];
          }
          return _ret = (_temp3 = (_this = _default$1(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.handleClick = function() {
            var _this$props = _this.props, sort = _this$props.sort, dataIndex = _this$props.dataIndex, sortDirections = _this$props.sortDirections;
            var nextSortType = "";
            sortDirections.forEach(function(dir, i2) {
              if (sort[dataIndex] === dir) {
                nextSortType = sortDirections.length - 1 > i2 ? sortDirections[i2 + 1] : sortDirections[0];
              }
            });
            if (!sort[dataIndex]) {
              nextSortType = sortDirections[0];
            }
            _this.onSort(dataIndex, nextSortType);
          }, _this.keydownHandler = function(e2) {
            e2.preventDefault();
            e2.stopPropagation();
            if (e2.keyCode === KEYCODE.ENTER) {
              _this.handleClick();
            }
          }, _this.onSort = function(dataIndex, order) {
            var sort = {};
            sort[dataIndex] = order;
            _this.props.onSort(dataIndex, order, sort);
          }, _temp3), _default$1(_this, _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, locale2 = _props.locale, sortDirections = _props.sortDirections, rtl = _props.rtl, sortStatus = sort[dataIndex], map2 = {
            desc: "descending",
            asc: "ascending"
          };
          var icons = sortDirections.map(function(sortOrder) {
            return sortOrder === "default" ? null : React__default.createElement(
              "a",
              { key: sortOrder, className: sortStatus === sortOrder ? "current" : "" },
              sortIcons ? sortIcons[sortOrder] : React__default.createElement(Icon, { rtl, type: map2[sortOrder], size: "xs" })
            );
          });
          var cls = classnames((_classnames = {}, _classnames[prefix + "table-sort"] = true, _classnames[className] = className, _classnames));
          return React__default.createElement(
            "span",
            {
              role: "button",
              tabIndex: "0",
              "aria-label": locale2[sortStatus],
              className: cls,
              onClick: this.handleClick.bind(this),
              onKeyDown: this.keydownHandler
            },
            icons
          );
        };
        Sort2.prototype.render = function render2() {
          return this.renderSort();
        };
        return Sort2;
      }(React__default.Component), _class$m.propTypes = {
        prefix: PT.string,
        rtl: PT.bool,
        className: PT.string,
        sort: PT.object,
        sortIcons: PT.object,
        onSort: PT.func,
        sortDirections: PT.arrayOf(PT.oneOf(["desc", "asc", "default"])),
        dataIndex: PT.string,
        locale: PT.object
      }, _class$m.defaultProps = {
        sort: {},
        sortDirections: ["desc", "asc"]
      }, _temp2$8);
      Sort.displayName = "Sort";
      var _class$l, _temp$d;
      var Resize = (_temp$d = _class$l = function(_React$Component) {
        _default(Resize2, _React$Component);
        function Resize2() {
          _default$3(this, Resize2);
          var _this = _default$1(this, _React$Component.call(this));
          _this.showResizeProxy = function() {
            _this.props.resizeProxyDomRef.style.cssText = "display:block;left:" + _this.startLeft + "px;";
          };
          _this.moveResizeProxy = function() {
            var moveLeft = _this.startLeft + _this.changedPageX;
            _this.props.resizeProxyDomRef.style.cssText = "left:" + moveLeft + "px;display:block;";
          };
          _this.resetResizeProxy = function() {
            if (_this.asyncResizeFlag) {
              _this.props.onChange(_this.props.dataIndex, _this.changedPageX);
            }
            _this.changedPageX = 0;
            _this.tRight = 0;
            _this.asyncResizeFlag = false;
            _this.props.resizeProxyDomRef.style.cssText = "display:none;";
          };
          _this.movingLimit = function() {
            var moveLeft = _this.startLeft + _this.changedPageX;
            if (moveLeft > _this.tRight) {
              moveLeft = _this.tRight;
              _this.changedPageX = _this.tRight - _this.startLeft;
            }
            if (moveLeft - _this.cellLeft < _this.cellMinWidth) {
              _this.changedPageX = _this.cellLeft + _this.cellMinWidth - _this.startLeft;
            }
            if (moveLeft < 0) {
              _this.changedPageX = 0 - _this.startLeft;
            }
            if (_this.props.col.width + _this.changedPageX < _this.cellMinWidth) {
              _this.changedPageX = _this.cellMinWidth - _this.props.col.width;
            }
          };
          _this.onMouseDown = function(e2) {
            var _this$props$tableEl$g = _this.props.tableEl.getBoundingClientRect(), tableLeft = _this$props$tableEl$g.left, tableWidth = _this$props$tableEl$g.width;
            if (!_this.props.cellDomRef || !_this.props.cellDomRef.current) {
              return;
            }
            var _this$props$cellDomRe = _this.props.cellDomRef.current.getBoundingClientRect(), cellDomLeft = _this$props$cellDomRe.left;
            _this.lastPageX = e2.pageX;
            _this.tLeft = tableLeft;
            _this.tRight = tableWidth;
            _this.startLeft = e2.pageX - tableLeft;
            _this.cellLeft = cellDomLeft - tableLeft;
            if (_this.props.asyncResizable)
              _this.showResizeProxy();
            events.on(document, "mousemove", _this.onMouseMove);
            events.on(document, "mouseup", _this.onMouseUp);
            _this.unSelect();
          };
          _this.onMouseMove = function(e2) {
            var pageX = e2.pageX;
            _this.changedPageX = pageX - _this.lastPageX;
            if (_this.props.rtl) {
              _this.changedPageX = -_this.changedPageX;
            }
            if (_this.props.hasLock) {
              if (!_this.props.asyncResizable) {
                _this.cellLeft = _this.props.cellDomRef.current.getBoundingClientRect().left - _this.tLeft;
              }
            }
            _this.movingLimit();
            if (_this.props.asyncResizable) {
              _this.asyncResizeFlag = true;
              _this.moveResizeProxy();
              return;
            }
            _this.props.onChange(_this.props.dataIndex, _this.changedPageX);
            _this.lastPageX = pageX;
          };
          _this.onMouseUp = function() {
            if (_this.props.asyncResizable) {
              _this.resetResizeProxy();
            }
            _this.startLeft = 0;
            _this.destory();
          };
          _this.cellMinWidth = 40;
          _this.lastPageX = 0;
          _this.tRight = 0;
          _this.tLeft = 0;
          _this.cellLeft = 0;
          _this.startLeft = 0;
          _this.changedPageX = 0;
          _this.asyncResizeFlag = false;
          return _this;
        }
        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__default.createElement("a", { className: prefix + "table-resize-handler", onMouseDown: this.onMouseDown });
        };
        return Resize2;
      }(React__default.Component), _class$l.propTypes = {
        prefix: PT.string,
        rtl: PT.bool,
        onChange: PT.func,
        dataIndex: PT.string,
        tableEl: PT.any,
        resizeProxyDomRef: PT.any,
        cellDomRef: PT.any,
        col: PT.any,
        hasLock: PT.bool,
        asyncResizable: PT.bool
      }, _class$l.defaultProps = {
        onChange: function onChange() {
        }
      }, _temp$d);
      Resize.displayName = "Resize";
      const ResizeComponent = Resize;
      var _class$k, _temp$c;
      var noop$4 = function noop2() {
      };
      var Header = (_temp$c = _class$k = function(_React$Component) {
        _default(Header2, _React$Component);
        function Header2() {
          _default$3(this, Header2);
          var _this = _default$1(this, _React$Component.call(this));
          _this.checkHasLock = function() {
            var columns = _this.props.columns;
            var hasLock = false;
            for (var i2 = 0; i2 < columns.length; i2++) {
              var cols = columns[i2];
              for (var j2 = 0; j2 < cols.length; j2++) {
                var col = cols[j2];
                if (col.lock) {
                  hasLock = true;
                  break;
                }
              }
              if (hasLock) {
                break;
              }
            }
            _this.hasLock = hasLock;
          };
          _this.getCellRef = function(i2, j2, cell) {
            _this.props.headerCellRef(i2, j2, cell);
            var columns = _this.props.columns;
            var columnProps = columns[i2] && columns[i2][j2];
            if (columnProps && columnProps.ref && typeof columnProps.ref === "function") {
              columnProps.ref(cell);
            }
          };
          _this.createCellDomRef = function(i2, j2) {
            var cellRefKey = _this.getCellDomRefKey(i2, j2);
            if (!_this[cellRefKey]) {
              _this[cellRefKey] = {};
            }
            return _this[cellRefKey];
          };
          _this.getCellDomRef = function(cellRef, cellDom) {
            if (!cellRef) {
              return;
            }
            cellRef.current = cellDom;
          };
          _this.getCellDomRefKey = function(i2, j2) {
            return "header_cell_" + i2 + "_" + j2;
          };
          _this.onSort = function(dataIndex, order, sort) {
            _this.props.onSort(dataIndex, order, sort);
          };
          _this.hasLock = false;
          return _this;
        }
        Header2.prototype.render = function render2() {
          var _this2 = this;
          var _props = this.props, prefix = _props.prefix, className = _props.className, children = _props.children, Tag2 = _props.component;
          _props.colGroup;
          var columns = _props.columns, locale2 = _props.locale, filterParams = _props.filterParams, onFilter = _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$4(_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, j2) {
              var _classnames;
              var cellRef = _this2.createCellDomRef(index2, j2);
              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$4(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__default.createElement(Sort$1, {
                    prefix,
                    className: prefix + "table-header-icon",
                    dataIndex,
                    onSort: _this2.onSort,
                    sortDirections,
                    sortIcons,
                    sort,
                    rtl,
                    locale: locale2
                  });
                }
                if (asyncResizable || resizable) {
                  resizeElement = React__default.createElement(Resize2, {
                    asyncResizable,
                    hasLock: _this2.hasLock,
                    col: col2,
                    tableEl,
                    prefix,
                    rtl,
                    dataIndex,
                    resizeProxyDomRef,
                    cellDomRef: cellRef,
                    onChange: onResizeChange
                  });
                }
                if (filters) {
                  filterElement = filters.length ? React__default.createElement(Filter2, {
                    dataIndex,
                    className: prefix + "table-header-icon",
                    filters,
                    prefix,
                    locale: locale2,
                    rtl,
                    filterParams,
                    filterMode,
                    filterMenuProps,
                    filterProps,
                    onFilter
                  }) : null;
                }
                attrs.rowSpan = rowSpan - index2;
              }
              if (+attrs.colSpan === 0) {
                return null;
              }
              return React__default.createElement(
                Cell$12,
                _default$5({}, others2, attrs, {
                  key: j2,
                  prefix,
                  pure,
                  rtl,
                  cell: title,
                  component: "th",
                  align: alignHeader ? alignHeader : align,
                  className: className2,
                  ref: _this2.getCellRef.bind(_this2, index2, j2),
                  getCellDomRef: _this2.getCellDomRef.bind(_this2, cellRef),
                  type: "header"
                }),
                sortElement,
                filterElement,
                resizeElement
              );
            });
            return React__default.createElement(
              "tr",
              { key: index2 },
              col
            );
          });
          return React__default.createElement(
            Tag2,
            _default$5({ className }, others),
            header,
            children
          );
        };
        return Header2;
      }(React__default.Component), _class$k.propTypes = {
        children: PT.any,
        prefix: PT.string,
        pure: PT.bool,
        className: PT.string,
        component: PT.string,
        columns: PT.array,
        colGroup: PT.object,
        headerCellRef: PT.func,
        locale: PT.object,
        filterParams: PT.object,
        onFilter: PT.func,
        components: PT.object,
        sort: PT.object,
        sortIcons: PT.object,
        onSort: PT.func,
        onResizeChange: PT.func,
        tableWidth: PT.number,
        tableEl: PT.any
      }, _class$k.defaultProps = {
        component: "thead",
        columns: [],
        headerCellRef: noop$4,
        onFilter: noop$4,
        components: {},
        onSort: noop$4,
        onResizeChange: noop$4
      }, _temp$c);
      Header.displayName = "Header";
      var _class$j, _temp$b;
      var Wrapper = (_temp$b = _class$j = function(_Component) {
        _default(Wrapper2, _Component);
        function Wrapper2() {
          _default$3(this, Wrapper2);
          return _default$1(this, _Component.apply(this, arguments));
        }
        Wrapper2.prototype.render = function render2() {
          var _props = this.props, colGroup = _props.colGroup, children = _props.children, tableWidth = _props.tableWidth, Tag2 = _props.component;
          return React__default.createElement(
            Tag2,
            { role: "table", style: { width: tableWidth } },
            colGroup,
            children
          );
        };
        return Wrapper2;
      }(React__default.Component), _class$j.propTypes = {
        tableWidth: PT.number
      }, _temp$b);
      Wrapper.displayName = "Wrapper";
      Wrapper.defaultProps = {
        component: "table"
      };
      Wrapper.propTypes = {
        children: PT.any,
        prefix: PT.string,
        colGroup: PT.any,
        component: PT.string
      };
      var _class$i, _temp$a;
      var Column = (_temp$a = _class$i = function(_React$Component) {
        _default(Column2, _React$Component);
        function Column2() {
          _default$3(this, Column2);
          return _default$1(this, _React$Component.apply(this, arguments));
        }
        Column2.prototype.render = function render2() {
          return null;
        };
        return Column2;
      }(React__default.Component), _class$i.propTypes = {
        /**
         * 指定列对应的字段,支持`a.b`形式的快速取值
         */
        dataIndex: PT.string,
        /**
         * 行渲染的逻辑
         * value, rowIndex, record, context四个属性只可读不可被更改
         * Function(value, index, record) => Element
         */
        cell: PT.oneOfType([PT.element, PT.node, PT.func]),
        /**
         * 表头显示的内容
         */
        title: PT.oneOfType([PT.element, PT.node, PT.func]),
        /**
         * 写到 header 单元格上的title属性
         */
        htmlTitle: PT.string,
        /**
         * 是否支持排序
         */
        sortable: PT.bool,
        /**
         * 排序的方向。
         * 设置 ['desc', 'asc'],表示降序、升序
         * 设置 ['desc', 'asc', 'default'],表示表示降序、升序、不排序
         * @version 1.23
         */
        sortDirections: PT.arrayOf(PT.oneOf(["desc", "asc", "default"])),
        /**
         * 列宽,注意在锁列的情况下一定需要配置宽度
         */
        width: PT.oneOfType([PT.number, PT.string]),
        /**
         * 单元格的对齐方式
         */
        align: PT.oneOf(["left", "center", "right"]),
        /**
         * 单元格标题的对齐方式, 不配置默认读取align值
         */
        alignHeader: PT.oneOf(["left", "center", "right"]),
        /**
         * 生成标题过滤的菜单, 格式为`[{label:'xxx', value:'xxx'}]`
         */
        filters: PT.arrayOf(PT.shape({
          label: PT.string,
          value: PT.oneOfType([PT.node, PT.string])
        })),
        /**
         * 过滤的模式是单选还是多选
         */
        filterMode: PT.oneOf(["single", "multiple"]),
        /**
         * filter 模式下传递给 Menu 菜单的属性, 默认继承 `Menu` 组件的API
         * @property {Boolean} subMenuSelectable 默认为`false` subMenu是否可选择
         * @property {Boolean} isSelectIconRight 默认为`false` 是否将选中图标居右。注意:SubMenu 上的选中图标一直居左,不受此API控制
         */
        filterMenuProps: PT.object,
        filterProps: PT.object,
        /**
         * 是否支持锁列,可选值为`left`,`right`, `true`
         */
        lock: PT.oneOfType([PT.bool, PT.string]),
        /**
         * 是否支持列宽调整, 当该值设为true,table的布局方式会修改为fixed.
         */
        resizable: PT.bool,
        /**
         * (推荐使用)是否支持异步列宽调整, 当该值设为true,table的布局方式会修改为fixed.
         * @version 1.24
         */
        asyncResizable: PT.bool,
        /**
         * header cell 横跨的格数,设置为0表示不出现此 th
         */
        colSpan: PT.number,
        /**
         * 设置该列单元格的word-break样式,对于id类、中文类适合用all,对于英文句子适合用word
         * @enumdesc all, word
         * @default all
         * @version 1.23
         */
        wordBreak: PT.oneOf(["all", "word"])
      }, _class$i.contextTypes = {
        parent: PT.any
      }, _class$i.defaultProps = {
        cell: function cell(value) {
          return value;
        },
        filterMode: "multiple",
        filterMenuProps: {
          subMenuSelectable: false
        },
        filterProps: {},
        resizable: false,
        asyncResizable: false
      }, _class$i._typeMark = "column", _temp$a);
      Column.displayName = "Column";
      var _class$h, _temp$9;
      var ColumnGroup = (_temp$9 = _class$h = function(_React$Component) {
        _default(ColumnGroup2, _React$Component);
        function ColumnGroup2() {
          _default$3(this, ColumnGroup2);
          return _default$1(this, _React$Component.apply(this, arguments));
        }
        ColumnGroup2.prototype.getChildContext = function getChildContext() {
          return {
            parent: this
          };
        };
        ColumnGroup2.prototype.render = function render2() {
          return null;
        };
        return ColumnGroup2;
      }(React__default.Component), _class$h.propTypes = {
        /**
         * 表头显示的内容
         */
        title: PT.oneOfType([PT.element, PT.node, PT.func])
      }, _class$h.childContextTypes = {
        parent: PT.any
      }, _class$h.defaultProps = {
        title: "column-group"
      }, _class$h._typeMark = "columnGroup", _temp$9);
      ColumnGroup.displayName = "ColumnGroup";
      var _class$g, _temp$8;
      var Children = React__default.Children, noop$3 = function noop2() {
      };
      var Table$3 = (_temp$8 = _class$g = function(_React$Component) {
        _default(Table2, _React$Component);
        function Table2(props, context) {
          _default$3(this, Table2);
          var _this = _default$1(this, _React$Component.call(this, props, context));
          _this.state = {
            sort: _this.props.sort || {}
          };
          _this.onSort = function(dataIndex, order, sort) {
            if (typeof _this.props.sort === "undefined") {
              _this.setState({
                sort
              }, function() {
                _this.props.onSort(dataIndex, order, sort);
              });
            } else {
              _this.props.onSort(dataIndex, order, sort);
            }
          };
          _this.onFilter = function(filterParams) {
            _this.props.onFilter(filterParams);
          };
          _this.onResizeChange = function(dataIndex, value) {
            _this.props.onResizeChange(dataIndex, value);
          };
          _this.getResizeProxyDomRef = function(resizeProxyDom) {
            if (!resizeProxyDom) {
              return _this.resizeProxyDomRef;
            }
            _this.resizeProxyDomRef = resizeProxyDom;
          };
          _this.getWrapperRef = function(wrapper) {
            if (!wrapper) {
              return _this.wrapper;
            }
            _this.wrapper = wrapper;
          };
          _this.getAffixRef = function(affixRef) {
            if (!affixRef) {
              return _this.affixRef;
            }
            _this.affixRef = affixRef;
          };
          _this.getHeaderCellRef = function(i2, j2, cell) {
            var cellRef = "header_cell_" + i2 + "_" + j2;
            if (!cell) {
              return _this[cellRef];
            }
            _this[cellRef] = cell;
          };
          _this.getRowRef = function(i2, row) {
            var rowRef = "row_" + i2;
            if (!row) {
              return _this[rowRef];
            }
            _this[rowRef] = row;
          };
          _this.getCellRef = function(i2, j2, cell) {
            var cellRef = "cell_" + i2 + "_" + j2;
            if (!cell) {
              return _this[cellRef];
            }
            _this[cellRef] = cell;
          };
          _this.handleColHoverClass = function(rowIndex, colIndex, isAdd) {
            var crossline = _this.props.crossline;
            var funcName = isAdd ? "addClass" : "removeClass";
            if (crossline) {
              _this.props.entireDataSource.forEach(function(val, index2) {
                try {
                  var currentCol = ReactDOM.findDOMNode(_this.getCellRef(index2, colIndex));
                  currentCol && dom[funcName](currentCol, "hovered");
                } catch (error) {
                  return null;
                }
              });
            }
          };
          _this.findEventTarget = function(e2) {
            var prefix = _this.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(_this.getCellRef(rowIndex, colIndex));
              if (currentCol === target) {
                return {
                  colIndex,
                  rowIndex
                };
              }
            } catch (error) {
              return {};
            }
            return {};
          };
          _this.onBodyMouseOver = function(e2) {
            var crossline = _this.props.crossline;
            if (!crossline) {
              return;
            }
            var _this$findEventTarget = _this.findEventTarget(e2), colIndex = _this$findEventTarget.colIndex, rowIndex = _this$findEventTarget.rowIndex;
            if (!colIndex || !rowIndex) {
              return;
            }
            _this.handleColHoverClass(rowIndex, colIndex, true);
            _this.colIndex = colIndex;
            _this.rowIndex = rowIndex;
          };
          _this.onBodyMouseOut = function(e2) {
            var crossline = _this.props.crossline;
            if (!crossline) {
              return;
            }
            var _this$findEventTarget2 = _this.findEventTarget(e2), colIndex = _this$findEventTarget2.colIndex, rowIndex = _this$findEventTarget2.rowIndex;
            if (!colIndex || !rowIndex) {
              return;
            }
            _this.handleColHoverClass(_this.rowIndex, _this.colIndex, false);
            _this.colIndex = -1;
            _this.rowIndex = -1;
          };
          _this.addColIndex = function(children) {
            var start = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0;
            children.forEach(function(child, i2) {
              child.__colIndex = start + i2;
            });
          };
          _this.getTableEl = function(ref) {
            _this.tableEl = ref;
          };
          var _this$context = _this.context, getTableInstance = _this$context.getTableInstance, getTableInstanceForVirtual = _this$context.getTableInstanceForVirtual, getTableInstanceForFixed = _this$context.getTableInstanceForFixed, getTableInstanceForExpand = _this$context.getTableInstanceForExpand;
          getTableInstance && getTableInstance(props.lockType, _this);
          getTableInstanceForFixed && getTableInstanceForFixed(props.lockType, _this);
          getTableInstanceForVirtual && getTableInstanceForVirtual(props.lockType, _this);
          getTableInstanceForExpand && getTableInstanceForExpand(_this);
          _this.notRenderCellIndex = [];
          return _this;
        }
        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$5({}, child.props);
                if (child.ref) {
                  _props.ref = child.ref;
                }
                if (!(child && ["function", "object"].indexOf(_default$2(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) {
              child.headerCellRowIndex = level;
              child.headerCellColIndex = groupChildren[level].length;
              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, i2) {
            groupChild.forEach(function(child, j2) {
              var colSpan = void 0;
              var children2 = child.children;
              if (children2) {
                colSpan = getColSpan(children2);
                child.colSpan = colSpan;
                groupChildren[i2][j2] = 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__default.createElement("col", { style, key: index2 });
          });
          return React__default.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, locale2 = _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__default.createElement("div", {
              key: prefix + "table-column-resize-proxy",
              ref: this.getResizeProxyDomRef,
              className: prefix + "table-column-resize-proxy"
            }), React__default.createElement(
              Wrapper$1,
              {
                key: prefix + "table-wrapper",
                colGroup,
                ref: this.getWrapperRef,
                prefix,
                tableWidth
              },
              hasHeader ? React__default.createElement(Header$1, {
                prefix,
                rtl,
                pure,
                affixRef: this.getAffixRef,
                colGroup,
                className: prefix + "table-header",
                filterParams,
                tableEl: this.tableEl,
                columns: groupChildren,
                locale: locale2,
                headerCellRef: this.getHeaderCellRef,
                components,
                onFilter: this.onFilter,
                sort,
                onResizeChange: this.onResizeChange,
                onSort: this.onSort,
                sortIcons,
                tableWidth,
                resizeProxyDomRef: this.resizeProxyDomRef
              }) : null,
              React__default.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: locale2,
                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$4(_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__default.createElement(
            "div",
            _default$5({
              className: cls,
              style,
              ref: ref || this.getTableEl
            }, obj.pickOthers(Object.keys(Table2.propTypes), others)),
            table,
            loading ? React__default.createElement(LoadingComponent, { className: loadingcls }) : null
          );
        };
        return Table2;
      }(React__default.Component), _class$g.Column = Column, _class$g.ColumnGroup = ColumnGroup, _class$g.Header = Header, _class$g.Body = Body, _class$g.Wrapper = Wrapper, _class$g.Row = Row, _class$g.Cell = Cell, _class$g.Filter = FilterComponent, _class$g.Sort = Sort, _class$g.propTypes = _default$5({}, ConfigProvider$1.propTypes, {
        /**
         * 样式类名的品牌前缀
         */
        prefix: PT.string,
        pure: PT.bool,
        rtl: PT.bool,
        /**
         * 表格元素的 table-layout 属性,设为 fixed 表示内容不会影响列的布局
         */
        tableLayout: PT.oneOf(["fixed", "auto"]),
        /**
         * 表格的总长度,可以这么用:设置表格总长度 、设置部分列的宽度,这样表格会按照剩余空间大小,自动其他列分配宽度
         */
        tableWidth: PT.number,
        /**
         * 自定义类名
         */
        className: PT.string,
        /**
         * 自定义内联样式
         */
        style: PT.object,
        /**
         * 尺寸 small为紧凑模式
         */
        size: PT.oneOf(["small", "medium"]),
        /**
         * 表格展示的数据源
         */
        dataSource: PT.array,
        entireDataSource: PT.array,
        /**
         * 点击表格每一行触发的事件
         * @param {Object} record 该行所对应的数据
         * @param {Number} index 该行所对应的序列
         * @param {Event} e DOM事件对象
         */
        onRowClick: PT.func,
        /**
         * 悬浮在表格每一行的时候触发的事件
         * @param {Object} record 该行所对应的数据
         * @param {Number} index 该行所对应的序列
         * @param {Event} e DOM事件对象
         */
        onRowMouseEnter: PT.func,
        /**
         * 离开表格每一行的时候触发的事件
         * @param {Object} record 该行所对应的数据
         * @param {Number} index 该行所对应的序列
         * @param {Event} e DOM事件对象
         */
        onRowMouseLeave: PT.func,
        /**
         * 点击列排序触发的事件
         * @param {String} dataIndex 指定的排序的字段
         * @param {String} order 排序对应的顺序, 有`desc`和`asc`两种
         */
        onSort: PT.func,
        /**
         * 点击过滤确认按钮触发的事件
         * @param {Object} filterParams 过滤的字段信息
         */
        onFilter: PT.func,
        /**
         * 重设列尺寸的时候触发的事件
         * @param {String} dataIndex 指定重设的字段
         * @param {Number} value 列宽变动的数值
         */
        onResizeChange: PT.func,
        /**
         * 设置每一行的属性,如果返回值和其他针对行操作的属性冲突则无效。
         * @param {Object} record 该行所对应的数据
         * @param {Number} index 该行所对应的序列
         * @returns {Object} 需要设置的行属性
         */
        rowProps: PT.func,
        /**
         * 设置单元格的属性,通过该属性可以进行合并单元格
         * @param {Number} rowIndex 该行所对应的序列
         * @param {Number} colIndex 该列所对应的序列
         * @param {String} dataIndex 该列所对应的字段名称
         * @param {Object} record 该行对应的记录
         * @returns {Object} 返回td元素的所支持的属性对象
         */
        cellProps: PT.func,
        /**
         * 虚拟滚动时向前保留渲染的行数
         */
        keepForwardRenderRows: PT.number,
        /**
         * 表格是否具有边框
         */
        hasBorder: PT.bool,
        /**
         * 表格是否具有头部
         */
        hasHeader: PT.bool,
        /**
         * 表格是否是斑马线
         */
        isZebra: PT.bool,
        /**
         * 表格是否在加载中
         */
        loading: PT.bool,
        /**
         * 自定义 Loading 组件
         * 请务必传递 props, 使用方式: loadingComponent={props => <Loading {...props}/>}
         * @param {LoadingProps} props 需要透传给组件的参数
         * @return {React.ReactNode} 展示的组件
         */
        loadingComponent: PT.func,
        /**
         * 当前过滤的的keys,使用此属性可以控制表格的头部的过滤选项中哪个菜单被选中,格式为 {dataIndex: {selectedKeys:[]}}
         * 示例:
         * 假设要控制dataIndex为id的列的过滤菜单中key为one的菜单项选中
         * `<Table filterParams={{id: {selectedKeys: ['one']}}}/>`
         */
        filterParams: PT.object,
        /**
         * 当前排序的字段,使用此属性可以控制表格的字段的排序,格式为{[dataIndex]: 'asc' | 'desc' } , 例如  {id: 'desc'}
         */
        sort: PT.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: PT.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: PT.object,
        components: PT.object,
        /**
         * 等同于写子组件 Table.Column ,子组件优先级更高
         */
        columns: PT.array,
        /**
         * 设置数据为空的时候的表格内容展现
         */
        emptyContent: PT.node,
        /**
         * dataSource当中数据的主键,如果给定的数据源中的属性不包含该主键,会造成选择状态全部选中
         */
        primaryKey: PT.oneOfType([PT.symbol, PT.string]),
        lockType: PT.oneOf(["left", "right"]),
        wrapperContent: PT.any,
        refs: PT.object,
        /**
         * 额外渲染行的渲染函数
         * @param {Object} record 该行所对应的数据
         * @param {Number} index 该行所对应的序列
         * @returns {Element} 渲染内容
         */
        expandedRowRender: PT.func,
        /**
         * 设置行是否可展开,设置 false 为不可展开
         * @param {Object} record 该行所对应的数据
         * @param {Number} index 该行所对应的序列
         * @returns {Boolean} 是否可展开
         */
        rowExpandable: PT.func,
        /**
         * 额外渲染行的缩进, 是个二维数组(eg:[1,1]) 分别表示左右两边的缩进
         */
        expandedRowIndent: PT.array,
        /**
         * 是否显示点击展开额外渲染行的+号按钮
         */
        hasExpandedRowCtrl: PT.bool,
        /**
         * 设置额外渲染行的属性
         * @param {Object} record 该行所对应的数据
         * @param {Number} index 该行所对应的序列
         * @returns {Object} 额外渲染行的属性
         */
        getExpandedColProps: PT.func,
        /**
         * 当前展开的 Expand行 或者 Tree行 , 传入此属性为受控状态,一般配合 onRowOpen 使用
         */
        openRowKeys: PT.array,
        /**
         * 默认情况下展开的 Expand行 或者 Tree行,非受控模式
         * @version 1.23.22
         */
        defaultOpenRowKeys: PT.array,
        /**
         * 在 Expand行 或者 Tree行 展开或者收起的时候触发的事件
         * @param {Array} openRowKeys 展开的渲染行的key
         * @param {String} currentRowKey 当前点击的渲染行的key
         * @param {Boolean} expanded 当前点击是展开还是收起
         * @param {Object} currentRecord 当前点击额外渲染行的记录
         */
        onRowOpen: PT.func,
        onExpandedRowClick: PT.func,
        /**
         * 表头是否固定,该属性配合maxBodyHeight使用,当内容区域的高度超过maxBodyHeight的时候,在内容区域会出现滚动条
         */
        fixedHeader: PT.bool,
        /**
         * 最大内容区域的高度,在`fixedHeader`为`true`的时候,超过这个高度会出现滚动条
         */
        maxBodyHeight: PT.oneOfType([PT.number, PT.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: PT.object,
        /**
         * 表头是否是sticky
         */
        stickyHeader: PT.bool,
        /**
         * 距离窗口顶部达到指定偏移量后触发
         */
        offsetTop: PT.number,
        /**
         * affix组件的的属性
         */
        affixProps: PT.object,
        /**
         * 在tree模式下的缩进尺寸, 仅在isTree为true时候有效
         */
        indent: PT.number,
        /**
         * 开启Table的tree模式, 接收的数据格式中包含children则渲染成tree table
         */
        isTree: PT.bool,
        /**
         * 是否开启虚拟滚动
         */
        useVirtual: PT.bool,
        rowHeight: PT.oneOfType([PT.number, PT.func]),
        /**
         * 滚动到第几行,需要保证行高相同。1.22.15 版本之前仅在虚拟滚动场景下生效,之后在所有情况下生效
         * @version 1.22.15
         */
        scrollToRow: PT.number,
        /**
         * 在内容区域滚动的时候触发的函数
         */
        onBodyScroll: PT.func,
        /**
         * 开启时,getExpandedColProps() / rowProps() / expandedRowRender() 的第二个参数 index (该行所对应的序列) 将按照01,2,3,4...的顺序返回,否则返回真实index(0,2,4,6... / 1,3,5,7...)
         */
        expandedIndexSimulate: PT.bool,
        /**
         * 在 hover 时出现十字参考轴,适用于表头比较复杂,需要做表头分类的场景。
         */
        crossline: PT.bool,
        lengths: PT.object
      }), _class$g.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,
        keepForwardRenderRows: 10,
        hasHeader: true,
        isZebra: false,
        loading: false,
        expandedIndexSimulate: false,
        primaryKey: "id",
        components: {},
        locale: locale$1.Table,
        crossline: false
      }, _class$g.childContextTypes = {
        notRenderCellIndex: PT.array,
        lockType: PT.oneOf(["left", "right"])
      }, _class$g.contextTypes = {
        getTableInstance: PT.func,
        getTableInstanceForFixed: PT.func,
        getTableInstanceForVirtual: PT.func,
        getTableInstanceForExpand: PT.func
      }, _temp$8);
      Table$3.displayName = "Table";
      const Base = polyfill(Table$3);
      var _class$f, _temp2$7;
      var LockRow = (_temp2$7 = _class$f = function(_React$Component) {
        _default(LockRow2, _React$Component);
        function LockRow2() {
          var _temp3, _this, _ret;
          _default$3(this, LockRow2);
          for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
            args[_key] = arguments[_key];
          }
          return _ret = (_temp3 = (_this = _default$1(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.onMouseEnter = function(record, index2, e2) {
            var onRowMouseEnter = _this.context.onRowMouseEnter;
            var onMouseEnter = _this.props.onMouseEnter;
            onRowMouseEnter && onRowMouseEnter(record, index2, e2);
            onMouseEnter(record, index2, e2);
          }, _this.onMouseLeave = function(record, index2, e2) {
            var onRowMouseLeave = _this.context.onRowMouseLeave;
            var onMouseLeave = _this.props.onMouseLeave;
            onRowMouseLeave && onRowMouseLeave(record, index2, e2);
            onMouseLeave(record, index2, e2);
          }, _temp3), _default$1(_this, _ret);
        }
        LockRow2.prototype.render = function render2() {
          return React__default.createElement(Row, _default$5({}, this.props, { onMouseEnter: this.onMouseEnter, onMouseLeave: this.onMouseLeave }));
        };
        return LockRow2;
      }(React__default.Component), _class$f.propTypes = _default$5({}, Row.propTypes), _class$f.contextTypes = {
        onRowMouseEnter: PT.func,
        onRowMouseLeave: PT.func
      }, _class$f.defaultProps = _default$5({}, Row.defaultProps), _temp2$7);
      LockRow.displayName = "LockRow";
      var _class$e, _temp2$6;
      var ExpandedRow = (_temp2$6 = _class$e = function(_React$Component) {
        _default(ExpandedRow2, _React$Component);
        function ExpandedRow2() {
          var _temp3, _this, _ret;
          _default$3(this, ExpandedRow2);
          for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
            args[_key] = arguments[_key];
          }
          return _ret = (_temp3 = (_this = _default$1(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.getExpandedRow = function(parentKey, ref) {
            var getExpandedRowRef = _this.context.getExpandedRowRef;
            getExpandedRowRef && getExpandedRowRef(parentKey, ref);
          }, _temp3), _default$1(_this, _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(i3) {
                ret.push(React__default.createElement(
                  "td",
                  { key: i3, ref: function ref(cell) {
                    return cellRef(rowIndex, i3 + start, cell);
                  } },
                  " "
                ));
              };
              for (var i2 = 0; i2 < number; i2++) {
                _loop(i2);
              }
              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__default.createElement(
                "tr",
                { className: prefix + "table-expanded-row", key: "expanded-" + expandedIndex },
                React__default.createElement(
                  "td",
                  { colSpan, ref: function ref(cell) {
                    return cellRef(rowIndex, expandedCols, cell);
                  } },
                  " "
                )
              ) : null;
            }
            var expandedRowStyle = {
              position: "sticky",
              left: 0
            };
            content = expandedRowRender(record, expandedIndex);
            if (!React__default.isValidElement(content)) {
              content = React__default.createElement(
                "div",
                {
                  className: prefix + "table-cell-wrapper",
                  ref: this.getExpandedRow.bind(this, record[primaryKey]),
                  style: expandedRowWidthEquals2Table && expandedRowStyle
                },
                content
              );
            } else {
              content = expandedRowWidthEquals2Table ? React__default.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__default.createElement(
              "tr",
              { className: prefix + "table-expanded-row", key: "expanded-" + (record[primaryKey] || expandedIndex) },
              renderCols(leftIndent),
              React__default.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$4(_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__default.createElement(LockRow, _default$5({}, others, { record, columns, __rowIndex: rowIndex, rowIndex: newRowIndex }));
        };
        return ExpandedRow2;
      }(React__default.Component), _class$e.propTypes = _default$5({}, LockRow.propTypes), _class$e.defaultProps = _default$5({}, LockRow.defaultProps), _class$e.contextTypes = {
        openRowKeys: PT.array,
        expandedRowRender: PT.func,
        expandedRowIndent: PT.array,
        expandedIndexSimulate: PT.bool,
        expandedRowWidthEquals2Table: PT.bool,
        lockType: PT.oneOf(["left", "right"]),
        getExpandedRowRef: PT.func
      }, _temp2$6);
      ExpandedRow.displayName = "ExpandedRow";
      var _class$d, _temp$7;
      var SelectionRow = (_temp$7 = _class$d = function(_React$Component) {
        _default(SelectionRow2, _React$Component);
        function SelectionRow2() {
          _default$3(this, SelectionRow2);
          return _default$1(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__default.createElement(ExpandedRow, _default$5({}, this.props, { className: cls }));
        };
        return SelectionRow2;
      }(React__default.Component), _class$d.propTypes = _default$5({}, ExpandedRow.propTypes), _class$d.defaultProps = _default$5({}, ExpandedRow.defaultProps), _class$d.contextTypes = {
        selectedRowKeys: PT.array
      }, _temp$7);
      SelectionRow.displayName = "SelectionRow";
      var _class$c, _temp$6;
      var TreeRow = (_temp$6 = _class$c = function(_React$Component) {
        _default(TreeRow2, _React$Component);
        function TreeRow2() {
          _default$3(this, TreeRow2);
          return _default$1(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$4(_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__default.createElement(SelectionRow, _default$5({}, others, { record, className: cls, primaryKey, prefix }));
        };
        return TreeRow2;
      }(React__default.Component), _class$c.propTypes = _default$5({}, SelectionRow.propTypes), _class$c.defaultProps = _default$5({}, SelectionRow.defaultProps), _class$c.contextTypes = {
        treeStatus: PT.array,
        openRowKeys: PT.array
      }, _temp$6);
      TreeRow.displayName = "TreeRow";
      var _class$b, _temp2$5;
      var TreeCell = (_temp2$5 = _class$b = function(_React$Component) {
        _default(TreeCell2, _React$Component);
        function TreeCell2() {
          var _temp3, _this, _ret;
          _default$3(this, TreeCell2);
          for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
            args[_key] = arguments[_key];
          }
          return _ret = (_temp3 = (_this = _default$1(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.onTreeNodeClick = function(record, e2) {
            e2.stopPropagation();
            _this.context.onTreeNodeClick(record);
          }, _this.expandedKeydown = function(record, e2) {
            e2.preventDefault();
            e2.stopPropagation();
            if (e2.keyCode === KEYCODE.ENTER) {
              _this.onTreeNodeClick(record, e2);
            }
          }, _temp3), _default$1(_this, _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, locale2 = _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__default.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__default.createElement(Icon, {
                  className: prefix + "table-tree-arrow",
                  type: treeArrowType,
                  size: "xs",
                  rtl,
                  onClick: function onClick(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 ? locale2.expanded : locale2.folded
                });
              }
            }
          }
          return React__default.createElement(
            Cell,
            _default$5({}, this.props, { innerStyle: firstCellStyle, isIconLeft: !!treeArrowNode }),
            children,
            treeArrowNode
          );
        };
        return TreeCell2;
      }(React__default.Component), _class$b.propTypes = _default$5({
        indent: PT.number,
        locale: PT.object
      }, Cell.propTypes), _class$b.defaultProps = _default$5({}, Cell.defaultProps, {
        component: "td",
        indent: 20
      }), _class$b.contextTypes = {
        openTreeRowKeys: PT.array,
        indent: PT.number,
        onTreeNodeClick: PT.func,
        isTree: PT.bool,
        rowSelection: PT.object
      }, _temp2$5);
      TreeCell.displayName = "TreeCell";
      var noop$2 = function noop2() {
      };
      function tree(BaseComponent) {
        var _class2, _temp3;
        var TreeTable = (_temp3 = _class2 = function(_React$Component) {
          _default(TreeTable2, _React$Component);
          function TreeTable2(props, context) {
            _default$3(this, TreeTable2);
            var _this = _default$1(this, _React$Component.call(this, props, context));
            _this.onTreeNodeClick = function(record) {
              var primaryKey = _this.props.primaryKey, id2 = record[primaryKey], dataSource = _this.ds, openRowKeys = [].concat(_this.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 i2 = openRowKeys.indexOf(id3);
                  if (i2 > -1) {
                    openRowKeys.splice(i2, 1);
                  }
                });
              } else {
                openRowKeys.push(id2);
              }
              if (!("openRowKeys" in _this.props)) {
                _this.setState({
                  openRowKeys
                });
              }
              _this.props.onRowOpen(openRowKeys, id2, index2 === -1, record);
            };
            _this.state = {
              openRowKeys: props.openRowKeys || props.defaultOpenRowKeys || []
            };
            return _this;
          }
          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$4(_props, ["components", "isTree", "dataSource", "indent"]);
            if (isTree) {
              components = _default$5({}, components);
              if (!components.Row) {
                components.Row = TreeRow;
              }
              if (!components.Cell) {
                components.Cell = TreeCell;
              }
              dataSource = this.normalizeDataSource(dataSource);
            }
            return React__default.createElement(BaseComponent, _default$5({}, others, { dataSource, components }));
          };
          return TreeTable2;
        }(React__default.Component), _class2.TreeRow = TreeRow, _class2.TreeCell = TreeCell, _class2.propTypes = _default$5({
          /**
           * 默认情况下展开的树形表格,传入了此属性代表tree的展开为受控操作
           */
          openRowKeys: PT.array,
          /**
           * 默认情况下展开的 Expand行 或者 Tree行,非受控模式
           * @version 1.23.22
           */
          defaultOpenRowKeys: PT.array,
          /**
           * 点击tree展开或者关闭的时候触发的事件
           * @param {Array} openRowKeys tree模式下展开的key
           * @param {String} currentRowKey 当前点击行的key
           * @param {Boolean} opened 当前点击是展开还是收起
           * @param {Object} currentRecord 当前点击行的记录
           */
          onRowOpen: PT.func,
          /**
           * dataSource当中数据的主键,如果给定的数据源中的属性不包含该主键,会造成选择状态全部选中
           */
          primaryKey: PT.oneOfType([PT.symbol, PT.string]),
          /**
           * 在tree模式下的缩进尺寸, 仅在isTree为true时候有效
           */
          indent: PT.number,
          /**
           * 开启Table的tree模式, 接收的数据格式中包含children则渲染成tree table
           */
          isTree: PT.bool,
          locale: PT.object
        }, BaseComponent.propTypes), _class2.defaultProps = _default$5({}, BaseComponent.defaultProps, {
          primaryKey: "id",
          onRowOpen: noop$2,
          components: {},
          indent: 12
        }), _class2.childContextTypes = {
          openTreeRowKeys: PT.array,
          indent: PT.number,
          treeStatus: PT.array,
          onTreeNodeClick: PT.func,
          isTree: PT.bool
        }, _temp3);
        TreeTable.displayName = "TreeTable";
        statics(TreeTable, BaseComponent);
        return polyfill(TreeTable);
      }
      var _class$a, _temp$5;
      var FixedHeader = (_temp$5 = _class$a = function(_React$Component) {
        _default(FixedHeader2, _React$Component);
        function FixedHeader2() {
          _default$3(this, FixedHeader2);
          return _default$1(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$4(_props, ["prefix", "className", "colGroup", "tableWidth"]);
          var _context = this.context, onFixedScrollSync = _context.onFixedScrollSync, lockType = _context.lockType;
          return React__default.createElement(
            "div",
            { className, onScroll: onFixedScrollSync },
            React__default.createElement(
              "div",
              { className: prefix + "table-header-inner", style: { overflow: "unset" } },
              React__default.createElement(
                "table",
                { style: { width: tableWidth } },
                colGroup,
                React__default.createElement(Header, _default$5({}, others, { prefix }))
              )
            ),
            !lockType && React__default.createElement("div", { className: prefix + "table-header-fixer", style: { position: "absolute", right: 0 } })
          );
        };
        return FixedHeader2;
      }(React__default.Component), _class$a.propTypes = {
        children: PT.any,
        prefix: PT.string,
        className: PT.string,
        colGroup: PT.any,
        tableWidth: PT.number
      }, _class$a.contextTypes = {
        getNode: PT.func,
        onFixedScrollSync: PT.func,
        lockType: PT.oneOf(["left", "right"])
      }, _temp$5);
      FixedHeader.displayName = "FixedHeader";
      var _class$9, _temp2$4;
      var FixedBody = (_temp2$4 = _class$9 = function(_React$Component) {
        _default(FixedBody2, _React$Component);
        function FixedBody2() {
          var _temp3, _this, _ret;
          _default$3(this, FixedBody2);
          for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
            args[_key] = arguments[_key];
          }
          return _ret = (_temp3 = (_this = _default$1(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.onBodyScroll = function(event) {
            var onFixedScrollSync = _this.context.onFixedScrollSync;
            onFixedScrollSync && onFixedScrollSync(event);
            if ("onLockScroll" in _this.props && typeof _this.props.onLockScroll === "function") {
              _this.props.onLockScroll(event);
            }
          }, _temp3), _default$1(_this, _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$4(_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__default.createElement(
            "div",
            { style, className, onScroll: this.onBodyScroll },
            React__default.createElement(
              "table",
              { style: { width: tableWidth } },
              colGroup,
              React__default.createElement(Body, _default$5({}, others, { colGroup }))
            )
          );
        };
        return FixedBody2;
      }(React__default.Component), _class$9.propTypes = {
        children: PT.any,
        prefix: PT.string,
        className: PT.string,
        colGroup: PT.any,
        onLockScroll: PT.func,
        tableWidth: PT.number
      }, _class$9.contextTypes = {
        fixedHeader: PT.bool,
        maxBodyHeight: PT.oneOfType([PT.number, PT.string]),
        onFixedScrollSync: PT.func,
        getNode: PT.func
      }, _temp2$4);
      FixedBody.displayName = "FixedBody";
      var _class$8, _temp$4;
      var FixedWrapper = (_temp$4 = _class$8 = function(_React$Component) {
        _default(FixedWrapper2, _React$Component);
        function FixedWrapper2() {
          _default$3(this, FixedWrapper2);
          return _default$1(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__default.createElement(
            "div",
            { className: prefix + "table-inner" },
            children,
            wrapperContent
          );
        };
        return FixedWrapper2;
      }(React__default.Component), _class$8.propTypes = {
        children: PT.any,
        prefix: PT.string,
        colGroup: PT.any,
        wrapperContent: PT.any
      }, _temp$4);
      FixedWrapper.displayName = "FixedWrapper";
      function fixed(BaseComponent, stickyLock2) {
        var _class2, _temp22;
        var FixedTable = (_temp22 = _class2 = function(_React$Component) {
          _default(FixedTable2, _React$Component);
          function FixedTable2() {
            var _temp3, _this, _ret;
            _default$3(this, FixedTable2);
            for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
              args[_key] = arguments[_key];
            }
            return _ret = (_temp3 = (_this = _default$1(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.state = {}, _this.getNode = function(type2, node, lockType) {
              lockType = lockType ? lockType.charAt(0).toUpperCase() + lockType.substr(1) : "";
              _this["" + type2 + lockType + "Node"] = node;
            }, _this.getTableInstance = function(type2, instance2) {
              type2 = "";
              _this["table" + type2 + "Inc"] = instance2;
            }, _this.onFixedScrollSync = function() {
              var current = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : { currentTarget: {} };
              var currentTarget = current.currentTarget || {}, headerNode = _this.headerNode, bodyNode = _this.bodyNode;
              var scrollLeft = currentTarget.scrollLeft, scrollWidth = currentTarget.scrollWidth, clientWidth = currentTarget.clientWidth;
              var scrollToRightEnd = !(scrollLeft < scrollWidth - clientWidth);
              var _this$props = _this.props, prefix = _this$props.prefix, loading = _this$props.loading;
              if (!loading && scrollToRightEnd !== _this.scrollToRightEnd) {
                _this.scrollToRightEnd = scrollToRightEnd;
                var table = _this.getTableNode();
                var leftFunc = scrollToRightEnd ? "removeClass" : "addClass";
                dom[leftFunc](table, prefix + "table-scrolling-to-right");
              }
              if (!_this.scrollTarget || _this.scrollTarget === currentTarget) {
                _this.scrollTarget = currentTarget;
                window.clearTimeout(_this.timeoutId);
                _this.timeoutId = window.setTimeout(function() {
                  _this.scrollTarget = null;
                  _this.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$1(_this, _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$4(_props2, ["components", "className", "prefix", "fixedHeader", "lockType", "dataSource", "maxBodyHeight"]);
            if (fixedHeader) {
              var _classnames;
              components = _default$5({}, 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__default.createElement(BaseComponent, _default$5({}, others, {
              dataSource,
              lockType,
              components,
              className,
              prefix
            }));
          };
          return FixedTable2;
        }(React__default.Component), _class2.FixedHeader = FixedHeader, _class2.FixedBody = FixedBody, _class2.FixedWrapper = FixedWrapper, _class2.propTypes = _default$5({
          /**
           * 是否具有表头
           */
          hasHeader: PT.bool,
          /**
           * 表头是否固定,该属性配合maxBodyHeight使用,当内容区域的高度超过maxBodyHeight的时候,在内容区域会出现滚动条
           */
          fixedHeader: PT.bool,
          /**
           * 最大内容区域的高度,在`fixedHeader`为`true`的时候,超过这个高度会出现滚动条
           */
          maxBodyHeight: PT.oneOfType([PT.number, PT.string])
        }, BaseComponent.propTypes), _class2.defaultProps = _default$5({}, BaseComponent.defaultProps, {
          hasHeader: true,
          fixedHeader: false,
          maxBodyHeight: 200,
          components: {},
          refs: {},
          prefix: "next-"
        }), _class2.childContextTypes = {
          fixedHeader: PT.bool,
          getNode: PT.func,
          onFixedScrollSync: PT.func,
          getTableInstanceForFixed: PT.func,
          maxBodyHeight: PT.oneOfType([PT.number, PT.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(SelectionTable2, _React$Component);
          function SelectionTable2(props, context) {
            _default$3(this, SelectionTable2);
            var _this = _default$1(this, _React$Component.call(this, props, context));
            _this.addSelection = function(columns) {
              var _this$props = _this.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$5({
                  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));
              }
            };
            _this.renderSelectionHeader = function() {
              var onChange = _this.selectAllRow, attrs = {}, _this$props2 = _this.props, rowSelection = _this$props2.rowSelection, primaryKey = _this$props2.primaryKey, dataSource = _this$props2.dataSource, entireDataSource = _this$props2.entireDataSource, locale2 = _this$props2.locale, selectedRowKeys = _this.state.selectedRowKeys, mode = rowSelection.mode ? rowSelection.mode : "multiple";
              var checked = !!selectedRowKeys.length;
              var indeterminate = false;
              var source = entireDataSource || dataSource;
              _this.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__default.createElement(CheckboxWithGroup, _default$5({
                key: "_total",
                indeterminate,
                "aria-label": locale2.selectAll,
                checked,
                onChange
              }, attrs, userAttrs)) : null, rowSelection.titleAddons && rowSelection.titleAddons()];
            };
            _this.renderSelectionBody = function(value, index2, record) {
              var _this$props3 = _this.props, rowSelection = _this$props3.rowSelection, primaryKey = _this$props3.primaryKey;
              var selectedRowKeys = _this.state.selectedRowKeys;
              var mode = rowSelection.mode ? rowSelection.mode : "multiple";
              var checked = selectedRowKeys.indexOf(record[primaryKey]) > -1;
              var onChange = _this.selectOneRow.bind(_this, index2, record);
              var attrs = rowSelection.getProps ? rowSelection.getProps(record, index2) || {} : {};
              attrs.onClick = makeChain(function(e2) {
                e2.stopPropagation();
              }, attrs.onClick);
              return mode === "multiple" ? React__default.createElement(CheckboxWithGroup, _default$5({ checked, onChange }, attrs)) : React__default.createElement(RadioWithSub, _default$5({ checked, onChange }, attrs));
            };
            _this.selectAllRow = function(checked, e2) {
              var ret = [].concat(_this.state.selectedRowKeys), _this$props4 = _this.props, rowSelection = _this$props4.rowSelection, primaryKey = _this$props4.primaryKey, dataSource = _this$props4.dataSource, entireDataSource = _this$props4.entireDataSource, selectedRowKeys = _this.state.selectedRowKeys, getProps = rowSelection.getProps;
              var attrs = {}, records = [];
              var source = entireDataSource ? entireDataSource : dataSource;
              _this.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 i2 = ret.indexOf(id2);
                  i2 > -1 && ret.splice(i2, 1);
                }
              });
              records = unique(records, primaryKey);
              if (typeof rowSelection.onSelectAll === "function") {
                rowSelection.onSelectAll(checked, records);
              }
              _this.triggerSelection(rowSelection, unique(ret), records);
              e2.stopPropagation();
            };
            _this.state = {
              selectedRowKeys: props.rowSelection && "selectedRowKeys" in props.rowSelection ? props.rowSelection.selectedRowKeys || [] : []
            };
            return _this;
          }
          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__default.Children.map(children, function(child, index2) {
                return React__default.cloneElement(child, {
                  key: index2
                });
              });
              var attrs = rowSelection.columnProps && rowSelection.columnProps() || {};
              children.unshift(React__default.createElement(Column, _default$5({
                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), i2 = 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 === null || id2 === void 0) {
              log.warning("Can't get value from record using given " + primaryKey + " as primaryKey.");
            }
            if (mode === "multiple") {
              if (checked) {
                selectedRowKeys.push(id2);
              } else {
                i2 = selectedRowKeys.indexOf(id2);
                selectedRowKeys.splice(i2, 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$4(_props3, ["rowSelection", "components", "children", "columns"]);
            var useColumns = columns && !children;
            if (rowSelection) {
              if (useColumns) {
                this.addSelection(columns);
              } else {
                children = this.normalizeChildren(children || []);
              }
              components = _default$5({}, components);
              components.Row = components.Row || SelectionRow;
            }
            return React__default.createElement(BaseComponent, _default$5({}, others, { columns, components, children }));
          };
          return SelectionTable2;
        }(React__default.Component), _class2.SelectionRow = SelectionRow, _class2.propTypes = _default$5({
          /**
           * 是否启用选择模式
           * @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: PT.object,
          primaryKey: PT.oneOfType([PT.symbol, PT.string]),
          dataSource: PT.array,
          entireDataSource: PT.array
        }, BaseComponent.propTypes), _class2.defaultProps = _default$5({}, BaseComponent.defaultProps, {
          locale: locale$1.Table,
          primaryKey: "id",
          prefix: "next-"
        }), _class2.contextTypes = {
          listHeader: PT.any
        }, _class2.childContextTypes = {
          rowSelection: PT.object,
          selectedRowKeys: PT.array
        }, _temp3);
        SelectionTable.displayName = "SelectionTable";
        statics(SelectionTable, BaseComponent);
        return polyfill(SelectionTable);
      }
      var noop$1 = function noop2() {
      };
      function expanded(BaseComponent, stickyLock2) {
        var _class2, _temp22;
        var ExpandedTable = (_temp22 = _class2 = function(_React$Component) {
          _default(ExpandedTable2, _React$Component);
          function ExpandedTable2() {
            var _temp3, _this, _ret;
            _default$3(this, ExpandedTable2);
            for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
              args[_key] = arguments[_key];
            }
            return _ret = (_temp3 = (_this = _default$1(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.state = {
              openRowKeys: _this.props.openRowKeys || _this.props.defaultOpenRowKeys || []
            }, _this.saveExpandedRowRef = function(key, rowRef) {
              if (!_this.expandedRowRefs) {
                _this.expandedRowRefs = {};
              }
              _this.expandedRowRefs[key] = rowRef;
            }, _this.setExpandedWidth = function() {
              var prefix = _this.props.prefix;
              var tableEl = _this.getTableNode();
              var totalWidth = +(tableEl && tableEl.clientWidth) - 1 || "100%";
              var bodyNode = tableEl && tableEl.querySelector("." + prefix + "table-body");
              Object.keys(_this.expandedRowRefs || {}).forEach(function(key) {
                dom.setStyle(_this.expandedRowRefs[key], { width: bodyNode && bodyNode.clientWidth || totalWidth });
              });
            }, _this.getTableInstance = function(instance2) {
              _this.tableInc = instance2;
            }, _this.expandedKeydown = function(value, record, index2, e2) {
              e2.preventDefault();
              e2.stopPropagation();
              if (e2.keyCode === KEYCODE.ENTER) {
                _this.onExpandedClick(value, record, index2, e2);
              }
            }, _this.renderExpandedCell = function(value, index2, record) {
              var _classnames;
              var _this$props = _this.props, getExpandedColProps = _this$props.getExpandedColProps, prefix = _this$props.prefix, locale2 = _this$props.locale, rowExpandable = _this$props.rowExpandable;
              if (typeof rowExpandable === "function" && !rowExpandable(record, index2)) {
                return "";
              }
              var openRowKeys = _this.state.openRowKeys, primaryKey = _this.props.primaryKey, hasExpanded = openRowKeys.indexOf(record[primaryKey]) > -1, switchNode = hasExpanded ? React__default.createElement(Icon, { type: "minus", size: "xs", className: prefix + "table-expand-unfold" }) : React__default.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 = _this.onExpandedClick.bind(_this, value, record, index2);
              }
              return React__default.createElement(
                "span",
                _default$5({}, attrs, {
                  role: "button",
                  tabIndex: "0",
                  onKeyDown: _this.expandedKeydown.bind(_this, value, record, index2),
                  "aria-label": hasExpanded ? locale2.expanded : locale2.folded,
                  "aria-expanded": hasExpanded,
                  className: cls
                }),
                switchNode
              );
            }, _this.addExpandCtrl = function(columns) {
              var _this$props2 = _this.props, prefix = _this$props2.prefix, size2 = _this$props2.size;
              if (!columns.find(function(record) {
                return record.key === "expanded";
              })) {
                columns.unshift({
                  key: "expanded",
                  title: "",
                  cell: _this.renderExpandedCell.bind(_this),
                  width: size2 === "small" ? 34 : 50,
                  className: prefix + "table-expanded " + prefix + "table-prerow",
                  __normalized: true
                });
              }
            }, _temp3), _default$1(_this, _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, i2, 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__default.Children.map(children, function(child, index2) {
              return React__default.cloneElement(child, {
                key: index2
              });
            });
            toArrayChildren.unshift(React__default.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$5({}, 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$4(_props2, ["components", "openRowKeys", "expandedRowRender", "rowExpandable", "hasExpandedRowCtrl", "children", "columns", "dataSource", "entireDataSource", "getExpandedColProps", "expandedRowIndent", "onRowOpen", "onExpandedRowClick"]);
            if (expandedRowRender && !components.Row) {
              components = _default$5({}, 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__default.createElement(
              BaseComponent,
              _default$5({}, others, {
                columns,
                dataSource,
                entireDataSource,
                components
              }),
              children
            );
          };
          return ExpandedTable2;
        }(React__default.Component), _class2.ExpandedRow = ExpandedRow, _class2.propTypes = _default$5({
          /**
           * 额外渲染行的渲染函数
           * @param {Object} record 该行所对应的数据
           * @param {Number} index 该行所对应的序列
           * @returns {Element}
           */
          expandedRowRender: PT.func,
          /**
           * 设置行是否可展开,设置 false 为不可展开
           * @param {Object} record 该行所对应的数据
           * @param {Number} index 该行所对应的序列
           * @returns {Boolean} 是否可展开
           * @version 1.21
           */
          rowExpandable: PT.func,
          /**
           * 额外渲染行的缩进
           */
          expandedRowIndent: PT.array,
          /**
           * 默认情况下展开的渲染行或者Tree, 传入此属性为受控状态
           */
          openRowKeys: PT.array,
          /**
           * 默认情况下展开的 Expand行 或者 Tree行,非受控模式
           * @version 1.23.22
           */
          defaultOpenRowKeys: PT.array,
          /**
           * 是否显示点击展开额外渲染行的+号按钮
           */
          hasExpandedRowCtrl: PT.bool,
          /**
           * 设置额外渲染行的属性
           */
          getExpandedColProps: PT.func,
          /**
           * 在额外渲染行或者Tree展开或者收起的时候触发的事件
           * @param {Array} openRowKeys 展开的渲染行的key
           * @param {String} currentRowKey 当前点击的渲染行的key
           * @param {Boolean} expanded 当前点击是展开还是收起
           * @param {Object} currentRecord 当前点击额外渲染行的记录
           */
          onRowOpen: PT.func,
          onExpandedRowClick: PT.func,
          locale: PT.object
        }, BaseComponent.propTypes), _class2.defaultProps = _default$5({}, BaseComponent.defaultProps, {
          getExpandedColProps: noop$1,
          onRowOpen: noop$1,
          hasExpandedRowCtrl: true,
          components: {},
          expandedRowIndent: stickyLock2 ? [0, 0] : [1, 0],
          prefix: "next-"
        }), _class2.childContextTypes = {
          openRowKeys: PT.array,
          expandedRowRender: PT.func,
          expandedIndexSimulate: PT.bool,
          expandedRowWidthEquals2Table: PT.bool,
          expandedRowIndent: PT.array,
          getExpandedRowRef: PT.func,
          getTableInstanceForExpand: PT.func
        }, _temp22);
        ExpandedTable.displayName = "ExpandedTable";
        statics(ExpandedTable, BaseComponent);
        return polyfill(ExpandedTable);
      }
      var _class$7, _temp2$3;
      var VirtualBody = (_temp2$3 = _class$7 = function(_React$Component) {
        _default(VirtualBody2, _React$Component);
        function VirtualBody2() {
          var _temp3, _this, _ret;
          _default$3(this, VirtualBody2);
          for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
            args[_key] = arguments[_key];
          }
          return _ret = (_temp3 = (_this = _default$1(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.tableRef = function(table) {
            _this.tableNode = table;
          }, _this.virtualScrollRef = function(virtualScroll) {
            _this.virtualScrollNode = virtualScroll;
          }, _this.onScroll = function(current) {
            _this.context.onFixedScrollSync(current);
            _this.context.onLockBodyScroll(current);
            _this.context.onVirtualScroll();
          }, _temp3), _default$1(_this, _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$4(_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__default.createElement(
            "div",
            { style: { maxHeight: maxBodyHeight }, className, onScroll: this.onScroll },
            React__default.createElement(
              "div",
              { style: wrapperStyle, ref: this.virtualScrollRef },
              React__default.createElement(
                "div",
                {
                  style: {
                    position: "relative",
                    transform: "translateY(" + innerTop + "px)",
                    willChange: "transform"
                  }
                },
                React__default.createElement(
                  "table",
                  { ref: this.tableRef, style },
                  colGroup,
                  React__default.createElement(Body, _default$5({}, others, { prefix }))
                )
              )
            )
          );
        };
        return VirtualBody2;
      }(React__default.Component), _class$7.propTypes = {
        children: PT.any,
        prefix: PT.string,
        className: PT.string,
        colGroup: PT.any,
        tableWidth: PT.number
      }, _class$7.contextTypes = {
        maxBodyHeight: PT.oneOfType([PT.number, PT.string]),
        onBodyScroll: PT.func,
        onFixedScrollSync: PT.func,
        onVirtualScroll: PT.func,
        onLockBodyScroll: PT.func,
        bodyHeight: PT.number,
        innerTop: PT.number,
        getNode: PT.func,
        getBodyNode: PT.func,
        getLockNode: PT.func,
        lockType: PT.oneOf(["left", "right"])
      }, _temp2$3);
      VirtualBody.displayName = "VirtualBody";
      var noop = function noop2() {
      };
      function virtual(BaseComponent) {
        var _class2, _temp3;
        var VirtualTable = (_temp3 = _class2 = function(_React$Component) {
          _default(VirtualTable2, _React$Component);
          function VirtualTable2(props, context) {
            _default$3(this, VirtualTable2);
            var _this = _default$1(this, _React$Component.call(this, props, context));
            _this.onScroll = function() {
              var scrollTop = _this.bodyNode.scrollTop;
              if (scrollTop === _this.lastScrollTop) {
                return;
              }
              var start = _this.computeScrollToRow(scrollTop);
              if (!("scrollToRow" in _this.props)) {
                _this.setState({
                  scrollToRow: start
                });
              }
              _this.props.onBodyScroll(start);
              _this.lastScrollTop = scrollTop;
            };
            _this.getBodyNode = function(node, lockType) {
              lockType = lockType ? lockType.charAt(0).toUpperCase() + lockType.substr(1) : "";
              _this["body" + lockType + "Node"] = node;
            };
            _this.getTableInstance = function(type2, instance2) {
              type2 = type2 ? type2.charAt(0).toUpperCase() + type2.substr(1) : "";
              _this["table" + type2 + "Inc"] = instance2;
            };
            var useVirtual = props.useVirtual, dataSource = props.dataSource;
            var hasVirtualData = useVirtual && dataSource && dataSource.length > 0;
            _this.state = {
              rowHeight: _this.props.rowHeight,
              scrollToRow: _this.props.scrollToRow,
              height: _this.props.maxBodyHeight,
              hasVirtualData
            };
            return _this;
          }
          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;
            } else {
              this.lastScrollTop = 0;
            }
            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 keepForwardRenderRows = this.props.keepForwardRenderRows;
            var rowHeight = this.state.rowHeight;
            if (typeof rowHeight === "function") {
              return 0;
            }
            var start = Math.max(this.start - keepForwardRenderRows, 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() {
            var _state3 = this.state, rowHeight = _state3.rowHeight, hasVirtualData = _state3.hasVirtualData, scrollToRow = _state3.scrollToRow;
            var oldScrollToRow = Math.floor(this.lastScrollTop / rowHeight);
            if (hasVirtualData && this.bodyNode) {
              if (oldScrollToRow !== scrollToRow) {
                this.bodyNode.scrollTop = rowHeight * scrollToRow;
              } else {
                this.bodyNode.scrollTop = this.lastScrollTop % rowHeight + rowHeight * 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(offset2) {
            var rowHeight = this.state.rowHeight;
            var start = parseInt(offset2 / 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 keepForwardRenderRows = _props.keepForwardRenderRows, others = _default$4(_props, ["useVirtual", "components", "dataSource", "fixedHeader", "rowHeight", "scrollToRow", "onBodyScroll", "keepForwardRenderRows"]);
            var entireDataSource = dataSource;
            var newDataSource = dataSource;
            this.rowSelection = this.props.rowSelection;
            if (this.state.hasVirtualData) {
              newDataSource = [];
              components = _default$5({}, 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 - keepForwardRenderRows, 0) && count < end) {
                    newDataSource.push(current);
                  }
                }
                current.__rowIndex = index2;
              });
              if (!components.Body) {
                components.Body = VirtualBody;
              }
              fixedHeader = true;
            }
            return React__default.createElement(BaseComponent, _default$5({}, others, {
              scrollToRow,
              dataSource: newDataSource,
              entireDataSource,
              components,
              fixedHeader
            }));
          };
          return VirtualTable2;
        }(React__default.Component), _class2.VirtualBody = VirtualBody, _class2.propTypes = _default$5({
          /**
           * 是否开启虚拟滚动
           */
          useVirtual: PT.bool,
          /**
           * 设置行高
           */
          rowHeight: PT.oneOfType([PT.number, PT.func]),
          maxBodyHeight: PT.oneOfType([PT.number, PT.string]),
          primaryKey: PT.oneOfType([PT.symbol, PT.string]),
          dataSource: PT.array,
          /**
           * 在内容区域滚动的时候触发的函数
           */
          onBodyScroll: PT.func,
          keepForwardRenderRows: PT.number
        }, BaseComponent.propTypes), _class2.defaultProps = _default$5({}, BaseComponent.defaultProps, {
          primaryKey: "id",
          rowHeight: noop,
          maxBodyHeight: 200,
          components: {},
          prefix: "next-",
          onBodyScroll: noop,
          keepForwardRenderRows: 10
        }), _class2.childContextTypes = {
          onVirtualScroll: PT.func,
          bodyHeight: PT.number,
          innerTop: PT.number,
          getBodyNode: PT.func,
          getTableInstanceForVirtual: PT.func,
          rowSelection: PT.object
        }, _temp3);
        VirtualTable.displayName = "VirtualTable";
        statics(VirtualTable, BaseComponent);
        return polyfill(VirtualTable);
      }
      var _class$6, _temp2$2;
      var LockBody = (_temp2$2 = _class$6 = function(_React$Component) {
        _default(LockBody2, _React$Component);
        function LockBody2() {
          var _temp3, _this, _ret;
          _default$3(this, LockBody2);
          for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
            args[_key] = arguments[_key];
          }
          return _ret = (_temp3 = (_this = _default$1(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.onBodyScroll = function(event) {
            _this.context.onLockBodyScroll(event);
          }, _temp3), _default$1(_this, _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__default.createElement(FixedBody, _default$5({}, this.props, event));
        };
        return LockBody2;
      }(React__default.Component), _class$6.propTypes = _default$5({}, FixedBody.propTypes), _class$6.contextTypes = _default$5({}, FixedBody.contextTypes, {
        getLockNode: PT.func,
        onLockBodyScroll: PT.func,
        lockType: PT.oneOf(["left", "right"])
      }), _temp2$2);
      LockBody.displayName = "LockBody";
      var _class$5, _temp$3;
      var LockHeader = (_temp$3 = _class$5 = function(_FixedHeader) {
        _default(LockHeader2, _FixedHeader);
        function LockHeader2() {
          _default$3(this, LockHeader2);
          return _default$1(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$5.propTypes = _default$5({}, FixedHeader.propTypes), _class$5.contextTypes = _default$5({}, FixedHeader.contextTypes, {
        getLockNode: PT.func,
        lockType: PT.oneOf(["left", "right"])
      }), _temp$3);
      var ieVersion$1 = env.ieVersion;
      function lock(BaseComponent) {
        var _class2, _temp3;
        var LockTable = (_temp3 = _class2 = function(_React$Component) {
          _default(LockTable2, _React$Component);
          function LockTable2(props, context) {
            _default$3(this, LockTable2);
            var _this = _default$1(this, _React$Component.call(this, props, context));
            _this.state = {};
            _this.getTableInstance = function(type2, instance2) {
              type2 = type2 ? type2.charAt(0).toUpperCase() + type2.substr(1) : "";
              _this["table" + type2 + "Inc"] = instance2;
            };
            _this.getNode = function(type2, node, lockType) {
              lockType = lockType ? lockType.charAt(0).toUpperCase() + lockType.substr(1) : "";
              _this["" + type2 + lockType + "Node"] = node;
              if (type2 === "header" && !_this.innerHeaderNode && !lockType) {
                _this.innerHeaderNode = _this.headerNode.querySelector("div");
              }
            };
            _this.onRowMouseEnter = function(record, index2) {
              if (_this.isLock()) {
                var row = _this.getRowNode(index2);
                var leftRow = _this.getRowNode(index2, "left");
                var rightRow = _this.getRowNode(index2, "right");
                [row, leftRow, rightRow].forEach(function(row2) {
                  row2 && dom.addClass(row2, "hovered");
                });
              }
            };
            _this.onRowMouseLeave = function(record, index2) {
              if (_this.isLock()) {
                var row = _this.getRowNode(index2);
                var leftRow = _this.getRowNode(index2, "left");
                var rightRow = _this.getRowNode(index2, "right");
                [row, leftRow, rightRow].forEach(function(row2) {
                  row2 && dom.removeClass(row2, "hovered");
                });
              }
            };
            _this.onLockBodyScrollTop = function(event) {
              var target = event.target;
              if (event.currentTarget !== target) {
                return;
              }
              var distScrollTop = target.scrollTop;
              if (_this.isLock() && distScrollTop !== _this.lastScrollTop) {
                var lockRightBody = _this.bodyRightNode, lockLeftBody = _this.bodyLeftNode, bodyNode = _this.bodyNode;
                var arr = [lockLeftBody, lockRightBody, bodyNode];
                arr.forEach(function(node) {
                  if (node && node.scrollTop !== distScrollTop) {
                    node.scrollTop = distScrollTop;
                  }
                });
                _this.lastScrollTop = distScrollTop;
              }
            };
            _this.onLockBodyScrollLeft = function() {
              if (_this.isLock()) {
                var rtl = _this.props.rtl;
                var lockRightTable = rtl ? _this.getWrapperNode("left") : _this.getWrapperNode("right"), lockLeftTable = rtl ? _this.getWrapperNode("right") : _this.getWrapperNode("left"), shadowClassName = "shadow";
                var x2 = _this.bodyNode.scrollLeft;
                if (x2 === 0) {
                  lockLeftTable && dom.removeClass(lockLeftTable, shadowClassName);
                  lockRightTable && dom.addClass(lockRightTable, shadowClassName);
                } else if (x2 === _this.bodyNode.scrollWidth - _this.bodyNode.clientWidth) {
                  lockLeftTable && dom.addClass(lockLeftTable, shadowClassName);
                  lockRightTable && dom.removeClass(lockRightTable, shadowClassName);
                } else {
                  lockLeftTable && dom.addClass(lockLeftTable, shadowClassName);
                  lockRightTable && dom.addClass(lockRightTable, shadowClassName);
                }
              }
            };
            _this.onLockBodyScroll = function(event) {
              _this.onLockBodyScrollTop(event);
              _this.onLockBodyScrollLeft();
            };
            _this.adjustSize = function() {
              if (!_this.adjustIfTableNotNeedLock()) {
                _this.adjustHeaderSize();
                _this.adjustBodySize();
                _this.adjustRowHeight();
                _this.onLockBodyScrollLeft();
              }
            };
            _this.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;
            };
            _this.saveLockLeftRef = function(ref) {
              _this.lockLeftEl = ref;
            };
            _this.saveLockRightRef = function(ref) {
              _this.lockRightEl = ref;
            };
            _this.lockLeftChildren = [];
            _this.lockRightChildren = [];
            return _this;
          }
          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__default.Children.forEach(children2, function(child) {
                  if (child) {
                    var _props = _default$5({}, 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 cell = _this2.getCellNode(0, index2) || {};
                var headerCell = _this2.getHeaderCellNode(0, index2) || {};
                try {
                  return {
                    cellWidths: parseFloat(getComputedStyle(cell).width) || 0,
                    headerWidths: parseFloat(getComputedStyle(headerCell).width) || 0
                  };
                } catch (error) {
                  return {
                    cellWidths: cell.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$2(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, i2, type2) {
            type2 = type2 ? type2.charAt(0).toUpperCase() + type2.substr(1) : "";
            var table = this["table" + type2 + "Inc"];
            try {
              return ReactDOM.findDOMNode(table.getHeaderCellRef(index2, i2));
            } catch (error) {
              return null;
            }
          };
          LockTable2.prototype.getCellNode = function getCellNode(index2, i2, type2) {
            type2 = type2 ? type2.charAt(0).toUpperCase() + type2.substr(1) : "";
            var table = this["table" + type2 + "Inc"];
            try {
              return ReactDOM.findDOMNode(table.getCellRef(index2, i2));
            } 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$4(_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$5({}, 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__default.createElement(BaseComponent, _default$5({}, 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__default.createElement(BaseComponent, _default$5({}, 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__default.createElement(BaseComponent, _default$5({}, others, {
                tableWidth,
                dataSource,
                columns: normalizedChildren,
                prefix,
                lengths,
                wrapperContent: content,
                components,
                className
              }));
            }
            return React__default.createElement(BaseComponent, this.props);
          };
          return LockTable2;
        }(React__default.Component), _class2.LockRow = LockRow, _class2.LockBody = LockBody, _class2.LockHeader = LockHeader, _class2.propTypes = _default$5({
          scrollToCol: PT.number,
          /**
           * 指定滚动到某一行,仅在`useVirtual`的时候生效
           */
          scrollToRow: PT.number
        }, BaseComponent.propTypes), _class2.defaultProps = _default$5({}, BaseComponent.defaultProps), _class2.childContextTypes = {
          getTableInstance: PT.func,
          getLockNode: PT.func,
          onLockBodyScroll: PT.func,
          onRowMouseEnter: PT.func,
          onRowMouseLeave: PT.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$5({}, 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(LockTable2, _React$Component);
          function LockTable2(props, context) {
            _default$3(this, LockTable2);
            var _this = _default$1(this, _React$Component.call(this, props));
            _this.state = {};
            _this.updateOffsetArr = function() {
              var _ref = _this.splitChildren || {}, lockLeftChildren = _ref.lockLeftChildren, lockRightChildren = _ref.lockRightChildren, originChildren = _ref.originChildren;
              var leftLen = _this.getFlatenChildren(lockLeftChildren).length;
              var rightLen = _this.getFlatenChildren(lockRightChildren).length;
              var totalLen = leftLen + rightLen + _this.getFlatenChildren(originChildren).length;
              var hasLockLeft = leftLen > 0;
              var hasLockRight = rightLen > 0;
              var leftOffsetArr = _this.getStickyWidth(lockLeftChildren, "left", totalLen);
              var rightOffsetArr = _this.getStickyWidth(lockRightChildren, "right", totalLen);
              var state = {};
              if ("" + leftOffsetArr !== "" + _this.state.leftOffsetArr) {
                state.leftOffsetArr = leftOffsetArr;
              }
              if ("" + rightOffsetArr !== "" + _this.state.rightOffsetArr) {
                state.rightOffsetArr = rightOffsetArr;
              }
              if (hasLockLeft !== _this.state.hasLockLeft) {
                state.hasLockLeft = hasLockLeft;
              }
              if (hasLockRight !== _this.state.hasLockRight) {
                state.hasLockRight = hasLockRight;
              }
              if (Object.keys(state).length > 0) {
                _this.setState(state);
              }
            };
            _this.onLockBodyScroll = function(e2, forceSet) {
              var _ref2 = e2.currentTarget || {}, scrollLeft = _ref2.scrollLeft, scrollWidth = _ref2.scrollWidth, clientWidth = _ref2.clientWidth;
              var pingRight = _this.pingRight, pingLeft = _this.pingLeft;
              var pingLeftNext = scrollLeft > 0 && _this.state.hasLockLeft;
              var pingRightNext = scrollLeft < scrollWidth - clientWidth && _this.state.hasLockRight;
              if (forceSet || pingLeft !== pingLeftNext || pingRight !== pingRightNext) {
                var prefix = _this.props.prefix;
                var table = _this.getTableNode();
                _this.pingLeft = pingLeftNext;
                _this.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");
              }
            };
            _this.getStickyWidth = function(lockChildren, dir, totalLen) {
              var _this$props = _this.props;
              _this$props.dataSource;
              _this$props.scrollToRow;
              var offsetArr = [];
              var flatenChildren = _this.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;
                if (dir === "left" && tag === 0) {
                  ret[0] = 0;
                  return ret;
                } else if (dir === "right" && tag === len - 1) {
                  ret[tag] = 0;
                  return ret;
                }
                var _flatenChildren$tagNe = flatenChildren[tagNext], headerCellRowIndex = _flatenChildren$tagNe.headerCellRowIndex, headerCellColIndex = _flatenChildren$tagNe.headerCellColIndex;
                var node = _this.getHeaderCellNode(headerCellRowIndex, headerCellColIndex);
                var colWidth = 0;
                if (node) {
                  colWidth = parseFloat(getComputedStyle(node).width) || 0;
                }
                ret[tag] = (ret[tagNext] || 0) + colWidth;
                return ret;
              }, offsetArr);
              return offsetArr;
            };
            _this.getTableInstance = function(type2, instance2) {
              type2 = "";
              _this["table" + type2 + "Inc"] = instance2;
            };
            _this.getNode = function(type2, node) {
              _this[type2 + "Node"] = node;
            };
            _this.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);
            };
            _this.state = {
              hasLockLeft: true,
              hasLockRight: true
            };
            _this.pingLeft = false;
            _this.pingRight = false;
            return _this;
          }
          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__default.Children.forEach(children2, function(child) {
                if (child) {
                  var _props = _default$5({}, 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, i2) {
            var table = this.tableInc;
            try {
              return ReactDOM.findDOMNode(table.getCellRef(index2, i2));
            } 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, i2) {
            var table = this.tableInc;
            try {
              return ReactDOM.findDOMNode(table.getHeaderCellRef(index2, i2));
            } 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$4(_props2, ["children", "columns", "prefix", "components", "scrollToRow", "className", "dataSource"]);
            var normalizedChildren = this.normalizeChildrenState(this.props);
            components = _default$5({}, 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__default.createElement(BaseComponent, _default$5({}, others, {
              dataSource,
              columns: normalizedChildren,
              prefix,
              components,
              className
            }));
          };
          return LockTable2;
        }(React__default.Component), _class2.LockRow = LockRow, _class2.LockBody = LockBody, _class2.LockHeader = LockHeader, _class2.propTypes = _default$5({
          scrollToCol: PT.number,
          /**
           * 指定滚动到某一行,仅在`useVirtual`的时候生效
           */
          scrollToRow: PT.number
        }, BaseComponent.propTypes), _class2.defaultProps = _default$5({}, BaseComponent.defaultProps), _class2.childContextTypes = {
          getTableInstance: PT.func,
          getLockNode: PT.func,
          onLockBodyScroll: PT.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$5({}, item);
            if (item.children) {
              item.children = copy2(item.children);
            }
            return newItem;
          });
        };
        return copy(arr);
      }
      var _class$4, _temp$2;
      var ListHeader = (_temp$2 = _class$4 = function(_React$Component) {
        _default(ListHeader2, _React$Component);
        function ListHeader2() {
          _default$3(this, ListHeader2);
          return _default$1(this, _React$Component.apply(this, arguments));
        }
        ListHeader2.prototype.render = function render2() {
          return null;
        };
        return ListHeader2;
      }(React__default.Component), _class$4.propTypes = {
        /**
         * 行渲染的逻辑
         */
        cell: PT.oneOfType([PT.element, PT.node, PT.func]),
        /**
         * 是否在Children上面渲染selection
         */
        hasChildrenSelection: PT.bool,
        /**
         * 是否在GroupHeader上面渲染selection
         */
        hasSelection: PT.bool,
        /**
         * 当 dataSouce 里没有 children 时,是否使用内容作为数据
         */
        useFirstLevelDataWhenNoChildren: PT.bool
      }, _class$4.defaultProps = {
        cell: function cell() {
          return "";
        },
        hasSelection: true,
        hasChildrenSelection: false,
        useFirstLevelDataWhenNoChildren: false
      }, _class$4._typeMark = "listHeader", _temp$2);
      ListHeader.displayName = "ListHeader";
      var _class$3, _temp$1;
      var ListFooter = (_temp$1 = _class$3 = function(_React$Component) {
        _default(ListFooter2, _React$Component);
        function ListFooter2() {
          _default$3(this, ListFooter2);
          return _default$1(this, _React$Component.apply(this, arguments));
        }
        ListFooter2.prototype.render = function render2() {
          return null;
        };
        return ListFooter2;
      }(React__default.Component), _class$3.propTypes = {
        /**
         * 行渲染的逻辑
         */
        cell: PT.oneOfType([PT.element, PT.node, PT.func])
      }, _class$3.defaultProps = {
        cell: function cell() {
          return "";
        }
      }, _class$3._typeMark = "listFooter", _temp$1);
      ListFooter.displayName = "ListFooter";
      var _class$2, _temp;
      var GroupListRow = (_temp = _class$2 = function(_Row) {
        _default(GroupListRow2, _Row);
        function GroupListRow2() {
          _default$3(this, GroupListRow2);
          return _default$1(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$4(_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__default.createElement(
            "table",
            _default$5({
              className: cls,
              role: "row"
            }, others, {
              onClick: this.onClick,
              onMouseEnter: this.onMouseEnter,
              onMouseLeave: this.onMouseLeave
            }),
            colGroup,
            React__default.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__default.createElement(
                  "tr",
                  { key: child[primaryKey] },
                  cells
                );
              }
              if (_this2.context.rowSelection) {
                cells.shift();
                cells[0] = cells[0] && React__default.cloneElement(cells[0], _default$5({
                  colSpan: 2
                }, cells[0].props));
              }
              return React__default.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__default.isValidElement(list2.cell)) {
              listNode = React__default.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__default.createElement(
                  "td",
                  { colSpan: columns.length - 1, key: "listNode" },
                  React__default.createElement(
                    "div",
                    { className: prefix + "table-cell-wrapper" },
                    listNode
                  )
                ));
                listNode = React__default.createElement(
                  "tr",
                  { className: prefix + "table-group-" + type2 },
                  cells
                );
              } else {
                listNode = React__default.createElement(
                  "tr",
                  { className: prefix + "table-group-" + type2 },
                  React__default.createElement(
                    "td",
                    { colSpan: columns.length },
                    React__default.createElement(
                      "div",
                      { className: prefix + "table-cell-wrapper" },
                      listNode
                    )
                  )
                );
              }
            }
          }
          return listNode;
        };
        return GroupListRow2;
      }(Row), _class$2.contextTypes = {
        listHeader: PT.any,
        listFooter: PT.any,
        rowSelection: PT.object,
        notRenderCellIndex: PT.array,
        lockType: PT.oneOf(["left", "right"])
      }, _temp);
      var _class$1, _temp2$1;
      var ListBody = (_temp2$1 = _class$1 = function(_React$Component) {
        _default(ListBody2, _React$Component);
        function ListBody2() {
          var _temp3, _this, _ret;
          _default$3(this, ListBody2);
          for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
            args[_key] = arguments[_key];
          }
          return _ret = (_temp3 = (_this = _default$1(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.onScroll = function(e2) {
            var onFixedScrollSync = _this.context.onFixedScrollSync;
            onFixedScrollSync && onFixedScrollSync(e2);
          }, _temp3), _default$1(_this, _ret);
        }
        ListBody2.prototype.componentDidMount = function componentDidMount() {
          var getNode = this.context.getNode;
          getNode && getNode("body", ReactDOM.findDOMNode(this));
        };
        ListBody2.prototype.render = function render2() {
          return React__default.createElement(Body, _default$5({ component: "div", onScroll: this.onScroll }, this.props));
        };
        return ListBody2;
      }(React__default.Component), _class$1.contextTypes = {
        getNode: PT.func,
        onFixedScrollSync: PT.func
      }, _temp2$1);
      ListBody.displayName = "ListBody";
      function list(BaseComponent) {
        var _class2, _temp22;
        var ListTable = (_temp22 = _class2 = function(_React$Component) {
          _default(ListTable2, _React$Component);
          function ListTable2() {
            var _temp3, _this, _ret;
            _default$3(this, ListTable2);
            for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
              args[_key] = arguments[_key];
            }
            return _ret = (_temp3 = (_this = _default$1(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.state = {}, _temp3), _default$1(_this, _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$5({}, 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$4(_props, ["components", "children", "className", "prefix"]);
            var isList = false, ret = [];
            React__default.Children.forEach(children, function(child) {
              if (child) {
                if (["function", "object"].indexOf(_default$2(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$5({}, 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__default.createElement(BaseComponent, _default$5({}, others, {
              components,
              children: ret.length > 0 ? ret : void 0,
              className,
              prefix
            }));
          };
          return ListTable2;
        }(React__default.Component), _class2.ListHeader = ListHeader, _class2.ListFooter = ListFooter, _class2.ListRow = GroupListRow, _class2.ListBody = ListBody, _class2.propTypes = _default$5({}, BaseComponent.propTypes), _class2.defaultProps = _default$5({}, BaseComponent.defaultProps), _class2.childContextTypes = {
          listHeader: PT.any,
          listFooter: PT.any,
          rowSelection: PT.object
        }, _temp22);
        ListTable.displayName = "ListTable";
        statics(ListTable, BaseComponent);
        return ListTable;
      }
      var _class, _temp2;
      var StickHeader = (_temp2 = _class = function(_React$Component) {
        _default(StickHeader2, _React$Component);
        function StickHeader2() {
          var _temp3, _this, _ret;
          _default$3(this, StickHeader2);
          for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
            args[_key] = arguments[_key];
          }
          return _ret = (_temp3 = (_this = _default$1(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.getAffixRef = function(ref) {
            _this.props.affixRef && _this.props.affixRef(ref);
          }, _temp3), _default$1(_this, _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$4(newAffixProps, ["className"]);
          var cls = classnames((_classnames = {}, _classnames[prefix + "table-affix"] = true, _classnames.className = className, _classnames));
          return React__default.createElement(
            Affix$1,
            _default$5({ ref: this.getAffixRef }, others, { className: cls, offsetTop }),
            React__default.createElement(Header2, this.props)
          );
        };
        return StickHeader2;
      }(React__default.Component), _class.propTypes = {
        prefix: PT.string
      }, _class.contextTypes = {
        Header: PT.any,
        offsetTop: PT.number,
        affixProps: PT.object
      }, _temp2);
      StickHeader.displayName = "StickHeader";
      function sticky(BaseComponent) {
        var _class2, _temp22;
        var StickyTable = (_temp22 = _class2 = function(_React$Component) {
          _default(StickyTable2, _React$Component);
          function StickyTable2() {
            var _temp3, _this, _ret;
            _default$3(this, StickyTable2);
            for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
              args[_key] = arguments[_key];
            }
            return _ret = (_temp3 = (_this = _default$1(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.state = {}, _temp3), _default$1(_this, _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$4(_props, ["stickyHeader", "offsetTop", "affixProps"]);
            var _props2 = this.props, components = _props2.components, maxBodyHeight = _props2.maxBodyHeight, fixedHeader = _props2.fixedHeader;
            if (stickyHeader) {
              components = _default$5({}, components);
              components.Header = StickHeader;
              fixedHeader = true;
              maxBodyHeight = Math.max(maxBodyHeight, 1e4);
            }
            return React__default.createElement(BaseComponent, _default$5({}, others, {
              components,
              fixedHeader,
              maxBodyHeight
            }));
          };
          return StickyTable2;
        }(React__default.Component), _class2.StickyHeader = StickHeader, _class2.propTypes = _default$5({
          /**
           * 表头是否是sticky
           */
          stickyHeader: PT.bool,
          /**
           * 距离窗口顶部达到指定偏移量后触发
           */
          offsetTop: PT.number,
          /**
           * affix组件的的属性
           */
          affixProps: PT.object,
          components: PT.object
        }, BaseComponent.propTypes), _class2.defaultProps = _default$5({
          components: {}
        }, BaseComponent.defaultProps), _class2.childContextTypes = {
          Header: PT.any,
          offsetTop: PT.number,
          affixProps: PT.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$1 = 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$1.Base = Base;
      Table$1.fixed = fixed;
      Table$1.lock = lock;
      Table$1.selection = selection;
      Table$1.expanded = expanded;
      Table$1.tree = tree;
      Table$1.virtual = virtual;
      Table$1.list = list;
      Table$1.sticky = sticky;
      Table$1.GroupHeader = ListHeader;
      Table$1.GroupFooter = ListFooter;
      Table$1.StickyLock = ConfigProvider$1.config(StickyLockTable, {
        componentName: "Table"
      });
      const Table$2 = ConfigProvider$1.config(Table$1, {
        componentName: "Table",
        transform: (
          /* istanbul ignore next */
          function transform2(props, deprecated2) {
            if ("columns" in props && typeof props.columns !== "undefined") {
              var _props = props, columns = _props.columns, others = _default$4(_props, ["columns"]);
              var newColumns = [].concat(columns);
              props = _default$5({
                columns: newColumns
              }, others);
            }
            if ("expandedRowKeys" in props) {
              deprecated2("expandedRowKeys", "openRowKeys", "Table");
              var _props2 = props, expandedRowKeys = _props2.expandedRowKeys, _others = _default$4(_props2, ["expandedRowKeys"]);
              props = _default$5({ openRowKeys: expandedRowKeys }, _others);
            }
            if ("onExpandedChange" in props) {
              deprecated2("onExpandedChange", "onRowOpen", "Table");
              var _props3 = props, onExpandedChange = _props3.onExpandedChange, _others2 = _default$4(_props3, ["onExpandedChange"]);
              props = _default$5({ onRowOpen: onExpandedChange }, _others2);
            }
            if ("isLoading" in props) {
              deprecated2("isLoading", "loading", "Table");
              var _props4 = props, isLoading = _props4.isLoading, _others3 = _default$4(_props4, ["isLoading"]);
              props = _default$5({ loading: isLoading }, _others3);
            }
            if ("indentSize" in props) {
              deprecated2("indentSize", "indent", "Table");
              var _props5 = props, indentSize = _props5.indentSize, _others4 = _default$4(_props5, ["indentSize"]);
              props = _default$5({ indent: indentSize }, _others4);
            }
            if ("optimization" in props) {
              deprecated2("optimization", "pure", "Table");
              var _props6 = props, optimization = _props6.optimization, _others5 = _default$4(_props6, ["optimization"]);
              props = _default$5({ pure: optimization }, _others5);
            }
            if ("getRowClassName" in props) {
              deprecated2("getRowClassName", "getRowProps", "Table");
              var _props7 = props, getRowClassName = _props7.getRowClassName, getRowProps = _props7.getRowProps, _others6 = _default$4(_props7, ["getRowClassName", "getRowProps"]);
              if (getRowClassName) {
                var newGetRowProps = function newGetRowProps2() {
                  return _default$5({
                    className: getRowClassName.apply(void 0, arguments)
                  }, getRowProps ? getRowProps.apply(void 0, arguments) : {});
                };
                props = _default$5({ getRowProps: newGetRowProps }, _others6);
              } else {
                props = _default$5({ getRowProps }, _others6);
              }
            }
            if ("getRowProps" in props) {
              deprecated2("getRowProps", "rowProps", "Table in 1.15.0");
              var _props8 = props, _getRowProps = _props8.getRowProps, _others7 = _default$4(_props8, ["getRowProps"]);
              props = _default$5({ rowProps: _getRowProps }, _others7);
            }
            if ("getCellProps" in props) {
              deprecated2("getCellProps", "cellProps", "Table in 1.15.0");
              var _props9 = props, getCellProps = _props9.getCellProps, _others8 = _default$4(_props9, ["getCellProps"]);
              props = _default$5({ cellProps: getCellProps }, _others8);
            }
            return props;
          }
        )
      });
      var Text = (
        /** @class */
        function(_super) {
          __extends(Text2, _super);
          function Text2() {
            return _super !== null && _super.apply(this, arguments) || this;
          }
          Text2.prototype.wrapChildren = function(children, wrapper) {
            return React__default.createElement(wrapper, {}, children);
          };
          Text2.prototype.render = function() {
            var _a = this.props, prefix = _a.prefix, className = _a.className, component = _a.component, strong = _a.strong, underline = _a.underline, deleteProp = _a.delete, code = _a.code, mark = _a.mark, rtl = _a.rtl, children = _a.children, others = __rest(_a, ["prefix", "className", "component", "strong", "underline", "delete", "code", "mark", "rtl", "children"]);
            var Component2 = component;
            var formattedChildren = children;
            if (strong) {
              formattedChildren = this.wrapChildren(formattedChildren, "strong");
            }
            if (underline) {
              formattedChildren = this.wrapChildren(formattedChildren, "u");
            }
            if (deleteProp) {
              formattedChildren = this.wrapChildren(formattedChildren, "del");
            }
            if (code) {
              formattedChildren = this.wrapChildren(formattedChildren, "code");
            }
            if (mark) {
              formattedChildren = this.wrapChildren(formattedChildren, "mark");
            }
            if (rtl) {
              others.dir = "rtl";
            }
            var cls = classnames("".concat(prefix, "typography"), className);
            return React__default.createElement(Component2, __assign({}, others, { className: cls }), formattedChildren);
          };
          Text2.propTypes = {
            prefix: PT.string,
            delete: PT.bool,
            mark: PT.bool,
            underline: PT.bool,
            strong: PT.bool,
            code: PT.bool,
            component: PT.elementType,
            children: PT.node,
            rtl: PT.bool
          };
          Text2.defaultProps = {
            prefix: "next-",
            delete: false,
            mark: false,
            underline: false,
            strong: false,
            code: false,
            component: "span",
            rtl: false
          };
          return Text2;
        }(React__default.Component)
      );
      const Text$1 = ConfigProvider$1.config(Text);
      var Paragraph = (
        /** @class */
        function(_super) {
          __extends(Paragraph2, _super);
          function Paragraph2() {
            return _super !== null && _super.apply(this, arguments) || this;
          }
          Paragraph2.prototype.render = function() {
            var _a = this.props, prefix = _a.prefix, className = _a.className, component = _a.component, others = __rest(_a, ["prefix", "className", "component"]);
            var cls = classnames("".concat(prefix, "typography-paragraph"), className);
            return React__default.createElement(Text$1, __assign({}, others, { className: cls, component }));
          };
          Paragraph2.propTypes = {
            prefix: PT.string,
            component: PT.elementType
          };
          Paragraph2.defaultProps = {
            prefix: "next-",
            type: "long",
            size: "medium",
            component: "p"
          };
          return Paragraph2;
        }(React__default.Component)
      );
      const Paragraph$1 = ConfigProvider$1.config(Paragraph);
      var Typography$1 = (
        /** @class */
        function(_super) {
          __extends(Typography2, _super);
          function Typography2() {
            return _super !== null && _super.apply(this, arguments) || this;
          }
          Typography2.prototype.render = function() {
            return React__default.createElement(Text$1, __assign({}, this.props));
          };
          Typography2.propTypes = {
            component: PT.elementType
          };
          Typography2.defaultProps = {
            component: "article"
          };
          return Typography2;
        }(React__default.Component)
      );
      const Typography$2 = Typography$1;
      const createTitle = function(Tag2) {
        var Title = (
          /** @class */
          function(_super) {
            __extends(Title2, _super);
            function Title2() {
              return _super !== null && _super.apply(this, arguments) || this;
            }
            Title2.prototype.render = function() {
              var _a = this.props, prefix = _a.prefix, className = _a.className, others = __rest(_a, ["prefix", "className"]);
              return React__default.createElement(Text$1, __assign({}, others, { component: Tag2, className: "".concat(className || "", " ").concat(prefix, "typography-title") }));
            };
            Title2.propTypes = {
              prefix: PT.string
            };
            Title2.defaultProps = {
              prefix: "next-"
            };
            Title2.displayName = Tag2.toUpperCase();
            return Title2;
          }(React__default.Component)
        );
        return ConfigProvider$1.config(Title);
      };
      var WithSubTypography = assignSubComponent(Typography$2, {
        Text: Text$1,
        Paragraph: Paragraph$1,
        H1: createTitle("h1"),
        H2: createTitle("h2"),
        H3: createTitle("h3"),
        H4: createTitle("h4"),
        H5: createTitle("h5"),
        H6: createTitle("h6")
      });
      const Typography = WithSubTypography;
      const CopyIcon = (hexColor, size2) => {
        return /* @__PURE__ */ jsxRuntimeExports.jsxs(
          "svg",
          {
            className: "icon",
            viewBox: "0 0 1024 1024",
            version: "1.1",
            xmlns: "http://www.w3.org/2000/svg",
            width: size2 || "15",
            height: size2 || "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
                }
              ),
              /* @__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
                }
              )
            ]
          }
        );
      };
      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 InterfaceIcon = (hexColor, size2) => {
        return /* @__PURE__ */ jsxRuntimeExports.jsx(
          "svg",
          {
            className: "icon",
            viewBox: "0 0 1024 1024",
            version: "1.1",
            xmlns: "http://www.w3.org/2000/svg",
            width: size2 || "15",
            height: size2 || "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",
                fill: hexColor
              }
            )
          }
        );
      };
      const { Menu, Balloon, Table } = _unsafeWindow["Deep"];
      class DataSourceApi extends React__default.Component {
        constructor(props) {
          super(props);
          this.state = {
            dataSourceApiDatas: []
          };
        }
        async componentDidMount() {
          await getDataSourceAPI().then((res) => {
            if (res.code !== 0) {
              MessageProvider.error(res.message);
              return;
            }
            this.setState({
              dataSourceApiDatas: res.data
            });
          });
        }
        render() {
          return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
            /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: Style$5.data_source_api_content_interface_path, children: [
              /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "AppType(变量)" }),
              /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: Style$5.js_api_icon_box, onClick: () => {
                GM_setClipboard("${window.pageConfig.appType || window.g_config.appKey}");
                MessageProvider.success("复制成功!");
              }, children: CopyIcon("#3c99d8") })
            ] }),
            /* @__PURE__ */ jsxRuntimeExports.jsx(Menu, { openMode: "single", defaultOpenKeys: "0", embeddable: true, children: this.state.dataSourceApiDatas.map((item, index2) => {
              return /* @__PURE__ */ jsxRuntimeExports.jsx(Menu.SubMenu, { label: item.className, children: item.content.map((content, index_content) => {
                return /* @__PURE__ */ jsxRuntimeExports.jsx(
                  Menu.PopupItem,
                  {
                    label: content.apiName,
                    triggerType: "click",
                    children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
                      "div",
                      {
                        className: [Style$5.data_source_api_content, Style$5.box_grid_1].join(" "),
                        children: [
                          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: Style$5.data_source_api_title, children: [
                            /* @__PURE__ */ jsxRuntimeExports.jsx(
                              "div",
                              {
                                className: Style$5.data_source_api_content_api_name,
                                children: content.apiName
                              }
                            ),
                            /* @__PURE__ */ jsxRuntimeExports.jsx(
                              TagWithSub,
                              {
                                size: "small",
                                type: "primary",
                                color: content.requestType === "POST" ? "green" : "blue",
                                children: content.requestType
                              }
                            )
                          ] }),
                          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: Style$5.data_source_api_content_interface_path, children: [
                            /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: content.interfacePath }),
                            /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: Style$5.js_api_icon_box, onClick: () => {
                              debugger;
                              if (content.interfacePath) {
                                GM_setClipboard("`/${window.pageConfig.appType || window.g_config.appKey}" + content.interfacePath + "`");
                                MessageProvider.success("复制成功!");
                              } else
                                MessageProvider.success("复制失败,请联系开发者!");
                            }, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
                              Balloon,
                              {
                                trigger: CopyIcon("#3c99d8"),
                                closable: false,
                                align: "t",
                                children: "复制"
                              }
                            ) }),
                            /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: Style$5.js_api_icon_box, onClick: () => {
                              const { project, skeleton: skeleton2 } = 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 = skeleton2.getPanel("datapool");
                              dp.parent.remove(dp);
                              MessageProvider.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: Style$5.js_api_icon_box, onClick: () => {
                              const { project, skeleton: skeleton2 } = 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 = skeleton2.getPanel("datapool");
                              dp.parent.remove(dp);
                              MessageProvider.success("数据源添加成功!");
                              setTimeout(() => dp.parent.add(dp), 100);
                            }, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
                              Balloon,
                              {
                                trigger: InterfaceIcon("#83b91b"),
                                closable: false,
                                align: "t",
                                children: "一键创建数据源(有数据)"
                              }
                            ) })
                          ] }),
                          /* @__PURE__ */ jsxRuntimeExports.jsxs(Table, { dataSource: content.params, children: [
                            /* @__PURE__ */ jsxRuntimeExports.jsx(Table.Column, { title: "参数名", dataIndex: "parameterName" }),
                            /* @__PURE__ */ jsxRuntimeExports.jsx(Table.Column, { title: "描述", dataIndex: "description" }),
                            /* @__PURE__ */ jsxRuntimeExports.jsx(Table.Column, { title: "必填", dataIndex: "requiredFields" }),
                            /* @__PURE__ */ jsxRuntimeExports.jsx(Table.Column, { title: "操作", cell: (value, index22, record) => {
                              return /* @__PURE__ */ jsxRuntimeExports.jsx(
                                Button$1,
                                {
                                  type: "primary",
                                  text: true,
                                  onClick: () => {
                                    GM_setClipboard(record.parameterName);
                                    MessageProvider.success("复制成功!");
                                  },
                                  children: "复制"
                                },
                                `${value}_${index22}`
                              );
                            } })
                          ] })
                        ]
                      }
                    )
                  },
                  `content_${index_content}`
                );
              }) }, index2);
            }) })
          ] });
        }
      }
      const box_grid_1$3 = "_box_grid_1_1bxo6_17";
      const box_grid_2$3 = "_box_grid_2_1bxo6_22";
      const yida_tool_skeleton_box$4 = "_yida_tool_skeleton_box_1bxo6_27";
      const item_box$1 = "_item_box_1bxo6_31";
      const item_title_box$1 = "_item_title_box_1bxo6_38";
      const item_title$1 = "_item_title_1bxo6_38";
      const item_description$1 = "_item_description_1bxo6_47";
      const icon_box$1 = "_icon_box_1bxo6_52";
      const Style$4 = {
        "next-tabs-tabpane": "_next-tabs-tabpane_1bxo6_8",
        box_grid_1: box_grid_1$3,
        box_grid_2: box_grid_2$3,
        yida_tool_skeleton_box: yida_tool_skeleton_box$4,
        item_box: item_box$1,
        item_title_box: item_title_box$1,
        item_title: item_title$1,
        item_description: item_description$1,
        icon_box: icon_box$1
      };
      const CodeCard = (schema, copy = false) => {
        return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: Style$4.item_box, children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: Style$4.item_title_box, children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: Style$4.item_title, children: schema.title }),
            copy ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: Style$4.icon_box, onClick: () => {
              if (schema.code) {
                GM_setClipboard(schema.code);
                MessageProvider.success("复制成功!");
              } else {
                MessageProvider.error("复制失败,请联系开发者!");
              }
            }, children: CopyIcon("#3c99d8") }) : null
          ] }),
          /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: Style$4.item_description, children: schema.description })
        ] }) });
      };
      const CommonCodeDatas = [
        {
          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: "setInterval()",
          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 = /^1\\d{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: "validateRule",
          description: "子表单组件唯一性校验",
          code: ` //子表单组件唯一性校验 
export function validateRule(value) { 
// 要校验的子表单组件ID列表,可以添加多个,用英文逗号隔开 
 const idList = ['ID1', 'ID2', 'ID3']
// 子表单ID
const tableId = '子表单ID'
 const tableData = this.$(tableId).getValue()
const tableValue = tableData.filter(row => { 
// 行中有任意一个要校验的选项没有值则跳过校验
for (const v in row) { 
      if ('' + row[v] === '') {
                return false
            }
}        return true
    }).map(row => {
        //当前行要校验的值拼接一个字符串
        let str = ''
        idList.forEach(id => str += row[id])
        return str
    })
    //利用Set去重
    const valueSet = new Set(tableValue)
    //如果长度相等则证明没有重复的
    return tableValue.length === valueSet.size
 };`
        },
        {
          title: "batchFetchLoading",
          description: "节流加载宜搭接口",
          code: ` export async function beforeImportData(data){
  const batchFetchLoading = this.utils.toast({
    title: \`处理中,请不要关闭浏览器\`,
    type: 'loading'
  });
  for (let i = 0; i < data.length; i++) {
    const delay = i === 0 ? 0 : 200;
    await new Promise((resolve => {
      // 节流,每次请求间隔 200 ms
      setTimeout(async () => {
        await this.dataSourceMap.updateFormData.load({
          //表单实例id
          formInstId: data[i].textField_lmhf5puo,

          //要更新的字段参数
          updateFormDataJson: JSON.stringify({
            'textField_ltflqu6f': ''
          }),

          //使用最新的表单版本进行更新 y | n
          useLatestVersion: 'y',
        })
        resolve();
      }, delay);
    }));
  };
  batchFetchLoading();
}`
        },
        {
          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 }) {
  //  参数 formUuid  表单id
  // data  请求获得的大批量数据
  this.dataSourceMap.searchFormDatas.load({
    formUuid: "FORM-QQ866JB1Q4R6U2BLALBVN7K8PUZU36TWX9ACL6"
  }).then(res=>{
    this.searchFormData("FORM-QQ866JB1Q4R6U2BLALBVN7K8PUZU36TWX9ACL6",res.totalCount, data => {
      console.log("data", data)
    })
  })
   
}
export function searchFormData(formUuid,totalCount, callback) {
  var number = Math.ceil(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;
}`
        }
      ];
      const CommonCodeBox = () => {
        return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: [Style$4.yida_tool_skeleton_box, Style$4.box_grid_1].join(" "), children: CommonCodeDatas.map((item, index2) => CodeCard(item, true)) });
      };
      const jsApiDatas = [
        {
          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 时无效
});`
        }
      ];
      const JsApiBox = () => {
        return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: [Style$4.yida_tool_skeleton_box, Style$4.box_grid_1].join(" "), children: jsApiDatas.map((item, index2) => CodeCard(item, true)) });
      };
      const AnnotationDatas = `/** 
 * 通过******,实现*****功能 。【方法详细解释】 
 * -------------------------------------------------------------------- 
 * @author 【${_unsafeWindow.loginUser.userName}】  
 * @date ${hooks().format("YYYY-MM-DD HH:mm:ss")} 
 * @param {Type} params={} 【入参数据】 
 * @return 【返回参数】 
 * */`;
      const Annotation = () => {
        return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: Style$4.item_box, children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: Style$4.item_title_box, children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: Style$4.item_title, children: "注释" }),
            /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: Style$4.icon_box, onClick: () => {
              _GM_setClipboard(AnnotationDatas);
              MessageProvider.success("复制成功!");
            }, children: CopyIcon("#3c99d8") })
          ] }),
          /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: Style$4.item_description, children: AnnotationDatas })
        ] }) }) });
      };
      const CreateTable = (fieldValues, dataSource) => {
        const { project, skeleton: skeleton2 } = 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 = skeleton2.getPanel("datapool");
            dp.parent.remove(dp);
            MessageProvider.success("数据源添加成功");
            setTimeout(() => dp.parent.add(dp), 100);
          }
          recursiveSearch(allComponent);
          _GM_setClipboard(JSON.stringify(tableSchemaObj));
          MessageProvider.success("生成成功,请粘贴入页面!");
        });
      };
      const yida_tool_skeleton_box$3 = "_yida_tool_skeleton_box_gsj87_1";
      const box_grid_1$2 = "_box_grid_1_gsj87_21";
      const box_grid_2$2 = "_box_grid_2_gsj87_26";
      const Style$3 = {
        yida_tool_skeleton_box: yida_tool_skeleton_box$3,
        "next-tabs-tabpane": "_next-tabs-tabpane_gsj87_12",
        box_grid_1: box_grid_1$2,
        box_grid_2: box_grid_2$2
      };
      class TableTool extends React__default.Component {
        constructor() {
          super(...arguments);
          __publicField(this, "field", new NextField(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(CheckboxWithGroup, { ...init("process", { valueName: "checked" }), children: "流程" }) }),
              /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: Style$3.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 componentsDatas = [
        {
          title: "容器",
          schema: JSON.stringify({
            "componentsTree": [{
              "componentName": "Div"
            }]
          })
        },
        {
          title: "开关",
          schema: JSON.stringify({
            "componentsTree": [{
              "componentName": "SwitchField"
            }]
          })
        },
        {
          title: "面包屑",
          schema: JSON.stringify({
            "componentsTree": [{
              "componentName": "Breadcrumb"
            }]
          })
        },
        {
          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" }] })
        },
        {
          title: "调试工具",
          schema: JSON.stringify({
            "componentsTree": [
              {
                "componentName": "Jsx",
                "props": {
                  "render": {
                    "type": "js",
                    "source": "function render() {\n  this.utils.loadScript('https://g.alicdn.com/code/lib/vConsole/3.11.2/vconsole.min.js').then(() => {\n    window.vConsole = new window.VConsole();\n  })\n  return;\n}",
                    "compiled": "function main(){\n    \n    'use strict';\n\nvar __compiledFunc__ = function render() {\n  this.utils.loadScript('https://g.alicdn.com/code/lib/vConsole/3.11.2/vconsole.min.js').then(function () {\n    window.vConsole = new window.VConsole();\n  });\n  return;\n};\n    return __compiledFunc__.apply(this, arguments);\n  }",
                    "error": {}
                  }
                }
              }
            ]
          })
        }
      ];
      const { Button } = _unsafeWindow["Deep"];
      const Components = () => {
        return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: Style$3.yida_tool_skeleton_box, children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: Style$3.box_grid_1, children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: Style$3.box_grid_2, children: componentsDatas.map((item) => {
            return /* @__PURE__ */ jsxRuntimeExports.jsx(
              Button,
              {
                onClick: () => {
                  if (item.schema) {
                    _GM_setClipboard(item.schema);
                    MessageProvider.success("复制成功!");
                  } else
                    MessageProvider.error("复制失败,请联系开发者!");
                },
                children: item.title
              },
              item.title
            );
          }) }),
          /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: Style$3.box_grid_1, children: /* @__PURE__ */ jsxRuntimeExports.jsx(TableTool, {}) })
        ] }) });
      };
      /*! 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 i2 = 0; i2 < data.length >> 1; ++i2)
          o[i2] = String.fromCharCode(data.charCodeAt(2 * i2 + 1) + (data.charCodeAt(2 * i2) << 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 i2 = 0; i2 < input.length; ) {
          c1 = input.charCodeAt(i2++);
          e1 = c1 >> 2;
          c2 = input.charCodeAt(i2++);
          e2 = (c1 & 3) << 4 | c2 >> 4;
          c3 = input.charCodeAt(i2++);
          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 i2 = 0; i2 < input.length; ) {
          e1 = Base64_map.indexOf(input.charAt(i2++));
          e2 = Base64_map.indexOf(input.charAt(i2++));
          c1 = e1 << 2 | e2 >> 4;
          o += String.fromCharCode(c1);
          e3 = Base64_map.indexOf(input.charAt(i2++));
          c2 = (e2 & 15) << 4 | e3 >> 2;
          if (e3 !== 64) {
            o += String.fromCharCode(c2);
          }
          e4 = Base64_map.indexOf(input.charAt(i2++));
          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 i2 = 0; i2 != s.length; ++i2)
          view[i2] = s.charCodeAt(i2) & 255;
        return buf;
      }
      function a2s(data) {
        if (Array.isArray(data))
          return data.map(function(c2) {
            return String.fromCharCode(c2);
          }).join("");
        var o = [];
        for (var i2 = 0; i2 < data.length; ++i2)
          o[i2] = String.fromCharCode(data[i2]);
        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 i2 = 0, maxlen = 0;
          for (i2 = 0; i2 < bufs.length; ++i2)
            maxlen += bufs[i2].length;
          var o = new Uint8Array(maxlen);
          var len = 0;
          for (i2 = 0, maxlen = 0; i2 < bufs.length; maxlen += len, ++i2) {
            len = bufs[i2].length;
            if (bufs[i2] instanceof Uint8Array)
              o.set(bufs[i2], maxlen);
            else if (typeof bufs[i2] == "string") {
              throw "wtf";
            } else
              o.set(new Uint8Array(bufs[i2]), 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 = "", i2 = x2.length - 1;
        while (i2 >= 0)
          o += x2.charAt(i2--);
        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 i2 = Math.round(v2);
        return pad0r2(i2, d2);
      }
      function SSF_isgeneral(s, i2) {
        i2 = i2 || 0;
        return s.length >= 7 + i2 && (s.charCodeAt(i2) | 32) === 103 && (s.charCodeAt(i2 + 1) | 32) === 101 && (s.charCodeAt(i2 + 2) | 32) === 110 && (s.charCodeAt(i2 + 3) | 32) === 101 && (s.charCodeAt(i2 + 4) | 32) === 114 && (s.charCodeAt(i2 + 5) | 32) === 97 && (s.charCodeAt(i2 + 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 j2 = s.length % w2, o = s.substr(0, j2);
        for (; j2 != s.length; j2 += w2)
          o += (o.length > 0 ? "," : "") + s.substr(j2, 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, sign2) {
        var den = parseInt(r2[4], 10), rr = Math.round(aval * den), base = Math.floor(rr / den);
        var myn = rr - base * den, myd = den;
        return sign2 + (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, sign2) {
        return sign2 + (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 i2 = 0; i2 != str.length; ++i2)
          switch (cc = str.charCodeAt(i2)) {
            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), sign2 = val < 0 ? "-" : "";
        if (fmt.match(/^00+$/))
          return sign2 + 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, sign2);
        if (fmt.match(/^#+0+$/))
          return sign2 + 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 sign2 + 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 sign2 + 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 = "" + sign2;
          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 sign2 + (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" ? sign2 + 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), sign2 = val < 0 ? "-" : "";
        if (fmt.match(/^00+$/))
          return sign2 + 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, sign2);
        if (fmt.match(/^#+0+$/))
          return sign2 + 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 sign2 + ("" + aval).replace(/\.(\d*[1-9])0*$/, ".$1").replace(/^(-?\d*)$/, "$1.").replace(/^0\./, r2[1].length ? "0." : ".");
        }
        if (r2 = fmt.match(/^#{1,3},##0(\.?)$/))
          return sign2 + 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 = "" + sign2;
          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 sign2 + (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" ? sign2 + 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 i2 = 0, j2 = 0; i2 < fmt.length; ++i2)
          switch (
            /*cc=*/
            fmt.charCodeAt(i2)
          ) {
            case 34:
              in_str = !in_str;
              break;
            case 95:
            case 42:
            case 92:
              ++i2;
              break;
            case 59:
              out[out.length] = fmt.substr(j2, i2 - j2);
              j2 = i2 + 1;
          }
        out[out.length] = fmt.substr(j2);
        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 i2 = 0, c2 = "", o = "";
        while (i2 < fmt.length) {
          switch (c2 = fmt.charAt(i2)) {
            case "G":
              if (SSF_isgeneral(fmt, i2))
                i2 += 6;
              i2++;
              break;
            case '"':
              for (
                ;
                /*cc=*/
                fmt.charCodeAt(++i2) !== 34 && i2 < fmt.length;
              ) {
              }
              ++i2;
              break;
            case "\\":
              i2 += 2;
              break;
            case "_":
              i2 += 2;
              break;
            case "@":
              ++i2;
              break;
            case "B":
            case "b":
              if (fmt.charAt(i2 + 1) === "1" || fmt.charAt(i2 + 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(i2, 3).toUpperCase() === "A/P")
                return true;
              if (fmt.substr(i2, 5).toUpperCase() === "AM/PM")
                return true;
              if (fmt.substr(i2, 5).toUpperCase() === "上午/下午")
                return true;
              ++i2;
              break;
            case "[":
              o = c2;
              while (fmt.charAt(i2++) !== "]" && i2 < fmt.length)
                o += fmt.charAt(i2);
              if (o.match(SSF_abstime))
                return true;
              break;
            case ".":
            case "0":
            case "#":
              while (i2 < fmt.length && ("0#?.,E+-%".indexOf(c2 = fmt.charAt(++i2)) > -1 || c2 == "\\" && fmt.charAt(i2 + 1) == "-" && "0#".indexOf(fmt.charAt(i2 + 2)) > -1)) {
              }
              break;
            case "?":
              while (fmt.charAt(++i2) === c2) {
              }
              break;
            case "*":
              ++i2;
              if (fmt.charAt(i2) == " " || fmt.charAt(i2) == "*")
                ++i2;
              break;
            case "(":
            case ")":
              ++i2;
              break;
            case "1":
            case "2":
            case "3":
            case "4":
            case "5":
            case "6":
            case "7":
            case "8":
            case "9":
              while (i2 < fmt.length && "0123456789".indexOf(fmt.charAt(++i2)) > -1) {
              }
              break;
            case " ":
              ++i2;
              break;
            default:
              ++i2;
              break;
          }
        }
        return false;
      }
      function eval_fmt(fmt, v2, opts, flen) {
        var out = [], o = "", i2 = 0, c2 = "", lst = "t", dt, j2, cc;
        var hr = "H";
        while (i2 < fmt.length) {
          switch (c2 = fmt.charAt(i2)) {
            case "G":
              if (!SSF_isgeneral(fmt, i2))
                throw new Error("unrecognized character " + c2 + " in " + fmt);
              out[out.length] = { t: "G", v: "General" };
              i2 += 7;
              break;
            case '"':
              for (o = ""; (cc = fmt.charCodeAt(++i2)) !== 34 && i2 < fmt.length; )
                o += String.fromCharCode(cc);
              out[out.length] = { t: "t", v: o };
              ++i2;
              break;
            case "\\":
              var w2 = fmt.charAt(++i2), t2 = w2 === "(" || w2 === ")" ? w2 : "t";
              out[out.length] = { t: t2, v: w2 };
              ++i2;
              break;
            case "_":
              out[out.length] = { t: "t", v: " " };
              i2 += 2;
              break;
            case "@":
              out[out.length] = { t: "T", v: v2 };
              ++i2;
              break;
            case "B":
            case "b":
              if (fmt.charAt(i2 + 1) === "1" || fmt.charAt(i2 + 1) === "2") {
                if (dt == null) {
                  dt = SSF_parse_date_code(v2, opts, fmt.charAt(i2 + 1) === "2");
                  if (dt == null)
                    return "";
                }
                out[out.length] = { t: "X", v: fmt.substr(i2, 2) };
                lst = c2;
                i2 += 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 (++i2 < fmt.length && fmt.charAt(i2).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(i2, 3).toUpperCase() === "A/P") {
                if (dt != null)
                  q2.v = dt.H >= 12 ? "P" : "A";
                q2.t = "T";
                hr = "h";
                i2 += 3;
              } else if (fmt.substr(i2, 5).toUpperCase() === "AM/PM") {
                if (dt != null)
                  q2.v = dt.H >= 12 ? "PM" : "AM";
                q2.t = "T";
                i2 += 5;
                hr = "h";
              } else if (fmt.substr(i2, 5).toUpperCase() === "上午/下午") {
                if (dt != null)
                  q2.v = dt.H >= 12 ? "下午" : "上午";
                q2.t = "T";
                i2 += 5;
                hr = "h";
              } else {
                q2.t = "t";
                ++i2;
              }
              if (dt == null && q2.t === "T")
                return "";
              out[out.length] = q2;
              lst = c2;
              break;
            case "[":
              o = c2;
              while (fmt.charAt(i2++) !== "]" && i2 < fmt.length)
                o += fmt.charAt(i2);
              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 (++i2 < fmt.length && (c2 = fmt.charAt(i2)) === "0")
                  o += c2;
                out[out.length] = { t: "s", v: o };
                break;
              }
            case "0":
            case "#":
              o = c2;
              while (++i2 < fmt.length && "0#?.,E+-%".indexOf(c2 = fmt.charAt(i2)) > -1)
                o += c2;
              out[out.length] = { t: "n", v: o };
              break;
            case "?":
              o = c2;
              while (fmt.charAt(++i2) === c2)
                o += c2;
              out[out.length] = { t: c2, v: o };
              lst = c2;
              break;
            case "*":
              ++i2;
              if (fmt.charAt(i2) == " " || fmt.charAt(i2) == "*")
                ++i2;
              break;
            case "(":
            case ")":
              out[out.length] = { t: flen === 1 ? "t" : c2, v: c2 };
              ++i2;
              break;
            case "1":
            case "2":
            case "3":
            case "4":
            case "5":
            case "6":
            case "7":
            case "8":
            case "9":
              o = c2;
              while (i2 < fmt.length && "0123456789".indexOf(fmt.charAt(++i2)) > -1)
                o += fmt.charAt(i2);
              out[out.length] = { t: "D", v: o };
              break;
            case " ":
              out[out.length] = { t: c2, v: c2 };
              ++i2;
              break;
            case "$":
              out[out.length] = { t: "t", v: "$" };
              ++i2;
              break;
            default:
              if (",$-+/():!^&'~{}<>=€acfijklopqrtuvwxzP".indexOf(c2) === -1)
                throw new Error("unrecognized character " + c2 + " in " + fmt);
              out[out.length] = { t: "t", v: c2 };
              ++i2;
              break;
          }
        }
        var bt = 0, ss0 = 0, ssm;
        for (i2 = out.length - 1, lst = "t"; i2 >= 0; --i2) {
          switch (out[i2].t) {
            case "h":
            case "H":
              out[i2].t = hr;
              lst = "h";
              if (bt < 1)
                bt = 1;
              break;
            case "s":
              if (ssm = out[i2].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[i2].t;
              break;
            case "m":
              if (lst === "s") {
                out[i2].t = "M";
                if (bt < 2)
                  bt = 2;
              }
              break;
            case "X":
              break;
            case "Z":
              if (bt < 1 && out[i2].v.match(/[Hh]/))
                bt = 1;
              if (bt < 2 && out[i2].v.match(/[Mm]/))
                bt = 2;
              if (bt < 3 && out[i2].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 (i2 = 0; i2 < out.length; ++i2) {
          switch (out[i2].t) {
            case "t":
            case "T":
            case " ":
            case "D":
              break;
            case "X":
              out[i2].v = "";
              out[i2].t = ";";
              break;
            case "d":
            case "m":
            case "y":
            case "h":
            case "H":
            case "M":
            case "s":
            case "e":
            case "b":
            case "Z":
              out[i2].v = SSF_write_date(out[i2].t.charCodeAt(0), out[i2].v, dt, ss0);
              out[i2].t = "t";
              break;
            case "n":
            case "?":
              jj = i2 + 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[i2].t === "(" && (c2 === " " || c2 === "n" || c2 === ")") || c2 === "t" && (out[jj].v === "/" || out[jj].v === " " && out[jj + 1] != null && out[jj + 1].t == "?"))) {
                out[i2].v += out[jj].v;
                out[jj] = { v: "", t: ";" };
                ++jj;
              }
              nstr += out[i2].v;
              i2 = jj - 1;
              break;
            case "G":
              out[i2].t = "t";
              out[i2].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 (i2 = 0; i2 < out.length; ++i2)
            if (out[i2] != null && out[i2].t != "t" && out[i2].v.indexOf(".") > -1) {
              decpt = i2;
              break;
            }
          var lasti = out.length;
          if (decpt === out.length && ostr.indexOf("E") === -1) {
            for (i2 = out.length - 1; i2 >= 0; --i2) {
              if (out[i2] == null || "n?".indexOf(out[i2].t) === -1)
                continue;
              if (jj >= out[i2].v.length - 1) {
                jj -= out[i2].v.length;
                out[i2].v = ostr.substr(jj + 1, out[i2].v.length);
              } else if (jj < 0)
                out[i2].v = "";
              else {
                out[i2].v = ostr.substr(0, jj + 1);
                jj = -1;
              }
              out[i2].t = "t";
              lasti = i2;
            }
            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 (i2 = decpt; i2 >= 0; --i2) {
              if (out[i2] == null || "n?".indexOf(out[i2].t) === -1)
                continue;
              j2 = out[i2].v.indexOf(".") > -1 && i2 === decpt ? out[i2].v.indexOf(".") - 1 : out[i2].v.length - 1;
              vv = out[i2].v.substr(j2 + 1);
              for (; j2 >= 0; --j2) {
                if (jj >= 0 && (out[i2].v.charAt(j2) === "0" || out[i2].v.charAt(j2) === "#"))
                  vv = ostr.charAt(jj--) + vv;
              }
              out[i2].v = vv;
              out[i2].t = "t";
              lasti = i2;
            }
            if (jj >= 0 && lasti < out.length)
              out[lasti].v = ostr.substr(0, jj + 1) + out[lasti].v;
            jj = ostr.indexOf(".") + 1;
            for (i2 = decpt; i2 < out.length; ++i2) {
              if (out[i2] == null || "n?(".indexOf(out[i2].t) === -1 && i2 !== decpt)
                continue;
              j2 = out[i2].v.indexOf(".") > -1 && i2 === decpt ? out[i2].v.indexOf(".") + 1 : 0;
              vv = out[i2].v.substr(0, j2);
              for (; j2 < out[i2].v.length; ++j2) {
                if (jj < ostr.length)
                  vv += ostr.charAt(jj++);
              }
              out[i2].v = vv;
              out[i2].t = "t";
              lasti = i2;
            }
          }
        }
        for (i2 = 0; i2 < out.length; ++i2)
          if (out[i2] != null && "n?".indexOf(out[i2].t) > -1) {
            myv = flen > 1 && v2 < 0 && i2 > 0 && out[i2 - 1].v === "-" ? -v2 : v2;
            out[i2].v = write_num(out[i2].t, out[i2].v, myv);
            out[i2].t = "t";
          }
        var retval = "";
        for (i2 = 0; i2 !== out.length; ++i2)
          if (out[i2] != null)
            retval += out[i2].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 i2 = 0; i2 < 392; ++i2) {
            if (table_fmt[i2] == void 0) {
              if (idx < 0)
                idx = i2;
              continue;
            }
            if (table_fmt[i2] == fmt) {
              idx = i2;
              break;
            }
          }
          if (idx < 0)
            idx = 391;
        }
        table_fmt[idx] = fmt;
        return idx;
      }
      function SSF_load_table(tbl) {
        for (var i2 = 0; i2 != 392; ++i2)
          if (tbl[i2] !== void 0)
            SSF_load(tbl[i2], i2);
      }
      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, i2) {
          var v2 = parseInt(match[i2 + 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 i2 = 0, L = bstr.length; i2 < L; )
            C = C >>> 8 ^ T0[(C ^ bstr.charCodeAt(i2++)) & 255];
          return ~C;
        }
        function crc32_buf(B, seed) {
          var C = seed ^ -1, L = B.length - 15, i2 = 0;
          for (; i2 < L; )
            C = Tf[B[i2++] ^ C & 255] ^ Te[B[i2++] ^ C >> 8 & 255] ^ Td[B[i2++] ^ C >> 16 & 255] ^ Tc[B[i2++] ^ C >>> 24] ^ Tb[B[i2++]] ^ Ta[B[i2++]] ^ T9[B[i2++]] ^ T8[B[i2++]] ^ T7[B[i2++]] ^ T6[B[i2++]] ^ T5[B[i2++]] ^ T4[B[i2++]] ^ T3[B[i2++]] ^ T2[B[i2++]] ^ T1[B[i2++]] ^ T0[B[i2++]];
          L += 15;
          while (i2 < L)
            C = C >>> 8 ^ T0[(C ^ B[i2++]) & 255];
          return ~C;
        }
        function crc32_str(str, seed) {
          var C = seed ^ -1;
          for (var i2 = 0, L = str.length, c2 = 0, d2 = 0; i2 < L; ) {
            c2 = str.charCodeAt(i2++);
            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(i2++) & 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 exports2 = {};
        exports2.version = "1.2.1";
        function namecmp(l2, r2) {
          var L = l2.split("/"), R = r2.split("/");
          for (var i3 = 0, c2 = 0, Z = Math.min(L.length, R.length); i3 < Z; ++i3) {
            if (c2 = L[i3].length - R[i3].length)
              return c2;
            if (L[i3] != R[i3])
              return L[i3] < R[i3] ? -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, j2 = 0; j2 < 109; ++j2) {
            q3 = blob.read_shift(4, "i");
            if (q3 < 0)
              break;
            fat_addrs[j2] = 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 i3 = 1; i3 < nsectors; ++i3)
            sectors[i3 - 1] = file.slice(i3 * ssz, (i3 + 1) * ssz);
          sectors[nsectors - 1] = file.slice(nsectors * ssz);
          return sectors;
        }
        function build_full_paths(FI, FP, Paths) {
          var i3 = 0, L = 0, R = 0, C = 0, j2 = 0, pl = Paths.length;
          var dad = [], q3 = [];
          for (; i3 < pl; ++i3) {
            dad[i3] = q3[i3] = i3;
            FP[i3] = Paths[i3];
          }
          for (; j2 < q3.length; ++j2) {
            i3 = q3[j2];
            L = FI[i3].L;
            R = FI[i3].R;
            C = FI[i3].C;
            if (dad[i3] === i3) {
              if (L !== -1 && dad[L] !== L)
                dad[i3] = dad[L];
              if (R !== -1 && dad[R] !== R)
                dad[i3] = dad[R];
            }
            if (C !== -1)
              dad[C] = i3;
            if (L !== -1 && i3 != dad[i3]) {
              dad[L] = dad[i3];
              if (q3.lastIndexOf(L) < j2)
                q3.push(L);
            }
            if (R !== -1 && i3 != dad[i3]) {
              dad[R] = dad[i3];
              if (q3.lastIndexOf(R) < j2)
                q3.push(R);
            }
          }
          for (i3 = 1; i3 < pl; ++i3)
            if (dad[i3] === i3) {
              if (R !== -1 && dad[R] !== R)
                dad[i3] = dad[R];
              else if (L !== -1 && dad[L] !== L)
                dad[i3] = dad[L];
            }
          for (i3 = 1; i3 < pl; ++i3) {
            if (FI[i3].type === 0)
              continue;
            j2 = i3;
            if (j2 != dad[j2])
              do {
                j2 = dad[j2];
                FP[i3] = FP[j2] + "/" + FP[i3];
              } while (j2 !== 0 && -1 !== dad[j2] && j2 != dad[j2]);
            dad[i3] = -1;
          }
          FP[0] += "/";
          for (i3 = 1; i3 < pl; ++i3) {
            if (FI[i3].type !== 2)
              FP[i3] += "/";
          }
        }
        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 i3 = 0; i3 < m2; ++i3) {
              if ((q3 = __readInt32LE(sector, i3 * 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, j2 = 0, jj = 0;
          for (j2 = start; j2 >= 0; ) {
            chkd[j2] = true;
            buf[buf.length] = j2;
            buf_chain.push(sectors[j2]);
            var addr = fat_addrs[Math.floor(j2 * 4 / ssz)];
            jj = j2 * 4 & modulus;
            if (ssz < 4 + jj)
              throw new Error("FAT boundary crossed: " + j2 + " 4 " + ssz);
            if (!sectors[addr])
              break;
            j2 = __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, i3 = 0, j2 = 0, k2 = 0, jj = 0;
          for (i3 = 0; i3 < sl; ++i3) {
            buf = [];
            k2 = i3 + dir_start;
            if (k2 >= sl)
              k2 -= sl;
            if (chkd[k2])
              continue;
            buf_chain = [];
            var seen2 = [];
            for (j2 = k2; j2 >= 0; ) {
              seen2[j2] = true;
              chkd[j2] = true;
              buf[buf.length] = j2;
              buf_chain.push(sectors[j2]);
              var addr = fat_addrs[Math.floor(j2 * 4 / ssz)];
              jj = j2 * 4 & modulus;
              if (ssz < 4 + jj)
                throw new Error("FAT boundary crossed: " + j2 + " 4 " + ssz);
              if (!sectors[addr])
                break;
              j2 = __readInt32LE(sectors[addr], jj);
              if (seen2[j2])
                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 i3 = 0, namelen = 0, name;
          for (; i3 < sector.length; i3 += 128) {
            var blob = (
              /*::(*/
              sector.slice(i3, i3 + 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, offset2) {
          return new Date((__readUInt32LE(blob, offset2 + 4) / 1e7 * Math.pow(2, 32) + __readUInt32LE(blob, offset2) / 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 i3 = cfb.FullPaths.length - 1; i3 >= 0; --i3) {
            var _file = cfb.FileIndex[i3];
            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 now2 = new Date(1987, 1, 19), j2 = 0;
          var fullPaths = Object.create ? /* @__PURE__ */ Object.create(null) : {};
          var data = [];
          for (i3 = 0; i3 < cfb.FullPaths.length; ++i3) {
            fullPaths[cfb.FullPaths[i3]] = true;
            if (cfb.FileIndex[i3].type === 0)
              continue;
            data.push([cfb.FullPaths[i3], cfb.FileIndex[i3]]);
          }
          for (i3 = 0; i3 < data.length; ++i3) {
            var dad = dirname(data[i3][0]);
            s = fullPaths[dad];
            if (!s) {
              data.push([dad, {
                name: filename(dad).replace("/", ""),
                type: 1,
                clsid: HEADER_CLSID,
                ct: now2,
                mt: now2,
                content: null
              }]);
              fullPaths[dad] = true;
            }
          }
          data.sort(function(x2, y2) {
            return namecmp(x2[0], y2[0]);
          });
          cfb.FullPaths = [];
          cfb.FileIndex = [];
          for (i3 = 0; i3 < data.length; ++i3) {
            cfb.FullPaths[i3] = data[i3][0];
            cfb.FileIndex[i3] = data[i3][1];
          }
          for (i3 = 0; i3 < data.length; ++i3) {
            var elt = cfb.FileIndex[i3];
            var nm = cfb.FullPaths[i3];
            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 (i3 === 0) {
              elt.C = data.length > 1 ? 1 : -1;
              elt.size = 0;
              elt.type = 5;
            } else if (nm.slice(-1) == "/") {
              for (j2 = i3 + 1; j2 < data.length; ++j2)
                if (dirname(cfb.FullPaths[j2]) == nm)
                  break;
              elt.C = j2 >= data.length ? -1 : j2;
              for (j2 = i3 + 1; j2 < data.length; ++j2)
                if (dirname(cfb.FullPaths[j2]) == dirname(nm))
                  break;
              elt.R = j2 >= data.length ? -1 : j2;
              elt.type = 1;
            } else {
              if (dirname(cfb.FullPaths[i3 + 1] || "") == dirname(nm))
                elt.R = i3 + 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 i4 = 0; i4 < cfb2.FileIndex.length; ++i4) {
              var file2 = cfb2.FileIndex[i4];
              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 i3 = 0, T = 0;
          {
            for (i3 = 0; i3 < 8; ++i3)
              o.write_shift(1, HEADER_SIG[i3]);
            for (i3 = 0; i3 < 8; ++i3)
              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 (i3 = 0; i3 < 3; ++i3)
              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 (i3 = 0; i3 < 109; ++i3)
              o.write_shift(-4, i3 < L[2] ? L[1] + i3 : -1);
          }
          if (L[1]) {
            for (T = 0; T < L[1]; ++T) {
              for (; i3 < 236 + T * 127; ++i3)
                o.write_shift(-4, i3 < L[2] ? L[1] + i3 : -1);
              o.write_shift(-4, T === L[1] - 1 ? ENDOFCHAIN : T + 1);
            }
          }
          var chainit = function(w2) {
            for (T += w2; i3 < T - 1; ++i3)
              o.write_shift(-4, i3 + 1);
            if (w2) {
              ++i3;
              o.write_shift(-4, ENDOFCHAIN);
            }
          };
          T = i3 = 0;
          for (T += L[1]; i3 < T; ++i3)
            o.write_shift(-4, consts.DIFSECT);
          for (T += L[2]; i3 < T; ++i3)
            o.write_shift(-4, consts.FATSECT);
          chainit(L[3]);
          chainit(L[4]);
          var j2 = 0, flen = 0;
          var file = cfb.FileIndex[0];
          for (; j2 < cfb.FileIndex.length; ++j2) {
            file = cfb.FileIndex[j2];
            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 = i3 = 0;
          for (j2 = 0; j2 < cfb.FileIndex.length; ++j2) {
            file = cfb.FileIndex[j2];
            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 (i3 = 0; i3 < L[4] << 2; ++i3) {
            var nm = cfb.FullPaths[i3];
            if (!nm || nm.length === 0) {
              for (j2 = 0; j2 < 17; ++j2)
                o.write_shift(4, 0);
              for (j2 = 0; j2 < 3; ++j2)
                o.write_shift(4, -1);
              for (j2 = 0; j2 < 12; ++j2)
                o.write_shift(4, 0);
              continue;
            }
            file = cfb.FileIndex[i3];
            if (i3 === 0)
              file.start = file.size ? file.start - 1 : ENDOFCHAIN;
            var _nm = i3 === 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 (j2 = 0; j2 < 4; ++j2)
                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 (i3 = 1; i3 < cfb.FileIndex.length; ++i3) {
            file = cfb.FileIndex[i3];
            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 (j2 = 0; j2 < file.size; ++j2)
                  o.write_shift(1, file.content[j2]);
                for (; j2 & 511; ++j2)
                  o.write_shift(1, 0);
              }
            }
          }
          for (i3 = 1; i3 < cfb.FileIndex.length; ++i3) {
            file = cfb.FileIndex[i3];
            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 (j2 = 0; j2 < file.size; ++j2)
                  o.write_shift(1, file.content[j2]);
                for (; j2 & 63; ++j2)
                  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 i3 = 0; i3 < o.length; ++i3)
            out[i3] = String.fromCharCode(o[i3]);
          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, i3 = 0;
          if (L >= sz)
            return b2;
          if (has_buf) {
            var o = new_unsafe_buf(M);
            if (b2.copy)
              b2.copy(o);
            else
              for (; i3 < b2.length; ++i3)
                o[i3] = b2[i3];
            return o;
          } else if (use_typed_arrays) {
            var a = new Uint8Array(M);
            if (a.set)
              a.set(b2);
            else
              for (; i3 < L; ++i3)
                a[i3] = b2[i3];
            return a;
          }
          b2.length = M;
          return b2;
        }
        function zero_fill_array(n2) {
          var o = new Array(n2);
          for (var i3 = 0; i3 < n2; ++i3)
            o[i3] = 0;
          return o;
        }
        function build_tree(clens, cmap, MAX) {
          var maxlen = 1, w2 = 0, i3 = 0, j2 = 0, ccode = 0, L = clens.length;
          var bl_count = use_typed_arrays ? new Uint16Array(32) : zero_fill_array(32);
          for (i3 = 0; i3 < 32; ++i3)
            bl_count[i3] = 0;
          for (i3 = L; i3 < MAX; ++i3)
            clens[i3] = 0;
          L = clens.length;
          var ctree = use_typed_arrays ? new Uint16Array(L) : zero_fill_array(L);
          for (i3 = 0; i3 < L; ++i3) {
            bl_count[w2 = clens[i3]]++;
            if (maxlen < w2)
              maxlen = w2;
            ctree[i3] = 0;
          }
          bl_count[0] = 0;
          for (i3 = 1; i3 <= maxlen; ++i3)
            bl_count[i3 + 16] = ccode = ccode + bl_count[i3 - 1] << 1;
          for (i3 = 0; i3 < L; ++i3) {
            ccode = clens[i3];
            if (ccode != 0)
              ctree[i3] = bl_count[ccode + 16]++;
          }
          var cleni = 0;
          for (i3 = 0; i3 < L; ++i3) {
            cleni = clens[i3];
            if (cleni != 0) {
              ccode = bit_swap_n(ctree[i3], maxlen) >> maxlen - cleni;
              for (j2 = (1 << maxlen + 4 - cleni) - 1; j2 >= 0; --j2)
                cmap[ccode | j2 << cleni] = cleni & 15 | i3 << 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 i2 = 0; i2 < 512; ++i2)
            fix_lmap[i2] = 0;
          for (i2 = 0; i2 < 32; ++i2)
            fix_dmap[i2] = 0;
        }
        (function() {
          var dlens = [];
          var i3 = 0;
          for (; i3 < 32; i3++)
            dlens.push(5);
          build_tree(dlens, fix_dmap, 32);
          var clens = [];
          i3 = 0;
          for (; i3 <= 143; i3++)
            clens.push(8);
          for (; i3 <= 255; i3++)
            clens.push(9);
          for (; i3 <= 279; i3++)
            clens.push(7);
          for (; i3 <= 287; i3++)
            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 j2 = 0, k2 = 0;
          for (; j2 < DST_LN.length - 1; ++j2) {
            for (; k2 < DST_LN[j2 + 1]; ++k2)
              DST_LN_RE[k2] = j2;
          }
          for (; k2 < 32768; ++k2)
            DST_LN_RE[k2] = 29;
          var LEN_LN_RE = use_typed_arrays ? new Uint8Array(259) : [];
          for (j2 = 0, k2 = 0; j2 < LEN_LN.length - 1; ++j2) {
            for (; k2 < LEN_LN[j2 + 1]; ++k2)
              LEN_LN_RE[k2] = j2;
          }
          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 i3 = 0; i3 < _HCLEN; ++i3) {
            clens[CLEN_ORDER[i3]] = w2 = read_bits_3(data, boff);
            if (maxlen < w2)
              maxlen = w2;
            bl_count[w2]++;
            boff += 3;
          }
          var ccode = 0;
          bl_count[0] = 0;
          for (i3 = 1; i3 <= maxlen; ++i3)
            next_code[i3] = ccode = ccode + bl_count[i3 - 1] << 1;
          for (i3 = 0; i3 < L; ++i3)
            if ((ccode = clens[i3]) != 0)
              ctree[i3] = next_code[ccode]++;
          var cleni = 0;
          for (i3 = 0; i3 < L; ++i3) {
            cleni = clens[i3];
            if (cleni != 0) {
              ccode = bitswap8[ctree[i3]] >> 8 - cleni;
              for (var j2 = (1 << 7 - cleni) - 1; j2 >= 0; --j2)
                dyn_cmap[ccode | j2 << cleni] = cleni & 7 | i3 << 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 (i3 = _HLIT; i3 < 286; ++i3)
            h1[i3] = 0;
          for (i3 = _HDIST; i3 < 30; ++i3)
            h2[i3] = 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 i3 = blob.length - 4;
          while ((blob[i3] != 80 || blob[i3 + 1] != 75 || blob[i3 + 2] != 5 || blob[i3 + 3] != 6) && i3 >= 0)
            --i3;
          blob.l = i3 + 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 (i3 = 0; i3 < fcnt; ++i3) {
            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 offset2 = 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 = offset2 + 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 i3 = 0; i3 < namelen; ++i3)
            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 i3 = 0, j2 = 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 (i3 = 1; i3 < cfb.FullPaths.length; ++i3) {
            fp = cfb.FullPaths[i3].slice(root.length);
            fi = cfb.FileIndex[i3];
            if (!fi.size || !fi.content || fp == "Sh33tJ5")
              continue;
            var start = start_cd;
            var namebuf = new_buf(fp.length);
            for (j2 = 0; j2 < fp.length; ++j2)
              namebuf.write_shift(1, fp.charCodeAt(j2) & 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 i3 = 0; i3 < data.length; i3 += 76)
            o.push(data.slice(i3, i3 + 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 i3 = 0; i3 < str.length; ) {
              var end = 76;
              var tmp = str.slice(i3, i3 + 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(i3, i3 + end);
              i3 += end;
              if (i3 < 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 i3 = 1; i3 < cfb.FullPaths.length; ++i3) {
            fp = cfb.FullPaths[i3].slice(root.length);
            fi = cfb.FileIndex[i3];
            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 j2 = 0; j2 < cfb.FileIndex.length; ++j2)
              if (cfb.FileIndex[j2] == file) {
                cfb.FileIndex.splice(j2, 1);
                cfb.FullPaths.splice(j2, 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 j2 = 0; j2 < cfb.FileIndex.length; ++j2)
              if (cfb.FileIndex[j2] == file) {
                cfb.FileIndex[j2].name = filename(new_name);
                cfb.FullPaths[j2] = new_name;
                return true;
              }
          }
          return false;
        }
        function cfb_gc(cfb) {
          rebuild_cfb(cfb, true);
        }
        exports2.find = find;
        exports2.read = read;
        exports2.parse = parse;
        exports2.write = write;
        exports2.writeFile = write_file;
        exports2.utils = {
          cfb_new,
          cfb_add,
          cfb_del,
          cfb_mov,
          cfb_gc,
          ReadShift,
          CheckField,
          prep_blob,
          bconcat,
          use_zlib,
          _deflateRaw: _deflate,
          _inflateRaw: _inflate,
          consts
        };
        return exports2;
      }();
      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 url2 = URL.createObjectURL(blob);
            if (typeof chrome === "object" && typeof (chrome.downloads || {}).download == "function") {
              if (URL.revokeObjectURL && typeof setTimeout !== "undefined")
                setTimeout(function() {
                  URL.revokeObjectURL(url2);
                }, 6e4);
              return chrome.downloads.download({ url: url2, filename: fname, saveAs: true });
            }
            var a = document.createElement("a");
            if (a.download != null) {
              a.download = fname;
              a.href = url2;
              document.body.appendChild(a);
              a.click();
              document.body.removeChild(a);
              if (URL.revokeObjectURL && typeof setTimeout !== "undefined")
                setTimeout(function() {
                  URL.revokeObjectURL(url2);
                }, 6e4);
              return url2;
            }
          }
        }
        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 keys(o) {
        var ks = Object.keys(o), o2 = [];
        for (var i2 = 0; i2 < ks.length; ++i2)
          if (Object.prototype.hasOwnProperty.call(o, ks[i2]))
            o2.push(ks[i2]);
        return o2;
      }
      function evert_key(obj2, key) {
        var o = [], K = keys(obj2);
        for (var i2 = 0; i2 !== K.length; ++i2)
          if (o[obj2[K[i2]][key]] == null)
            o[obj2[K[i2]][key]] = K[i2];
        return o;
      }
      function evert(obj2) {
        var o = [], K = keys(obj2);
        for (var i2 = 0; i2 !== K.length; ++i2)
          o[obj2[K[i2]]] = K[i2];
        return o;
      }
      function evert_num(obj2) {
        var o = [], K = keys(obj2);
        for (var i2 = 0; i2 !== K.length; ++i2)
          o[obj2[K[i2]]] = parseInt(K[i2], 10);
        return o;
      }
      function evert_arr(obj2) {
        var o = [], K = keys(obj2);
        for (var i2 = 0; i2 !== K.length; ++i2) {
          if (o[obj2[K[i2]]] == null)
            o[obj2[K[i2]]] = [];
          o[obj2[K[i2]]].push(K[i2]);
        }
        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 i2 = 0; i2 != arr.length; ++i2)
          o.push(String.fromCharCode(arr[i2]));
        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 = "", i2 = 0, c2 = 0, d2 = 0, e2 = 0, f2 = 0, w2 = 0;
        while (i2 < orig.length) {
          c2 = orig.charCodeAt(i2++);
          if (c2 < 128) {
            out += String.fromCharCode(c2);
            continue;
          }
          d2 = orig.charCodeAt(i2++);
          if (c2 > 191 && c2 < 224) {
            f2 = (c2 & 31) << 6;
            f2 |= d2 & 63;
            out += String.fromCharCode(f2);
            continue;
          }
          e2 = orig.charCodeAt(i2++);
          if (c2 < 240) {
            out += String.fromCharCode((c2 & 15) << 12 | (d2 & 63) << 6 | e2 & 63);
            continue;
          }
          f2 = orig.charCodeAt(i2++);
          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, i2, j2 = 1, k2 = 0, ww = 0, c2;
        for (i2 = 0; i2 < data.length; i2 += j2) {
          j2 = 1;
          if ((c2 = data.charCodeAt(i2)) < 128)
            w2 = c2;
          else if (c2 < 224) {
            w2 = (c2 & 31) * 64 + (data.charCodeAt(i2 + 1) & 63);
            j2 = 2;
          } else if (c2 < 240) {
            w2 = (c2 & 15) * 4096 + (data.charCodeAt(i2 + 1) & 63) * 64 + (data.charCodeAt(i2 + 2) & 63);
            j2 = 3;
          } else {
            j2 = 4;
            w2 = (c2 & 7) * 262144 + (data.charCodeAt(i2 + 1) & 63) * 4096 + (data.charCodeAt(i2 + 2) & 63) * 64 + (data.charCodeAt(i2 + 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 = [], i2 = 0, c2 = 0, d2 = 0;
        while (i2 < orig.length) {
          c2 = orig.charCodeAt(i2++);
          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(i2++) - 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 i2 = 0; i2 < entities.length; ++i2)
            o = o.replace(entities[i2][0], entities[i2][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 keys(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 i2 = 5; i2 >= 0; --i2)
          m2 = m2 * 256 + b2[idx + i2];
        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 i2 = 0; i2 <= 5; ++i2, m2 /= 256)
          b2[idx + i2] = 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 i2 = 0; i2 < bufs[0].length; ++i2)
          if (bufs[0][i2])
            for (var j2 = 0, L = bufs[0][i2].length; j2 < L; j2 += w2)
              x2.push.apply(x2, bufs[0][i2].slice(j2, j2 + 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 i2 = s; i2 < e2; i2 += 2)
          ss.push(String.fromCharCode(__readUInt16LE(b2, i2)));
        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 i2 = s; i2 < s + l2; ++i2)
          ss.push(("0" + b2[i2].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 i2 = s; i2 < e2; i2++)
          ss.push(String.fromCharCode(__readUInt8(b2, i2)));
        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, i2) {
        var len = __readUInt32LE(b2, i2);
        return len > 0 ? __utf8(b2, i2 + 4, i2 + 4 + len - 1) : "";
      };
      var __lpstr = ___lpstr;
      var ___cpstr = function(b2, i2) {
        var len = __readUInt32LE(b2, i2);
        return len > 0 ? __utf8(b2, i2 + 4, i2 + 4 + len - 1) : "";
      };
      var __cpstr = ___cpstr;
      var ___lpwstr = function(b2, i2) {
        var len = 2 * __readUInt32LE(b2, i2);
        return len > 0 ? __utf8(b2, i2 + 4, i2 + 4 + len - 1) : "";
      };
      var __lpwstr = ___lpwstr;
      var ___lpp4 = function lpp4_(b2, i2) {
        var len = __readUInt32LE(b2, i2);
        return len > 0 ? __utf16le(b2, i2 + 4, i2 + 4 + len) : "";
      };
      var __lpp4 = ___lpp4;
      var ___8lpp4 = function(b2, i2) {
        var len = __readUInt32LE(b2, i2);
        return len > 0 ? __utf8(b2, i2 + 4, i2 + 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, i2) {
          if (!Buffer.isBuffer(b2))
            return ___lpstr(b2, i2);
          var len = b2.readUInt32LE(i2);
          return len > 0 ? b2.toString("utf8", i2 + 4, i2 + 4 + len - 1) : "";
        };
        __cpstr = function cpstr_b(b2, i2) {
          if (!Buffer.isBuffer(b2))
            return ___cpstr(b2, i2);
          var len = b2.readUInt32LE(i2);
          return len > 0 ? b2.toString("utf8", i2 + 4, i2 + 4 + len - 1) : "";
        };
        __lpwstr = function lpwstr_b(b2, i2) {
          if (!Buffer.isBuffer(b2))
            return ___lpwstr(b2, i2);
          var len = 2 * b2.readUInt32LE(i2);
          return b2.toString("utf16le", i2 + 4, i2 + 4 + len - 1);
        };
        __lpp4 = function lpp4_b(b2, i2) {
          if (!Buffer.isBuffer(b2))
            return ___lpp4(b2, i2);
          var len = b2.readUInt32LE(i2);
          return b2.toString("utf16le", i2 + 4, i2 + 4 + len);
        };
        __8lpp4 = function lpp4_8b(b2, i2) {
          if (!Buffer.isBuffer(b2))
            return ___8lpp4(b2, i2);
          var len = b2.readUInt32LE(i2);
          return b2.toString("utf8", i2 + 4, i2 + 4 + len);
        };
        __double = function double_(b2, i2) {
          if (Buffer.isBuffer(b2))
            return b2.readDoubleLE(i2);
          return ___double(b2, i2);
        };
        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, i2, 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 (i2 = 0; i2 < size2; ++i2) {
                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 (i2 = 0; i2 < size2; ++i2) {
              if (this.lens && this.lens.indexOf(loc) !== -1) {
                w2 = __readUInt8(this, loc);
                this.l = loc + 1;
                vv = ReadShift.call(this, size2 - i2, 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 (i2 = 0; i2 != size2; ++i2) {
              if (this.lens && this.lens.indexOf(loc) !== -1) {
                w2 = __readUInt8(this, loc);
                this.l = loc + 1;
                vv = ReadShift.call(this, size2 - i2, 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, i2 = 0;
        if (f2 === "dbcs") {
          for (i2 = 0; i2 != val.length; ++i2)
            __writeUInt16LE(this, val.charCodeAt(i2), this.l + 2 * i2);
          size2 = 2 * val.length;
        } else if (f2 === "sbcs") {
          {
            val = val.replace(/[^\x00-\x7F]/g, "_");
            for (i2 = 0; i2 != val.length; ++i2)
              this[this.l + i2] = val.charCodeAt(i2) & 255;
          }
          size2 = val.length;
        } else if (f2 === "hex") {
          for (; i2 < t2; ++i2) {
            this[this.l++] = parseInt(val.slice(2 * i2, 2 * i2 + 2), 16) || 0;
          }
          return this;
        } else if (f2 === "utf16le") {
          var end = Math.min(this.l + t2, this.length);
          for (i2 = 0; i2 < Math.min(val.length, t2); ++i2) {
            var cc = val.charCodeAt(i2);
            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 i2 = 0; i2 != 4; ++i2) {
          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(cell, tgt, opts) {
        var out = dup(cell);
        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(cell, range, opts) {
        var out = dup(cell);
        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, i2 = 0;
        for (; i2 !== c2.length; ++i2)
          d2 = 26 * d2 + c2.charCodeAt(i2) - 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 i2 = 0; i2 < cstr.length; ++i2) {
          var cc = cstr.charCodeAt(i2);
          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(cell) {
        var col = cell.c + 1;
        var s = "";
        for (; col; col = (col - 1) / 26 | 0)
          s = String.fromCharCode((col - 1) % 26 + 65) + s;
        return s + (cell.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, i2 = 0, cc = 0;
        var len = range.length;
        for (idx = 0; i2 < len; ++i2) {
          if ((cc = range.charCodeAt(i2) - 64) < 1 || cc > 26)
            break;
          idx = 26 * idx + cc;
        }
        o.s.c = --idx;
        for (idx = 0; i2 < len; ++i2) {
          if ((cc = range.charCodeAt(i2) - 48) < 0 || cc > 9)
            break;
          idx = 10 * idx + cc;
        }
        o.s.r = --idx;
        if (i2 === len || cc != 10) {
          o.e.c = o.s.c;
          o.e.r = o.s.r;
          return o;
        }
        ++i2;
        for (idx = 0; i2 != len; ++i2) {
          if ((cc = range.charCodeAt(i2) - 64) < 1 || cc > 26)
            break;
          idx = 26 * idx + cc;
        }
        o.e.c = --idx;
        for (idx = 0; i2 != len; ++i2) {
          if ((cc = range.charCodeAt(i2) - 48) < 0 || cc > 9)
            break;
          idx = 10 * idx + cc;
        }
        o.e.r = --idx;
        return o;
      }
      function safe_format_cell(cell, v2) {
        var q2 = cell.t == "d" && v2 instanceof Date;
        if (cell.z != null)
          try {
            return cell.w = SSF_format(cell.z, q2 ? datenum(v2) : v2);
          } catch (e2) {
          }
        try {
          return cell.w = SSF_format((cell.XF || {}).numFmtId || (q2 ? 14 : 0), q2 ? datenum(v2) : v2);
        } catch (e2) {
          return "" + v2;
        }
      }
      function format_cell(cell, v2, o) {
        if (cell == null || cell.t == null || cell.t == "z")
          return "";
        if (cell.w !== void 0)
          return cell.w;
        if (cell.t == "d" && !cell.z && o && o.dateNF)
          cell.z = o.dateNF;
        if (cell.t == "e")
          return BErr[cell.v] || cell.v;
        if (v2 == void 0)
          return safe_format_cell(cell, cell.v);
        return safe_format_cell(cell, 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 cell = { 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))
              cell = data[R][C];
            else {
              if (Array.isArray(cell.v)) {
                cell.f = data[R][C][1];
                cell.v = cell.v[0];
              }
              if (cell.v === null) {
                if (cell.f)
                  cell.t = "n";
                else if (o.nullError) {
                  cell.t = "e";
                  cell.v = 0;
                } else if (!o.sheetStubs)
                  continue;
                else
                  cell.t = "z";
              } else if (typeof cell.v === "number")
                cell.t = "n";
              else if (typeof cell.v === "boolean")
                cell.t = "b";
              else if (cell.v instanceof Date) {
                cell.z = o.dateNF || table_fmt[14];
                if (o.cellDates) {
                  cell.t = "d";
                  cell.w = SSF_format(cell.z, datenum(cell.v));
                } else {
                  cell.t = "n";
                  cell.v = datenum(cell.v);
                  cell.w = SSF_format(cell.z, cell.v);
                }
              } else
                cell.t = "s";
            }
            if (dense) {
              if (!ws[__R])
                ws[__R] = [];
              if (ws[__R][__C] && ws[__R][__C].z)
                cell.z = ws[__R][__C].z;
              ws[__R][__C] = cell;
            } else {
              var cell_ref = encode_cell({ c: __C, r: __R });
              if (ws[cell_ref] && ws[cell_ref].z)
                cell.z = ws[cell_ref].z;
              ws[cell_ref] = cell;
            }
          }
        }
        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 i2 = 0; i2 != dwSizeStrRun; ++i2)
            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(cell, o) {
        if (o == null)
          o = new_buf(8);
        o.write_shift(-4, cell.c);
        o.write_shift(3, cell.iStyleRef || cell.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(cell, o) {
        if (o == null)
          o = new_buf(4);
        o.write_shift(3, cell.iStyleRef || cell.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 cell = { s: {}, e: {} };
        cell.s.r = data.read_shift(4);
        cell.e.r = data.read_shift(4);
        cell.s.c = data.read_shift(4);
        cell.e.c = data.read_shift(4);
        return cell;
      }
      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
        })];
        keys(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 i2 = 0; i2 < manifest.length; ++i2)
          o.push('  <manifest:file-entry manifest:full-path="' + manifest[i2][0] + '" manifest:media-type="' + manifest[i2][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 i2 = 0; i2 != rdf.length; ++i2) {
          o.push(write_rdf_type(rdf[i2][0], rdf[i2][1]));
          o.push(write_rdf_has("", rdf[i2][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 i2 = 0; i2 != CORE_PROPS.length; ++i2) {
          var f2 = CORE_PROPS[i2];
          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;
        keys(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 = [];
        keys(XLMLDocPropsMap).map(function(m2) {
          for (var i2 = 0; i2 < CORE_PROPS.length; ++i2)
            if (CORE_PROPS[i2][1] == m2)
              return CORE_PROPS[i2];
          for (i2 = 0; i2 < EXT_PROPS.length; ++i2)
            if (EXT_PROPS[i2][1] == m2)
              return EXT_PROPS[i2];
          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)
          keys(Props).forEach(function(k2) {
            if (!Object.prototype.hasOwnProperty.call(Props, k2))
              return;
            for (var i2 = 0; i2 < CORE_PROPS.length; ++i2)
              if (k2 == CORE_PROPS[i2][1])
                return;
            for (i2 = 0; i2 < EXT_PROPS.length; ++i2)
              if (k2 == EXT_PROPS[i2][1])
                return;
            for (i2 = 0; i2 < BLACKLIST.length; ++i2)
              if (k2 == BLACKLIST[i2])
                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)
          keys(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, i2 = 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 (i2 = 0; i2 < entries.length; ++i2) {
            var value = entries[i2][0];
            pr = new_buf(4 + 4 + 2 * (value.length + 1) + (value.length % 2 ? 0 : 2));
            pr.write_shift(4, i2 + 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 (i2 = 0; i2 < entries.length; ++i2) {
          if (RE && !RE[entries[i2][0]])
            continue;
          if (XLSPSSkip.indexOf(entries[i2][0]) > -1 || PseudoPropsPairs.indexOf(entries[i2][0]) > -1)
            continue;
          if (entries[i2][1] == null)
            continue;
          var val = entries[i2][1], idx = 0;
          if (RE) {
            idx = +RE[entries[i2][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 + i2 : idx);
          piao.push(pio);
          sz += 8 + pr.length;
        }
        var w2 = 8 * (prop.length + 1);
        for (i2 = 0; i2 < prop.length; ++i2) {
          piao[i2].write_shift(4, w2);
          w2 += prop[i2].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 j2 = 0; j2 < n2; ++j2)
          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 i2 = 0; i2 < str.length; ++i2)
          o.write_shift(2, str.charCodeAt(i2));
        o.write_shift(2, 0);
        return o;
      }
      function write_Hyperlink(hl) {
        var out = new_buf(512), i2 = 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 (i2 = 0; i2 < data.length; ++i2)
          out.write_shift(4, data[i2]);
        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 (i2 = 0; i2 < data.length; ++i2)
            out.write_shift(1, parseInt(data[i2], 16));
          var Pretarget = hashidx > -1 ? Target.slice(0, hashidx) : Target;
          out.write_shift(4, 2 * (Pretarget.length + 1));
          for (i2 = 0; i2 < Pretarget.length; ++i2)
            out.write_shift(2, Pretarget.charCodeAt(i2));
          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 (i2 = 0; i2 < data.length; ++i2)
            out.write_shift(1, parseInt(data[i2], 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 (i2 = 0; i2 < Target.length - 3 * P; ++i2)
            out.write_shift(1, Target.charCodeAt(i2 + 3 * P) & 255);
          out.write_shift(1, 0);
          out.write_shift(2, 65535);
          out.write_shift(2, 57005);
          for (i2 = 0; i2 < 6; ++i2)
            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 j2 = 0; j2 < sst.length; ++j2)
          strs[j2] = write_XLUnicodeRichExtendedString(sst[j2]);
        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(i2, 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, i2);
        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 i2 = 0; i2 < merges.length; ++i2)
          write_Ref8U(merges[i2], 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 i2 = 0; i2 < 16; ++i2)
          O.write_shift(1, parseInt(clsid[i2], 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 i2 = 0; i2 < TT.length; ++i2)
          O.write_shift(2, TT.charCodeAt(i2));
        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 i2 = 0; i2 < n2; ++i2)
          out.write_shift(2, i2 + 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 i2 = 0, j2 = 0, hcnt = 0, rlen = 1;
          for (i2 = 0; i2 < headers.length; ++i2) {
            if (((cols[i2] || {}).DBF || {}).name) {
              headers[i2] = cols[i2].DBF.name;
              ++hcnt;
              continue;
            }
            if (headers[i2] == null)
              continue;
            ++hcnt;
            if (typeof headers[i2] === "number")
              headers[i2] = headers[i2].toString(10);
            if (typeof headers[i2] !== "string")
              throw new Error("DBF Invalid column name " + headers[i2] + " |" + typeof headers[i2] + "|");
            if (headers.indexOf(headers[i2]) !== i2) {
              for (j2 = 0; j2 < 1024; ++j2)
                if (headers.indexOf(headers[i2] + "_" + j2) == -1) {
                  headers[i2] += "_" + j2;
                  break;
                }
            }
          }
          var range = safe_decode_range(ws["!ref"]);
          var coltypes = [];
          var colwidths = [];
          var coldecimals = [];
          for (i2 = 0; i2 <= range.e.c - range.s.c; ++i2) {
            var guess = "", _guess = "", maxlen = 0;
            var col = [];
            for (j2 = 0; j2 < data.length; ++j2) {
              if (data[j2][i2] != null)
                col.push(data[j2][i2]);
            }
            if (col.length == 0 || headers[i2] == null) {
              coltypes[i2] = "?";
              continue;
            }
            for (j2 = 0; j2 < col.length; ++j2) {
              switch (typeof col[j2]) {
                case "number":
                  _guess = "B";
                  break;
                case "string":
                  _guess = "C";
                  break;
                case "boolean":
                  _guess = "L";
                  break;
                case "object":
                  _guess = col[j2] instanceof Date ? "D" : "C";
                  break;
                default:
                  _guess = "C";
              }
              maxlen = Math.max(maxlen, String(col[j2]).length);
              guess = guess && guess != _guess ? "C" : _guess;
            }
            if (maxlen > 250)
              maxlen = 250;
            _guess = ((cols[i2] || {}).DBF || {}).type;
            if (_guess == "C") {
              if (cols[i2].DBF.len > maxlen)
                maxlen = cols[i2].DBF.len;
            }
            if (guess == "B" && _guess == "N") {
              guess = "N";
              coldecimals[i2] = cols[i2].DBF.dec;
              maxlen = cols[i2].DBF.len;
            }
            colwidths[i2] = guess == "C" || _guess == "N" ? maxlen : _RLEN[guess] || 0;
            rlen += colwidths[i2];
            coltypes[i2] = 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 (i2 = 0; i2 < 4; ++i2)
            h2.write_shift(4, 0);
          h2.write_shift(4, 0 | (+dbf_reverse_map[
            /*::String(*/
            current_ansi
            /*::)*/
          ] || 3) << 8);
          for (i2 = 0, j2 = 0; i2 < headers.length; ++i2) {
            if (headers[i2] == null)
              continue;
            var hf = ba.next(32);
            var _f = (headers[i2].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[i2] == "?" ? "C" : coltypes[i2], "sbcs");
            hf.write_shift(4, j2);
            hf.write_shift(1, colwidths[i2] || _RLEN[coltypes[i2]] || 0);
            hf.write_shift(1, coldecimals[i2] || 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);
            j2 += colwidths[i2] || _RLEN[coltypes[i2]] || 0;
          }
          var hb = ba.next(264);
          hb.write_shift(4, 13);
          for (i2 = 0; i2 < 65; ++i2)
            hb.write_shift(4, 0);
          for (i2 = 0; i2 < data.length; ++i2) {
            var rout = ba.next(rlen);
            rout.write_shift(1, 0);
            for (j2 = 0; j2 < headers.length; ++j2) {
              if (headers[j2] == null)
                continue;
              switch (coltypes[j2]) {
                case "L":
                  rout.write_shift(1, data[i2][j2] == null ? 63 : data[i2][j2] ? 84 : 70);
                  break;
                case "B":
                  rout.write_shift(8, data[i2][j2] || 0, "f");
                  break;
                case "N":
                  var _n = "0";
                  if (typeof data[i2][j2] == "number")
                    _n = data[i2][j2].toFixed(coldecimals[j2] || 0);
                  for (hcnt = 0; hcnt < colwidths[j2] - _n.length; ++hcnt)
                    rout.write_shift(1, 32);
                  rout.write_shift(1, _n, "sbcs");
                  break;
                case "D":
                  if (!data[i2][j2])
                    rout.write_shift(8, "00000000", "sbcs");
                  else {
                    rout.write_shift(4, ("0000" + data[i2][j2].getFullYear()).slice(-4), "sbcs");
                    rout.write_shift(2, ("00" + (data[i2][j2].getMonth() + 1)).slice(-2), "sbcs");
                    rout.write_shift(2, ("00" + data[i2][j2].getDate()).slice(-2), "sbcs");
                  }
                  break;
                case "C":
                  var _s = String(data[i2][j2] != null ? data[i2][j2] : "").slice(0, colwidths[j2]);
                  rout.write_shift(1, _s, "sbcs");
                  for (hcnt = 0; hcnt < colwidths[j2] - _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(" + keys(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, j2;
          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 (j2 = arr.length; j2 <= R; ++j2)
                          arr[j2] = [];
                        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 (j2 = arr.length; j2 <= R; ++j2)
                          arr[j2] = [];
                        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 (j2 = parseInt(cw[0], 10); j2 <= parseInt(cw[1], 10); ++j2) {
                          Mval = parseInt(cw[2], 10);
                          colinfo[j2 - 1] = Mval === 0 ? { hidden: true } : { wch: Mval };
                          process_col(colinfo[j2 - 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);
          keys(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(cell, ws, R, C) {
          var o = "C;Y" + (R + 1) + ";X" + (C + 1) + ";K";
          switch (cell.t) {
            case "n":
              o += cell.v || 0;
              if (cell.f && !cell.F)
                o += ";E" + a1_to_rc(cell.f, { r: R, c: C });
              break;
            case "b":
              o += cell.v ? "TRUE" : "FALSE";
              break;
            case "e":
              o += cell.w || cell.v;
              break;
            case "d":
              o += '"' + (cell.w || cell.v) + '"';
              break;
            case "s":
              o += '"' + cell.v.replace(/"/g, "").replace(/;/g, ";;") + '"';
              break;
          }
          return o;
        }
        function write_ws_cols_sylk(out, cols) {
          cols.forEach(function(col, i2) {
            var rec = "F;W" + (i2 + 1) + " " + (i2 + 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, i2) {
            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" + (i2 + 1));
          });
        }
        function sheet_to_sylk(ws, opts) {
          var preamble = ["ID;PWXL;N;E"], o = [];
          var r2 = safe_decode_range(ws["!ref"]), cell;
          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 });
              cell = dense ? (ws[R] || [])[C] : ws[coord];
              if (!cell || cell.v == null && (!cell.f || cell.F))
                continue;
              o.push(write_ws_cell_sylk(cell, 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"]), cell;
            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 });
                cell = dense ? (ws[R] || [])[C] : ws[coord];
                if (!cell) {
                  push_value(o, 1, 0, "");
                  continue;
                }
                switch (cell.t) {
                  case "n":
                    var val = cell.w;
                    if (!val && cell.v != null)
                      val = cell.v;
                    if (val == null) {
                      if (cell.f && !cell.F)
                        push_value(o, 1, 0, "=" + cell.f);
                      else
                        push_value(o, 1, 0, "");
                    } else
                      push_value(o, 0, val, "V");
                    break;
                  case "b":
                    push_value(o, 0, cell.v ? 1 : 0, cell.v ? "TRUE" : "FALSE");
                    break;
                  case "s":
                    push_value(o, 1, 0, isNaN(cell.v) ? cell.v : '="' + cell.v + '"');
                    break;
                  case "d":
                    if (!cell.w)
                      cell.w = SSF_format(cell.z || table_fmt[14], datenum(parseDate(cell.v)));
                    push_value(o, 0, cell.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 = [], cell, 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 });
              cell = dense ? (ws[R] || [])[C] : ws[coord];
              if (!cell || cell.v == null || cell.t === "z")
                continue;
              oo = ["cell", coord, "t"];
              switch (cell.t) {
                case "s":
                case "str":
                  oo.push(encode(cell.v));
                  break;
                case "n":
                  if (!cell.f) {
                    oo[2] = "v";
                    oo[3] = cell.v;
                  } else {
                    oo[2] = "vtf";
                    oo[3] = "n";
                    oo[4] = cell.v;
                    oo[5] = encode(cell.f);
                  }
                  break;
                case "b":
                  oo[2] = "vt" + (cell.f ? "f" : "c");
                  oo[3] = "nl";
                  oo[4] = cell.v ? "1" : "0";
                  oo[5] = encode(cell.f || (cell.v ? "TRUE" : "FALSE"));
                  break;
                case "d":
                  var t2 = datenum(parseDate(cell.v));
                  oo[2] = "vtc";
                  oo[3] = "nd";
                  oo[4] = "" + t2;
                  oo[5] = cell.w || SSF_format(cell.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 cell = {};
            if (s.charAt(0) == '"' && s.charAt(s.length - 1) == '"')
              s = s.slice(1, -1).replace(/""/g, '"');
            if (s.length === 0)
              cell.t = "z";
            else if (o.raw) {
              cell.t = "s";
              cell.v = s;
            } else if (s.trim().length === 0) {
              cell.t = "s";
              cell.v = s;
            } else if (s.charCodeAt(0) == 61) {
              if (s.charCodeAt(1) == 34 && s.charCodeAt(s.length - 1) == 34) {
                cell.t = "s";
                cell.v = s.slice(2, -1).replace(/""/g, '"');
              } else if (fuzzyfmla(s)) {
                cell.t = "n";
                cell.f = s.slice(1);
              } else {
                cell.t = "s";
                cell.v = s;
              }
            } else if (s == "TRUE") {
              cell.t = "b";
              cell.v = true;
            } else if (s == "FALSE") {
              cell.t = "b";
              cell.v = false;
            } else if (!isNaN(v2 = fuzzynum(s))) {
              cell.t = "n";
              if (o.cellText !== false)
                cell.w = s;
              cell.v = v2;
            } else if (!isNaN(fuzzydate(s).getDate()) || _re && s.match(_re)) {
              cell.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) {
                cell.t = "d";
                cell.v = parseDate(s, k2);
              } else {
                cell.t = "n";
                cell.v = datenum(parseDate(s, k2));
              }
              if (o.cellText !== false)
                cell.w = SSF_format(cell.z, cell.v instanceof Date ? datenum(cell.v) : cell.v);
              if (!o.cellNF)
                delete cell.z;
            } else {
              cell.t = "s";
              cell.v = s;
            }
            if (cell.t == "z")
              ;
            else if (o.dense) {
              if (!ws[R])
                ws[R] = [];
              ws[R][C] = cell;
            } else
              ws[encode_cell({ c: C, r: R })] = cell;
            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"]), cell;
          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 });
              cell = dense ? (ws[R] || [])[C] : ws[coord];
              if (!cell || cell.v == null) {
                oo.push("          ");
                continue;
              }
              var w2 = (cell.w || (format_cell(cell), cell.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 i2 = 0; i2 < realnames.length; ++i2)
            if (sheets[snames[i2]]) {
              rnames.push(realnames[i2] || snames[i2]);
              osheets[realnames[i2]] = sheets[realnames[i2]] || sheets[snames[i2]];
            } else {
              rnames.push(realnames[i2]);
              osheets[realnames[i2]] = { "!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 cell = dense ? (ws[R] || [])[C] : ws[ref];
              if (!cell || cell.t == "z")
                continue;
              if (cell.t == "n") {
                if ((cell.v | 0) == cell.v && cell.v >= -32768 && cell.v <= 32767)
                  write_biff_rec(ba, 13, write_INTEGER(R, C, cell.v));
                else
                  write_biff_rec(ba, 14, write_NUMBER(R, C, cell.v));
              } else {
                var str = format_cell(cell);
                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 i2 = 0, cnt = 0; i2 < wb.SheetNames.length; ++i2)
            if ((wb.Sheets[wb.SheetNames[i2]] || {})["!ref"])
              write_biff_rec(ba, 27, write_XFORMAT_SHEETNAME(wb.SheetNames[i2], cnt++));
          var wsidx = 0;
          for (i2 = 0; i2 < wb.SheetNames.length; ++i2) {
            var ws = wb.Sheets[wb.SheetNames[i2]];
            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 cell = dense ? (ws[R] || [])[C] : ws[ref];
                if (!cell || cell.t == "z")
                  continue;
                if (cell.t == "n") {
                  write_biff_rec(ba, 23, write_NUMBER_17(R, C, wsidx, cell.v));
                } else {
                  var str = format_cell(cell);
                  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 i2 = 0; i2 < wb.SheetNames.length; ++i2) {
            var name = wb.SheetNames[i2];
            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 i2 = 0; i2 < o.length; ++i2) {
            var cc = s.charCodeAt(i2);
            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 i2 = 0; i2 < s.length; ++i2) {
            var cc = s.charCodeAt(i2);
            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 i2 = 0; i2 < name.length; ++i2) {
            var cc = name.charCodeAt(i2);
            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 i2 = 0; i2 != sst.length; ++i2) {
          if (sst[i2] == null)
            continue;
          var s = sst[i2];
          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 i2 = 0; i2 < sst.length; ++i2)
          write_record(ba, 19, write_BrtSSTItem(sst[i2]));
        write_record(
          ba,
          160
          /* BrtEndSst */
        );
        return ba.end();
      }
      function _JS2ANSI(str) {
        var o = [], oo = str.split("");
        for (var i2 = 0; i2 < oo.length; ++i2)
          o[i2] = oo[i2].charCodeAt(0);
        return o;
      }
      function crypto_CreatePasswordVerifier_Method1(Password2) {
        var Verifier = 0, PasswordArray;
        var PasswordDecoded = _JS2ANSI(Password2);
        var len = PasswordDecoded.length + 1, i2, PasswordByte;
        var Intermediate1, Intermediate2, Intermediate3;
        PasswordArray = new_raw_buf(len);
        PasswordArray[0] = PasswordDecoded.length;
        for (i2 = 1; i2 != len; ++i2)
          PasswordArray[i2] = PasswordDecoded[i2 - 1];
        for (i2 = len - 1; i2 >= 0; --i2) {
          PasswordByte = PasswordArray[i2];
          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 cell = { v: data, t: "s" };
                    if (Array.isArray(ws))
                      ws[R][C] = cell;
                    else
                      ws[encode_cell({ r: R, c: C })] = cell;
                  }
                  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"]), cell;
          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 });
              cell = dense ? (ws[R] || [])[C] : ws[coord];
              if (!cell || cell.v == null && (!cell.f || cell.F))
                continue;
              o.push(" " + (cell.w || (format_cell(cell), cell.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 i2 = 0, o = 1; i2 != 3; ++i2)
          o = o * 256 + (rgb[i2] > 255 ? 255 : rgb[i2] < 0 ? 0 : rgb[i2]);
        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 i2 = r2[0]; i2 <= r2[1]; ++i2)
            if (NF[i2] != null)
              o[o.length] = writextag("numFmt", null, { numFmtId: i2, formatCode: escapexml(NF[i2]) });
        });
        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(i2, f2, o) {
        if (!o)
          o = new_buf(6 + 4 * f2.length);
        o.write_shift(2, i2);
        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 j2 = 0;
        if (fls != 40) {
          write_BrtColor({ auto: 1 }, o);
          write_BrtColor({ auto: 1 }, o);
          for (; j2 < 12; ++j2)
            o.write_shift(4, 0);
        } else {
          for (; j2 < 4; ++j2)
            o.write_shift(4, 0);
          for (; j2 < 12; ++j2)
            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 i2 = r2[0]; i2 <= r2[1]; ++i2)
            if (NF[i2] != 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 i2 = r2[0]; i2 <= r2[1]; ++i2)
            if (NF[i2] != null)
              write_record(ba, 44, write_BrtFmt(i2, NF[i2]));
        });
        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 i2 = 0; i2 < mdb.length; ++i2) {
          o.write_shift(4, mdb[i2][0]);
          o.write_shift(4, mdb[i2][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 cell = {};
        cell.r = data.read_shift(4);
        cell.c = data.read_shift(4);
        out.r = encode_cell(cell);
        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 i2 = 1; i2 < ts.length; ++i2)
              t2 += "Reply:\n    " + ts[i2] + "\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, i2) {
          if (i2 == 0)
            return;
          var newpath = p2.replace(/[^\/]*[\/]/, "/_VBA_PROJECT_CUR/");
          if (newpath.slice(-1) !== "/")
            CFB.utils.cfb_add(cfb, newpath, vba.FileIndex[i2].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 offset2 = blob.read_shift(opts && opts.biff == 2 ? 1 : 2);
        var o = [];
        for (var i2 = 0; i2 <= offset2; ++i2)
          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 i2 = 0; i2 != count; ++i2)
          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 i2 = 0, o = []; i2 != rows && (o[i2] = []); ++i2)
          for (var j2 = 0; j2 != cols; ++j2)
            o[i2][j2] = 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 i2 = 0; i2 !== rgce.length; ++i2) {
          switch (rgce[i2][0]) {
            case "PtgArray":
              rgce[i2][1] = parse_PtgExtraArray(blob, 0, opts);
              o.push(rgce[i2][1]);
              break;
            case "PtgMemArea":
              rgce[i2][2] = parse_PtgExtraMem(blob, rgce[i2][1], opts);
              o.push(rgce[i2][2]);
              break;
            case "PtgExp":
              if (opts && opts.biff == 12) {
                rgce[i2][1][1] = blob.read_shift(4);
                o.push(rgce[i2][1]);
              }
              break;
            case "PtgList":
            case "PtgElfRadicalS":
            case "PtgElfColS":
            case "PtgElfColSV":
              throw "Unsupported " + rgce[i2][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 i2 = 0; i2 < f2.length; ++i2) {
          var x2 = f2[i2], r2 = [];
          for (var j2 = 0; j2 < x2.length; ++j2) {
            var y2 = x2[j2];
            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, cell, 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 = cell ? shift_cell_xls(f2[1][1], cell, 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], cell ? { s: cell } : _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: cell.c, r: cell.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(cell, R, C, opts, os) {
        var o1 = write_XLSCell(R, C, os);
        var o2 = write_FormulaValue(cell.v);
        var o3 = new_buf(6);
        var flags = 1 | 32;
        o3.write_shift(2, flags);
        o3.write_shift(4, 0);
        var bf = new_buf(cell.bf.length);
        for (var i2 = 0; i2 < cell.bf.length; ++i2)
          bf[i2] = cell.bf[i2];
        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 i2 = 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 (; i2 < revarr.length; ++i2) {
              if (sst[revarr[i2]].t === str) {
                sst.Count++;
                return revarr[i2];
              }
            }
          }
        } else
          for (; i2 < len; ++i2) {
            if (sst[i2].t === str) {
              sst.Count++;
              return i2;
            }
          }
        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, cell, opts) {
        var z2 = opts.revssf[cell.z != null ? cell.z : "General"];
        var i2 = 60, len = styles.length;
        if (z2 == null && opts.ssf) {
          for (; i2 < 392; ++i2)
            if (opts.ssf[i2] == null) {
              SSF_load(cell.z, i2);
              opts.ssf[i2] = cell.z;
              opts.revssf[cell.z] = z2 = i2;
              break;
            }
        }
        for (i2 = 0; i2 != len; ++i2)
          if (styles[i2].numFmtId === z2)
            return i2;
        styles[len] = {
          numFmtId: z2,
          fontId: 0,
          fillId: 0,
          borderId: 0,
          xfId: 0,
          applyNumberFormat: 1
        };
        return len;
      }
      function check_ws(ws, sname, i2) {
        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 (" + i2 + "): " + ws["!ref"]);
        }
      }
      function write_ws_xml_merges(merges) {
        if (merges.length === 0)
          return "";
        var o = '<mergeCells count="' + merges.length + '">';
        for (var i2 = 0; i2 != merges.length; ++i2)
          o += '<mergeCell ref="' + encode_range(merges[i2]) + '"/>';
        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 i2 = 0; i2 != cols.length; ++i2) {
          if (!(col = cols[i2]))
            continue;
          o[o.length] = writextag("col", null, col_obj_w(i2, 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 i2 = 0; i2 < names.length; ++i2) {
          var name = names[i2];
          if (name.Name != "_xlnm._FilterDatabase")
            continue;
          if (name.Sheet != idx)
            continue;
          name.Ref = "'" + wb.SheetNames[idx] + "'!" + ref;
          break;
        }
        if (i2 == 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(cell, ref, ws, opts) {
        if (cell.c)
          ws["!comments"].push([ref, cell.c]);
        if (cell.v === void 0 && typeof cell.f !== "string" || cell.t === "z" && !cell.f)
          return "";
        var vv = "";
        var oldt = cell.t, oldv = cell.v;
        if (cell.t !== "z")
          switch (cell.t) {
            case "b":
              vv = cell.v ? "1" : "0";
              break;
            case "n":
              vv = "" + cell.v;
              break;
            case "e":
              vv = BErr[cell.v];
              break;
            case "d":
              if (opts && opts.cellDates)
                vv = parseDate(cell.v, -1).toISOString();
              else {
                cell = dup(cell);
                cell.t = "n";
                vv = "" + (cell.v = datenum(parseDate(cell.v)));
              }
              if (typeof cell.z === "undefined")
                cell.z = table_fmt[14];
              break;
            default:
              vv = cell.v;
              break;
          }
        var v2 = writetag("v", escapexml(vv)), o = { r: ref };
        var os = get_cell_style(opts.cellXfs, cell, opts);
        if (os !== 0)
          o.s = os;
        switch (cell.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 (cell.v == null) {
              delete cell.t;
              break;
            }
            if (cell.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, cell.v, opts.revStrings));
              o.t = "s";
              break;
            }
            o.t = "str";
            break;
        }
        if (cell.t != oldt) {
          cell.t = oldt;
          cell.v = oldv;
        }
        if (typeof cell.f == "string" && cell.f) {
          var ff = cell.F && cell.F.slice(0, ref.length) == ref ? { t: "array", ref: cell.F } : null;
          v2 = writextag("f", escapexml(cell.f), ff) + (cell.v != null ? v2 : "");
        }
        if (cell.l)
          ws["!links"].push([ref, cell.l]);
        if (cell.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"]), cell = "", 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 ((cell = write_ws_xml_cell(_cell, ref, ws, opts)) != null)
              r2.push(cell);
          }
          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 i2 = 0; i2 < 16; ++i2) {
          if (range.s.c > i2 + 1 << 10 || range.e.c < i2 << 10)
            continue;
          var first = -1, last = -1;
          for (var j2 = i2 << 10; j2 < i2 + 1 << 10; ++j2) {
            caddr.c = j2;
            var cell = Array.isArray(ws) ? (ws[caddr.r] || [])[caddr.c] : ws[encode_cell(caddr)];
            if (cell) {
              if (first < 0)
                first = j2;
              last = j2;
            }
          }
          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 i2 = 1; i2 < 3; ++i2)
          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 cell = parse_XLSBCell(data);
        return [cell];
      }
      function write_BrtCellBlank(cell, ncell, o) {
        if (o == null)
          o = new_buf(8);
        return write_XLSBCell(ncell, o);
      }
      function parse_BrtShortBlank(data) {
        var cell = parse_XLSBShortCell(data);
        return [cell];
      }
      function write_BrtShortBlank(cell, ncell, o) {
        if (o == null)
          o = new_buf(4);
        return write_XLSBShortCell(ncell, o);
      }
      function parse_BrtCellBool(data) {
        var cell = parse_XLSBCell(data);
        var fBool = data.read_shift(1);
        return [cell, fBool, "b"];
      }
      function write_BrtCellBool(cell, ncell, o) {
        if (o == null)
          o = new_buf(9);
        write_XLSBCell(ncell, o);
        o.write_shift(1, cell.v ? 1 : 0);
        return o;
      }
      function parse_BrtShortBool(data) {
        var cell = parse_XLSBShortCell(data);
        var fBool = data.read_shift(1);
        return [cell, fBool, "b"];
      }
      function write_BrtShortBool(cell, ncell, o) {
        if (o == null)
          o = new_buf(5);
        write_XLSBShortCell(ncell, o);
        o.write_shift(1, cell.v ? 1 : 0);
        return o;
      }
      function parse_BrtCellError(data) {
        var cell = parse_XLSBCell(data);
        var bError = data.read_shift(1);
        return [cell, bError, "e"];
      }
      function write_BrtCellError(cell, ncell, o) {
        if (o == null)
          o = new_buf(9);
        write_XLSBCell(ncell, o);
        o.write_shift(1, cell.v);
        return o;
      }
      function parse_BrtShortError(data) {
        var cell = parse_XLSBShortCell(data);
        var bError = data.read_shift(1);
        return [cell, bError, "e"];
      }
      function write_BrtShortError(cell, ncell, o) {
        if (o == null)
          o = new_buf(8);
        write_XLSBShortCell(ncell, o);
        o.write_shift(1, cell.v);
        o.write_shift(2, 0);
        o.write_shift(1, 0);
        return o;
      }
      function parse_BrtCellIsst(data) {
        var cell = parse_XLSBCell(data);
        var isst = data.read_shift(4);
        return [cell, isst, "s"];
      }
      function write_BrtCellIsst(cell, 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 cell = parse_XLSBShortCell(data);
        var isst = data.read_shift(4);
        return [cell, isst, "s"];
      }
      function write_BrtShortIsst(cell, 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 cell = parse_XLSBCell(data);
        var value = parse_Xnum(data);
        return [cell, value, "n"];
      }
      function write_BrtCellReal(cell, ncell, o) {
        if (o == null)
          o = new_buf(16);
        write_XLSBCell(ncell, o);
        write_Xnum(cell.v, o);
        return o;
      }
      function parse_BrtShortReal(data) {
        var cell = parse_XLSBShortCell(data);
        var value = parse_Xnum(data);
        return [cell, value, "n"];
      }
      function write_BrtShortReal(cell, ncell, o) {
        if (o == null)
          o = new_buf(12);
        write_XLSBShortCell(ncell, o);
        write_Xnum(cell.v, o);
        return o;
      }
      function parse_BrtCellRk(data) {
        var cell = parse_XLSBCell(data);
        var value = parse_RkNumber(data);
        return [cell, value, "n"];
      }
      function write_BrtCellRk(cell, ncell, o) {
        if (o == null)
          o = new_buf(12);
        write_XLSBCell(ncell, o);
        write_RkNumber(cell.v, o);
        return o;
      }
      function parse_BrtShortRk(data) {
        var cell = parse_XLSBShortCell(data);
        var value = parse_RkNumber(data);
        return [cell, value, "n"];
      }
      function write_BrtShortRk(cell, ncell, o) {
        if (o == null)
          o = new_buf(8);
        write_XLSBShortCell(ncell, o);
        write_RkNumber(cell.v, o);
        return o;
      }
      function parse_BrtCellRString(data) {
        var cell = parse_XLSBCell(data);
        var value = parse_RichStr(data);
        return [cell, value, "is"];
      }
      function parse_BrtCellSt(data) {
        var cell = parse_XLSBCell(data);
        var value = parse_XLWideString(data);
        return [cell, value, "str"];
      }
      function write_BrtCellSt(cell, ncell, o) {
        if (o == null)
          o = new_buf(12 + 4 * cell.v.length);
        write_XLSBCell(ncell, o);
        write_XLWideString(cell.v, o);
        return o.length > o.l ? o.slice(0, o.l) : o;
      }
      function parse_BrtShortSt(data) {
        var cell = parse_XLSBShortCell(data);
        var value = parse_XLWideString(data);
        return [cell, value, "str"];
      }
      function write_BrtShortSt(cell, ncell, o) {
        if (o == null)
          o = new_buf(8 + 4 * cell.v.length);
        write_XLSBShortCell(ncell, o);
        write_XLWideString(cell.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 cell = parse_XLSBCell(data);
        cell.r = opts["!row"];
        var value = data.read_shift(1);
        var o = [cell, value, "b"];
        if (opts.cellFormula) {
          data.l += 2;
          var formula = parse_XLSBCellParsedFormula(data, end - data.l, opts);
          o[3] = stringify_formula(formula, null, cell, opts.supbooks, opts);
        } else
          data.l = end;
        return o;
      }
      function parse_BrtFmlaError(data, length2, opts) {
        var end = data.l + length2;
        var cell = parse_XLSBCell(data);
        cell.r = opts["!row"];
        var value = data.read_shift(1);
        var o = [cell, value, "e"];
        if (opts.cellFormula) {
          data.l += 2;
          var formula = parse_XLSBCellParsedFormula(data, end - data.l, opts);
          o[3] = stringify_formula(formula, null, cell, opts.supbooks, opts);
        } else
          data.l = end;
        return o;
      }
      function parse_BrtFmlaNum(data, length2, opts) {
        var end = data.l + length2;
        var cell = parse_XLSBCell(data);
        cell.r = opts["!row"];
        var value = parse_Xnum(data);
        var o = [cell, value, "n"];
        if (opts.cellFormula) {
          data.l += 2;
          var formula = parse_XLSBCellParsedFormula(data, end - data.l, opts);
          o[3] = stringify_formula(formula, null, cell, opts.supbooks, opts);
        } else
          data.l = end;
        return o;
      }
      function parse_BrtFmlaString(data, length2, opts) {
        var end = data.l + length2;
        var cell = parse_XLSBCell(data);
        cell.r = opts["!row"];
        var value = parse_XLWideString(data);
        var o = [cell, value, "str"];
        if (opts.cellFormula) {
          data.l += 2;
          var formula = parse_XLSBCellParsedFormula(data, end - data.l, opts);
          o[3] = stringify_formula(formula, null, cell, 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, cell, R, C, opts, ws, last_seen) {
        if (cell.v === void 0)
          return false;
        var vv = "";
        switch (cell.t) {
          case "b":
            vv = cell.v ? "1" : "0";
            break;
          case "d":
            cell = dup(cell);
            cell.z = cell.z || table_fmt[14];
            cell.v = datenum(parseDate(cell.v));
            cell.t = "n";
            break;
          case "n":
          case "e":
            vv = "" + cell.v;
            break;
          default:
            vv = cell.v;
            break;
        }
        var o = { r: R, c: C };
        o.s = get_cell_style(opts.cellXfs, cell, opts);
        if (cell.l)
          ws["!links"].push([encode_cell(o), cell.l]);
        if (cell.c)
          ws["!comments"].push([encode_cell(o), cell.c]);
        switch (cell.t) {
          case "s":
          case "str":
            if (opts.bookSST) {
              vv = get_sst_id(opts.Strings, cell.v, opts.revStrings);
              o.t = "s";
              o.v = vv;
              if (last_seen)
                write_record(ba, 18, write_BrtShortIsst(cell, o));
              else
                write_record(ba, 7, write_BrtCellIsst(cell, o));
            } else {
              o.t = "str";
              if (last_seen)
                write_record(ba, 17, write_BrtShortSt(cell, o));
              else
                write_record(ba, 6, write_BrtCellSt(cell, o));
            }
            return true;
          case "n":
            if (cell.v == (cell.v | 0) && cell.v > -1e3 && cell.v < 1e3) {
              if (last_seen)
                write_record(ba, 13, write_BrtShortRk(cell, o));
              else
                write_record(ba, 2, write_BrtCellRk(cell, o));
            } else {
              if (last_seen)
                write_record(ba, 16, write_BrtShortReal(cell, o));
              else
                write_record(ba, 5, write_BrtCellReal(cell, o));
            }
            return true;
          case "b":
            o.t = "b";
            if (last_seen)
              write_record(ba, 15, write_BrtShortBool(cell, o));
            else
              write_record(ba, 4, write_BrtCellBool(cell, o));
            return true;
          case "e":
            o.t = "e";
            if (last_seen)
              write_record(ba, 14, write_BrtShortError(cell, o));
            else
              write_record(ba, 3, write_BrtCellError(cell, o));
            return true;
        }
        if (last_seen)
          write_record(ba, 12, write_BrtShortBlank(cell, o));
        else
          write_record(ba, 1, write_BrtCellBlank(cell, 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 cell = dense ? (ws[R] || [])[C] : ws[ref];
              if (!cell) {
                last_seen = false;
                continue;
              }
              last_seen = write_ws_bin_cell(ba, cell, 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, i2) {
          if (m2)
            write_record(ba, 60, write_BrtColInfo(i2, 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 i2 = 0; i2 < names.length; ++i2) {
          var name = names[i2];
          if (name.Name != "_xlnm._FilterDatabase")
            continue;
          if (name.Sheet != idx)
            continue;
          name.Ref = "'" + wb.SheetNames[idx] + "'!" + ref;
          break;
        }
        if (i2 == 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, i2) {
          check_ws_name(n2);
          for (var j2 = 0; j2 < i2; ++j2)
            if (n2 == N[j2])
              throw new Error("Duplicate Sheet Name: " + n2);
          if (codes) {
            var cn = S && S[i2] && S[i2].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 i2 = 0; i2 < wb.SheetNames.length; ++i2)
          check_ws(wb.Sheets[wb.SheetNames[i2]], wb.SheetNames[i2], i2);
      }
      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 i2 = 0;
        if (sheets && sheets[0] && !!sheets[0].Hidden) {
          o[o.length] = "<bookViews>";
          for (i2 = 0; i2 != wb.SheetNames.length; ++i2) {
            if (!sheets[i2])
              break;
            if (!sheets[i2].Hidden)
              break;
          }
          if (i2 == wb.SheetNames.length)
            i2 = 0;
          o[o.length] = '<workbookView firstSheet="' + i2 + '" activeTab="' + i2 + '"/>';
          o[o.length] = "</bookViews>";
        }
        o[o.length] = "<sheets>";
        for (i2 = 0; i2 != wb.SheetNames.length; ++i2) {
          var sht = { name: escapexml(wb.SheetNames[i2].slice(0, 31)) };
          sht.sheetId = "" + (i2 + 1);
          sht["r:id"] = "rId" + (i2 + 1);
          if (sheets[i2])
            switch (sheets[i2].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 i2 = 0; i2 != 4; ++i2)
          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 i2 = 0, vistab = -1, hidden = -1;
        for (; i2 < sheets.length; ++i2) {
          if (!sheets[i2] || !sheets[i2].Hidden && vistab == -1)
            vistab = i2;
          else if (sheets[i2].Hidden == 1 && hidden == -1)
            hidden = i2;
        }
        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 i2 = 0; i2 < names.length; ++i2) {
          var n2 = names[i2];
          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 i2 = 0; i2 < names.length; ++i2) {
          var n2 = names[i2];
          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 i2 = 0; i2 < idx; ++i2)
              if (wb.Workbook.Sheets[i2] && !wb.Workbook.Sheets[i2].Hidden)
                break;
            if (i2 == 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(cell, ref, ws, opts, idx, wb, addr) {
        if (!cell || cell.v == void 0 && cell.f == void 0)
          return "";
        var attr = {};
        if (cell.f)
          attr["ss:Formula"] = "=" + escapexml(a1_to_rc(cell.f, addr));
        if (cell.F && cell.F.slice(0, ref.length) == ref) {
          var end = decode_cell(cell.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 (cell.l && cell.l.Target) {
          attr["ss:HRef"] = escapexml(cell.l.Target);
          if (cell.l.Tooltip)
            attr["x:HRefScreenTip"] = escapexml(cell.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 (cell.t) {
          case "z":
            if (!opts.sheetStubs)
              return "";
            break;
          case "n":
            t2 = "Number";
            p2 = String(cell.v);
            break;
          case "b":
            t2 = "Boolean";
            p2 = cell.v ? "1" : "0";
            break;
          case "e":
            t2 = "Error";
            p2 = BErr[cell.v];
            break;
          case "d":
            t2 = "DateTime";
            p2 = new Date(cell.v).toISOString();
            if (cell.z == null)
              cell.z = cell.z || table_fmt[14];
            break;
          case "s":
            t2 = "String";
            p2 = escapexlml(cell.v || "");
            break;
        }
        var os = get_cell_style(opts.cellXfs, cell, opts);
        attr["ss:StyleID"] = "s" + (21 + os);
        attr["ss:Index"] = addr.c + 1;
        var _v = cell.v != null ? p2 : "";
        var m2 = cell.t == "z" ? "" : '<Data ss:Type="' + t2 + '">' + _v + "</Data>";
        if ((cell.c || []).length > 0)
          m2 += write_ws_xlml_comment(cell.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, i2) {
            process_col(n2);
            var w2 = !!n2.width;
            var p2 = col_obj_w(i2, n2);
            var k2 = { "ss:Index": i2 + 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), cell = dense ? (ws[R] || [])[C] : ws[ref];
            row.push(write_ws_xlml_cell(cell, 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 i2 = 0; i2 < wb.SheetNames.length; ++i2)
          d2.push(writextag("Worksheet", write_ws_xlml(i2, opts, wb), { "ss:Name": escapexml(wb.SheetNames[i2]) }));
        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 i2 = 0, Keys;
        var DocSummaryRE = evert_key(DocSummaryPIDDSI, "n");
        var SummaryRE = evert_key(SummaryPIDSI, "n");
        if (wb.Props) {
          Keys = keys(wb.Props);
          for (i2 = 0; i2 < Keys.length; ++i2)
            (Object.prototype.hasOwnProperty.call(DocSummaryRE, Keys[i2]) ? DSEntries : Object.prototype.hasOwnProperty.call(SummaryRE, Keys[i2]) ? SEntries : CEntries).push([Keys[i2], wb.Props[Keys[i2]]]);
        }
        if (wb.Custprops) {
          Keys = keys(wb.Custprops);
          for (i2 = 0; i2 < Keys.length; ++i2)
            if (!Object.prototype.hasOwnProperty.call(wb.Props || {}, Keys[i2]))
              (Object.prototype.hasOwnProperty.call(DocSummaryRE, Keys[i2]) ? DSEntries : Object.prototype.hasOwnProperty.call(SummaryRE, Keys[i2]) ? SEntries : CEntries).push([Keys[i2], wb.Custprops[Keys[i2]]]);
        }
        var CEntries2 = [];
        for (i2 = 0; i2 < CEntries.length; ++i2) {
          if (XLSPSSkip.indexOf(CEntries[i2][0]) > -1 || PseudoPropsPairs.indexOf(CEntries[i2][0]) > -1)
            continue;
          if (CEntries[i2][1] == null)
            continue;
          CEntries2.push(CEntries[i2]);
        }
        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 i2 = 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(i2, i2 + w2));
        i2 += w2;
        while (i2 < 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(i2, i2 + w2));
          i2 += 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, cell, R, C) {
        if (cell.v != null)
          switch (cell.t) {
            case "d":
            case "n":
              var v2 = cell.t == "d" ? datenum(parseDate(cell.v)) : cell.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, cell.v, cell.t));
              return;
            case "s":
            case "str":
              write_biff_rec(ba, 4, write_BIFF2LABEL(R, C, (cell.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 cell = dense ? (ws[R] || [])[C] : ws[ref];
            if (!cell)
              continue;
            write_ws_biff2_cell(ba, cell, R, C);
          }
        }
      }
      function write_biff2_buf(wb, opts) {
        var o = opts || {};
        var ba = buf_array();
        var idx = 0;
        for (var i2 = 0; i2 < wb.SheetNames.length; ++i2)
          if (wb.SheetNames[i2] == o.sheet)
            idx = i2;
        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 i2 = r2[0]; i2 <= r2[1]; ++i2)
            if (NF[i2] != null)
              write_biff_rec(ba, 1054, write_Format(i2, NF[i2], 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 i2 = 0; i2 < 16; ++i2)
          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, cell, R, C, opts) {
        var os = 16 + get_cell_style(opts.cellXfs, cell, opts);
        if (cell.v == null && !cell.bf) {
          write_biff_rec(ba, 513, write_XLSCell(R, C, os));
          return;
        }
        if (cell.bf)
          write_biff_rec(ba, 6, write_Formula(cell, R, C, opts, os));
        else
          switch (cell.t) {
            case "d":
            case "n":
              var v2 = cell.t == "d" ? datenum(parseDate(cell.v)) : cell.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, cell.v, os, opts, cell.t));
              break;
            case "s":
            case "str":
              if (opts.bookSST) {
                var isst = get_sst_id(opts.Strings, cell.v, opts.revStrings);
                write_biff_rec(ba, 253, write_LabelSst(R, C, isst, os));
              } else
                write_biff_rec(ba, 516, write_Label(R, C, (cell.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 cell = dense ? (ws[R] || [])[C] : ws[ref];
            if (!cell)
              continue;
            write_ws_biff8_cell(ba, cell, R, C, opts);
            if (b8 && cell.l)
              ws["!links"].push([ref, cell.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, j2 = 0;
        for (j2 = 0; j2 < wb.SheetNames.length; ++j2)
          blen += (b8 ? 12 : 11) + (b8 ? 2 : 1) * wb.SheetNames[j2].length;
        var start = a.length + blen + c2.length;
        for (j2 = 0; j2 < wb.SheetNames.length; ++j2) {
          var _sheet = _sheets[j2] || {};
          write_biff_rec(B, 133, write_BoundSheet8({ pos: start, hs: _sheet.Hidden || 0, dt: 0, name: wb.SheetNames[j2] }, opts));
          start += bufs[j2].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 i2 = 0; i2 < wb.SheetNames.length; ++i2)
          bufs[bufs.length] = write_ws_biff8(i2, o, wb);
        bufs.unshift(write_biff8_global(wb, bufs, o));
        return bconcat(bufs);
      }
      function write_biff_buf(wb, opts) {
        for (var i2 = 0; i2 <= wb.SheetNames.length; ++i2) {
          var ws = wb.Sheets[wb.SheetNames[i2]];
          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[i2] + "' 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 j2 = 0; j2 < M.length; ++j2) {
            if (M[j2].s.r > R || M[j2].s.c > C)
              continue;
            if (M[j2].e.r < R || M[j2].e.c < C)
              continue;
            if (M[j2].s.r < R || M[j2].s.c < C) {
              RS = -1;
              break;
            }
            RS = M[j2].e.r - M[j2].s.r + 1;
            CS = M[j2].e.c - M[j2].s.c + 1;
            break;
          }
          if (RS < 0)
            continue;
          var coord = encode_cell({ r: R, c: C });
          var cell = o.dense ? (ws[R] || [])[C] : ws[coord];
          var w2 = cell && cell.v != null && (cell.h || escapehtml(cell.w || (format_cell(cell), cell.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 (cell) {
            sp["data-t"] = cell && cell.t || "z";
            if (cell.v != null)
              sp["data-v"] = cell.v;
            if (cell.z != null)
              sp["data-z"] = cell.z;
            if (cell.l && (cell.l.Target || "#").charAt(0) != "#")
              w2 = '<a href="' + cell.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, i2) {
          var o = [];
          o.push('      <table:table table:name="' + escapexml(wb.SheetNames[i2]) + '" 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 }), cell = dense ? (ws[R] || [])[C] : ws[ref];
              if (cell && cell.f) {
                ct["table:formula"] = escapexml(csf_to_ods_formula(cell.f));
                if (cell.F) {
                  if (cell.F.slice(0, ref.length) == ref) {
                    var _Fref = decode_range(cell.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 (!cell) {
                o.push(null_cell_xml);
                continue;
              }
              switch (cell.t) {
                case "b":
                  textp = cell.v ? "TRUE" : "FALSE";
                  ct["office:value-type"] = "boolean";
                  ct["office:boolean-value"] = cell.v ? "true" : "false";
                  break;
                case "n":
                  textp = cell.w || String(cell.v || 0);
                  ct["office:value-type"] = "float";
                  ct["office:value"] = cell.v || 0;
                  break;
                case "s":
                case "str":
                  textp = cell.v == null ? "" : cell.v;
                  ct["office:value-type"] = "string";
                  break;
                case "d":
                  textp = cell.w || parseDate(cell.v).toISOString();
                  ct["office:value-type"] = "date";
                  ct["office:date-value"] = parseDate(cell.v).toISOString();
                  ct["table:style-name"] = "ce1";
                  break;
                default:
                  o.push(null_cell_xml);
                  continue;
              }
              var text_p = write_text_p(textp);
              if (cell.l && cell.l.Target) {
                var _tgt = cell.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 i2 = 0; i2 != wb.SheetNames.length; ++i2)
            o.push(write_ws2(wb.Sheets[wb.SheetNames[i2]], wb, i2));
          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 j2 = 0; j2 < search.length; ++j2)
              if (body[L + j2] != search[j2])
                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, offset2, 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[offset2 + 15] |= exp >> 7;
        buf[offset2 + 14] |= (exp & 127) << 1;
        for (var i2 = 0; mantissa >= 1; ++i2, mantissa /= 256)
          buf[offset2 + i2] = mantissa & 255;
        buf[offset2 + 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(proto2) {
        var out = [];
        proto2.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 offset2 = 0, length2 = 0;
            if (tag == 1) {
              length2 = (buf[ptr[0]] >> 2 & 7) + 4;
              offset2 = (buf[ptr[0]++] & 224) << 3;
              offset2 |= buf[ptr[0]++];
            } else {
              length2 = (buf[ptr[0]++] >> 2) + 1;
              if (tag == 2) {
                offset2 = buf[ptr[0]] | buf[ptr[0] + 1] << 8;
                ptr[0] += 2;
              } else {
                offset2 = (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 (offset2 == 0)
              throw new Error("Invalid offset 0");
            if (offset2 > chunks[0].length)
              throw new Error("Invalid offset beyond length");
            if (length2 >= offset2) {
              chunks.push(chunks[0].slice(-offset2));
              length2 -= offset2;
              while (length2 >= chunks[chunks.length - 1].length) {
                chunks.push(chunks[chunks.length - 1]);
                length2 -= chunks[chunks.length - 1].length;
              }
            }
            chunks.push(chunks[0].slice(-offset2, -offset2 + 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(cell, sst) {
        var out = new Uint8Array(32), dv = u8_to_dataview(out), l2 = 12, flags = 0;
        out[0] = 5;
        switch (cell.t) {
          case "n":
            out[1] = 2;
            writeDecimal128LE(out, l2, cell.v);
            flags |= 1;
            l2 += 16;
            break;
          case "b":
            out[1] = 6;
            dv.setFloat64(l2, cell.v ? 1 : 0, true);
            flags |= 2;
            l2 += 8;
            break;
          case "s":
            if (sst.indexOf(cell.v) == -1)
              throw new Error("Value ".concat(cell.v, " missing from SST!"));
            out[1] = 3;
            dv.setUint32(l2, sst.indexOf(cell.v), true);
            flags |= 8;
            l2 += 4;
            break;
          default:
            throw "unsupported cell type " + cell.t;
        }
        dv.setUint32(8, flags, true);
        return out.slice(0, l2);
      }
      function write_old_storage(cell, sst) {
        var out = new Uint8Array(32), dv = u8_to_dataview(out), l2 = 12, flags = 0;
        out[0] = 3;
        switch (cell.t) {
          case "n":
            out[2] = 2;
            dv.setFloat64(l2, cell.v, true);
            flags |= 32;
            l2 += 8;
            break;
          case "b":
            out[2] = 6;
            dv.setFloat64(l2, cell.v ? 1 : 0, true);
            flags |= 32;
            l2 += 8;
            break;
          case "s":
            if (sst.indexOf(cell.v) == -1)
              throw new Error("Value ".concat(cell.v, " missing from SST!"));
            out[2] = 3;
            dv.setUint32(l2, sst.indexOf(cell.v), true);
            flags |= 16;
            l2 += 4;
            break;
          default:
            throw "unsupported cell type " + cell.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(cell) {
            if (typeof cell == "string")
              SST.push(cell);
          });
        });
        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 j2 = 0; j2 < _x.length; ++j2) {
              if (_x[j2].id == cruidsref)
                break;
            }
            if (_x[j2].id != cruidsref)
              throw "Bad ColumnRowUIDMapArchive";
            var cruids = parse_shallow(_x[j2].messages[0].data);
            cruids[1] = [];
            cruids[2] = [], cruids[3] = [];
            for (var C = 0; C <= range.e.c; ++C) {
              var uuid = [];
              uuid[1] = uuid[2] = [{ type: 0, data: write_varint49(C + 420690) }];
              cruids[1].push({ type: 2, data: write_shallow(uuid) });
              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) {
              uuid = [];
              uuid[1] = uuid[2] = [{ type: 0, data: write_varint49(R + 726270) }];
              cruids[4].push({ type: 2, data: write_shallow(uuid) });
              cruids[5].push({ type: 0, data: write_varint49(R) });
              cruids[6].push({ type: 0, data: write_varint49(R) });
            }
            _x[j2].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, i2) {
                  newsst[1] = [{ type: 0, data: write_varint49(i2) }];
                  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(defaults2) {
        return function fix_opts(opts) {
          for (var i2 = 0; i2 != defaults2.length; ++i2) {
            var d2 = defaults2[i2];
            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 && keys(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 && keys(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 i2 = 0; i2 < out.length; ++i2)
              bstr += String.fromCharCode(out[i2]);
            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, offset2 = 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)
          offset2 = 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 + offset2; 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 i2 = 0, cc = 0; i2 !== txt.length; ++i2)
              if ((cc = txt.charCodeAt(i2)) === 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 offset2 = +!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 cell;
        var range = { s: { c: 0, r: 0 }, e: { c: _C, r: _R + js.length - 1 + offset2 } };
        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 + offset2;
          }
        } else {
          if (_R == -1) {
            _R = 0;
            range.e.r = js.length - 1 + offset2;
          }
        }
        var hdr = o.header || [], C = 0;
        js.forEach(function(JS, R) {
          keys(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 + offset2 });
            cell = 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 (!cell)
                ws[ref] = cell = { t: t2, v: v2 };
              else {
                cell.t = t2;
                cell.v = v2;
                delete cell.w;
                delete cell.R;
                if (z2)
                  cell.z = z2;
              }
              if (z2)
                cell.z = z2;
            }
          });
        });
        range.e.c = Math.max(range.e.c, _C + hdr.length - 1);
        var __R = encode_row(_R);
        if (offset2)
          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 i2 = 1;
        if (!name) {
          for (; i2 <= 65535; ++i2, name = void 0)
            if (wb.SheetNames.indexOf(name = "Sheet" + i2) == -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+)$/);
          i2 = m2 && +m2[2] || 0;
          var root = m2 && m2[1] || name;
          for (++i2; i2 <= 65535; ++i2)
            if (wb.SheetNames.indexOf(name = root + i2) == -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(cell, fmt) {
        cell.z = fmt;
        return cell;
      }
      function cell_set_hyperlink(cell, target, tooltip) {
        if (!target) {
          delete cell.l;
        } else {
          cell.l = { Target: target };
          if (tooltip)
            cell.l.Tooltip = tooltip;
        }
        return cell;
      }
      function cell_set_internal_link(cell, range, tooltip) {
        return cell_set_hyperlink(cell, "#" + range, tooltip);
      }
      function cell_add_comment(cell, text, author) {
        if (!cell.c)
          cell.c = [];
        cell.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 cell = ws_get_cell_stub(ws, R, C);
            cell.t = "n";
            cell.F = rngstr;
            delete cell.v;
            if (R == rng.s.r && C == rng.s.c) {
              cell.f = formula;
              if (dynamic)
                cell.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
        }
      };
      const yida_tool_skeleton_box$2 = "_yida_tool_skeleton_box_gsj87_1";
      const box_grid_1$1 = "_box_grid_1_gsj87_21";
      const box_grid_2$1 = "_box_grid_2_gsj87_26";
      const Style$2 = {
        yida_tool_skeleton_box: yida_tool_skeleton_box$2,
        "next-tabs-tabpane": "_next-tabs-tabpane_gsj87_12",
        box_grid_1: box_grid_1$1,
        box_grid_2: box_grid_2$1
      };
      class SelectForm extends React__default.Component {
        constructor() {
          super(...arguments);
          __publicField(this, "state", {
            tableObj: []
          });
          __publicField(this, "field", new NextField(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 i2 = 0; i2 != s.length; ++i2)
                view[i2] = s.charCodeAt(i2) & 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", { className: Style$2.yida_tool_skeleton_box, 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(CheckboxWithGroup, { ...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$1, { type: "primary", text: true, onClick: () => {
              const sheetHeader = [
                {
                  title: "名称",
                  value: "title"
                },
                {
                  title: "唯一标识",
                  value: "dataKey"
                }
              ];
              const result = [];
              for (let i2 = 0; i2 < this.state.tableObj.length; i2++) {
                let item = {};
                for (let j2 = 0; j2 < sheetHeader.length; j2++) {
                  item[sheetHeader[j2].title] = this.state.tableObj[i2][sheetHeader[j2].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$2, { dataSource: this.state.tableObj, children: [
              /* @__PURE__ */ jsxRuntimeExports.jsx(Table$2.Column, { title: "名称", dataIndex: "title" }),
              /* @__PURE__ */ jsxRuntimeExports.jsx(Table$2.Column, { title: "唯一标识", dataIndex: "dataKey" }),
              /* @__PURE__ */ jsxRuntimeExports.jsx(Table$2.Column, { title: "操作", cell: (value, index2, record) => {
                return /* @__PURE__ */ jsxRuntimeExports.jsx(Button$1, { text: true, type: "primary", onClick: () => {
                  console.log(value, index2, record);
                  _GM_setClipboard(record.dataKey);
                  MessageProvider.success("复制成功!");
                }, children: "复制" });
              } })
            ] })
          ] });
        }
      }
      const dingDatas = [
        {
          title: "钉钉JSAPI",
          description: "加载钉钉的JSAPI脚本",
          code: `this.utils.loadScript('https://g.alicdn.com/dingding/dingtalk-jsapi/3.0.25/dingtalk.open.js');`
        },
        {
          title: "钉钉端内判断",
          description: "由于很多钉钉JSAPI要求必须端内调用,因此在调用钉钉JSAPI时,需要提前先判断一下是否在钉钉端内",
          code: `export function isDingTalk() {
 return window.navigator && /dingtalk/i.test(window.navigator.userAgent)
   }`
        }
      ];
      const Ding = () => {
        return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: [Style$4.box_grid_1, Style$4.yida_tool_skeleton_box].join(" "), children: dingDatas.map((item, index2) => CodeCard(item, true)) });
      };
      const yida_tool_skeleton_box$1 = "_yida_tool_skeleton_box_1ijbx_1";
      const box_grid_1 = "_box_grid_1_1ijbx_21";
      const box_grid_2 = "_box_grid_2_1ijbx_26";
      const item_box = "_item_box_1ijbx_31";
      const item_title_box = "_item_title_box_1ijbx_38";
      const item_title = "_item_title_1ijbx_38";
      const item_description = "_item_description_1ijbx_47";
      const icon_box = "_icon_box_1ijbx_52";
      const Style$1 = {
        yida_tool_skeleton_box: yida_tool_skeleton_box$1,
        "next-tabs-tabpane": "_next-tabs-tabpane_1ijbx_12",
        box_grid_1,
        box_grid_2,
        item_box,
        item_title_box,
        item_title,
        item_description,
        icon_box
      };
      class iframeBox extends React__default.Component {
        constructor() {
          super(...arguments);
          __publicField(this, "state", {
            tableObj: [],
            jumpUrl: ""
          });
          __publicField(this, "field", new NextField(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 i2 = 0; i2 != s.length; ++i2)
                view[i2] = s.charCodeAt(i2) & 255;
              return buf;
            }
            const blob = new Blob([s2ab2(wbout)], {
              type: "application/octet-stream"
            });
            return blob;
          });
        }
        render() {
          const RadioGroup2 = RadioWithSub.Group;
          const { init, validate } = this.field;
          return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: Style$1.yida_tool_skeleton_box, children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx("h6", { style: { margin: "8px 0" }, children: "查询表单" }),
            /* @__PURE__ */ jsxRuntimeExports.jsxs(Form, { size: "small", children: [
              /* @__PURE__ */ jsxRuntimeExports.jsxs(Form.Item, { label: /* @__PURE__ */ jsxRuntimeExports.jsx("h6", { children: "CorpId" }), children: [
                /* @__PURE__ */ jsxRuntimeExports.jsx(
                  Input,
                  {
                    placeholder: "corpId",
                    className: "input-style",
                    ...init("corpId", {
                      initValue: _unsafeWindow.pageConfig.corpId,
                      rules: [{
                        required: true,
                        message: "corpId 不能为空!"
                      }]
                    })
                  }
                ),
                this.field.getError("corpId") ? /* @__PURE__ */ jsxRuntimeExports.jsx("span", { style: {
                  color: "red"
                }, children: this.field.getError("corpId").join(",") }) : ""
              ] }),
              /* @__PURE__ */ jsxRuntimeExports.jsxs(Form.Item, { label: /* @__PURE__ */ jsxRuntimeExports.jsx("h6", { children: "URL" }), help: "当需要动态使用钉钉CorpId时,请使用$CORPID$进行变量表示", children: [
                /* @__PURE__ */ jsxRuntimeExports.jsx(Input.TextArea, { placeholder: "url", className: "input-style", ...init("url", {
                  rules: [{
                    required: true,
                    message: "url 不能为空!"
                  }]
                }) }),
                this.field.getError("url") ? /* @__PURE__ */ jsxRuntimeExports.jsx("span", { style: {
                  color: "red"
                }, children: this.field.getError("url").join(",") }) : ""
              ] }),
              /* @__PURE__ */ jsxRuntimeExports.jsx(Form.Item, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
                RadioGroup2,
                {
                  ...init("types", { initValue: "browser" }),
                  "aria-labelledby": "groupId",
                  children: [
                    /* @__PURE__ */ jsxRuntimeExports.jsx(RadioWithSub, { id: "browser", value: "browser", children: "钉钉浏览器打开" }),
                    /* @__PURE__ */ jsxRuntimeExports.jsx(RadioWithSub, { id: "sidebar", value: "sidebar", children: "侧边栏打开" })
                  ]
                }
              ) }),
              /* @__PURE__ */ jsxRuntimeExports.jsx(Form.Submit, { style: { width: "100%" }, onClick: () => {
                validate();
                let urls = this.field.getValue("url");
                urls = urls.replace("$CORPID$", this.field.getValue("corpId"));
                let jumpUrl = urls;
                if (this.field.getValue("types") == "browser") {
                  jumpUrl = "dingtalk://dingtalkclient/page/link?url=" + encodeURIComponent(urls + "&ddtab=true");
                }
                if (this.field.getValue("types") == "sidebar") {
                  jumpUrl = "dingtalk://dingtalkclient/page/link?url=" + encodeURIComponent(urls) + "&pc_slide=true";
                }
                this.setState({
                  jumpUrl
                });
                console.log("单选状态", this.field.getValue("types"), urls, this.state.jumpUrl);
              }, children: "生成" })
            ] }),
            /* @__PURE__ */ jsxRuntimeExports.jsx("hr", { style: { margin: "12px 0" } }),
            /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: Style$1.item_title_box, children: [
              /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "UrlItemTitle", onClick: () => {
                if (this.state.jumpUrl) {
                  _GM_setClipboard(this.state.jumpUrl);
                  MessageProvider.success("复制成功!");
                } else
                  MessageProvider.error("复制失败,请联系开发者!");
              }, children: this.state.jumpUrl }),
              this.state.jumpUrl ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "jsApiIcon_Box", onClick: () => {
                if (this.state.jumpUrl) {
                  _GM_setClipboard(this.state.jumpUrl);
                  MessageProvider.success("复制成功!");
                } else
                  MessageProvider.error("复制失败,请联系开发者!");
              }, children: CopyIcon("#3c99d8") }) : ""
            ] })
          ] });
        }
      }
      const GiteeIcon = () => {
        return /* @__PURE__ */ jsxRuntimeExports.jsx(
          "svg",
          {
            className: "icon",
            viewBox: "0 0 1024 1024",
            version: "1.1",
            xmlns: "http://www.w3.org/2000/svg",
            width: "15",
            height: "15",
            children: /* @__PURE__ */ jsxRuntimeExports.jsx(
              "path",
              {
                d: "M512 1024C229.222 1024 0 794.778 0 512S229.222 0 512 0s512 229.222 512 512-229.222 512-512 512z m259.149-568.883h-290.74a25.293 25.293 0 0 0-25.292 25.293l-0.026 63.206c0 13.952 11.315 25.293 25.267 25.293h177.024c13.978 0 25.293 11.315 25.293 25.267v12.646a75.853 75.853 0 0 1-75.853 75.853h-240.23a25.293 25.293 0 0 1-25.267-25.293V417.203a75.853 75.853 0 0 1 75.827-75.853h353.946a25.293 25.293 0 0 0 25.267-25.292l0.077-63.207a25.293 25.293 0 0 0-25.268-25.293H417.152a189.62 189.62 0 0 0-189.62 189.645V771.15c0 13.977 11.316 25.293 25.294 25.293h372.94a170.65 170.65 0 0 0 170.65-170.65V480.384a25.293 25.293 0 0 0-25.293-25.267z",
                fill: "#C71D23"
              }
            )
          }
        );
      };
      const yida_tool_skeleton_box = "_yida_tool_skeleton_box_zka8q_1";
      const about_box = "_about_box_zka8q_5";
      const Style = {
        yida_tool_skeleton_box,
        about_box
      };
      const GreasyForkIcon = () => {
        return /* @__PURE__ */ jsxRuntimeExports.jsxs(
          "svg",
          {
            className: "icon",
            viewBox: "0 0 1024 1024",
            version: "1.1",
            xmlns: "http://www.w3.org/2000/svg",
            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"
                }
              ),
              /* @__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"
                }
              )
            ]
          }
        );
      };
      const version_number = "Version 3.0.1";
      const author_list = [
        "Navcoo.Li",
        "whale",
        "翰林"
      ];
      const AboutUs = () => {
        const { Text: Text2 } = Typography;
        return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: [Style.about_box, Style.yida_tool_skeleton_box].join(" "), children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "当前版本:" }),
            /* @__PURE__ */ jsxRuntimeExports.jsx(Text2, { code: true, size: "small", color: "blue", children: version_number }),
            /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "作者:" }),
            /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: { display: "flex", alignItems: "center", gap: 8 }, children: author_list.map((item) => /* @__PURE__ */ jsxRuntimeExports.jsx(Text2, { code: true, children: item }, item)) }),
            /* @__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://gitee.com/li78080114/yida-add-pro",
                  children: GiteeIcon()
                }
              ),
              /* @__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()
                }
              )
            ] })
          ] }),
          /* @__PURE__ */ jsxRuntimeExports.jsx("br", {}),
          /* @__PURE__ */ jsxRuntimeExports.jsx(Button$1, { style: { width: "100%" }, type: "primary", onClick: () => {
            window.open("https://update.greasyfork.org/scripts/474556/%E5%AE%9C%E6%90%AD%2B.user.js\n");
          }, children: "检查/更新" })
        ] });
      };
      const { Tab } = _unsafeWindow["Deep"];
      const { Item } = Tab;
      const YidaToolsMenu = [
        {
          key: "data_source_api",
          title: "跨应用数据源API",
          children: /* @__PURE__ */ jsxRuntimeExports.jsx(DataSourceApi, {})
        },
        {
          key: "common_code",
          title: "常用代码",
          children: /* @__PURE__ */ jsxRuntimeExports.jsx(CommonCodeBox, {})
        },
        {
          key: "js_api",
          title: "JS-API",
          children: /* @__PURE__ */ jsxRuntimeExports.jsx(JsApiBox, {})
        },
        {
          key: "annotation",
          title: "注释",
          children: /* @__PURE__ */ jsxRuntimeExports.jsx(Annotation, {})
        },
        {
          key: "components",
          title: "组件",
          children: /* @__PURE__ */ jsxRuntimeExports.jsx(Components, {})
        },
        {
          key: "select_form",
          title: "查询表单",
          children: /* @__PURE__ */ jsxRuntimeExports.jsx(SelectForm, {})
        },
        {
          key: "ding",
          title: "Ding",
          children: /* @__PURE__ */ jsxRuntimeExports.jsx(Ding, {})
        },
        {
          key: "address_translation_tool",
          title: "地址转换工具",
          children: /* @__PURE__ */ jsxRuntimeExports.jsx(iframeBox, {})
        },
        {
          key: "about_us",
          title: "关于我们",
          children: /* @__PURE__ */ jsxRuntimeExports.jsx(AboutUs, {})
        }
      ];
      const YidaToolsSkeleton = () => {
        _GM_addStyle(`
    .next-tabs-tabpane {
        display: none;
        height: calc(100vh - 100px);
        outline: none !important;
        outline-offset: 0 !important;
        -webkit-box-shadow: none;
        box-shadow: none;
        padding: 0 12px;
    }`);
        return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: Style$6.skeleton, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Tab, { size: "small", shape: "wrapped", tabPosition: "left", children: YidaToolsMenu.map((item) => /* @__PURE__ */ jsxRuntimeExports.jsx(Item, { title: item.title, children: item.children }, item.key)) }) });
      };
      const YidaTools = () => {
        AliLowCodeEngine.skeleton.add({
          area: "leftArea",
          type: "PanelDock",
          name: "yidaTool",
          content: YidaToolsSkeleton,
          props: {
            align: "left",
            icon: YidaToolsIcon(),
            description: "Yida+ Pro"
          },
          panelProps: {
            floatable: true,
            hideTitleBar: false,
            title: "Yida+ Pro",
            width: 700,
            enableDrag: true
          }
        });
        AliLowCodeEngine.designerCabin.addBuiltinComponentAction({
          name: "Copy",
          content: {
            icon: YidaToolsIcon("#ffffff"),
            title: "复制唯一标识",
            action(node) {
              const fieldId = ((node == null ? void 0 : node.propsData) == null ? void 0 : node.propsData.fieldId) || node.id;
              _GM_setClipboard(fieldId);
              MessageProvider.success(`唯一标识:${fieldId}`);
            }
          },
          important: true,
          condition: true
        });
        try {
          document.getElementsByClassName("lc-left-area-bottom")[0].children[0].style.display = "block";
        } catch (e2) {
          console.log(e2);
        }
        console.log("Yida+加载完成!");
      };
      const loadYidaTools = (startTimeStamp) => {
        requestAnimationFrame(() => {
          if (_unsafeWindow.LeGao && _unsafeWindow.AliLowCodeEngine && _unsafeWindow.__VcDeepYidaUtils__) {
            console.info(`已扫描到Yida引擎加载完成`);
            YidaTools();
          } else {
            const nowTimeStamp = (/* @__PURE__ */ new Date()).getTime();
            if (nowTimeStamp - startTimeStamp < 6e3)
              loadYidaTools(startTimeStamp);
            else
              console.error(`扫描超时,暂未扫描到Yida引擎,请重试或联系开发者!`);
          }
        });
      };
      const App = () => {
        const startTimeStamp = (/* @__PURE__ */ new Date()).getTime();
        console.info(`Yida+启动,开始扫描Yida引擎,请稍后...`);
        loadYidaTools(startTimeStamp);
      };
      client.createRoot(
        (() => {
          const app = document.createElement("div");
          document.body.append(app);
          return app;
        })()
      ).render(
        /* @__PURE__ */ jsxRuntimeExports.jsx(React__default.StrictMode, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(App, {}) })
      );
    }
  });
  require_main_001();

})(React, ReactDOM);